Subscribe
Explainers
6 min read

What Is Precision vs. Recall? The Two Ways an AI System Can Be Wrong

Every system that decides things is wrong in two different ways. A spam filter that deletes your interview invitation is broken, and so is a spam filter that shows you forty scams. A screening tool that rejects a qualified candidate is broken, and so is one that passes twenty unqualified ones. The two failures are different animals, they move in opposite directions, and most evaluation numbers hide which one you are buying. The words for that trade-off are precision and recall. They came out of

What Is Precision vs. Recall? The Two Ways an AI System Can Be Wrong

Every system that decides things is wrong in two different ways. A spam filter that deletes your interview invitation is broken, and so is a spam filter that shows you forty scams. A screening tool that rejects a qualified candidate is broken, and so is one that passes twenty unqualified ones. The two failures are different animals, they move in opposite directions, and most evaluation numbers hide which one you are buying.

The words for that trade-off are precision and recall. They came out of 1970s library science, crossed into medical diagnostics, and now sit underneath almost every quality claim an AI lab publishes. Here is what they actually count, and how to catch the versions of them that lie.

One grid, four boxes

A binary classifier sorts items into flagged and not-flagged. Reality sorts the same items into positive and negative. That gives four boxes:

  • True positive: flagged, and right to do it.
  • False positive: flagged, but the item was clean. A false alarm.
  • False negative: not flagged, but the item was a positive. A miss.
  • True negative: not flagged, and right to skip it.

Precision asks what share of the alarms are real:

precision = TP / (TP + FP)

Recall asks what share of the real positives got caught:

recall = TP / (TP + FN)

Medicine uses different names for the same arithmetic. Sensitivity is recall. Positive predictive value is precision. Specificity is the true-negative rate (Parikh et al., 2008). The field that perfected this grid screens for diseases, where a false alarm costs an anxious patient and a biopsy and a miss can cost a death. That cost asymmetry is the whole subject.

A 2x2 printed grid on cream paper, each box holding dots in a different arrangement

You cannot have both, because there is only one dial

Most classifiers produce a score and flag whatever crosses a threshold. Lower the threshold and more items get flagged: recall climbs, false alarms climb with it, precision falls. Raise it and precision recovers while real positives slip past. The two numbers are the same dial read from two sides.

Bad evaluations exploit this. A classic trap is judging a system by its ROC curve, which plots catch rate against false-alarm rate. Davis and Goadrich showed at ICML 2006 that ROC curves "can present an overly optimistic view of an algorithm's performance if there is a large skew" in the classes, because the false-positive axis divides by the negative population, which grows enormous when positives are rare. A system can look excellent in ROC space and be barely better than chance at telling a real alarm from a fake one in yours.

The base rate is the boss

Work an example you can check. A firm screens 1,000 applications and uses a detector that flags AI-written ones. Suppose 1 percent of applications are genuinely AI-written, ten of them. Suppose the detector catches 95 percent of those and falsely flags 5 percent of the 990 honest applications. That is a tool that scores 95 percent in both directions, the sort of number a vendor would happily print.

It now returns 9.5 true alarms and 49.5 false ones. Of everything it flagged, only about 16 percent was real. Precision collapsed not because the detector is bad but because what it hunts is rare. The same detector in a pool where 20 percent of applications are AI-written would flag far more truth than noise. Medical statistics writes this down as Bayes' rule: predictive value depends on sensitivity, specificity, and prevalence (Monaghan et al., 2021).

The adjacent trap is plain accuracy. In that same population, a classifier that flags nothing at all is 99 percent accurate and catches zero. When one class is rare, accuracy is close to meaningless, and it is always the first number a press release quotes.

The F1 score, and what it hides

The words entered formal use in information retrieval, the discipline of measuring how well search systems find relevant documents. C. J. van Rijsbergen's textbook Information Retrieval (2nd ed., 1979) established the precision-recall pair as the standard effectiveness measures and derived the F-measure for a user who weights recall and precision equally.

