A detector that is right 95% of the time can still be wrong about most of the cases it flags. Bayes' rule says exactly when and by how much, and it is the single most useful formula for reading any classifier, test, verifier or evaluation result.
Turning the conditional around
The product rule from the previous lesson can be written two ways: . Dividing by gives Bayes' rule:
The denominator is the law of total probability. Each term has a name:
- , the prior: how plausible the hypothesis was before the evidence.
- , the likelihood: how expected the evidence is if the hypothesis is true.
- , the posterior: what you should believe after seeing it.
The result is named after Thomas Bayes, whose essay was published posthumously in 1763 after Richard Price edited it and communicated it to the Royal Society.[1] Bayes treated a specific problem, inferring the unknown chance of an event from observed successes and failures. Laplace, independently and in more general form, set out the principle of reasoning from observed effects to probable causes in a 1774 memoir, and he did most to make it a working tool.[2]
The rule is trivial to derive. Its practical difficulty is that people, including experts, routinely confuse with .
Worked example: a good test for a rare condition
A screening test has 99% sensitivity () and 95% specificity (, so the false-positive rate is 0.05). The condition has 1% prevalence. Someone tests positive. How likely are they to have it?
About one in six. The arithmetic is clearer as natural frequencies. Take 10,000 people:
| Test positive | Test negative | Total | |
|---|---|---|---|
| Have the condition | 99 | 1 | 100 |
| Healthy | 495 | 9,405 | 9,900 |
There are 594 positives, of which 99 are real. The test is accurate; the false positives win because they are drawn from a pool 99 times larger. This is the base-rate trap: ignoring and reading the test's accuracy as if it were the answer.
The trap is well documented. In 1978 Casscells, Schoenberger and Graboys asked 60 physicians, residents and students at Harvard-affiliated hospitals about a test for a disease with prevalence 1/1000 and a 5% false-positive rate.[3] Assuming perfect sensitivity, the answer is . According to a 2014 re-analysis, only 11 of the 60 answered correctly and the most common answer was 95%; a replication with 61 respondents at a Boston-area hospital found 14 correct, and 95% was again the most common answer.[4]
Re-run the screening example with the condition at 10% prevalence instead of 1%, keeping sensitivity 0.99 and false-positive rate 0.05. What is ?
Show answer +Hide answer −
. Same test, very different meaning: a positive result's value depends on the base rate.
The odds form: evidence multiplies
Bayes' rule is easiest to use in odds, . Dividing Bayes' rule for by Bayes' rule for cancels the awkward denominator:
In the screening example the prior odds are and the likelihood ratio of a positive result is , so the posterior odds are , that is , a probability of . In log-odds the update is additive: each independent piece of evidence adds its log likelihood ratio. A second independent positive test multiplies the odds by 19.8 again, giving , a probability of about 0.80.
The odds form explains a number of results about selection with imperfect judges. In the lab's Thurstone bounds Best-of-N, the condition under which a shared exploit defeats plurality voting is that its conditional rate exceed , the prior odds that a candidate is correct.[5] When correct answers are rare, the bar a false answer must clear is correspondingly low.
Where the base rate bites in AI
Detectors and filters. Any system that flags a rare class (fraudulent transactions, harmful prompts, machine-generated text, a reward hack among thousands of samples) faces the same arithmetic. A false-positive rate that looks small on a balanced test set can dominate the flagged set in deployment, where the target class is rare. When you read a detector's reported accuracy, the first question is: at what prevalence?
Verifiers. In Best-of-N sampling a verifier scores many candidates and the highest score wins. If the base rate of correct candidates is low, even a verifier that rarely scores a wrong answer highly will, across enough candidates, be shown more high-scoring wrong answers than right ones. The test-time compute course develops this.
Calibration. Bayes' rule takes probabilities as inputs, so it is only as good as those numbers. A classifier's softmax output is a posterior only if the model is calibrated: among cases where it says 80%, about 80% should be right. Guo and colleagues found that modern deep networks were often poorly calibrated, more so than older, smaller networks, and that a single-parameter fix, temperature scaling, worked well on most datasets they tested.[6] An uncalibrated score fed into Bayes' rule gives a precise-looking but wrong posterior.
Updating more than once, honestly
Bayes' rule can be applied sequentially: today's posterior becomes tomorrow's prior. The odds form makes this look like a sum of log likelihood ratios, but that is valid only if the pieces of evidence are conditionally independent given the hypothesis. Two tests that share a failure mode, or two language-model judges that read the same flawed context, are not two independent pieces of evidence. Counting them as independent double-counts. The lab's correlated critique note measured a same-context critic that missed all 12 planted errors that fresh critics caught; agreement between such a critic and the generator is weak evidence, however confident both are.[7]
Two detectors each have likelihood ratio 10 for "this document is machine-generated", and the prior odds are 1:20. A document triggers both. What posterior probability do you get if you treat them as independent, and why might that be wrong?
Show answer +Hide answer −
Independent: posterior odds , so . If the detectors were trained on similar data and share failure modes, the second alarm carries less information than a factor of 10; in the fully redundant case the odds are just , .
Key takeaways
- Bayes' rule, , turns "how likely is this evidence under the hypothesis" into "how likely is the hypothesis given the evidence". The two are not the same.
- A test's accuracy says little about the meaning of a positive result until you know the base rate; rare targets make false positives dominate.
- In odds form, each independent piece of evidence multiplies the odds by its likelihood ratio. Natural-frequency tables make the arithmetic hard to get wrong.
- Model outputs are usable as posteriors only if calibrated, and repeated evidence adds up only if it is conditionally independent.
Sources
-
T. Bayes and R. Price (1763). "An Essay towards Solving a Problem in the Doctrine of Chances." Philosophical Transactions of the Royal Society of London 53: 370–418. https://doi.org/10.1098/rstl.1763.0053 ↩
-
P.-S. Laplace (1774). "Mémoire sur la probabilité des causes par les événements." English translation with introduction in S. M. Stigler (1986), "Laplace's 1774 Memoir on Inverse Probability," Statistical Science 1(3): 359–363. https://doi.org/10.1214/ss/1177013620 ↩
-
W. Casscells, A. Schoenberger, T. B. Graboys (1978). "Interpretation by Physicians of Clinical Laboratory Results." New England Journal of Medicine 299(18): 999–1001. https://doi.org/10.1056/NEJM197811022991808 ↩
-
A. K. Manrai, G. Bhatia, J. Strymish, I. S. Kohane, S. H. Jain (2014). "Medicine's Uncomfortable Relationship With Math: Calculating Positive Predictive Value." JAMA Internal Medicine 174(6): 991–993. https://pmc.ncbi.nlm.nih.gov/articles/PMC4955674 ↩
-
NeuroGenesys (2026). "Thurstone bounds Best-of-N: a 1927 identity, calibrated for modern verifiers." /research/thurstone-bounds-best-of-n ↩
-
C. Guo, G. Pleiss, Y. Sun, K. Q. Weinberger (2017). "On Calibration of Modern Neural Networks." ICML 2017. arXiv:1706.04599. https://arxiv.org/abs/1706.04599 ↩
-
NeuroGenesys (2026). "A critic that shares the generator's prompt shares its errors: measured self-critique correlation." /research/correlated-critique ↩
