Skip to content
TestingExperience

AI Tool Tests

Independent tests of AI tools

27 guides on testing detectors, watermarks, provenance pipelines and disclosure labels.

Open section

Start here, in order

Methods and protocols

How we test 2.0%CI 1.3 to 3.1 False positive rate in the worked benchmark: 20 of 1,000 human-written documents wrongly flagged. Read the protocol
Editorial methodGlossaryReport an errorNo tool maker pays for a test

Software testing

Reference guides for testers

26 guides on planning, automating and designing tests, written to outlive any tool.

Testing Techniques

Sections

Recently updated

Test ManagementTest AutomationAgile TestingTesting TechniquesGuides name no products

Magazine

The magazine, 2008 to 2014

A free quarterly for professional software testers, published in Berlin across 28 issues.

The archive

Archive

Issue pages

28 issues Each issue page states the date and the theme where it is known, and nothing beyond it. The original issues are not distributed.
The archiveAll issuesEditorial methodRecords, not reproductions

False positives, base rates and the confusion matrix

A classifier that is right 98 percent of the time sounds dependable. Whether it is depends on something the classifier does not control: how common the thing it looks for really is. When the target is rare, even a small false positive rate produces more wrong flags than right ones. Testers who report on detectors, fraud rules or any screening model need this arithmetic more than any other.

Foundation guide8 min readUpdated

Quick answer

A confusion matrix counts true positives, false negatives, false positives and true negatives. The false positive rate is false positives over all real negatives; precision is true positives over everything flagged. Precision depends on the base rate: 94 percent detection with 2 percent false positives is right on 98 percent of flags at 50 percent prevalence, 32 percent at 1 percent.

Cells
TP, FN, FP, TN
False positive rate
FP / (FP + TN)
Precision
TP / (TP + FP)
Precision at 50 percent base rate
97.9 percent (worked example)
Precision at 1 percent base rate
32.2 percent (same detector)
Better plot for rare targets
precision-recall, not ROC

Run this test on your own sample

The protocol guide sets out the sample set, the threshold and the report in the order you need them.

Open the protocol
Figure 1Share of flags that are correct, by the share of documents that really are AI-written
Share of flags that are correct, by the share of documents that really are AI-written25%50%75%100%1%2%5%10%20%30%40%50%prevalence: share of the test population that is really AI-written (log scale)spec 99%spec 98%spec 95%
Precision of a flag against the share of documents that are really machine-written, for three detectors that each catch 95 percent of machine text. At a 5 percent base rate the detector with 95 percent specificity is wrong about half the time it flags.

The four cells and the rates built from them

Every binary classifier result, whether a spam filter, a fraud rule or an AI text detector, falls into one of four cells. A true positive is a flagged document that really is machine-written; a false negative is a machine-written document that passed; a false positive is a human-written document that was flagged; a true negative is a human-written document that passed. All the familiar rates are ratios of these four counts, and each one answers a different question.

Rates from the worked benchmark in the detector benchmarking guide: 1,000 human and 1,000 machine documents
RateFormulaQuestion it answersWorked value
Detection rate (recall, sensitivity)TP / (TP + FN)Of the machine text, how much is caught?940 / 1,000 = 94.0%
False positive rateFP / (FP + TN)Of the human text, how much is wrongly flagged?20 / 1,000 = 2.0%
SpecificityTN / (FP + TN)Of the human text, how much passes?980 / 1,000 = 98.0%
Precision (positive predictive value)TP / (TP + FP)Of the flags, how many are right?940 / 960 = 97.9%
Accuracy(TP + TN) / allHow many verdicts are right overall?1,920 / 2,000 = 96.0%

The first three rates are properties of the classifier on each class and do not depend on how many documents of each class are in the set. Precision and accuracy do. That is the root of most misreadings: a benchmark with equal numbers of human and machine documents reports a precision that will not survive contact with a population where machine text is rare, or where it is the majority.

Base rates change what a flag means

Take the same detector, with a 94 percent detection rate and a 2 percent false positive rate, and apply it to 10,000 documents of which 5 percent are really machine-written. It catches 470 of the 500 machine documents and wrongly flags 190 of the 9,500 human ones. Of 660 flags, 190 are wrong: precision has fallen from 97.9 percent to 71.2 percent without anything about the detector changing. At a 1 percent base rate, precision is 32.2 percent: two of every three flags point at a person who wrote their own text.

