Search, Reflection, and Test-Time Compute › Sampling: Coverage Before You Can Select
Language AI HandbookAll chapters Coverage is the fraction of problems for which the pool contains a correct candidate. It bounds the accuracy of any selector that returns a member of that pool. Measure it alongside selected accuracy to find out how much room remains for better selection.
Independent sampling and pass@k
Suppose a single sample from the model is correct with probability , independently across draws. The probability that at least one of samples is correct is
This is the quantity reported in code-generation benchmarks, where it is estimated with the unbiased estimator from Chen et al. (2021): given samples of which are correct,
For , the ratio is the fraction of size- subsets made up entirely of incorrect samples. Use zero in the numerator when . Under independent, identically distributed draws, each subset has the same success probability, which makes the estimator unbiased. The plug-in estimate , with , instead has downward bias for and a nondegenerate . Coverage is concave as a function of , so averaging over estimates of gives a lower value than evaluating it at the true .
When , coverage approaches 1 as grows. The smallest budgets that reach at least 0.999 are 10 draws at and 3 at . The gain from each additional draw falls as the pool gets larger. Its size depends on both and the existing budget.
These assumptions are conditional on a prompt and a fixed sampling policy. Across a suite, average over prompts. In general the result differs from evaluating the formula at the average . Revisions that condition on earlier answers can change the proposal distribution, so this formula need not apply. Brown et al. found that an exponentiated power law in sample count fit many of their empirical coverage curves. Some curves, including one on MiniF2F-MATH, showed a poorer fit.
A fixed decoder with never samples a correct answer. When is positive but small, you may still see no correct candidate within your budget. Similar coverage curves over a short range of can come from either case.
Temperature, nucleus sampling, and the diversity dial
Independent draws can repeat an answer. With deterministic greedy decoding, identical prompts produce the same output under fixed model and tie-breaking settings, so repeating that computation does not increase coverage.
For a fixed prompt and model, three common decoding settings change the sampling distribution:
- Temperature rescales logits before the softmax, giving token weights proportional to . Higher temperature flattens the distribution. As approaches zero, mass concentrates on the maximum-logit tokens. Deterministic greedy decoding chooses one of them using a tie rule.
- Top- keeps the highest-probability tokens and renormalizes their probabilities.
- Top- (nucleus) sampling keeps the shortest probability-sorted prefix whose cumulative mass reaches , then renormalizes. A peaked distribution can reach the threshold with fewer tokens. Holtzman et al.
Changing the decoder can increase the variety of sampled answers while sending probability mass to wrong answers. For fixed and independent draws on a given prompt, coverage grows when the decoder increases the probability of a correct draw. Sweep the decoder settings on held-out prompts and measure coverage and selected accuracy for each selector at the resource budget you intend to use.
Redundancy
Even independent samples can collide. Sixty-four draws might produce only five distinct final answers. You still paid for sixty-four draws, and the multiplicities are part of the evidence for a plurality vote.
A deterministic scorer can reuse a result whenever its inputs match. If it reads the full derivation, two responses with the same final answer can still require different scores. Check what the grouping preserves before collapsing candidates. Removing exact duplicates preserves whether the pool contains a correct answer, and keeping the counts preserves votes.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!