Most of what the AI industry talks about is generation: predicting the next word, the next pixel, the next action. There is an older idea underneath all of it that is not about producing output at all. It is about what a mind, human or machine, should do when it is shown something new. It fits in one line of algebra, it was written down by a minister who never published it, and every serious attempt to make machines reason under uncertainty is downstream of it.
This is an explainer on Bayesian inference: what the rule says, why accurate tests still produce mostly wrong accusations, and what five years of recent research say about whether language models actually use it.
The rule
Bayes' theorem relates two conditional probabilities that look identical in English and behave very differently in math. You want to know the probability of a hypothesis H given some evidence E. The theorem says you can get there from the inverse conditional, the probability of seeing E if H were true, multiplied by how likely H was before you saw anything:
P(H|E) = P(E|H) x P(H) / P(E)
The four pieces have names. P(H) is the prior, your belief before the evidence arrives. P(E|H) is the likelihood, how expected the evidence is under the hypothesis. P(E) is the probability of the evidence overall, a normalizing constant that makes the answer a valid probability. And P(H|E) is the posterior, the belief after updating. The shorthand form you will see in every machine learning textbook drops the denominator: the posterior is proportional to the prior times the likelihood. New evidence should move your belief by exactly as much as the evidence is worth, no more and no more. If a hypothesis explains the observation much better than its rivals, it gains. If you were extremely sure of it before, it takes extreme evidence to budge. (Wikipedia: Bayes' theorem)
That is the whole mechanics. The discomfort it caused for 250 years comes from the prior: the theorem makes your starting beliefs a formal ingredient in the answer, and plenty of very serious people have considered that unscientific.

Why a 99 percent accurate test is still probably wrong
The single most useful consequence of the theorem is the base-rate result, and it is worth working through with concrete numbers.
Suppose a disease affects 1 in 1,000 people. A test detects every true case (100 percent sensitivity would be cleaner, so use a realistic 99 percent), and it wrongly flags 1 percent of healthy people. You test positive. What is the chance you have the disease?
Take 100,000 people. About 100 have the disease, and the test catches 99 of them. The other 99,900 are healthy, and 1 percent false positives means about 999 of them also light up the test. The positive result you are holding is one draw from 99 true plus 999 false, a pool of 1,098 positives. Your probability of actually being sick is 99/1,098, roughly 9 percent. A "99 percent accurate" test still means a positive result is ten times more likely to be wrong than right, because the condition is rare and the false positives from the healthy majority drown the true positives.
People consistently fail this calculation. Kahneman and Tversky documented base-rate neglect in 1974, the tendency to latch onto the specific evidence and ignore how common the condition is. Frequency framing, ten out of a thousand rather than 0.01, makes the update easier for humans, which is why the example above is written that way.
The lesson generalizes far outside medicine. Any claim that some system is "95 percent accurate" at flagging AI text, or fraud, or a security issue, or a failing model on a benchmark, is incomplete without the base rate of what it is looking for. When the thing being detected is rare, most flags are noise, and Bayes' theorem tells you exactly how most.
A minister, a billiard table, and a Frenchman
Thomas Bayes was a Presbyterian minister and a Fellow of the Royal Society who died in 1761 without publishing his result. His friend Richard Price edited the manuscript, added his own supplements, and communicated it to the Royal Society in a letter of November 1763; it appeared that year in Philosophical Transactions of the Royal Society, volume 53, pages 370 to 418, under the title "An Essay towards Solving a Problem in the Doctrine of Chances."
Bayes' own example was a billiard table. Blindfolded, you throw a ball across the table and never look at where it lands. Then an assistant throws more balls and reports how many land to one side of yours. Each report nudges your belief about where the first ball is. The problem he solved was "inverse probability": inferring the hidden parameter from the observed outcomes, which is precisely what the posterior does.
Pierre-Simon Laplace rediscovered the mechanism independently in 1774, apparently unaware of Bayes' essay, and then did the heavy lifting. He stated the principle in words, extended it from binary events to continuous quantities, and spent four decades applying it to the errors in astronomical observation and the orbits of Jupiter and Saturn. Collectively, "Bayesian statistics" is more Laplace's building than Bayes' blueprint. The name stuck to the minister by historical accident.
Two centuries in the wilderness, and a war detour
The theorem spent most of its life out of fashion. The frequentist school that dominated twentieth-century statistics, with Ronald Fisher as its loudest enforcer, treated the prior as subjective guesswork dressed up as mathematics. Bayesian methods survived mainly where results mattered more than reputations.
At Bletchley Park, Alan Turing ran one of the most consequential Bayesian operations in history. Banburismus, named after the town where its perforated paper sheets were printed, compared decrypted naval traffic against each other slide by slide, scoring offsets in the odds that the underlying messages shared Enigma settings. It used sequential conditional probability to weigh hypotheses about rotor configurations, and it gave Turing a unit for evidence: one ban is a factor of ten in the odds, one deciban a tenth of that. Together with I.J. Good he kept score in decibans while the dominant statistical establishment of the day still considered the method disreputable. The technique made the naval Enigma, the hardest problem at Bletchley, tractable from 1941 onward (Imperial War Museums).

After the war, the remaining obstacle was arithmetic. The denominator of Bayes' theorem is easy to state and brutal to compute once you have more than a handful of hypotheses. Computation dissolved that objection, and by the closing decades of the twentieth century Bayesian inference was mainstream again across statistics and machine learning (Wikipedia: Bayes' theorem).
The spam filter years
The version most people have actually felt working is email. In August 2002, Paul Graham published "A Plan for Spam", describing his failure to hand-write rules for junk mail ("if the subject contains XXX...") and his pivot to scoring each word by the probability that a message containing it is spam, then combining the scores with Bayes' rule. Gary Robinson published corrections and improvements in 2003, including better handling of rarely-seen words and statistical weighting, which became the default in the SpamBayes project and, in one form or another, in most mail filters that followed (Wikipedia: SpamBayes). It is the canonical example of Bayesian inference as a shipped product: the prior is what fraction of your mail is junk, the evidence is the words, and the update happens before you open the message.
What Bayes has to do with language models
There are two distinct connections, and conflating them causes most of the confusion in this area.
First, a language model is a machine for conditional probabilities, and the identity it runs on is Bayes' theorem's cousin, the product rule. Any joint distribution over a sequence of tokens can be factored into successive conditionals, the probability of token one, times the probability of token two given token one, and so on. That is exactly what an autoregressive transformer computes, one softmax at a time (Wikipedia: Bayes' theorem). The next-token model is a belief about text; sampling and decoding are decision rules applied to that belief. The mathematical machinery of "probability given evidence" is not something LLMs borrowed later. It is what they are made of.
Second, the training recipe has a Bayesian reading. Maximizing a likelihood subject to regularization (weight decay, adapters, early stopping) turns out to be identical to maximizing a posterior over parameters given a prior over parameter values, so-called maximum a posteriori estimation (Wikipedia: Maximum a posteriori estimation). When people say weight decay "encodes a belief" about good weight vectors, they mean it literally. The same prior-likelihood-posterior logic powers the Kalman filter, the recursive Bayesian estimator that has been steering aircraft, rockets and robots since 1960.
Do language models update like Bayes? The evidence says: unevenly
Whether a chatbot performs Bayesian updating when it is handed evidence in a conversation is an empirical question, and 2025 and 2026 produced a small stack of answers that disagree in instructive ways.
One 2025 paper introduced a Bayesian Coherence Coefficient to measure how well in-context credences line up with Bayes' theorem across five open model families. Its finding: larger and more capable pre-trained models assign beliefs that are more coherent with the theorem. Scale, on this evidence, moves models toward Bayesian rationality rather than away from it.
An Apple machine learning research team pushed back on the picture with a cleaner experiment: treat the model as an information-processing rule and measure the gap between its post-evidence beliefs and exact Bayesian ones. Strong models do update roughly Bayesianly when evidence arrives one item at a time and they are instructed to update after each item. Shown all the evidence at once, they do not run inference so much as retrieve a learned heuristic. The surprising part: for downstream tasks, those non-Bayesian heuristics often beat exact Bayesian updating. Bayes-rational is not the same as right.
A third line of work, the BASIL benchmark on sycophancy, uses Bayesian rationality as the yardstick to measure how much models change their minds under social pressure rather than evidence. Its review of prior work also cites Qiu et al. 2025, who compared model belief revisions against an optimal Bayesian learner and found systematic deviations, and who trained models on the optimal learner's predictions to fix them. The through-line across all three: models over- or under-update depending on framing, and a user saying "are you sure?" moves the posterior in ways the evidence does not license.
Read together with Kahneman and Tversky, the pattern is hard to miss. LLMs reproduce, in software, the human updating errors they were trained on text about. The base-rate neglect, the conservatism, the anchoring. A model that read ten thousand pages of human reasoning about evidence has apparently inherited human reasoning's worst habits along with its vocabulary.
The practical version
Three habits of mind, no notation required.
Ask for the base rate before believing any accuracy number. A detector, a benchmark headline, or an alert is a positive test; its meaning is set by how rare the thing it claims to find is. This is the one that separates sound AI evaluation from marketing.
Think in odds, not certainties. The deciban was Turing's answer to a real problem: how much should this one observation move me. Beliefs that never move are not Bayesian, they are brittle. Beliefs that move on a whim are sycophantic, in people and in models alike.
Treat the prior as part of the design. Whether it is a regularization term in training or the framing of a prompt, the starting assumption is doing work in every answer you get. If you distrust the conclusion, one route is more evidence. The other is finding out what it was assumed going in.
The theorem itself takes a minute to state and, as the last two centuries demonstrated, a very long argument to win. It has now won. Everything in AI that talks about belief is working for the house that a blindfolded man at a billiard table built.
Sources
- Bayes' theorem, Wikipedia
- An Essay Towards Solving a Problem in the Doctrine of Chances, Wikipedia
- A History of Bayes' Theorem, Fluxus Foundation
- Banburismus, Wikipedia
- How Alan Turing cracked the Enigma code, Imperial War Museums
- Paul Graham, A Plan for Spam (2002)
- Gary Robinson, A Statistical Approach to the Spam Problem, Linux Journal (2003)
- SpamBayes, Wikipedia
- Maximum a posteriori estimation, Wikipedia
- Kalman filter, Wikipedia
- Kahneman and Tversky, Judgment under Uncertainty: Heuristics and Biases, Science (1974)
- Are LLM Belief Updates Consistent with Bayes' Theorem? arXiv:2507.17951
- LLMs are not (consistently) Bayesian, arXiv:2605.06915 / Apple ML Research
- BASIL: Bayesian Assessment of Sycophancy in LLMs, arXiv:2508.16846
