diff --git a/README.md b/README.md index 936aa47..a029214 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ It is an evaluation harness, not a detector. Nothing here should be used to accu All numbers below are measured on texts that were not used to set the flagging bar. "AI caught" is the share of AI texts flagged when the bar is set so that 5% of human texts would be flagged. +**Read the next section with these tables.** The "humans flagged" figures here hold for the public human +texts in the test sets. On one student's private, pre-ChatGPT school writing the asked model flagged 42%, +not 5%, and the combinations that include it broke the same way. + **Short texts (150 words or fewer)** | Detector | AUROC | AI caught | Humans actually flagged | AI caught, bar set for 1% | @@ -75,6 +79,44 @@ Machine-readable: [results/comparison.json](results/comparison.json), [results/s ![Share flagged by group, 300-word texts](results/figures/detectors_by_group_300_words.png) +## False accusations on private, pre-ChatGPT writing + +The public human texts above may be in the models' training data, and they are not the kind of writing +detectors are mostly used on. So the detectors were also run on one student's private Google Docs, with +the flagging bar left exactly where the public data put it (5% of public human texts). 300-word passages: + +| Detector | Public human texts | Private, dated before 30 Nov 2022 | Private school work, undated | Private journal, 2024 | Private, dated since (AI use unknown) | +|---|---|---|---|---|---| +| Clef 27B, asked | 5% | 42% (21 of 50) | 31% (20 of 65) | not run | 50% (42 of 84) | +| Binoculars (0.5B pair) | 4% | 4% (2 of 50) | 6% (4 of 65) | 2% (1 of 65) | 19% (16 of 84) | +| Classifier, RAID only | 3% | 6% (3 of 50) | 12% (8 of 65) | 2% (1 of 65) | 32% (27 of 84) | +| Classifier, RAID + mirrors | 3% | 8% (4 of 50) | 6% (4 of 65) | 3% (2 of 65) | 48% (40 of 84) | +| Binoculars + classifier | 6% | 22% (11 of 50) | 11% (7 of 65) | 2% (1 of 65) | 57% (48 of 84) | +| Clef + Binoculars | 5% | 64% (32 of 50) | 43% (28 of 65) | not run | 76% (64 of 84) | +| All three combined | 5% | 44% (22 of 50) | 29% (19 of 65) | not run | 77% (65 of 84) | + +- **Asking Clef is not safe on real student essays.** It flagged 21 of 50 passages (15 of 29 documents) + written between 2019 and November 2022, eight times the rate the public data suggested. Passages from + 2020 were flagged as often as later ones, so this is not hidden AI use. +- **The trained classifier and Binoculars roughly held their bar** on the same passages (8% and 4%), and + on an informal journal (2 to 3%). +- **The combinations did not.** Their weights were fitted on public human text, where this writer's essays + would have looked unusual: the classifier's typical score for these essays sits far closer to AI text + than public human text does, although mostly under the bar. Stacking detectors amplified that. +- **The classifier, not Clef, tells this writer's older work from recent work.** The writer says much of + the recent work was AI-written or AI-revised. The classifier flags 48% of it against 8% of the older + work (AUROC 0.78 between the two); Clef flags 50% against 42% (AUROC 0.59). +- **Re-setting the bar on these essays costs the classifier little.** With the bar moved to flag 5% of the + pre-ChatGPT passages, it still catches 85% of AI text at 300 words (91% before); Clef drops from 76% to + 65% and its AUROC against this human writing is 0.77, against 0.94 for public human text. + +What this does and does not show: it is one writer, mostly high-school literary essays; long documents +were cut into passages, which are not independent; and it cannot say whether Clef recognises the public +texts from training or simply finds formal school essays AI-like. Either way, a bar set on public human +text does not transfer to the writing detectors are used on. The texts, titles and per-document scores are +kept out of this repository; [results/private_writing.md](results/private_writing.md) has the full tables +at every length. + ## Read this before trusting the numbers - **Small test halves.** Each number rests on roughly 170 to 260 human and 180 to 190 AI texts. Group @@ -83,9 +125,11 @@ Machine-readable: [results/comparison.json](results/comparison.json), [results/s - **A 1% bar is set by two or three texts.** The "bar set for 1%" columns are indicative only. - **The bar does not always hold.** Set for 5% of calibration humans, the updated classifier flagged 8% of test humans in the short set, mostly RAID documents. -- **Human writing the models cannot have seen is still missing.** Recent forum posts were meant to fill - that gap and turned out to include AI-assisted writing. Private writing that has never been online - remains the clean test, and none was used. +- **Private human writing was tested for one writer only.** Recent forum posts turned out to include + AI-assisted writing, so the clean test is the private-writing section above. It covers a single + student's school work; other writers and other genres may behave differently. +- **The combined detectors are fitted to public human text.** They should be refitted with realistic + private human writing in the calibration data before any use. - **The classifier's test is easier than real use.** Its human training text comes from the same seven RAID domains as much of the test set (different documents), and its mirrors use the same prompt style as the 2026 test texts. Student essays and the evaluation forum sites were kept out of training. @@ -234,7 +278,7 @@ they cannot be in any model's training data and cannot be AI-assisted. `{"id": "doc-001", "group": "own_pre_ai", "text": "..."}`. `group` is free text; use one group for writing you are sure is unassisted and another for anything else. 2. `uv run python -m detecteval.private_eval clef` (paid; sends each text to Clef on your Workers AI - account), then `uv run python -m detecteval.private_eval local` (needs `uv sync --group ml` and the + account; add `--skip-group NAME` to keep a group on your machine), then `uv run python -m detecteval.private_eval local` (needs `uv sync --group ml` and the trained classifiers). 3. `uv run python -m detecteval.private_eval report` writes `results/private_writing.md`. @@ -258,7 +302,7 @@ Binoculars and the classifier run locally: about 30 minutes and 60 minutes on an | Both evaluation sets | [data/eval_set.jsonl](data/eval_set.jsonl), [data/long_set.jsonl](data/long_set.jsonl) | JSON Lines | Fields in [data/README.md](data/README.md) | | Generated texts and training mirrors | [data/](data/) | JSON Lines | `generate`, `generate_long`, `generate_mirrors` | | Scores per detector | [results/scores/](results/scores/), [results/scores_long/](results/scores_long/), [results/detectors/](results/detectors/) | JSON Lines | `score`, `score_long`, `binoculars`, `classify` | -| Reports | [results/report.md](results/report.md), [results/comparison.md](results/comparison.md), with `.json` twins | Markdown, JSON | `report`, `compare` | +| Reports | [results/report.md](results/report.md), [results/comparison.md](results/comparison.md), [results/private_writing.md](results/private_writing.md), with `.json` twins | Markdown, JSON | `report`, `compare`, `private_eval report` | | Figures | [results/figures/](results/figures/) | PNG | `report`, `compare` | | Trained classifiers (2 × 306 MB) | [release v0.3.0](https://github.com/ichen27/ai-text-detection-eval/releases/tag/v0.3.0) | Hugging Face model folders, gzipped tar | Extract into `RAW_DATA_DIR/models/`, then `python -m detecteval.classify raid mirrors`; or retrain with `train_classifier` | @@ -275,6 +319,7 @@ src/detecteval/ pipeline modules (see AGENTS.md for which belongs to which stu data/ both evaluation sets, the texts generated for them, training mirrors results/ report.md, summary.json first study comparison.md, comparison.json all detectors on held-out halves + private_writing.md, .json false accusations on private writing (aggregates only) scores/, scores_long/, detectors/ raw scores per detector figures/ tests/ unit tests for metrics, text preparation, splits and detector statistics diff --git a/results/private_writing.json b/results/private_writing.json new file mode 100644 index 0000000..ac016d0 --- /dev/null +++ b/results/private_writing.json @@ -0,0 +1,1627 @@ +{ + "target_fpr": 0.05, + "passages": { + "own_pre_ai": 60, + "own_recent": 99, + "own_school_undated": 82, + "own_journal_2024": 66 + }, + "documents": { + "own_journal_2024": 1, + "own_pre_ai": 32, + "own_school_undated": 59, + "own_recent": 61 + }, + "rungs": { + "75": { + "clef": { + "public_test_humans": { + "n": 263, + "flagged": 19, + "share": 0.07224334600760456, + "ci95": [ + 0.04673388801633136, + 0.11006924912570343 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 19, + "share": 0.31666666666666665, + "ci95": [ + 0.21305705841174333, + 0.4423400494301654 + ], + "documents": 32, + "documents_flagged": 15 + }, + "own_recent": { + "n": 99, + "flagged": 32, + "share": 0.32323232323232326, + "ci95": [ + 0.23919862826396276, + 0.4204721664339027 + ], + "documents": 61, + "documents_flagged": 26 + }, + "own_school_undated": { + "n": 82, + "flagged": 24, + "share": 0.2926829268292683, + "ci95": [ + 0.2052619989088515, + 0.3986596428126448 + ], + "documents": 59, + "documents_flagged": 20 + } + } + }, + "binoculars": { + "public_test_humans": { + "n": 263, + "flagged": 6, + "share": 0.022813688212927757, + "ci95": [ + 0.010496544111168887, + 0.04887051110061218 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 5, + "share": 0.08333333333333333, + "ci95": [ + 0.03611992405048589, + 0.18069168468112481 + ], + "documents": 32, + "documents_flagged": 5 + }, + "own_recent": { + "n": 99, + "flagged": 20, + "share": 0.20202020202020202, + "ci95": [ + 0.13475627715378938, + 0.29154591962261234 + ], + "documents": 61, + "documents_flagged": 18 + }, + "own_school_undated": { + "n": 82, + "flagged": 4, + "share": 0.04878048780487805, + "ci95": [ + 0.0191307559738843, + 0.11881634659643125 + ], + "documents": 59, + "documents_flagged": 4 + }, + "own_journal_2024": { + "n": 66, + "flagged": 2, + "share": 0.030303030303030304, + "ci95": [ + 0.008349735075946503, + 0.10392718870586834 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "classifier-raid": { + "public_test_humans": { + "n": 263, + "flagged": 12, + "share": 0.045627376425855515, + "ci95": [ + 0.026290303194593807, + 0.07804725136961208 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 10, + "share": 0.16666666666666666, + "ci95": [ + 0.09313077201321032, + 0.28031851497207827 + ], + "documents": 32, + "documents_flagged": 10 + }, + "own_recent": { + "n": 99, + "flagged": 26, + "share": 0.26262626262626265, + "ci95": [ + 0.18598028163201125, + 0.3570062141051224 + ], + "documents": 61, + "documents_flagged": 21 + }, + "own_school_undated": { + "n": 82, + "flagged": 11, + "share": 0.13414634146341464, + "ci95": [ + 0.07658612768827223, + 0.22445206358495667 + ], + "documents": 59, + "documents_flagged": 10 + }, + "own_journal_2024": { + "n": 66, + "flagged": 0, + "share": 0.0, + "ci95": [ + 0.0, + 0.05500446725160935 + ], + "documents": 1, + "documents_flagged": 0 + } + } + }, + "classifier-mirrors": { + "public_test_humans": { + "n": 263, + "flagged": 15, + "share": 0.057034220532319393, + "ci95": [ + 0.03486434978625598, + 0.0919584544541623 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 8, + "share": 0.13333333333333333, + "ci95": [ + 0.06914026978309641, + 0.24165394590072103 + ], + "documents": 32, + "documents_flagged": 7 + }, + "own_recent": { + "n": 99, + "flagged": 30, + "share": 0.30303030303030304, + "ci95": [ + 0.2212615693494659, + 0.3995144590281556 + ], + "documents": 61, + "documents_flagged": 28 + }, + "own_school_undated": { + "n": 82, + "flagged": 4, + "share": 0.04878048780487805, + "ci95": [ + 0.0191307559738843, + 0.11881634659643125 + ], + "documents": 59, + "documents_flagged": 4 + }, + "own_journal_2024": { + "n": 66, + "flagged": 0, + "share": 0.0, + "ci95": [ + 0.0, + 0.05500446725160935 + ], + "documents": 1, + "documents_flagged": 0 + } + } + }, + "local-two": { + "public_test_humans": { + "n": 263, + "flagged": 8, + "share": 0.030418250950570342, + "ci95": [ + 0.015492213860800727, + 0.058865007801788605 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 10, + "share": 0.16666666666666666, + "ci95": [ + 0.09313077201321032, + 0.28031851497207827 + ], + "documents": 32, + "documents_flagged": 9 + }, + "own_recent": { + "n": 99, + "flagged": 32, + "share": 0.32323232323232326, + "ci95": [ + 0.23919862826396276, + 0.4204721664339027 + ], + "documents": 61, + "documents_flagged": 27 + }, + "own_school_undated": { + "n": 82, + "flagged": 6, + "share": 0.07317073170731707, + "ci95": [ + 0.03396431451476119, + 0.15058024197067243 + ], + "documents": 59, + "documents_flagged": 6 + }, + "own_journal_2024": { + "n": 66, + "flagged": 0, + "share": 0.0, + "ci95": [ + 0.0, + 0.05500446725160935 + ], + "documents": 1, + "documents_flagged": 0 + } + } + }, + "clef+binoculars": { + "public_test_humans": { + "n": 263, + "flagged": 17, + "share": 0.06463878326996197, + "ci95": [ + 0.04074510851378986, + 0.10106786217743667 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 35, + "share": 0.5833333333333334, + "ci95": [ + 0.45727854313239624, + 0.6993591351212818 + ], + "documents": 32, + "documents_flagged": 22 + }, + "own_recent": { + "n": 99, + "flagged": 50, + "share": 0.5050505050505051, + "ci95": [ + 0.4082299868548984, + 0.6014937047251627 + ], + "documents": 61, + "documents_flagged": 38 + }, + "own_school_undated": { + "n": 82, + "flagged": 32, + "share": 0.3902439024390244, + "ci95": [ + 0.2918451685297083, + 0.4984662888522603 + ], + "documents": 59, + "documents_flagged": 25 + } + } + }, + "all-three": { + "public_test_humans": { + "n": 263, + "flagged": 10, + "share": 0.03802281368821293, + "ci95": [ + 0.020781892630570023, + 0.06856549548282757 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 19, + "share": 0.31666666666666665, + "ci95": [ + 0.21305705841174333, + 0.4423400494301654 + ], + "documents": 32, + "documents_flagged": 14 + }, + "own_recent": { + "n": 99, + "flagged": 49, + "share": 0.494949494949495, + "ci95": [ + 0.39850629527483744, + 0.5917700131451018 + ], + "documents": 61, + "documents_flagged": 38 + }, + "own_school_undated": { + "n": 82, + "flagged": 18, + "share": 0.21951219512195122, + "ci95": [ + 0.14360671297875127, + 0.32052256699739085 + ], + "documents": 59, + "documents_flagged": 16 + } + } + } + }, + "150": { + "clef": { + "public_test_humans": { + "n": 263, + "flagged": 11, + "share": 0.04182509505703422, + "ci95": [ + 0.02351216226721163, + 0.07333030907159009 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 16, + "share": 0.26666666666666666, + "ci95": [ + 0.17132496487078852, + 0.3900895360189135 + ], + "documents": 32, + "documents_flagged": 11 + }, + "own_recent": { + "n": 99, + "flagged": 28, + "share": 0.2828282828282828, + "ci95": [ + 0.20351825976230095, + 0.3783630022950766 + ], + "documents": 61, + "documents_flagged": 24 + }, + "own_school_undated": { + "n": 82, + "flagged": 25, + "share": 0.3048780487804878, + "ci95": [ + 0.21583254094468948, + 0.4113878277343659 + ], + "documents": 59, + "documents_flagged": 22 + } + } + }, + "binoculars": { + "public_test_humans": { + "n": 263, + "flagged": 13, + "share": 0.049429657794676805, + "ci95": [ + 0.02911112116353915, + 0.08272151662607086 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 7, + "share": 0.11666666666666667, + "ci95": [ + 0.05767647403450049, + 0.2217902059985814 + ], + "documents": 32, + "documents_flagged": 7 + }, + "own_recent": { + "n": 99, + "flagged": 18, + "share": 0.18181818181818182, + "ci95": [ + 0.11821769885745204, + 0.2691897315987058 + ], + "documents": 61, + "documents_flagged": 14 + }, + "own_school_undated": { + "n": 82, + "flagged": 7, + "share": 0.08536585365853659, + "ci95": [ + 0.04196599135384306, + 0.16587729208914964 + ], + "documents": 59, + "documents_flagged": 7 + }, + "own_journal_2024": { + "n": 66, + "flagged": 2, + "share": 0.030303030303030304, + "ci95": [ + 0.008349735075946503, + 0.10392718870586834 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "classifier-raid": { + "public_test_humans": { + "n": 263, + "flagged": 15, + "share": 0.057034220532319393, + "ci95": [ + 0.03486434978625598, + 0.0919584544541623 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 14, + "share": 0.23333333333333334, + "ci95": [ + 0.1443943161843107, + 0.3543651134039202 + ], + "documents": 32, + "documents_flagged": 13 + }, + "own_recent": { + "n": 99, + "flagged": 34, + "share": 0.3434343434343434, + "ci95": [ + 0.25731989006284084, + 0.44124567095526857 + ], + "documents": 61, + "documents_flagged": 26 + }, + "own_school_undated": { + "n": 82, + "flagged": 11, + "share": 0.13414634146341464, + "ci95": [ + 0.07658612768827223, + 0.22445206358495667 + ], + "documents": 59, + "documents_flagged": 10 + }, + "own_journal_2024": { + "n": 66, + "flagged": 0, + "share": 0.0, + "ci95": [ + 0.0, + 0.05500446725160935 + ], + "documents": 1, + "documents_flagged": 0 + } + } + }, + "classifier-mirrors": { + "public_test_humans": { + "n": 263, + "flagged": 12, + "share": 0.045627376425855515, + "ci95": [ + 0.026290303194593807, + 0.07804725136961208 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 6, + "share": 0.1, + "ci95": [ + 0.04664219945723587, + 0.20149694492511044 + ], + "documents": 32, + "documents_flagged": 5 + }, + "own_recent": { + "n": 99, + "flagged": 35, + "share": 0.35353535353535354, + "ci95": [ + 0.2664470798753757, + 0.45156586430285567 + ], + "documents": 61, + "documents_flagged": 31 + }, + "own_school_undated": { + "n": 82, + "flagged": 4, + "share": 0.04878048780487805, + "ci95": [ + 0.0191307559738843, + 0.11881634659643125 + ], + "documents": 59, + "documents_flagged": 4 + }, + "own_journal_2024": { + "n": 66, + "flagged": 0, + "share": 0.0, + "ci95": [ + 0.0, + 0.05500446725160935 + ], + "documents": 1, + "documents_flagged": 0 + } + } + }, + "local-two": { + "public_test_humans": { + "n": 263, + "flagged": 13, + "share": 0.049429657794676805, + "ci95": [ + 0.02911112116353915, + 0.08272151662607086 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 9, + "share": 0.15, + "ci95": [ + 0.08097349242295689, + 0.26114825891159615 + ], + "documents": 32, + "documents_flagged": 9 + }, + "own_recent": { + "n": 99, + "flagged": 38, + "share": 0.3838383838383838, + "ci95": [ + 0.29408494593454726, + 0.48227014772404997 + ], + "documents": 61, + "documents_flagged": 31 + }, + "own_school_undated": { + "n": 82, + "flagged": 6, + "share": 0.07317073170731707, + "ci95": [ + 0.03396431451476119, + 0.15058024197067243 + ], + "documents": 59, + "documents_flagged": 6 + }, + "own_journal_2024": { + "n": 66, + "flagged": 0, + "share": 0.0, + "ci95": [ + 0.0, + 0.05500446725160935 + ], + "documents": 1, + "documents_flagged": 0 + } + } + }, + "clef+binoculars": { + "public_test_humans": { + "n": 263, + "flagged": 10, + "share": 0.03802281368821293, + "ci95": [ + 0.020781892630570023, + 0.06856549548282757 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 30, + "share": 0.5, + "ci95": [ + 0.37734812427246284, + 0.6226518757275372 + ], + "documents": 32, + "documents_flagged": 24 + }, + "own_recent": { + "n": 99, + "flagged": 45, + "share": 0.45454545454545453, + "ci95": [ + 0.3599919588990025, + 0.5524948168804487 + ], + "documents": 61, + "documents_flagged": 36 + }, + "own_school_undated": { + "n": 82, + "flagged": 31, + "share": 0.3780487804878049, + "ci95": [ + 0.28078209931893033, + 0.4862306311054793 + ], + "documents": 59, + "documents_flagged": 25 + } + } + }, + "all-three": { + "public_test_humans": { + "n": 263, + "flagged": 9, + "share": 0.034220532319391636, + "ci95": [ + 0.018105895346679998, + 0.06374640954131347 + ] + }, + "groups": { + "own_pre_ai": { + "n": 60, + "flagged": 23, + "share": 0.38333333333333336, + "ci95": [ + 0.2708808958488824, + 0.5098263545959686 + ], + "documents": 32, + "documents_flagged": 21 + }, + "own_recent": { + "n": 99, + "flagged": 59, + "share": 0.5959595959595959, + "ci95": [ + 0.4974671538075806, + 0.6872829862135781 + ], + "documents": 61, + "documents_flagged": 45 + }, + "own_school_undated": { + "n": 82, + "flagged": 16, + "share": 0.1951219512195122, + "ci95": [ + 0.12382792433083327, + 0.2937039017301908 + ], + "documents": 59, + "documents_flagged": 14 + } + } + } + }, + "300": { + "clef": { + "public_test_humans": { + "n": 263, + "flagged": 12, + "share": 0.045627376425855515, + "ci95": [ + 0.026290303194593807, + 0.07804725136961208 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 21, + "share": 0.42, + "ci95": [ + 0.2937479723456693, + 0.5576680331222217 + ], + "documents": 29, + "documents_flagged": 15 + }, + "own_recent": { + "n": 84, + "flagged": 42, + "share": 0.5, + "ci95": [ + 0.39543750035009767, + 0.6045624996499024 + ], + "documents": 54, + "documents_flagged": 33 + }, + "own_school_undated": { + "n": 65, + "flagged": 20, + "share": 0.3076923076923077, + "ci95": [ + 0.20886876704271462, + 0.4279787205229433 + ], + "documents": 48, + "documents_flagged": 16 + } + } + }, + "binoculars": { + "public_test_humans": { + "n": 263, + "flagged": 10, + "share": 0.03802281368821293, + "ci95": [ + 0.020781892630570023, + 0.06856549548282757 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 2, + "share": 0.04, + "ci95": [ + 0.011038652660826577, + 0.13460337877954667 + ], + "documents": 29, + "documents_flagged": 2 + }, + "own_recent": { + "n": 84, + "flagged": 16, + "share": 0.19047619047619047, + "ci95": [ + 0.12078595196346183, + 0.2872394027659602 + ], + "documents": 54, + "documents_flagged": 14 + }, + "own_school_undated": { + "n": 65, + "flagged": 4, + "share": 0.06153846153846154, + "ci95": [ + 0.024188663436562223, + 0.14782360821313795 + ], + "documents": 48, + "documents_flagged": 4 + }, + "own_journal_2024": { + "n": 65, + "flagged": 1, + "share": 0.015384615384615385, + "ci95": [ + 0.002720874527486622, + 0.08213479413797146 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "classifier-raid": { + "public_test_humans": { + "n": 263, + "flagged": 8, + "share": 0.030418250950570342, + "ci95": [ + 0.015492213860800727, + 0.058865007801788605 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 3, + "share": 0.06, + "ci95": [ + 0.020614596364630478, + 0.16217343370877002 + ], + "documents": 29, + "documents_flagged": 3 + }, + "own_recent": { + "n": 84, + "flagged": 27, + "share": 0.32142857142857145, + "ci95": [ + 0.23125977350162447, + 0.42721639268842665 + ], + "documents": 54, + "documents_flagged": 21 + }, + "own_school_undated": { + "n": 65, + "flagged": 8, + "share": 0.12307692307692308, + "ci95": [ + 0.06370391444937325, + 0.22451716117931636 + ], + "documents": 48, + "documents_flagged": 7 + }, + "own_journal_2024": { + "n": 65, + "flagged": 1, + "share": 0.015384615384615385, + "ci95": [ + 0.002720874527486622, + 0.08213479413797146 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "classifier-mirrors": { + "public_test_humans": { + "n": 263, + "flagged": 7, + "share": 0.026615969581749048, + "ci95": [ + 0.012951195827670212, + 0.053910942609514984 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 4, + "share": 0.08, + "ci95": [ + 0.031549003255790686, + 0.18838502545063704 + ], + "documents": 29, + "documents_flagged": 4 + }, + "own_recent": { + "n": 84, + "flagged": 40, + "share": 0.47619047619047616, + "ci95": [ + 0.3727826732247559, + 0.5816808156005842 + ], + "documents": 54, + "documents_flagged": 35 + }, + "own_school_undated": { + "n": 65, + "flagged": 4, + "share": 0.06153846153846154, + "ci95": [ + 0.024188663436562223, + 0.14782360821313795 + ], + "documents": 48, + "documents_flagged": 4 + }, + "own_journal_2024": { + "n": 65, + "flagged": 2, + "share": 0.03076923076923077, + "ci95": [ + 0.008478819400945352, + 0.10542905025926008 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "local-two": { + "public_test_humans": { + "n": 263, + "flagged": 17, + "share": 0.06463878326996197, + "ci95": [ + 0.04074510851378986, + 0.10106786217743667 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 11, + "share": 0.22, + "ci95": [ + 0.12753786224302288, + 0.35241815689459555 + ], + "documents": 29, + "documents_flagged": 11 + }, + "own_recent": { + "n": 84, + "flagged": 48, + "share": 0.5714285714285714, + "ci95": [ + 0.4647675967027547, + 0.6718419368212247 + ], + "documents": 54, + "documents_flagged": 36 + }, + "own_school_undated": { + "n": 65, + "flagged": 7, + "share": 0.1076923076923077, + "ci95": [ + 0.05315354431925605, + 0.20601533031468616 + ], + "documents": 48, + "documents_flagged": 7 + }, + "own_journal_2024": { + "n": 65, + "flagged": 1, + "share": 0.015384615384615385, + "ci95": [ + 0.002720874527486622, + 0.08213479413797146 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "clef+binoculars": { + "public_test_humans": { + "n": 263, + "flagged": 12, + "share": 0.045627376425855515, + "ci95": [ + 0.026290303194593807, + 0.07804725136961208 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 32, + "share": 0.64, + "ci95": [ + 0.5014076201030195, + 0.7586143703281711 + ], + "documents": 29, + "documents_flagged": 23 + }, + "own_recent": { + "n": 84, + "flagged": 64, + "share": 0.7619047619047619, + "ci95": [ + 0.6606473307381485, + 0.8402542921831097 + ], + "documents": 54, + "documents_flagged": 45 + }, + "own_school_undated": { + "n": 65, + "flagged": 28, + "share": 0.4307692307692308, + "ci95": [ + 0.31759267537345776, + 0.5516724201501791 + ], + "documents": 48, + "documents_flagged": 23 + } + } + }, + "all-three": { + "public_test_humans": { + "n": 263, + "flagged": 12, + "share": 0.045627376425855515, + "ci95": [ + 0.026290303194593807, + 0.07804725136961208 + ] + }, + "groups": { + "own_pre_ai": { + "n": 50, + "flagged": 22, + "share": 0.44, + "ci95": [ + 0.3116198721023534, + 0.5769421319985648 + ], + "documents": 29, + "documents_flagged": 20 + }, + "own_recent": { + "n": 84, + "flagged": 65, + "share": 0.7738095238095238, + "ci95": [ + 0.6735289274916636, + 0.8501409510169247 + ], + "documents": 54, + "documents_flagged": 48 + }, + "own_school_undated": { + "n": 65, + "flagged": 19, + "share": 0.2923076923076923, + "ci95": [ + 0.19583261556264242, + 0.4119626710082681 + ], + "documents": 48, + "documents_flagged": 17 + } + } + } + }, + "500": { + "clef": { + "public_test_humans": { + "n": 111, + "flagged": 7, + "share": 0.06306306306306306, + "ci95": [ + 0.03088026451475212, + 0.12447807253384349 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 13, + "share": 0.35135135135135137, + "ci95": [ + 0.2182540663110087, + 0.5124127048243043 + ], + "documents": 25, + "documents_flagged": 12 + }, + "own_recent": { + "n": 72, + "flagged": 43, + "share": 0.5972222222222222, + "ci95": [ + 0.4818046137128726, + 0.702790647990467 + ], + "documents": 52, + "documents_flagged": 35 + }, + "own_school_undated": { + "n": 43, + "flagged": 12, + "share": 0.27906976744186046, + "ci95": [ + 0.16746451821827157, + 0.42691312900129397 + ], + "documents": 29, + "documents_flagged": 9 + } + } + }, + "binoculars": { + "public_test_humans": { + "n": 111, + "flagged": 4, + "share": 0.036036036036036036, + "ci95": [ + 0.014101074357880557, + 0.08901138663186531 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 3, + "share": 0.08108108108108109, + "ci95": [ + 0.027960066396321384, + 0.2130099249850153 + ], + "documents": 25, + "documents_flagged": 3 + }, + "own_recent": { + "n": 72, + "flagged": 10, + "share": 0.1388888888888889, + "ci95": [ + 0.07722647811471899, + 0.23713397841573391 + ], + "documents": 52, + "documents_flagged": 7 + }, + "own_school_undated": { + "n": 43, + "flagged": 5, + "share": 0.11627906976744186, + "ci95": [ + 0.050703529948620846, + 0.24479448890641395 + ], + "documents": 29, + "documents_flagged": 5 + }, + "own_journal_2024": { + "n": 65, + "flagged": 1, + "share": 0.015384615384615385, + "ci95": [ + 0.002720874527486622, + 0.08213479413797146 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "classifier-raid": { + "public_test_humans": { + "n": 111, + "flagged": 6, + "share": 0.05405405405405406, + "ci95": [ + 0.02500597339497708, + 0.11293707163400198 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 6, + "share": 0.16216216216216217, + "ci95": [ + 0.07651103235297099, + 0.31136799295455864 + ], + "documents": 25, + "documents_flagged": 6 + }, + "own_recent": { + "n": 72, + "flagged": 28, + "share": 0.3888888888888889, + "ci95": [ + 0.2846554187000152, + 0.5043785679247396 + ], + "documents": 52, + "documents_flagged": 20 + }, + "own_school_undated": { + "n": 43, + "flagged": 9, + "share": 0.20930232558139536, + "ci95": [ + 0.11422705997811457, + 0.35205931794236645 + ], + "documents": 29, + "documents_flagged": 9 + }, + "own_journal_2024": { + "n": 65, + "flagged": 1, + "share": 0.015384615384615385, + "ci95": [ + 0.002720874527486622, + 0.08213479413797146 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "classifier-mirrors": { + "public_test_humans": { + "n": 111, + "flagged": 2, + "share": 0.018018018018018018, + "ci95": [ + 0.004955074866777286, + 0.06332680208373542 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 4, + "share": 0.10810810810810811, + "ci95": [ + 0.04285120520506268, + 0.24708846415167163 + ], + "documents": 25, + "documents_flagged": 4 + }, + "own_recent": { + "n": 72, + "flagged": 39, + "share": 0.5416666666666666, + "ci95": [ + 0.42739664196707616, + 0.6517156130486407 + ], + "documents": 52, + "documents_flagged": 33 + }, + "own_school_undated": { + "n": 43, + "flagged": 7, + "share": 0.16279069767441862, + "ci95": [ + 0.08116524502857546, + 0.2997269533591824 + ], + "documents": 29, + "documents_flagged": 7 + }, + "own_journal_2024": { + "n": 65, + "flagged": 2, + "share": 0.03076923076923077, + "ci95": [ + 0.008478819400945352, + 0.10542905025926008 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "local-two": { + "public_test_humans": { + "n": 111, + "flagged": 2, + "share": 0.018018018018018018, + "ci95": [ + 0.004955074866777286, + 0.06332680208373542 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 7, + "share": 0.1891891891891892, + "ci95": [ + 0.09479858757337126, + 0.342050115709556 + ], + "documents": 25, + "documents_flagged": 7 + }, + "own_recent": { + "n": 72, + "flagged": 43, + "share": 0.5972222222222222, + "ci95": [ + 0.4818046137128726, + 0.702790647990467 + ], + "documents": 52, + "documents_flagged": 32 + }, + "own_school_undated": { + "n": 43, + "flagged": 13, + "share": 0.3023255813953488, + "ci95": [ + 0.18601827946182872, + 0.4510564575240983 + ], + "documents": 29, + "documents_flagged": 12 + }, + "own_journal_2024": { + "n": 65, + "flagged": 1, + "share": 0.015384615384615385, + "ci95": [ + 0.002720874527486622, + 0.08213479413797146 + ], + "documents": 1, + "documents_flagged": 1 + } + } + }, + "clef+binoculars": { + "public_test_humans": { + "n": 111, + "flagged": 9, + "share": 0.08108108108108109, + "ci95": [ + 0.04324151215311865, + 0.14694740893471014 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 16, + "share": 0.43243243243243246, + "ci95": [ + 0.2867148684035131, + 0.5908609366579929 + ], + "documents": 25, + "documents_flagged": 14 + }, + "own_recent": { + "n": 72, + "flagged": 49, + "share": 0.6805555555555556, + "ci95": [ + 0.5660743422203383, + 0.7767454295144354 + ], + "documents": 52, + "documents_flagged": 37 + }, + "own_school_undated": { + "n": 43, + "flagged": 18, + "share": 0.4186046511627907, + "ci95": [ + 0.2838433433748524, + 0.5667168424428823 + ], + "documents": 29, + "documents_flagged": 15 + } + } + }, + "all-three": { + "public_test_humans": { + "n": 111, + "flagged": 3, + "share": 0.02702702702702703, + "ci95": [ + 0.00923347121399111, + 0.07646369775613819 + ] + }, + "groups": { + "own_pre_ai": { + "n": 37, + "flagged": 13, + "share": 0.35135135135135137, + "ci95": [ + 0.2182540663110087, + 0.5124127048243043 + ], + "documents": 25, + "documents_flagged": 11 + }, + "own_recent": { + "n": 72, + "flagged": 53, + "share": 0.7361111111111112, + "ci95": [ + 0.6242391943879235, + 0.8240635840344728 + ], + "documents": 52, + "documents_flagged": 39 + }, + "own_school_undated": { + "n": 43, + "flagged": 15, + "share": 0.3488372093023256, + "ci95": [ + 0.22418398748963103, + 0.49828492902901905 + ], + "documents": 29, + "documents_flagged": 13 + } + } + } + } + }, + "recalibrated": { + "75": { + "clef": { + "reference_passages": 60, + "ai_caught_public_bar": 0.48704663212435234, + "ai_caught_private_bar": 0.35751295336787564, + "public_humans_flagged_private_bar": 0.022813688212927757, + "auroc_public_ai_over_reference": 0.577461139896373, + "auroc_public_ai_over_public_humans": 0.8343840501191907 + }, + "binoculars": { + "reference_passages": 60, + "ai_caught_public_bar": 0.5129533678756477, + "ai_caught_private_bar": 0.40932642487046633, + "public_humans_flagged_private_bar": 0.0076045627376425855, + "auroc_public_ai_over_reference": 0.8066493955094991, + "auroc_public_ai_over_public_humans": 0.8803955948698753 + }, + "classifier-raid": { + "reference_passages": 60, + "ai_caught_public_bar": 0.5958549222797928, + "ai_caught_private_bar": 0.33678756476683935, + "public_humans_flagged_private_bar": 0.011406844106463879, + "auroc_public_ai_over_reference": 0.774740932642487, + "auroc_public_ai_over_public_humans": 0.8846706987923324 + }, + "classifier-mirrors": { + "reference_passages": 60, + "ai_caught_public_bar": 0.7823834196891192, + "ai_caught_private_bar": 0.6269430051813472, + "public_humans_flagged_private_bar": 0.015209125475285171, + "auroc_public_ai_over_reference": 0.9143350604490501, + "auroc_public_ai_over_public_humans": 0.9584113162197837 + } + }, + "150": { + "clef": { + "reference_passages": 60, + "ai_caught_public_bar": 0.5854922279792746, + "ai_caught_private_bar": 0.40932642487046633, + "public_humans_flagged_private_bar": 0.011406844106463879, + "auroc_public_ai_over_reference": 0.6626943005181347, + "auroc_public_ai_over_public_humans": 0.8930830000591028 + }, + "binoculars": { + "reference_passages": 60, + "ai_caught_public_bar": 0.689119170984456, + "ai_caught_private_bar": 0.5440414507772021, + "public_humans_flagged_private_bar": 0.015209125475285171, + "auroc_public_ai_over_reference": 0.8527633851468048, + "auroc_public_ai_over_public_humans": 0.908961957485372 + }, + "classifier-raid": { + "reference_passages": 60, + "ai_caught_public_bar": 0.689119170984456, + "ai_caught_private_bar": 0.533678756476684, + "public_humans_flagged_private_bar": 0.0076045627376425855, + "auroc_public_ai_over_reference": 0.8109671848013817, + "auroc_public_ai_over_public_humans": 0.9156602769952127 + }, + "classifier-mirrors": { + "reference_passages": 60, + "ai_caught_public_bar": 0.8497409326424871, + "ai_caught_private_bar": 0.694300518134715, + "public_humans_flagged_private_bar": 0.019011406844106463, + "auroc_public_ai_over_reference": 0.9462003454231434, + "auroc_public_ai_over_public_humans": 0.9771863117870723 + } + }, + "300": { + "clef": { + "reference_passages": 50, + "ai_caught_public_bar": 0.7564766839378239, + "ai_caught_private_bar": 0.6476683937823834, + "public_humans_flagged_private_bar": 0.019011406844106463, + "auroc_public_ai_over_reference": 0.7726424870466321, + "auroc_public_ai_over_public_humans": 0.9365334226442601 + }, + "binoculars": { + "reference_passages": 50, + "ai_caught_public_bar": 0.7253886010362695, + "ai_caught_private_bar": 0.7253886010362695, + "public_humans_flagged_private_bar": 0.03802281368821293, + "auroc_public_ai_over_reference": 0.8716062176165803, + "auroc_public_ai_over_public_humans": 0.9177879784865738 + }, + "classifier-raid": { + "reference_passages": 50, + "ai_caught_public_bar": 0.694300518134715, + "ai_caught_private_bar": 0.6476683937823834, + "public_humans_flagged_private_bar": 0.0076045627376425855, + "auroc_public_ai_over_reference": 0.8349222797927461, + "auroc_public_ai_over_public_humans": 0.9345534782009102 + }, + "classifier-mirrors": { + "reference_passages": 50, + "ai_caught_public_bar": 0.9067357512953368, + "ai_caught_private_bar": 0.8549222797927462, + "public_humans_flagged_private_bar": 0.015209125475285171, + "auroc_public_ai_over_reference": 0.9662176165803109, + "auroc_public_ai_over_public_humans": 0.9881991370988397 + } + }, + "500": { + "clef": { + "reference_passages": 37, + "ai_caught_public_bar": 0.7368421052631579, + "ai_caught_private_bar": 0.6447368421052632, + "public_humans_flagged_private_bar": 0.036036036036036036, + "auroc_public_ai_over_reference": 0.8122332859174964, + "auroc_public_ai_over_public_humans": 0.9408487434803224 + }, + "binoculars": { + "reference_passages": 37, + "ai_caught_public_bar": 0.5394736842105263, + "ai_caught_private_bar": 0.4868421052631579, + "public_humans_flagged_private_bar": 0.0, + "auroc_public_ai_over_reference": 0.7652916073968705, + "auroc_public_ai_over_public_humans": 0.8258653390232338 + }, + "classifier-raid": { + "reference_passages": 37, + "ai_caught_public_bar": 0.4868421052631579, + "ai_caught_private_bar": 0.3815789473684211, + "public_humans_flagged_private_bar": 0.009009009009009009, + "auroc_public_ai_over_reference": 0.7021692745376956, + "auroc_public_ai_over_public_humans": 0.8760075865339023 + }, + "classifier-mirrors": { + "reference_passages": 37, + "ai_caught_public_bar": 0.9473684210526315, + "ai_caught_private_bar": 0.7894736842105263, + "public_humans_flagged_private_bar": 0.018018018018018018, + "auroc_public_ai_over_reference": 0.9743954480796586, + "auroc_public_ai_over_public_humans": 0.9943100995732574 + } + } + } +} diff --git a/results/private_writing.md b/results/private_writing.md new file mode 100644 index 0000000..2e17c65 --- /dev/null +++ b/results/private_writing.md @@ -0,0 +1,85 @@ +# Private writing + +How often each detector flags documents that were never published. The flagging bar is the one set to flag 5% of human texts on the calibration half of the long set; these documents had no part in setting it. A detector that treats this writing like other human writing should flag about 5% of it. + +Long documents are cut into consecutive passages of up to 500 words, so passages from one document are not independent. Cells read: passages flagged of passages scored (share; 95% interval treating passages as independent), then documents with at least one flagged passage. + +| Group | Documents | Passages | +|---|---|---| +| Personal journal, 2024 | 1 | 66 | +| Dated before ChatGPT (30 Nov 2022) | 32 | 60 | +| Dated since, AI use unknown | 61 | 99 | +| School work, undated (2019 to mid-2023) | 59 | 82 | + +The texts, titles and per-document scores are not in this repository. A blank cell means the detector was not run on that group. + +## At 75 words + +| Detector | Public human texts (test half) | Personal journal, 2024 | Dated before ChatGPT (30 Nov 2022) | Dated since, AI use unknown | School work, undated (2019 to mid-2023) | +|---|---|---|---|---|---| +| Clef 27B, asked | 19 of 263 (7%; 5%-11%) | | 19 of 60 (32%; 21%-44%); 15 of 32 documents | 32 of 99 (32%; 24%-42%); 26 of 61 documents | 24 of 82 (29%; 21%-40%); 20 of 59 documents | +| Binoculars (0.5B pair) | 6 of 263 (2%; 1%-5%) | 2 of 66 (3%; 1%-10%); 1 of 1 documents | 5 of 60 (8%; 4%-18%); 5 of 32 documents | 20 of 99 (20%; 13%-29%); 18 of 61 documents | 4 of 82 (5%; 2%-12%); 4 of 59 documents | +| Classifier, RAID only | 12 of 263 (5%; 3%-8%) | 0 of 66 (0%; 0%-6%); 0 of 1 documents | 10 of 60 (17%; 9%-28%); 10 of 32 documents | 26 of 99 (26%; 19%-36%); 21 of 61 documents | 11 of 82 (13%; 8%-22%); 10 of 59 documents | +| Classifier, RAID + mirrors | 15 of 263 (6%; 3%-9%) | 0 of 66 (0%; 0%-6%); 0 of 1 documents | 8 of 60 (13%; 7%-24%); 7 of 32 documents | 30 of 99 (30%; 22%-40%); 28 of 61 documents | 4 of 82 (5%; 2%-12%); 4 of 59 documents | +| Binoculars + classifier (mirrors) | 8 of 263 (3%; 2%-6%) | 0 of 66 (0%; 0%-6%); 0 of 1 documents | 10 of 60 (17%; 9%-28%); 9 of 32 documents | 32 of 99 (32%; 24%-42%); 27 of 61 documents | 6 of 82 (7%; 3%-15%); 6 of 59 documents | +| Clef + Binoculars | 17 of 263 (6%; 4%-10%) | | 35 of 60 (58%; 46%-70%); 22 of 32 documents | 50 of 99 (51%; 41%-60%); 38 of 61 documents | 32 of 82 (39%; 29%-50%); 25 of 59 documents | +| All three combined | 10 of 263 (4%; 2%-7%) | | 19 of 60 (32%; 21%-44%); 14 of 32 documents | 49 of 99 (49%; 40%-59%); 38 of 61 documents | 18 of 82 (22%; 14%-32%); 16 of 59 documents | + +## At 150 words + +| Detector | Public human texts (test half) | Personal journal, 2024 | Dated before ChatGPT (30 Nov 2022) | Dated since, AI use unknown | School work, undated (2019 to mid-2023) | +|---|---|---|---|---|---| +| Clef 27B, asked | 11 of 263 (4%; 2%-7%) | | 16 of 60 (27%; 17%-39%); 11 of 32 documents | 28 of 99 (28%; 20%-38%); 24 of 61 documents | 25 of 82 (30%; 22%-41%); 22 of 59 documents | +| Binoculars (0.5B pair) | 13 of 263 (5%; 3%-8%) | 2 of 66 (3%; 1%-10%); 1 of 1 documents | 7 of 60 (12%; 6%-22%); 7 of 32 documents | 18 of 99 (18%; 12%-27%); 14 of 61 documents | 7 of 82 (9%; 4%-17%); 7 of 59 documents | +| Classifier, RAID only | 15 of 263 (6%; 3%-9%) | 0 of 66 (0%; 0%-6%); 0 of 1 documents | 14 of 60 (23%; 14%-35%); 13 of 32 documents | 34 of 99 (34%; 26%-44%); 26 of 61 documents | 11 of 82 (13%; 8%-22%); 10 of 59 documents | +| Classifier, RAID + mirrors | 12 of 263 (5%; 3%-8%) | 0 of 66 (0%; 0%-6%); 0 of 1 documents | 6 of 60 (10%; 5%-20%); 5 of 32 documents | 35 of 99 (35%; 27%-45%); 31 of 61 documents | 4 of 82 (5%; 2%-12%); 4 of 59 documents | +| Binoculars + classifier (mirrors) | 13 of 263 (5%; 3%-8%) | 0 of 66 (0%; 0%-6%); 0 of 1 documents | 9 of 60 (15%; 8%-26%); 9 of 32 documents | 38 of 99 (38%; 29%-48%); 31 of 61 documents | 6 of 82 (7%; 3%-15%); 6 of 59 documents | +| Clef + Binoculars | 10 of 263 (4%; 2%-7%) | | 30 of 60 (50%; 38%-62%); 24 of 32 documents | 45 of 99 (45%; 36%-55%); 36 of 61 documents | 31 of 82 (38%; 28%-49%); 25 of 59 documents | +| All three combined | 9 of 263 (3%; 2%-6%) | | 23 of 60 (38%; 27%-51%); 21 of 32 documents | 59 of 99 (60%; 50%-69%); 45 of 61 documents | 16 of 82 (20%; 12%-29%); 14 of 59 documents | + +## At 300 words + +| Detector | Public human texts (test half) | Personal journal, 2024 | Dated before ChatGPT (30 Nov 2022) | Dated since, AI use unknown | School work, undated (2019 to mid-2023) | +|---|---|---|---|---|---| +| Clef 27B, asked | 12 of 263 (5%; 3%-8%) | | 21 of 50 (42%; 29%-56%); 15 of 29 documents | 42 of 84 (50%; 40%-60%); 33 of 54 documents | 20 of 65 (31%; 21%-43%); 16 of 48 documents | +| Binoculars (0.5B pair) | 10 of 263 (4%; 2%-7%) | 1 of 65 (2%; 0%-8%); 1 of 1 documents | 2 of 50 (4%; 1%-13%); 2 of 29 documents | 16 of 84 (19%; 12%-29%); 14 of 54 documents | 4 of 65 (6%; 2%-15%); 4 of 48 documents | +| Classifier, RAID only | 8 of 263 (3%; 2%-6%) | 1 of 65 (2%; 0%-8%); 1 of 1 documents | 3 of 50 (6%; 2%-16%); 3 of 29 documents | 27 of 84 (32%; 23%-43%); 21 of 54 documents | 8 of 65 (12%; 6%-22%); 7 of 48 documents | +| Classifier, RAID + mirrors | 7 of 263 (3%; 1%-5%) | 2 of 65 (3%; 1%-11%); 1 of 1 documents | 4 of 50 (8%; 3%-19%); 4 of 29 documents | 40 of 84 (48%; 37%-58%); 35 of 54 documents | 4 of 65 (6%; 2%-15%); 4 of 48 documents | +| Binoculars + classifier (mirrors) | 17 of 263 (6%; 4%-10%) | 1 of 65 (2%; 0%-8%); 1 of 1 documents | 11 of 50 (22%; 13%-35%); 11 of 29 documents | 48 of 84 (57%; 46%-67%); 36 of 54 documents | 7 of 65 (11%; 5%-21%); 7 of 48 documents | +| Clef + Binoculars | 12 of 263 (5%; 3%-8%) | | 32 of 50 (64%; 50%-76%); 23 of 29 documents | 64 of 84 (76%; 66%-84%); 45 of 54 documents | 28 of 65 (43%; 32%-55%); 23 of 48 documents | +| All three combined | 12 of 263 (5%; 3%-8%) | | 22 of 50 (44%; 31%-58%); 20 of 29 documents | 65 of 84 (77%; 67%-85%); 48 of 54 documents | 19 of 65 (29%; 20%-41%); 17 of 48 documents | + +## At 500 words + +| Detector | Public human texts (test half) | Personal journal, 2024 | Dated before ChatGPT (30 Nov 2022) | Dated since, AI use unknown | School work, undated (2019 to mid-2023) | +|---|---|---|---|---|---| +| Clef 27B, asked | 7 of 111 (6%; 3%-12%) | | 13 of 37 (35%; 22%-51%); 12 of 25 documents | 43 of 72 (60%; 48%-70%); 35 of 52 documents | 12 of 43 (28%; 17%-43%); 9 of 29 documents | +| Binoculars (0.5B pair) | 4 of 111 (4%; 1%-9%) | 1 of 65 (2%; 0%-8%); 1 of 1 documents | 3 of 37 (8%; 3%-21%); 3 of 25 documents | 10 of 72 (14%; 8%-24%); 7 of 52 documents | 5 of 43 (12%; 5%-24%); 5 of 29 documents | +| Classifier, RAID only | 6 of 111 (5%; 3%-11%) | 1 of 65 (2%; 0%-8%); 1 of 1 documents | 6 of 37 (16%; 8%-31%); 6 of 25 documents | 28 of 72 (39%; 28%-50%); 20 of 52 documents | 9 of 43 (21%; 11%-35%); 9 of 29 documents | +| Classifier, RAID + mirrors | 2 of 111 (2%; 0%-6%) | 2 of 65 (3%; 1%-11%); 1 of 1 documents | 4 of 37 (11%; 4%-25%); 4 of 25 documents | 39 of 72 (54%; 43%-65%); 33 of 52 documents | 7 of 43 (16%; 8%-30%); 7 of 29 documents | +| Binoculars + classifier (mirrors) | 2 of 111 (2%; 0%-6%) | 1 of 65 (2%; 0%-8%); 1 of 1 documents | 7 of 37 (19%; 9%-34%); 7 of 25 documents | 43 of 72 (60%; 48%-70%); 32 of 52 documents | 13 of 43 (30%; 19%-45%); 12 of 29 documents | +| Clef + Binoculars | 9 of 111 (8%; 4%-15%) | | 16 of 37 (43%; 29%-59%); 14 of 25 documents | 49 of 72 (68%; 57%-78%); 37 of 52 documents | 18 of 43 (42%; 28%-57%); 15 of 29 documents | +| All three combined | 3 of 111 (3%; 1%-8%) | | 13 of 37 (35%; 22%-51%); 11 of 25 documents | 53 of 72 (74%; 62%-82%); 39 of 52 documents | 15 of 43 (35%; 22%-50%); 13 of 29 documents | + +## If the bar were set on the private human group ("Dated before ChatGPT (30 Nov 2022)") + +The bar is moved to flag 5% of that group's passages, and AI text caught is measured on the public test half. The bar is set on the same private passages it is judged on, so treat these as indicative. AUROC compares public AI text with each kind of human text; 1.0 is perfect separation. + +| Length | Detector | AI caught, bar set on public humans | AI caught, bar set on private humans | AUROC against public humans | AUROC against private humans | +|---|---|---|---|---|---| +| 75 words | Clef 27B, asked | 49% | 36% | 0.83 | 0.58 | +| 75 words | Binoculars (0.5B pair) | 51% | 41% | 0.88 | 0.81 | +| 75 words | Classifier, RAID only | 60% | 34% | 0.88 | 0.77 | +| 75 words | Classifier, RAID + mirrors | 78% | 63% | 0.96 | 0.91 | +| 150 words | Clef 27B, asked | 59% | 41% | 0.89 | 0.66 | +| 150 words | Binoculars (0.5B pair) | 69% | 54% | 0.91 | 0.85 | +| 150 words | Classifier, RAID only | 69% | 53% | 0.92 | 0.81 | +| 150 words | Classifier, RAID + mirrors | 85% | 69% | 0.98 | 0.95 | +| 300 words | Clef 27B, asked | 76% | 65% | 0.94 | 0.77 | +| 300 words | Binoculars (0.5B pair) | 73% | 73% | 0.92 | 0.87 | +| 300 words | Classifier, RAID only | 69% | 65% | 0.93 | 0.83 | +| 300 words | Classifier, RAID + mirrors | 91% | 85% | 0.99 | 0.97 | +| 500 words | Clef 27B, asked | 74% | 64% | 0.94 | 0.81 | +| 500 words | Binoculars (0.5B pair) | 54% | 49% | 0.83 | 0.77 | +| 500 words | Classifier, RAID only | 49% | 38% | 0.88 | 0.70 | +| 500 words | Classifier, RAID + mirrors | 95% | 79% | 0.99 | 0.97 | diff --git a/src/detecteval/private_eval.py b/src/detecteval/private_eval.py index 1466869..ecf9a8c 100644 --- a/src/detecteval/private_eval.py +++ b/src/detecteval/private_eval.py @@ -5,6 +5,7 @@ test of how often a detector accuses a real person. python -m detecteval.private_eval clef # paid: sends each text to Clef 27B on Workers AI + # (--skip-group NAME keeps a group on this machine) python -m detecteval.private_eval local # Binoculars and both classifiers; needs the "ml" group python -m detecteval.private_eval report # writes results/private_writing.md and .json @@ -29,13 +30,18 @@ from .items import private_dir, private_documents, private_items DETECTORS = ["clef", "binoculars", "classifier-raid", "classifier-mirrors"] -COMBINATIONS = {"clef+binoculars": ["clef", "binoculars"], +COMBINATIONS = {"local-two": ["binoculars", "classifier-mirrors"], + "clef+binoculars": ["clef", "binoculars"], "all-three": ["clef", "binoculars", "classifier-mirrors"]} NAMES = {"clef": "Clef 27B, asked", "binoculars": "Binoculars (0.5B pair)", "classifier-raid": "Classifier, RAID only", "classifier-mirrors": "Classifier, RAID + mirrors", - "clef+binoculars": "Clef + Binoculars", "all-three": "All three combined"} -GROUP_NAMES = {"own_pre_ai": "Written before ChatGPT (30 Nov 2022)", - "own_recent": "Written since, AI use unknown"} + "local-two": "Binoculars + classifier (mirrors)", "clef+binoculars": "Clef + Binoculars", + "all-three": "All three combined"} +REFERENCE_GROUP = "own_pre_ai" # the group treated as certainly human when re-setting the bar +GROUP_NAMES = {"own_pre_ai": "Dated before ChatGPT (30 Nov 2022)", + "own_school_undated": "School work, undated (2019 to mid-2023)", + "own_journal_2024": "Personal journal, 2024", + "own_recent": "Dated since, AI use unknown"} def scores_dir(): @@ -57,28 +63,33 @@ def load_private_scores() -> dict[str, dict[str, float]]: return {name: values for name, values in scores.items() if values} -def rate(values: np.ndarray, threshold: float) -> dict: - count = int((values > threshold).sum()) - return {"n": int(values.size), "flagged": count, "share": count / values.size if values.size else None, - "ci95": metrics.wilson_interval(count, int(values.size))} +def rate(values: np.ndarray, threshold: float, documents: list | None = None) -> dict: + """Texts over the bar. With ``documents`` (one label per text), also how many documents have any.""" + over = values > threshold + count = int(over.sum()) + out = {"n": int(values.size), "flagged": count, "share": count / values.size if values.size else None, + "ci95": metrics.wilson_interval(count, int(values.size))} + if documents is not None: + out["documents"] = len(set(documents)) + out["documents_flagged"] = len({doc for doc, hit in zip(documents, over, strict=True) if hit}) + return out def analyse(target_fpr: float = 0.05) -> dict: texts, public = compare.load_texts(), compare.load_scores() private = load_private_scores() - groups = {row["id"]: row["group"] for row in private_documents()} - out: dict = {"target_fpr": target_fpr, "documents": dict(collections.Counter(groups.values())), "rungs": {}} + manifest = private_documents() + groups = {row["id"]: row["group"] for row in manifest} + source = {row["id"]: row.get("doc", row["id"]) for row in manifest} # passages cut from one document + out: dict = {"target_fpr": target_fpr, "passages": dict(collections.Counter(groups.values())), + "documents": {group: len({source[doc] for doc, g in groups.items() if g == group}) + for group in set(groups.values())}, "rungs": {}} for rung in config.RUNGS: keys = compare.keys_of(texts, "long", rung, public) calib = [key for key in keys if texts[key]["split"] == "calib" and texts[key]["label"] in ("human", "ai")] calib_human = [key for key in calib if texts[key]["label"] == "human"] test_human = [key for key in keys if texts[key]["split"] == "test" and texts[key]["label"] == "human"] - mine = collections.defaultdict(list) - for document, group in groups.items(): - key = f"{document}@{rung}" - if all(key in private.get(name, {}) for name in DETECTORS): - mine[group].append(key) - if len(calib_human) < 20 or not mine: + if len(calib_human) < 20: continue entry: dict = {} plans = {name: [name] for name in DETECTORS} | COMBINATIONS @@ -97,10 +108,51 @@ def matrix(rows, source, parts=parts): def score(rows, source, model=model, matrix=matrix): return metrics.predict_logistic(model, matrix(rows, source)) + # A group appears for a detector only where every one of its documents at this length was scored. + mine = collections.defaultdict(list) + for document, group in groups.items(): + key = f"{document}@{rung}" + if all(key in private[part] for part in parts): + mine[group].append(key) + if not mine: + continue threshold = metrics.threshold_for_fpr(score(calib_human, public), target_fpr) entry[name] = {"public_test_humans": rate(score(test_human, public), threshold), - "groups": {group: rate(score(rows, private), threshold) for group, rows in mine.items()}} - out["rungs"][str(rung)] = entry + "groups": {group: rate(score(rows, private), threshold, + [source[key.rsplit("@", 1)[0]] for key in rows]) + for group, rows in mine.items()}} + if entry: + out["rungs"][str(rung)] = entry + + # What each detector catches if the bar is set on the certainly-human private group instead of on + # public human text. The bar is set and the private rate measured on the same passages, so this is + # indicative; the AI rate is measured on the public test half. + out["recalibrated"] = {} + for rung in config.RUNGS: + keys = compare.keys_of(texts, "long", rung, public) + test_ai = [key for key in keys if texts[key]["split"] == "test" and texts[key]["label"] == "ai"] + test_human = [key for key in keys if texts[key]["split"] == "test" and texts[key]["label"] == "human"] + calib_human = [key for key in keys if texts[key]["split"] == "calib" and texts[key]["label"] == "human"] + entry = {} + for name in DETECTORS: + if name not in public or name not in private: + continue + reference = np.array([private[name][f"{doc}@{rung}"] for doc, group in groups.items() + if group == REFERENCE_GROUP and f"{doc}@{rung}" in private[name]]) + if reference.size < 30 or len(test_ai) < 20: + continue + public_bar = metrics.threshold_for_fpr(np.array([public[name][key] for key in calib_human]), target_fpr) + private_bar = metrics.threshold_for_fpr(reference, target_fpr) + ai = np.array([public[name][key] for key in test_ai]) + human = np.array([public[name][key] for key in test_human]) + entry[name] = {"reference_passages": int(reference.size), + "ai_caught_public_bar": metrics.flag_rate(ai, public_bar), + "ai_caught_private_bar": metrics.flag_rate(ai, private_bar), + "public_humans_flagged_private_bar": metrics.flag_rate(human, private_bar), + "auroc_public_ai_over_reference": metrics.auroc(reference, ai), + "auroc_public_ai_over_public_humans": metrics.auroc(human, ai)} + if entry: + out["recalibrated"][str(rung)] = entry return out @@ -110,9 +162,14 @@ def markdown(summary: dict) -> str: f"set to flag {summary['target_fpr']:.0%} of human texts on the calibration half of the long set; " "these documents had no part in setting it. A detector that treats this writing like other human " f"writing should flag about {summary['target_fpr']:.0%} of it.", "", - "Documents: " + ", ".join(f"{GROUP_NAMES.get(group, group)}: {count}" - for group, count in sorted(summary["documents"].items())) + ".", - "The texts, titles and per-document scores are not in this repository."] + "Long documents are cut into consecutive passages of up to 500 words, so passages from one " + "document are not independent. Cells read: passages flagged of passages scored (share; 95% " + "interval treating passages as independent), then documents with at least one flagged passage.", "", + "| Group | Documents | Passages |", "|---|---|---|"] + lines += [f"| {GROUP_NAMES.get(group, group)} | {summary['documents'][group]} | {count} |" + for group, count in sorted(summary["passages"].items())] + lines += ["", "The texts, titles and per-document scores are not in this repository. A blank cell means the " + "detector was not run on that group."] for rung, entry in summary["rungs"].items(): groups = sorted({group for detector in entry.values() for group in detector["groups"]}) lines += ["", f"## At {rung} words", "", @@ -122,21 +179,44 @@ def markdown(summary: dict) -> str: for name, detector in entry.items(): cells = [] for cell in [detector["public_test_humans"]] + [detector["groups"].get(group) for group in groups]: - cells.append("" if not cell or not cell["n"] else - f"{cell['flagged']} of {cell['n']} ({cell['share']:.0%}; " - f"{cell['ci95'][0]:.0%}-{cell['ci95'][1]:.0%})") + if not cell or not cell["n"]: + cells.append("") + continue + text = (f"{cell['flagged']} of {cell['n']} ({cell['share']:.0%}; " + f"{cell['ci95'][0]:.0%}-{cell['ci95'][1]:.0%})") + if "documents" in cell: + text += f"; {cell['documents_flagged']} of {cell['documents']} documents" + cells.append(text) lines.append(f"| {NAMES[name]} | " + " | ".join(cells) + " |") + if summary.get("recalibrated"): + reference = GROUP_NAMES.get(REFERENCE_GROUP, REFERENCE_GROUP) + lines += ["", f"## If the bar were set on the private human group (\"{reference}\")", "", + f"The bar is moved to flag {summary['target_fpr']:.0%} of that group's passages, and AI text " + "caught is measured on the public test half. The bar is set on the same private passages it " + "is judged on, so treat these as indicative. AUROC compares public AI text with each kind of " + "human text; 1.0 is perfect separation.", "", + "| Length | Detector | AI caught, bar set on public humans | AI caught, bar set on private humans | " + "AUROC against public humans | AUROC against private humans |", "|---|---|---|---|---|---|"] + for rung, entry in summary["recalibrated"].items(): + for name, row in entry.items(): + lines.append(f"| {rung} words | {NAMES[name]} | {row['ai_caught_public_bar']:.0%} | " + f"{row['ai_caught_private_bar']:.0%} | {row['auroc_public_ai_over_public_humans']:.2f} | " + f"{row['auroc_public_ai_over_reference']:.2f} |") return "\n".join(lines) + "\n" def main() -> None: parser = argparse.ArgumentParser(description=__doc__.split("\n")[0]) parser.add_argument("step", choices=["clef", "local", "report"]) + parser.add_argument("--skip-group", action="append", default=[], + help="with 'clef': keep this group's texts on this machine (may be repeated)") args = parser.parse_args() config.load_env() if args.step == "clef": from .score_long import score - score("clef", "pct_ai", config.RUNGS, private_items(), scores_dir() / "clef.pct_ai.jsonl") + held_back = {row["id"] for row in private_documents() if row["group"] in args.skip_group} + items = [item for item in private_items() if item["id"] not in held_back] + score("clef", "pct_ai", config.RUNGS, items, scores_dir() / "clef.pct_ai.jsonl") elif args.step == "local": from . import binoculars, classify binoculars.run(private_items(), scores_dir() / "binoculars.jsonl")