Common distributions

Five shapes cover most of what LLM papers need. Bernoulli for a pass/fail answer, binomial for counting passes, categorical for the next token, Gaussian for noise, and Beta for uncertainty about a probability.

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

012345678
Numbers above the bars: % chance of each count.
mean2.40
variance1.680
P(all fail)5.8%
P(at least one)94.2%
The number of successes in 8 independent tries. Free throws made out of 8; or how many of 8 sampled answers to a prompt are right. The bar at 0 is the chance all 8 fail.
Each family is a recipe with a few dials. Papers say “rewards are Bernoulli” or “x is Gaussian” and expect you to picture these shapes.

Bernoulli: one yes/no

A single trial that succeeds with probability pp. Mean pp, variance p(1−p)p(1-p).

example · a free throw

A basketball player who makes 75% of free throws: each shot is Bernoulli(0.75).

example · a verifiable reward

In RL with verifiable rewards, each sampled answer is checked and scored 1 or 0. On a given prompt, the reward is Bernoulli(pqp_q), where pqp_q is the model’s pass rate on that prompt. See RLVR.

Binomial: counting successes

The number of successes in nn independent Bernoulli(pp) trials. Mean npnp, variance np(1−p)np(1-p). The chance of exactly kk successes is

P(K=k)=(nk)pk(1−p)n−kP(K = k) = \binom{n}{k} p^k (1 - p)^{n - k}

where (nk)\binom{n}{k}, “n choose k”, counts the ways to pick which kk of the nn trials succeed.

example · ten free throws

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 0.7510≈6%0.75^{10} \approx 6\% of the time.

example · a GRPO group

Sample G=8G = 8 answers to a prompt with pass rate 0.3. The number correct is Binomial(8, 0.3). The chance all 8 are wrong is 0.78≈5.8%0.7^8 \approx 5.8\% and the chance all are right is about 0.007%0.007\%; 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 KK outcomes with probabilities p1,…,pKp_1, \dots, p_K 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 nn draws, is the multinomial.

example · the next token

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, N(μ,σ2)\mathcal{N}(\mu, \sigma^2), is a symmetric bell with mean μ\mu and standard deviation σ\sigma. About 68% of values fall within 1σ1\sigma of the mean and 95% within 2σ2\sigma (more precisely 1.96σ1.96\sigma).

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.

example · heights

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.

example · noise in models

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, α\alpha and β\beta; its mean is αα+β\frac{\alpha}{\alpha + \beta}, and larger α+β\alpha + \beta makes it narrower. A handy reading: α−1\alpha - 1 past successes and β−1\beta - 1 past failures. Beta(1, 1) is flat: no idea at all.

example · a new restaurant

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 4/6≈67%4/6 \approx 67\%, but still wide, because four meals isn’t much evidence.

example · a prompt’s pass rate

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

going deeper

Reference

DistributionValuesParametersPMF or PDFMeanVariance
Bernoulli0, 1pppx(1−p)1−xp^x (1-p)^{1-x}ppp(1−p)p(1-p)
Binomial0…nn,pn, p(nk)pk(1−p)n−k\binom{n}{k} p^k (1-p)^{n-k}npnpnp(1−p)np(1-p)
Categorical1…Kp1…pKp_1 \dots p_Kpkp_k––
Gaussianrealμ,σ2\mu, \sigma^21σ2πe−(x−μ)2/2σ2\frac{1}{\sigma\sqrt{2\pi}} e^{-(x-\mu)^2 / 2\sigma^2}μ\muσ2\sigma^2
Beta0 to 1α,β\alpha, \betaxα−1(1−x)β−1B(α,β)\frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha, \beta)}αα+β\frac{\alpha}{\alpha+\beta}αβ(α+β)2(α+β+1)\frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}

B(α,β)B(\alpha, \beta) 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 xx as p(x)p(x) or acc(x)\mathrm{acc}(x), and its variance as p(x)(1−p(x))p(x)(1 - p(x)).
  • Cat⁡(softmax⁡(z))\operatorname{Cat}(\operatorname{softmax}(z)) is a categorical distribution with probabilities from logits zz.
  • ϵ∼N(0,I)\epsilon \sim \mathcal{N}(0, I) is a vector of independent standard Gaussians; II is the identity matrix. It appears in diffusion, in the reparameterisation trick, and in weight initialisation.
  • Beta⁡(α+s,β+f)\operatorname{Beta}(\alpha + s, \beta + f) after ss successes and ff failures is the conjugate update on the priors and posteriors page.

Related

  • random-variables - A random variable is a number that depends on chance. Its distribution says which values are likely, as a list (PMF), a curve (PDF) or a running total (CDF).
  • variance - The mean says where a random number sits; the variance says how much it wobbles; the covariance says whether two of them wobble together. GRPO’s advantage formula is these three ideas in one line.
  • bayesian-inference - Bayes’ theorem applied to an unknown number. Start with a belief about it, multiply by the likelihood of the data, and get a sharper belief. With a Beta prior and yes/no data, the update is just counting.