Detector with 94 percent detection rate and 2 percent false positive rate; precision from Bayes' rule
Base rate (share really machine-written)Flags that are rightFlags that are wrong
50 percent97.9%2.1%
20 percent92.2%7.8%
5 percent71.2%28.8%
1 percent32.2%67.8%

This is the same arithmetic that makes screening tests for rare conditions produce many false alarms, and it is not a flaw that better engineering removes. Lowering the false positive rate helps most, which is why the figure above shows three detectors that differ only in specificity. Testers should report the expected precision at the population's plausible base rate, or a small table across a range of base rates when nobody knows it, next to the rates measured in the detector benchmark.

Thresholds trade one error for the other

Most classifiers output a score, and the flag depends on a threshold. Raising the threshold lowers the false positive rate and the detection rate together. An ROC curve plots detection rate against false positive rate across every threshold; Fawcett's introduction remains the standard reference. When the target is rare, Saito and Rehmsmeier showed that the precision-recall plot is more informative, because ROC curves can look excellent while precision is poor. For a decision that falls on a person, pick the threshold from the false positive ceiling first and accept the detection rate that results.

Uncertainty belongs in the number

A rate measured on a sample is an estimate. Report it with a confidence interval: the Wilson score interval behaves well for rates near zero, where the simple normal approximation fails. Twenty false positives in 1,000 human documents gives 2.0 percent with an interval of 1.3 to 3.1 percent. Two differences are only meaningful if the intervals say so; a detector at 1.8 percent is not better than one at 2.2 percent on samples of this size. The guide to evaluation test set design shows how to size the sample for the precision you need, and the testing metrics guide covers the general rule that a metric reported alone misleads.

For the published numbers behind these warnings, including a 2023 test in which no detector reached 80 percent accuracy, see do AI detectors work.

This guide is part of the testing AI systems hub. It is best read alongside how to benchmark an ai text detector and evaluation test set design for ai models, which cover the neighbouring questions.

Work it out

Calculator: how many flags are wrong?

out of 1,000 documents
Share of human-written text the tool flags
Share of machine-written text the tool flags
How common machine text is in your population

18 of 112 flags land on human writers: 16% of flags are wrong.

  • Human text wrongly flagged18
  • Machine text correctly flagged94
  • Machine text missed6
  • Human text cleared882

Pre-filled with Detector A’s measured rates (sample data). Counts are rounded to whole documents.

Calculator: 95% interval for an error rate

Wilson interval
Documents the tool got wrong
Documents in that class

2.0%95% interval 1.3% to 3.1%, 1.8 points wide

The bar shows the interval on a 0 to 100 percent scale; the dark line is the observed rate.

Questions

What is a confusion matrix?

A two-by-two table of a classifier's results: true positives, false negatives, false positives and true negatives. Every standard rate (detection rate, false positive rate, precision, accuracy) is a ratio of its cells.

What is the difference between false positive rate and precision?

The false positive rate is the share of real negatives that are wrongly flagged. Precision is the share of flags that are right. The first is a property of the classifier; the second also depends on how common positives are in the population.

Why does a low false positive rate still produce many wrong flags?

Because when most items are negative, a small rate applied to a large number produces many false positives. At a 1 percent base rate, a 2 percent false positive rate yields about two wrong flags for every right one, even with a 94 percent detection rate.

Is accuracy useful for AI detectors?

Only with care. Accuracy blends both error types and depends on the class mix in the test set. A detector that flags nothing is 99 percent accurate on a population where 1 percent of documents are machine-written.

Which curve should a detector report, ROC or precision-recall?

Both have uses, but when the target class is rare the precision-recall curve shows the practical cost of false positives more honestly. Report the operating point actually used, with its rates and intervals, whatever curve accompanies it.

Sources

  1. Saito and Rehmsmeier, The Precision-Recall Plot Is More Informative than the ROC Plot on Imbalanced Datasets, PLOS ONE (2015)
  2. Liang et al. (2023), detectors of machine-written text are biased against non-native English writers
  3. NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.4.1 Confidence intervals for a proportion (Wilson method)
  4. Tom Fawcett, An Introduction to ROC Analysis (Pattern Recognition Letters 27, 2006)
  5. Edwin B. Wilson, Probable Inference, the Law of Succession, and Statistical Inference (Journal of the American Statistical Association 22, 1927)
  6. Alan Agresti and Brent A. Coull, Approximate Is Better than Exact for Interval Estimation of Binomial Proportions (The American Statistician 52(2), 1998)
  7. Gerd Gigerenzer, Calculated Risks: How to Know When Numbers Deceive You (Simon and Schuster, 2002)