- Key idea
- Bernoulli, binomial, categorical, Gaussian, Beta (and Dirichlet), with their means and variances
- Real world
- The number of heads in 10 coin flips is binomial. Adult heights are roughly Gaussian. Your belief about a new restaurant’s chance of being good, after 3 good meals and 1 bad, is a Beta.
- In an LLM
- One graded answer is Bernoulli. The number of correct answers out of 8 samples is binomial. The next token is categorical. A prompt’s unknown pass rate, estimated from a few samples, is a Beta.
Named shapes
Most random quantities in papers are assumed to follow one of a few standard families. Each family is a formula with a few parameters, dials that set its shape. Saying “the reward is Bernoulli with parameter 0.3” describes the whole distribution in five words.
Try it
Bernoulli: one yes/no
A single trial that succeeds with probability . Mean , variance .
A basketball player who makes 75% of free throws: each shot is Bernoulli(0.75).
In RL with verifiable rewards, each sampled answer is checked and scored 1 or 0. On a given prompt, the reward is Bernoulli(), where is the model’s pass rate on that prompt. See RLVR.
Binomial: counting successes
The number of successes in independent Bernoulli() trials. Mean , variance . The chance of exactly successes is
where , “n choose k”, counts the ways to pick which of the trials succeed.
The player above takes 10 shots. The number made is Binomial(10, 0.75): on average 7.5, and they’ll hit all ten only of the time.
Sample answers to a prompt with pass rate 0.3. The number correct is Binomial(8, 0.3). The chance all 8 are wrong is and the chance all are right is about ; in those cases the group has no variance and gives no learning signal. For a prompt with pass rate 0.05, “all wrong” jumps to 66%.
Categorical: one of many
One draw from a fixed list of outcomes with probabilities adding up to 1. A die is categorical with six equal probabilities. The generalisation of the binomial, counting how many times each outcome came up in draws, is the multinomial.
A language model’s output at each step is a categorical distribution over its vocabulary of roughly 100,000 tokens, produced by a softmax. Ranked by probability, these distributions fall off steeply: a handful of tokens take most of the mass and a very long tail shares the rest, which is why truncated sampling works.
Gaussian: the bell curve
The Gaussian or normal distribution, , is a symmetric bell with mean and standard deviation . About 68% of values fall within of the mean and 95% within (more precisely ).
It shows up so often because of the central limit theorem: sums and averages of many small independent effects are approximately Gaussian, whatever the effects look like individually. See error bars.
Adult heights within one population are close to Gaussian: many genes and environmental factors each nudge height a little, and the sum of many small nudges is bell-shaped.
Network weights are initialised with Gaussian noise. A benchmark score, being an average over many questions, has an approximately Gaussian sampling error. Diffusion models for images generate by removing Gaussian noise step by step. (Diffusion language models mostly use masking instead: see diffusion language models.)
Beta: a distribution over a probability
The Beta distribution lives between 0 and 1, so it can describe uncertainty about a probability itself. It has two parameters, and ; its mean is , and larger makes it narrower. A handy reading: past successes and past failures. Beta(1, 1) is flat: no idea at all.
You’ve had 3 good meals and 1 bad one at a new place. Starting from a flat Beta(1, 1), your belief about the chance the next meal is good is Beta(4, 2): mean , but still wide, because four meals isn’t much evidence.
Sample 8 answers to a prompt; 2 are right. Your belief about its pass rate is Beta(3, 7), mean 30% but spread from roughly 10% to 55%. Recent RL recipes keep a Beta like this per prompt to decide which prompts to train on, and where to spend more samples: see priors and posteriors.
The Dirichlet is the Beta’s many-outcome cousin: a distribution over categorical distributions, used when you are uncertain about a whole set of probabilities.
Where this shows up
- Updating a Beta with data: priors and posteriors.
- The Gaussian approximation behind every eval error bar: error bars.
- Pass@k is a binomial calculation: Does RL teach new skills?.
Reference
| Distribution | Values | Parameters | PMF or PDF | Mean | Variance |
|---|---|---|---|---|---|
| Bernoulli | 0, 1 | ||||
| Binomial | 0…n | ||||
| Categorical | 1…K | – | – | ||
| Gaussian | real | ||||
| Beta | 0 to 1 |
is the normalising constant that makes the Beta integrate to 1.
In papers
- “Rewards are binary” means Bernoulli; papers then write the expected reward on prompt as or , and its variance as .
- is a categorical distribution with probabilities from logits .
- is a vector of independent standard Gaussians; is the identity matrix. It appears in diffusion, in the reparameterisation trick, and in weight initialisation.
- after successes and failures is the conjugate update on the priors and posteriors page.