- Key idea
- Independence, conditional independence, i.i.d. samples, and hidden common causes
- Real world
- Two coin flips are independent. But whether two friends both carry umbrellas is not: both depend on the weather. Given the weather, they become independent again.
- In an LLM
- Two answers sampled for the same prompt are independent given the prompt. Across a benchmark they aren’t: if the first is right, the question is probably easy, so the second is likely right too. That’s why pass@k grows more slowly than the textbook formula.
What independence means
Two events are independent if knowing one happened doesn’t change the probability of the other:
Equivalently, the probability of both is the product of the probabilities: . That product rule is the reason independence matters so much. It is what lets you write for “ten failures in a row”, or multiply probabilities across data points.
A coin and a die don’t affect each other: . In the dice widget, “first die is even” and “sum is 7” are independent too ( and ; together ), even though both involve the first die. Independence is about numbers, not about whether things are “connected”.
Sample one answer to a geometry question the model solves 60% of the time, and one to an unrelated history question it solves 50% of the time. Each answer is drawn with its own fresh randomness, so the chance both are right is . That product is what lets you predict a whole batch: on 10 such unrelated prompts at 50% each, the chance all 10 are right is , about 0.1%.
Independent given something else
Often two things are linked only through a shared cause. Once you know the cause, the link disappears. This is conditional independence.
On a random day, if your friend brought an umbrella, you probably did too: you both looked at the same sky. Your umbrellas aren’t independent. But given the forecast, your choices have nothing more to do with each other. The weather is a common cause: condition on it, and the dependence goes away.
Sample two answers to the same question at temperature 1. Each token is drawn with fresh randomness, so given the prompt, the two answers are independent: , where is the model’s pass rate on that question.
But across a benchmark, questions differ. Some have , others . If you’re told only that the first answer was right, that is evidence you’re on an easy question, and the second answer is more likely to be right too. The question’s difficulty is the common cause.
Try it
The top chart is the spread of difficulty across questions. The bottom chart is pass@k as you sample more answers: dashed if every answer were an independent coin flip at the average pass rate, solid for what you actually get. Make the questions differ more and watch the two pull apart.
Why it matters
The textbook formula for “at least one of succeeds” assumes every attempt has the same success chance . Averaged over a benchmark of easy and hard questions, it overestimates: many tries on an easy question add little, and many tries on a near-impossible question still fail. The real pass@k averages the formula per question:
The same effect shows up in:
- Majority voting helps less than “independent voters” maths predicts, because a model’s mistakes on a question are correlated: it tends to make the same mistake. See latent variables.
- Error bars on evals are too small if you treat related questions (several questions about one document, or several samples per question) as independent. See error bars.
- GRPO groups where all 8 answers get the same reward carry no learning signal; on very easy or very hard prompts this happens far more often than independent coin flips at the average pass rate would suggest. See GRPO.
i.i.d.
Papers constantly say samples are i.i.d.: independent and identically distributed. Each sample comes from the same distribution, and none of them affects the others. Most formulas for averages and error bars assume it. When a paper samples several answers per prompt, the answers are i.i.d. within a prompt, but the full set isn’t i.i.d. across the benchmark, which is exactly the situation in the widget.
Where this shows up
- Repeated sampling and pass@k: Does RL teach new skills?.
- Clustered questions and correct error bars: error bars.
- Language models are explicitly not independent across tokens; the chain rule handles the dependence.
Definitions
and are independent, written , when
They are conditionally independent given , written , when
Neither implies the other: independent variables can become dependent once you condition on a common effect (two independent causes of a single alarm become linked once you know the alarm went off; this is “explaining away”).
The hidden-difficulty calculation
Let each question have pass rate , itself random across questions with mean and variance . Then for two answers to the same question:
The excess over is exactly the variance of difficulty across questions. With a Beta distribution of pass rates (as in the widget), averaging has a closed form, and by Jensen’s inequality, so true pass@k is always at most the naive formula.
In papers
The Large Language Monkeys paper (Brown et al., 2024) measures “coverage”, pass@k as grows into the thousands, and finds it rises roughly log-linearly, well fitted by an “exponentiated power law”, rather than the fast exponential approach to 1 that a single shared would give. A slow, power-law-like climb is what you get by averaging over a wide spread of per-question difficulties with many very hard questions.