TL;DR
Most language model use gives the model one attempt per problem. This paper asks what happens when the model is allowed many independent attempts and a checker keeps the good ones. Across math, coding and formal proof tasks, the share of problems solved by at least one attempt grows steadily with the number of attempts, and the growth often fits a power law. When the checker can tell right answers from wrong ones, that extra coverage becomes real accuracy, so a cheaper model with many tries can beat a stronger model with one.
Builds on: Softmax Temperature, Pass@k, Solution Verifier, Power Law · Leads to: Scaling LLM Test-Time Compute Optimally (later work on how to spend the same inference budget)
Why it mattered
Most scaling work at the time spent compute on training: bigger models, longer runs, more data. The paper points out that far less was invested in inference compute, and that users and developers often limit a model to one attempt. Repeated sampling is a simple way to spend more inference compute, and the paper measures what it buys.
The clearest result is on SWE-bench Lite, a set of real GitHub issues where a model must edit the repository so that its unit tests pass. With DeepSeek-Coder-V2-Instruct inside the Moatless Tools agent framework, the solve rate rose from 15.9 percent with one attempt to 56 percent with 250 attempts. The paper notes that the single-attempt state of the art at that time was 43 percent, so many cheap attempts beat the best single attempt. The paper also argues that the same approach can be cheaper: five attempts from a cheaper model solved more issues than a single attempt from GPT-4o or Claude 3.5 Sonnet, at a total cost the paper puts 3.6 and 4.7 times lower, as shown in the Results section.
The paper's warning matters as much as its promise. Repeated sampling only pays off if the right answer can be picked out of a pile of wrong ones, and in tasks without an automatic checker the usual picking methods stop improving early.
The problem
Suppose a model gets one try at a problem and succeeds with probability p. The usual measure of quality is the success rate, the share of problems solved. With repeated sampling the success rate depends on two things. The first is coverage: as the number of samples grows, what share of problems has at least one correct sample? The second is precision: given a pile of samples, can we identify the correct ones?
The paper treats coverage first. It measures coverage as a function of the number of samples per problem, which is the pass@k quantity from Pass@k. It then asks whether that curve follows a simple law, in the same spirit as the scaling laws for training, which describe loss as a power law in compute (Neural Scaling Laws). Finally it asks whether a verifier can turn coverage into success.
How it works
The procedure has four stages. Here is the pipeline in order.
flowchart LR P[One problem] --> S[Draw N independent samples at temperature above zero] S --> V[Checker marks each sample right or wrong] V --> C[Coverage: any sample right] V --> Q[Precision: pick the right sample]
- Sample. Give the model the same prompt N times. Each time it writes a full candidate solution. Because the sampling temperature is above zero, the answers differ from each other. Recall Softmax Temperature: a positive temperature spreads probability over several next tokens, so each run can take a different path. The paper uses temperatures between 0.5 and 1.6, depending on the task.
- Check. Run a checker on every sample. For Lean proofs the checker is the proof checker. For CodeContests and SWE-bench Lite it is a suite of tests, in the spirit of Unit Testing. For GSM8K and MATH the paper's coverage numbers use an oracle that compares the final answer with the known correct answer. Real systems do not have an oracle, which is the reason for the precision problem in step 4.
- Count. For each problem, count the correct samples C. Coverage over a set of problems is the share of problems where C is at least 1. Tiny case: three problems with four samples each. Problem A has 0 correct samples, problem B has 1, problem C has 2. Coverage is 2 out of 3, about 0.67, because B and C each have at least one correct sample.
- Select or measure. Either measure coverage directly, which assumes a perfect checker, or pick one answer per problem with a rule such as majority vote or a reward model. The gap between the two is the cost of imperfect precision.
A fifth step, which the paper fits to the coverage numbers, is to describe how coverage grows with the number of samples k. That is the power-law step in the math section.
The math
For a set of P problems, let N be the number of samples drawn per problem and C_i the number of correct samples for problem i. Coverage at budget k is the share of problems that have at least one correct sample among k samples drawn from the N. The unbiased estimate, from Chen et al., is shown below.
Count in symbols: estimate coverage from N samples
Drawing exactly k samples from N is what the estimator simulates. The chance that all k draws are wrong is the number of ways to choose k wrong samples divided by the number of ways to choose any k samples. The probability of at least one correct sample is one minus that chance. Averaging over the P problems gives
Here is the number of ways to choose k items from n, and the paper uses this exact form, with a numerically stable implementation, so that the estimate has low variance.
Tiny case, one problem with N = 5 samples and C = 2 correct:
- k = 1: . This is just the fraction of correct samples, 2 out of 5.
- k = 2: . Check it directly: the chance that two draws without replacement are both wrong is (3/5) times (2/4), which is 6/20 = 0.3, so the chance of at least one correct is 0.7.
- k = 5: . Five draws from five always include the two correct ones.
Fit the curve in symbols: the power law in the budget
The paper models the logarithm of coverage as a power of the budget, and then exponentiates both sides. With fitted parameters a and b, which are real numbers,
Here c is coverage and k is the number of samples. Fitting is done by least squares on about 40 points spaced evenly on a log scale, using SciPy's curve_fit. The fit is not exact: the paper says these laws are less exact than training scaling laws, and that some curves, such as Llama-3-8B-Instruct on MiniF2F-MATH, do not follow it closely.
The plot below uses made-up parameters a = -1 and b = -0.5. It is an illustration of the shape, not one of the paper's fits.
- a = -1, b = -0.5 (illustrative)
Select in symbols: coverage is an upper bound on success
If the checker is perfect, success equals coverage. If the checker is imperfect, success can only be lower, because a correct sample that the checker rejects, or a wrong sample it accepts, changes the answer. In the paper's words, coverage gives an upper bound on the success rate in the general case. This is why precision, the subject of Results, decides whether the gains are real.
Results
The paper's main numbers, copied from its text:
- Coverage across tasks. On CodeContests with Gemma-2B, pass@1 is 0.02 percent and pass@10,000 is 7.1 percent, an increase of over 300 times. On MATH with Pythia-160M, pass@1 is 0.27 percent and pass@10,000 is 57 percent.
- SWE-bench Lite. DeepSeek-Coder-V2-Instruct with Moatless Tools solves 15.9 percent of issues with one attempt and 56 percent with 250 attempts. The single-attempt state of the art cited by the paper is 43 percent.
- Cost per issue (Table 1 in the paper, SWE-bench Lite, same agent framework):
| Model | Cost per attempt (USD) | Attempts | Issues solved (%) | Total cost (USD) | Relative total cost |
|---|---|---|---|---|---|
| DeepSeek-Coder-V2-Instruct | 0.0072 | 5 | 29.62 | 10.8 | 1x |
| GPT-4o | 0.13 | 1 | 24.00 | 39 | 3.6x |
| Claude 3.5 Sonnet | 0.17 | 1 | 26.70 | 51 | 4.7x |
- Verifiers on MATH. With Llama-3-8B-Instruct, coverage rises from 82.9 percent at 100 samples to 98.44 percent at 10,000. Majority vote and reward-model selection rise only from 40.50 percent to 41.41 percent over the same range. Those methods plateau around 100 samples, while coverage keeps climbing and passes 95 percent.
- Checker problems. The paper reports that 11.3 percent of SWE-bench Lite problems have flaky test suites, and Appendix B lists 34 such instances. On CodeContests, 35 of the 122 test problems that have Python3 solutions have correct reference solutions that fail the tests.
- Chain-of-thought quality. A manual check of 105 chains of thought from correct GSM8K answers found that over 90 percent were faithful, even on problems where the model was right only rarely. So the reasoning carries signal that a verifier could use.
Limits. The setup is deliberately simple: every attempt is independent, uses the same prompt, and differs only by sampling. The paper names three directions for gains beyond this setup: more diversity than sampling temperature alone, multi-turn feedback from execution tools, and learning from earlier attempts. Cost comparisons use FLOPs or API prices, which ignore system efficiency; the paper notes that repeated sampling can run with large batches and prompt-sharing attention optimisations. The tasks are five benchmarks: GSM8K, MATH, MiniF2F-MATH in Lean, CodeContests and SWE-bench Lite.
Reading guide
- Section 1, Introduction. Read after Pass@k and Solution Verifier. It states the two properties, coverage and precision, and the headline numbers.
- Section 2, Scaling repeated sampling. Needs Pass@k for the estimator and Softmax Temperature for why samples differ. The FLOPs formula is plain arithmetic on model size and tokens; the cost table needs no more than the prices.
- Section 3, Characterising the benefits. Needs Power Law and the training-side picture in Neural Scaling Laws. The S-curve overlay in Section 3.2 is an extra idea you can skip on a first read.
- Section 4, Precision. Needs Solution Verifier and Reward Model, and Unit Testing for why test suites can be wrong. Majority voting is the same rule as in Self-Consistency Improves Chain of Thought Reasoning in Language Models.
- Sections 5 and 6, Discussion and related work. Mention Chain-of-Thought Prompting, Best-of-N Sampling and Scaling LLM Test-Time Compute Optimally as neighbours. Appendix A lists the sampling setups, some with Few-Shot Learning prompts; Appendix B lists the flaky SWE-bench problems.
Check yourself
QuestionIn plain words, what is coverage in this paper, and why is it an upper bound on the success rate when the checker is imperfect?Show answer
Coverage is the fraction of problems for which at least one of the generated samples is correct. A checker can only pick out correct samples and cannot create them. So the success rate can equal coverage at best, when the checker is perfect. An imperfect checker can reject correct samples or accept wrong ones, which can only lower the success rate below coverage.
QuestionA problem has N = 10 samples with C = 3 correct. Compute pass@2 for this problem using the estimator.Show answer
pass@2 = 1 minus the number of ways to pick 2 wrong samples divided by the number of ways to pick any 2 samples. Ways to pick 2 wrong out of 7 wrong: C(7,2) = 21. Ways to pick any 2 out of 10: C(10,2) = 45. So pass@2 = 1 minus 21/45 = 24/45 = 8/15, about 0.533.
QuestionWhy do majority voting and reward-model selection stop improving at around 100 samples on MATH, while coverage keeps rising?Show answer
Rare correct answers do not change the most common answer, so majority voting ignores them. A reward model can score correct rare samples low, or the wrong common answers high. Coverage counts any correct sample, so it keeps climbing as rare correct answers appear. The gap between the two is the cost of a weak precision step.
QuestionYou have a coding task with a full unit-test suite and a cheap model. A colleague says that sampling 20 times from the cheap model will always beat one sample from the expensive model. What would you check before agreeing?Show answer
First, whether the test suite is reliable: flaky tests or tests that reject correct solutions cap the gain, as the paper found for SWE-bench Lite and CodeContests. Second, whether the 20 samples cost less than one expensive attempt, counting the agent framework and tokens, not just the model price. Third, whether the tasks look like the paper's, where many samples helped. The claim is plausible but not guaranteed, and it depends on the checker and the cost per attempt.
Sources
- Brown et al., Large Language Monkeys: Scaling Inference Compute with Repeated Sampling, 2024. https://arxiv.org/abs/2407.21787
- Chen et al., Evaluating Large Language Models Trained on Code, 2021 (source of the pass@k estimator). https://arxiv.org/abs/2107.03374
- Jimenez et al., SWE-bench: Can Language Models Resolve Real-World GitHub Issues?, 2024. https://arxiv.org/abs/2310.06770