Skip to content
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.

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.

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.

Key figures

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

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.

Reporting rule

Never report precision or accuracy from a balanced test set as if it applied to a real population. Report detection rate and false positive rate, then precision at a stated base rate.

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.

Common 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)

Further reading named in the text

  • Tom Fawcett, An Introduction to ROC Analysis (Pattern Recognition Letters 27, 2006)
  • Edwin B. Wilson, Probable Inference, the Law of Succession, and Statistical Inference (Journal of the American Statistical Association 22, 1927)
  • Alan Agresti and Brent A. Coull, Approximate Is Better than Exact for Interval Estimation of Binomial Proportions (The American Statistician 52(2), 1998)
  • Gerd Gigerenzer, Calculated Risks: How to Know When Numbers Deceive You (Simon and Schuster, 2002)

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.