F1 is the harmonic mean of the two: 2PR / (P + R). The harmonic mean punishes lopsidedness on purpose. A classifier at 90 percent precision and 10 percent recall gets an F1 of 0.18, where the ordinary average would report 0.50. The message built into the formula: you are only as good as your worse error. The counter-warning, made by Powers (2015), is that F1 hides the split. Two systems with identical F1 can differ tenfold in how many innocent items they false-alarm on. When a report gives you one number, asking for the two halves is a fair question.

Where these numbers live in LLMs now

  • Question answering. SQuAD, the 2016 Stanford reading-comprehension dataset, scored answers two ways: exact match, all tokens right, and token-overlap F1 for partial credit. The launch paper reported 51.0 percent F1 for its best model against 86.8 percent for humans, and closing that gap became a research industry.
  • Retrieval. A RAG system splits the error budget across two stages. The original 2020 RAG paper scored its retriever on recall@k, whether the passage containing the answer appears in the top-k results, because the generator cannot use evidence the retriever dropped. Evaluation frameworks have standardized the same split for production pipelines: RAGAS context recall asks whether retrieved chunks cover everything the reference answer needs, context precision asks whether the chunks that did arrive are focused and well-ranked.
  • Safety. Guard models are benchmarked with per-category harmfulness F1; the Aegis 2.0 paper compares open and commercial moderation systems that way. Here both boxes on the grid have customers: a false negative is harm that shipped, a false positive is a refused safe request. Measured across 20 LLMs, jailbreak defenses raise false-refusal rates substantially, which is the dial, not a bug. (We covered the phenomenon itself in What Is Over-Refusal?)
  • AI text detection. The clearest public lesson in bad precision: Liang et al. (Patterns, 2023) ran seven commercial detectors over essays by non-native English speakers and found an average 61.3 percent false-positive rate, with 97.8 percent of essays flagged by at least one tool, while the same detectors were near-perfect on native eighth-grade writing. Having ChatGPT enrich the essays' vocabulary dropped the false-alarm rate to 11.6 percent. A detector can have excellent recall on its target and collapsing precision in the hands of real users, which is how entire classroom disputes got fought over a threshold.
A mid-century rotary dial on a control panel, flanked by a bell on one side and a catching net on the other

Which number to optimize

Pick by the cost of the two boxes, not by which number photographs better. When false alarms are expensive, a spam folder, a plagiarism accusation, an auto-rejected loan, tune for precision and tolerate some misses. When misses are expensive, jailbreak detection, malware screening, early cancer detection, tune for recall and accept the follow-up work the noise creates. If one number is required, F-beta with beta above 1 weights recall heavier than precision, which at least states the value judgment instead of burying it.

The useful habit this leaves you with is small: whenever an AI system is reported to be "99 percent accurate," ask what it counts as positive, how rare those cases actually are, and what the false-alarm rate is on the population you care about. Precision and recall are not two quality scores. They are the two ways of being wrong, and every launch number is one reading of a dial somebody set for you.

Sources

  • C. J. van Rijsbergen, Information Retrieval, 2nd ed., Butterworths, 1979 (PDF)
  • J. Davis and M. Goadrich, "The Relationship Between Precision-Recall and ROC Curves," ICML 2006 (PDF)
  • D. M. W. Powers, "What the F-measure doesn't measure: Features, factors and effect factors," arXiv:1503.06410
  • R. Parikh et al., "Understanding and using sensitivity, specificity and predictive values," Indian Journal of Ophthalmology, PMC2636062
  • R. Zaki et al., "Foundational Statistical Principles in Medical Research," PMC8156826
  • P. Rajpurkar et al., "SQuAD: 100,000+ Questions for Machine Comprehension of Text," arXiv:1606.05250
  • P. Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks," arXiv:2005.11401
  • S. Es et al., "RAGAS: Automated Evaluation of Retrieval Augmented Generation," arXiv:2309.15217; RAGAS docs on context recall
  • S. Ghosh et al., "Aegis2.0: A Diverse AI Safety Dataset and Risks Taxonomy for Alignment of LLM Guardrails," arXiv:2501.09004
  • W. Liang et al., "GPT detectors are biased against non-native English writers," Patterns, PMC10382961
  • "Automatic Pseudo-Harmful Prompt Generation for Evaluating False Refusals in Large Language Models" (PHTest), arXiv:2409.00598
ExplainersLLM