Every modern AI system that outputs a prediction, from a spam filter to a large language model, is in the business of assigning numbers to uncertain outcomes. Probability is the small set of rules those numbers must obey to stay consistent, and nearly everything else in machine learning is built on top of that arithmetic.
Outcomes, events and three axioms
Start with a sample space : the set of everything that could happen. Roll a die and . Ask a language model for the next token and is its vocabulary, perhaps 100,000 strings. An event is a subset of : "the roll is even" is ; "the next token is a digit" is the set of digit tokens.
A probability assigns each event a number. In 1933 Andrey Kolmogorov showed that the whole theory could be derived from three axioms:[1]
- for every event .
- : something happens.
- If and cannot both happen (they are disjoint), (and likewise for countably many disjoint events).
Everything else is a consequence. The complement rule, , follows because and its complement are disjoint and together make up . For events that can overlap, inclusion–exclusion corrects the double count:
Why should degrees of belief, rather than long-run frequencies, obey these same rules? Richard Cox argued in 1946 that any system for reasoning about plausibility that satisfies two consistency requirements (the plausibility of "not A" is determined by that of A, and the plausibility of "A and B" is determined by that of B and of A given B) must, up to rescaling, be isomorphic to probability theory.[2] This is the formal version of Laplace's description of probability as common sense reduced to calculation.[3] It means the rules are not just a convention for dice: they apply to a model's belief about the next word, or your belief that a benchmark result will replicate.
Conditioning: updating the denominator
The conditional probability of given that has happened is
Conditioning shrinks the sample space to and renormalises. If a fair die shows an even number, the probability it is a 6 rises from to .
Rearranged, the definition becomes the product rule: . Applied repeatedly to a sequence of outcomes , it gives the chain rule of probability:
This identity is exact, with no modelling assumptions, and it is the blueprint for every autoregressive language model. Rather than modelling the astronomically large joint distribution over whole texts, a model learns the conditional distribution of each next token given what came before, and the chain rule stitches the pieces back together. Bengio and colleagues' 2003 neural language model was framed in exactly these terms: learn a function that outputs and multiply.[4] The model's final layer turns arbitrary scores into a valid distribution with the softmax, , which is non-negative and sums to one by construction, so axioms 1 and 2 hold automatically. See Next-token prediction for where this leads.
Why we work in logarithms
The chain rule multiplies many numbers below one. If a model gives each of 100 tokens probability 0.9, the whole sequence has probability ; for a 2,000-token document with typical per-token probabilities, the product underflows standard floating-point formats. Taking logarithms turns the product into a sum,
which is numerically stable and is the quantity training actually optimises (see Maximum likelihood).
Independence, and what it buys
Events and are independent when , equivalently : learning tells you nothing about . Independence is what lets small probabilities compound into large ones.
Worked example: coverage from repeated sampling
Suppose a model solves a hard problem on a single attempt with probability . Draw independent attempts. What is the probability that at least one is correct?
"At least one success" is awkward to count directly, but its complement, "every attempt fails", is a single product:
| coverage | ||
|---|---|---|
| 1 | 0.900 | 0.100 |
| 10 | 0.349 | 0.651 |
| 64 | 0.0012 | 0.9988 |
Brown and colleagues measured exactly this quantity, which they call coverage, for language models given many attempts, and found it kept rising across four orders of magnitude of samples.[5] The arithmetic explains why: the failure probability decays geometrically.
A model answers a question correctly with probability 0.3 per attempt, and attempts are independent. What is the probability that at least one of two attempts is correct? What if the two attempts were perfectly correlated (always identical)?
Show answer +Hide answer −
Independent: . Perfectly correlated: the second attempt adds nothing, so the probability stays . Independence is what turns repeated tries into higher coverage.
Two warnings follow directly from the axioms.
Coverage is not accuracy. At least one of 64 attempts being right does not mean you can tell which one. Picking the winner requires a verifier, and the verifier's errors compound with as well. The NeuroGenesys paper Thurstone bounds Best-of-N works through a reference case () in which coverage at is 0.9988 while selected accuracy peaks near 0.70 and then falls as grows further.[6] The course on test-time compute develops this in detail.
Independence is an assumption, not a default. Samples from one model share its blind spots, and judges that read the same context share its errors. The lab's note A critic that shares the generator's prompt shares its errors measured a same-context critic that missed 12 of 12 planted errors that fresh critics all caught.[7] When events are positively correlated, overstates what repetition buys; in the extreme it buys nothing.
A three-token continuation has conditional probabilities , , . What is the probability of the continuation, and its natural-log probability?
Show answer +Hide answer −
By the chain rule, . The log probability is , and .
Marginalisation
The last basic tool is the law of total probability. If events partition (exactly one of them happens), then
This is how you compute a probability you cannot observe directly by averaging over hidden cases. If 70% of a model's traffic is easy queries answered correctly 95% of the time and 30% is hard queries answered correctly 60% of the time, overall accuracy is . A reported average hides that split, which is why a change in the query mix can move "accuracy" with no change in the model. Combined with the product rule, total probability gives Bayes' rule, the subject of the next lesson.
Key takeaways
- Probability is defined by three axioms (non-negativity, normalisation, additivity for disjoint events); complements, inclusion–exclusion and everything else follow.
- Conditioning restricts the sample space and renormalises. Chained together, conditionals give the exact factorisation that autoregressive language models implement.
- Products of many probabilities underflow; work with summed log-probabilities.
- Independence makes failure probabilities multiply, which is why repeated sampling raises coverage as . Correlation erodes that gain, and coverage is not the same as being able to pick the right answer.
Sources
-
A. N. Kolmogorov (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung. Ergebnisse der Mathematik, Springer, Berlin. https://doi.org/10.1007/978-3-642-49888-6 ↩
-
R. T. Cox (1946). "Probability, Frequency and Reasonable Expectation." American Journal of Physics 14(1): 1–13. https://doi.org/10.1119/1.1990764 ↩
-
P.-S. Laplace (1814). Essai philosophique sur les probabilités. Paris: Courcier. Digitised copy, Kyoto University Rare Materials Digital Archive: https://rmda.kulib.kyoto-u.ac.jp/en/item/rb00028954 ↩
-
Y. Bengio, R. Ducharme, P. Vincent, C. Jauvin (2003). "A Neural Probabilistic Language Model." Journal of Machine Learning Research 3: 1137–1155. https://www.jmlr.org/papers/v3/bengio03a.html ↩
-
B. Brown et al. (2024). "Large Language Monkeys: Scaling Inference Compute with Repeated Sampling." arXiv:2407.21787. https://arxiv.org/abs/2407.21787 ↩
-
NeuroGenesys (2026). "Thurstone bounds Best-of-N: a 1927 identity, calibrated for modern verifiers." /research/thurstone-bounds-best-of-n ↩
-
NeuroGenesys (2026). "A critic that shares the generator's prompt shares its errors: measured self-critique correlation." /research/correlated-critique ↩
