Search, Reflection, and Test-Time Compute
Learn how sampling, verifiers, and adaptive stopping convert inference compute into accuracy, and why selection limits what more draws can deliver.
Language AI HandbookAll chapters Search, Reflection, and Test-Time Compute
In the simulation below, drawing 32 answers instead of one raises the fraction of problems with a correct candidate from 47.0% to 99.5%. At 32 draws the random verifier still returns a correct answer on less than half the problems in this run. The additional samples make the right answer available. Selection determines whether the system returns it.
You can change a system's behavior at serving time with the model weights fixed. Generate several complete answers, score them with a verifier or vote, or feed an answer back as the starting point for revision. Each choice spends computation differently. The simulation compares adaptive stopping with two baselines. One assigns budgets without looking at individual answers and uses the same total number of draws. The other gives every problem the adaptive policy's maximum number of draws.
Test-time compute is work performed after receiving a prompt to produce a response. It can include generated tokens, verifier passes, search expansions, or tool execution. A study's budget measures some of this work. Read the cost unit alongside any accuracy comparison.
From Training Compute to Inference Compute
Training scaling laws relate loss to quantities such as model size and training data. On a deployed model, the question changes. What can you do with a fixed set of weights and a larger budget for answering a prompt?
Suppose the decoder draws independently from the same distribution on a given problem and gets the answer right with probability on each draw. The chance that all draws fail is , so at least one succeeds with probability . This is coverage. Program synthesis systems have used learned search and, in systems such as AlphaCode, large-scale sampling (Kulal et al., 2019; Li et al., 2022).
The other question is how to recognize a correct candidate once you have one. A unit test or proof checker can sometimes do that more cheaply than generating a solution. A learned verifier may be useful when no such checker is available. Cobbe et al. (2021), for example, scored complete math solutions against one another using a verifier trained on labeled candidates. The value of the scorer depends on how reliably it ranks the candidates your generator produces.
Sampling, scoring, and stopping give you three decisions to make. You can draw complete answers from scratch or expand partial derivations. A scoring heuristic can guide which paths survive, and a stopping rule decides when to return an answer.
What Counts as Test-Time Compute
| Setting | Work to count | What a larger budget allows |
|---|---|---|
| Number of samples | Generation for candidates | More chances to draw a correct answer |
| Verifier scoring | One score per candidate for pointwise reranking. Calls depend on batching and reuse. | A ranking of candidates |
| Chain-of-thought length | Generated tokens per sample | More steps in a single trajectory |
| Search branching and depth | Expanded nodes and their scoring costs | Exploration within a derivation |
| Revision rounds | Extra generations and any separate critique | Another attempt to repair an answer |
| Tool and execution calls | Tool latency and execution work | Evidence such as test or compiler output |
A method that uses more inference compute might change any of these settings. Check which resource the comparison counts. For example, generated tokens exclude scoring work done by a separate model. A system that calls an external interpreter also incurs work outside the model.
Raising gives a selector more candidates. Whether it returns more correct answers depends on the ranking rule and the resulting pool. Longer reasoning can help on some hard tasks and add tokens without improving accuracy on others. A tool call may supply evidence, such as which test failed, that more draws from the original prompt would leave out.
The General Pipeline: Generate, Score, Select, Stop
Start with a prompt . The generation policy assigns a complete response the probability obtained by multiplying its conditional token probabilities in order, including the end token when it marks completion. A decoder sets temperature and truncation and samples a list of complete responses. The list can contain duplicates. The random seed fixes a realization of the decoding procedure. Repeated draws require advancing the random stream or using separate streams.
- Generate. Draw candidates from the configured decoder.
- Score. Assign each candidate a scalar score . A scorer can read the candidate and prompt, run tests, or count agreements in the pool.
- Select. Return , where is a highest-scoring index chosen by a tie rule.
- Stop or continue. Decide whether to return the selected answer, draw more candidates, or try a revision.
For test-time allocation, let be the cost incurred on prompt with random draws . One objective is to maximize expected accuracy under an expected budget per prompt:
Here comes from the target distribution and represents the policy's randomness. On a finite benchmark of prompts, a realized total budget instead takes the form . A separate condition can cap any one request.
Best-of- draws a fixed pool and returns the candidate that scores highest under a specified rule. The scorer can use a model, a task checker, or aggregated process scores. Self-consistency uses agreement among sampled reasoning paths. Chain-of-thought prompts for an intermediate explanation before the answer. Tree of Thoughts expands and evaluates partial paths. Reflexion feeds feedback from an earlier attempt into a later one.
An anytime implementation can return a valid incumbent when interrupted after it has one. Sampling and reranking can keep an incumbent from the first complete candidate onward. A beam can do the same if it retains a completed candidate or has a valid fallback. If existing candidates keep their scores, adding candidates cannot lower the best score. Selected accuracy can still fall.
Sampling: Coverage Before You Can Select
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.
Verifiers
A verifier scores a candidate or a partial derivation. For a learned verifier, distinguish what the score describes from what the model reads. An outcome-supervised model may read a whole derivation while learning from a final-answer label. Those labels can come from a task checker or human judgments. Voting instead scores candidates from agreement in the pool.
Outcome reward models
An outcome reward model (ORM) predicts whether the final answer is correct. It can predict that outcome from a prefix or a complete answer. Cobbe et al. labeled generated GSM8K solutions according to whether they reached the reference answer. Their default verifier learned to predict that final-outcome label after each solution token. At inference, they ranked complete solutions and returned the highest-scoring candidate.
Cobbe et al. reported that their 6B verification setup slightly outperformed their fine-tuned 175B baseline on the full GSM8K test setting. Both generator and verifier in the 6B setup used the same model size. This comparison used a candidate pool and should not be read as a comparison at the same per-query cost.
Automatic grading can avoid per-candidate human annotation. It still needs a grading rule, such as answer matching or a test suite, and a way to check that the labels reflect the task. A final-number match can approve an invalid derivation. Human judgments can train a scorer when automatic grading is unavailable, with additional collection costs.
Process reward models
A process reward model (PRM) can score each step in context: . A reranker can combine those step scores into a score for the trajectory.
If the step scores are in , multiplying in an additional step can only keep or lower the product for the same prefix. A minimum makes the result sensitive to one low score, including a spuriously low one. A mean gives each step equal weight, so one low score has less effect in a longer trajectory.
Lightman et al. reported 78.2% for their large-scale process-supervised verifier, 72.4% for their large-scale outcome-supervised verifier, and 69.6% for voting when each selected from 1,860 candidates per problem on their held-out MATH subset. The two trained verifiers used data collected differently.
A PRM can guide beam search or pruning by scoring a partial derivation directly. A scorer that expects a completed answer can guide prefix search by scoring rollout completions and aggregating their results. Other search systems use prompted value estimates or feedback from the environment.
Rollout labels can replace human step annotations with additional computation. The fraction of successful completions estimates how often the rollout policy can finish from that prefix under the chosen checker. That quantity depends on the policy. A stronger completer may recover from a prefix that nearly always leads to failure under the original policy.
Implicit verifiers
Several scoring rules work without training a separate verifier on the task:
- Self-consistency. Return the most frequent answer among sampled reasoning paths. This is a plurality vote. Wang et al.
- Log-likelihood. Rank an answer by the probability the model assigns it under the stated scoring convention. Raw sequence log-likelihood sums token log probabilities, so both length and the model's familiarity with a continuation can affect the score.
- LLM-as-judge. Prompt a model to evaluate the candidates. The judge can share errors or preferences with the generator, including when both calls use the same weights.
If a wrong label is uniquely most probable under a fixed answer distribution, plurality over independent draws selects it with probability approaching one. Log-likelihood can prefer a wrong answer when the model assigns it more probability. In Lee et al.'s EMBER benchmark, adding expressions of confidence or uncertainty to answers affected the tested judges' preferences. Compare each scoring rule on the candidate pools it will see.
Uniform selection and the coverage ceiling
Suppose you draw independent samples and each is correct with probability . Let be the number of correct samples. Then:
- Coverage (an oracle selector) has accuracy . This is the ceiling.
- A random selector, which picks uniformly among the samples, has accuracy . Extra draws give this selector no gain in expected returned-answer accuracy.
The oracle gives an upper bound. Random selection is a reference point. A verifier that systematically favors the wrong answers can fall below that reference.
The expected fraction of correct candidates is , since each candidate has marginal correctness probability . Uniform selection gives the same expected accuracy as one draw while generating candidates. Actual compute depends on candidate lengths, shared work, and scoring.
Brown et al. found that coverage kept increasing on math word problems after majority voting and reward-model selection began to plateau. In their code and formal-proof evaluations, available automatic checkers let coverage gains translate into higher measured success rates.
A verifier can also fare worse as the candidate pool grows. If very high scores often go to a wrong answer, a larger pool gives that answer more chances to win. A feature such as confident phrasing can raise scores for incorrect candidates and still have little effect if correct answers consistently score higher. Measure end-to-end accuracy and resource use across budgets, with plurality voting as a comparator. Pairwise discrimination is a separate diagnostic.
The next cell simulates 400 problems with true labels from 1 through 9. Label 0 is always wrong. The verifier gives it a score bonus of 1.8, compared with a bonus of 1.0 for correct candidates. Argmax uses the earliest candidate if scores tie. The figure shows the result for this seeded pool.
PythonIn [3]Expand
import numpy as np
bias_rng = np.random.default_rng(20240118)
bias_n_problems = 400
bias_n_choices = 10
bias_n_max = 32
bias_p = bias_rng.uniform(0.05, 0.85, size=bias_n_problems)
bias_truth = bias_rng.integers(1, bias_n_choices, size=bias_n_problems)
bias_answers = np.empty((bias_n_problems, bias_n_max), dtype=int)
bias_correct = np.empty((bias_n_problems, bias_n_max), dtype=bool)
for i in range(bias_n_problems):
p = bias_p[i]
hit = bias_rng.random(bias_n_max) < p
wrong = (
bias_truth[i] + bias_rng.integers(1, bias_n_choices, size=bias_n_max)
) % bias_n_choices
bias_answers[i] = np.where(hit, bias_truth[i], wrong)
bias_correct[i] = bias_answers[i] == bias_truth[i]
bias_scores = bias_rng.normal(
loc=1.0 * bias_correct + 1.8 * (bias_answers == 0),
scale=1.0,
)
bias_sample_counts = np.array([1, 2, 4, 8, 16, 32])
bias_selected = []
bias_coverage = []
for n in bias_sample_counts:
block_answers = bias_answers[:, :n]
block_scores = bias_scores[:, :n]
idx = np.argmax(block_scores, axis=1)
picked = np.take_along_axis(block_answers, idx[:, None], axis=1).ravel()
bias_selected.append((picked == bias_truth).mean())
bias_coverage.append(bias_correct[:, :n].any(axis=1).mean())
bias_selected = np.array(bias_selected)
bias_coverage = np.array(bias_coverage)VisualizationOut [4]Expand

What plurality voting requires
With independent, identically distributed binary votes that are each right with probability , the chance that the majority is right approaches one. The threshold changes when wrong votes are split across labels.
Suppose there are possible answers, with probability on the correct label and the remaining mass divided equally across the other . The correct answer is uniquely most probable when
With ten choices and uniform distractors, the threshold is . Under independent draws from a fixed distribution over the labels, observed vote proportions converge to their label probabilities. If one answer is uniquely most probable, it wins with probability approaching one. To check whether the true answer is that mode, compare with the largest individual distractor probability. At a finite budget, the full distribution and tie rule govern accuracy.
Reflection and Self-Correction
Some methods draw new answers and choose among them. Others revise an existing answer. When comparing revision studies, inspect what feedback the second attempt receives.
Exploratory search draws new candidates and picks among them.
Externally informed correction revises an answer with evidence supplied by a separate source, such as a failing test, a compiler diagnostic, a retrieved document, or a person. The feedback may depend on the original answer or the tool call.
Unaided reflection prompts the same model to critique or revise an earlier answer without outside evidence. The original answer and the revision instruction are part of the new context.
What unaided reflection can and cannot do
Unaided reflection changes the prompt even when the model weights stay fixed. If the initial accuracy is , the net change in accuracy is , where is the fraction of initially wrong answers repaired and is the fraction of initially correct answers spoiled. Measure both transitions on labeled problems.
Overall accuracy improves when repairs outnumber spoiled correct answers. The balance depends on the initial accuracy as well as the two transition rates. With 90% initial accuracy, repairing half of the errors gains five percentage points. Spoiling one tenth of the correct answers loses nine.
Huang et al. found that intrinsic self-correction did not reliably improve their reasoning benchmarks and sometimes lowered accuracy under the prompts they tested. That result concerns the study’s models and evaluation conditions.
Use labeled answers to measure how well a critic's score ranks correct and incorrect attempts, for example with ROC AUC. A value near 0.5 indicates chance-level aggregate ranking in the chosen score direction. The ranking statistic alone does not give the repair or spoil rate at a revision threshold. Compare the full policy with the original answer and, if you have an extra generation budget, a fresh second draw.
What externally informed correction can do
A failing test or a retrieved reference can give the reviser information it did not use on the first attempt. Madaan et al. used self-generated feedback in Self-Refine and reported a separate correctness-oracle experiment for math in Appendix H.1. Measure whether the feedback is actually informative for the target task.
A revision prompt and another generation can change the output even without external feedback. A tool can also supply evidence that directs the revision. A failing compiler check may locate a line to inspect, while a failing test often only shows one input on which the behavior differs from the expectation. Measure whether acting on that feedback improves the final answers.
Search over thoughts
Tree of Thoughts (Yao et al., 2023) expands partial reasoning states, evaluates them, and uses breadth-first or depth-first search with pruning. Language Agent Tree Search (Zhou et al., 2023) uses Monte Carlo tree search and can use feedback from the environment.
A full unpruned tree of depth has nodes for branching factor , which is for fixed . Actual work depends on which nodes you expand and what each generation and scoring step costs. In Game of 24, you can check an intermediate move by confirming that it uses two available numbers and recalculating its result. When partial states give little guidance, compare tree search with complete-answer sampling under the same compute accounting.
Budget Allocation and Stopping
So far we have treated as a single global number. In practice the interesting question is how to distribute a total budget across a heterogeneous set of problems.
The value of another draw varies across problems. A uniform budget spends the same number of draws on problems with different success probabilities.
When changing the allocation helps
Consider coverage. The marginal value of one more sample on a problem with per-sample success probability is
For any fixed , the gain is zero at and and peaks at . These are gains in coverage with independent draws. A verifier-guided policy's gain in selected accuracy also depends on the scorer and may be negative.
The plot shows the next-draw coverage gain for several current sample budgets.
PythonIn [5]Expand
import numpy as np
p_grid = np.linspace(0.01, 0.99, 240)
n_values = np.array([2, 5, 10, 20])
marginal_by_n = {int(n): p_grid * (1.0 - p_grid) ** n for n in n_values}VisualizationOut [6]Expand

At a fixed budget, a very high leaves little uncovered. A very low leaves most problems uncovered but gives any one additional draw little chance to help. The peak balances the chance of having missed so far with the chance of succeeding on the next draw.
Fixed counts and adaptive stopping
A fixed-count baseline assigns the same to every problem. Giving it the adaptive policy's maximum lets us compare policies at a common per-problem cap.
An adaptive policy allocates per problem based on a signal available during generation:
- Agreement. Draw an initial batch and spend more of the budget if answers disagree. A repeated wrong answer can trigger an early stop.
- Verifier confidence. Stop when a candidate's score passes a threshold. Check calibration on the pools and budget range where you will apply the rule.
- Difficulty prediction. Use a heuristic, a prompted estimate, or a trained predictor. Manvi et al. fine-tuned a model to estimate whether restarting would produce a better answer than continuing an attempt.
- Vote margin. Stop when the leading answer clears a chosen margin. A formal sequential error guarantee requires explicit hypotheses, a likelihood ratio or other test statistic, and calibrated stopping boundaries.
The matched-cost trap
For a retrospective mean-budget comparison, match the total number of draws used across the benchmark. If the mean falls between integers, assign the two adjacent budgets in the required proportions and choose which tasks get the larger budget by a shuffle. A cap-matched policy instead gives every problem the largest number of draws allowed by the adaptive policy. The mean and cap answer different questions about work. For serving latency, measure the wall-clock distribution as well. A draw cap limits how many samples you generate, while the time taken also depends on output lengths, parallelism, and scoring. If you need comparable total computation, count those costs under the same convention for all policies.
Stopping on four unanimous answers can accept a wrong consensus. The probability of this event is a lower bound on the policy’s error rate.
With nine equally likely wrong labels and independent draws, the probability of an incorrect early stop is the chance that all four initial draws give the same wrong answer. That probability is . One minus this probability is an upper bound on the accuracy of a policy that accepts unanimous answers immediately.
Compute-optimal reasoning
The strongest version of the test-time-compute claim is that it can substitute for model scale. Snell et al. (2024) studied this carefully, using a PaLM-2-class generator, a process reward model, and a FLOPs-matched comparison against larger pretrained models.
Their findings, stated with their bounds:
- With a generation budget of 128 and verifier-based selection, the easier difficulty bins favored fully sequential revisions. The harder bins favored a mix of sequential revisions and parallel samples. Snell et al., Figure 7, right
- In their revision experiments, choosing a sequential-to-parallel ratio by difficulty improved on the studied parallel best-of- baseline. The paper compares both oracle and estimated difficulty bins. Snell et al., Figure 8
- In a separate FLOPs-matched analysis, Snell et al. compared additional inference on PaLM 2-S* with greedy decoding from a model roughly 14 times larger, holding the quantity of training data fixed. The result depended on the difficulty bin and the expected share of inference compute. Snell et al., Section 7
Wu et al. (2024) also studied when a smaller model with additional inference work can match a larger one. The comparison depends on the task, search method, scorer, and accounting convention. To choose , measure the selected accuracy curve and cost with the scorer you plan to use.
Chen et al. studied redundant reasoning on simple problems and evaluated a self-training approach that reduced computational overhead while preserving performance across their benchmark suite. This is a measured result for their setup.
Worked Example
Start with four problems to see how the coverage ceiling and the accuracy of two selection rules differ before we compare them on a larger simulated suite.
Take four problems with per-draw success probabilities . For each problem, draw times independently from its fixed distribution.
The coverage ceiling, , is:
| Problem | pass@5 | |
|---|---|---|
| A | 0.9 | 0.99999 |
| B | 0.6 | 0.98976 |
| C | 0.3 | 0.83193 |
| D | 0.1 | 0.40951 |
| Mean | 0.475 | 0.80780 |
A single sample averages 0.475, and an oracle selector over five samples averages 0.808. The number of generations goes up by a factor of five. The relative improvement in the coverage ceiling is
where:
- : the mean per-sample accuracy, the average of across the four problems
- : the mean coverage ceiling, the average of across the four problems
- : the relative improvement of the ceiling over the single-sample baseline
Now apply two selection rules to the five-draw pools.
An uninformative verifier. A random ranking gives the same expected accuracy as one draw, which is on each problem and 0.475 averaged over the suite.
Plurality voting with ten choices and uniform distractors. Exhaustively weighting the five-draw sequences with uniform tie-breaking gives accuracies of about 0.998, 0.883, 0.455, and 0.100 on A through D. The mean is 0.609, between the single-draw baseline and the oracle ceiling. On D all ten labels are equally likely, so the vote still has 0.100 expected accuracy.
The worked example assigns an equal chance to every tied leader. Label zero represents the truth only for enumeration. When zero ties with other leaders, the contribution is one divided by the number of leaders. The simulation later uses a lowest-label tie rule with randomly assigned true labels.
PythonIn [7]Expand
from itertools import product
from math import fsum
example_choices = 10
example_draws = 5
vote_weight_by_correct_count = [0.0] * (example_draws + 1)
for draw in product(range(example_choices), repeat=example_draws):
counts = [draw.count(label) for label in range(example_choices)]
correct_count = counts[0]
maximum = max(counts)
if correct_count == maximum:
vote_weight_by_correct_count[correct_count] += 1 / counts.count(maximum)
def exact_example_vote_accuracy(p):
wrong_label_p = (1 - p) / (example_choices - 1)
return fsum(
weight * p**count * wrong_label_p ** (example_draws - count)
for count, weight in enumerate(vote_weight_by_correct_count)
)
example_accuracy = [
exact_example_vote_accuracy(p) for p in (0.9, 0.6, 0.3, 0.1)
]
print(
"Five-draw plurality accuracy (A to D):",
", ".join(f"{a:.3f}" for a in example_accuracy),
)
print(f"Mean: {fsum(example_accuracy) / len(example_accuracy):.3f}")ConsoleOut [7]Expand
Five-draw plurality accuracy (A to D): 0.998, 0.883, 0.455, 0.100 Mean: 0.609
Allocation. Uniform costs 20 samples. The next-draw coverage gains are about , , , and on A through D. If the per-task success probabilities were known and the objective were oracle coverage, a sixth draw would buy the most on D.
Code Implementation
The simulation makes the distribution of candidate answers explicit. It draws 400 problems with varying per-draw correctness probabilities, scores their candidates under several verifier settings, and counts the draws used by an early-stopping policy.
Setup
We need a small task suite. Each problem has a latent per-sample success probability, drawn from a heterogeneous distribution so that difficulty varies across problems, and a true answer drawn from ten possibilities.
PythonIn [8]Expand
import matplotlib.pyplot as plt
import numpy as np
rng = np.random.default_rng(20240117)
N_PROBLEMS = 400
N_CHOICES = 10
N_MAX = 32
# Latent difficulty: probability that a single independent sample is correct.
P_MIN, P_MAX = 0.05, 0.85
p_correct = rng.uniform(P_MIN, P_MAX, size=N_PROBLEMS)
true_answer = rng.integers(0, N_CHOICES, size=N_PROBLEMS)The generator draws an answer for one problem: with probability it emits the true answer, otherwise it emits one of the other nine uniformly at random. This is the simplest error model that still exhibits the mode structure we discussed.
PythonIn [9]Expand
def draw_samples(problem, n):
"""Draw n i.i.d. answers for one problem."""
p = p_correct[problem]
truth = true_answer[problem]
hit = rng.random(n) < p
wrong = (truth + rng.integers(1, N_CHOICES, size=n)) % N_CHOICES
return np.where(hit, truth, wrong), hitWe draw the maximum budget once per problem and reuse its prefixes at smaller budgets. At any fixed length, the prefix has the same distribution as a fresh draw of that size. Sharing candidates pairs the comparisons across budgets.
PythonIn [10]Expand
answers = np.zeros((N_PROBLEMS, N_MAX), dtype=int)
is_correct = np.zeros((N_PROBLEMS, N_MAX), dtype=bool)
for i in range(N_PROBLEMS):
a, c = draw_samples(i, N_MAX)
answers[i] = a
is_correct[i] = cConsoleOut [11]Expand
Problems in the suite: 400 Mean latent per-sample accuracy: 0.455 Empirical single-sample accuracy: 0.470
In this run, the model probabilities average 0.455 and the first draw succeeds on 0.470 of the problems.
Selectors and a dial-able verifier
Three selectors cover the range we care about: an oracle-free plurality vote, a verifier-guided best-of-, and (implicitly) random selection when the verifier has no signal.
PythonIn [12]Expand
def plurality_vote(block):
"""Plurality vote over the answers in each row of `block`."""
out = np.empty(block.shape[0], dtype=int)
for i, row in enumerate(block):
out[i] = np.argmax(np.bincount(row, minlength=N_CHOICES))
return out
def best_of_n(block_answers, block_scores):
"""Pick the highest-scoring candidate in each row."""
idx = np.argmax(block_scores, axis=1)
return np.take_along_axis(block_answers, idx[:, None], axis=1).ravel()The tie rule chooses the lowest label among tied leaders. With uniformly sampled true labels and symmetric distractors, this has the same aggregate expected accuracy as choosing uniformly among the leaders. It still favors lower predicted labels in ties and can change the observed accuracy of a particular run.
The simulator draws independent unit-variance normal scores around separation for correct candidates and around zero for incorrect ones. The difference between one correct and one incorrect score has variance 2 and mean separation. The chance that it is positive is , where is the standard normal cumulative distribution function. The probabilities at separations 0, 1, and 3 are about 0.50, 0.76, and 0.98.
PythonIn [13]Expand
def score_with_verifier(block_correct, separation):
return rng.normal(loc=separation * block_correct.astype(float), scale=1.0)Measuring coverage versus selection
The sweep records five curves: coverage, plurality voting, and best-of- with each of three verifier settings.
PythonIn [14]Expand
sample_counts = [1, 2, 4, 8, 16, 32]
separations = {"uninformative": 0.0, "weak": 1.0, "strong": 3.0}
# One verifier noise draw per quality level, reused as prefixes across N.
verifier_scores = {
k: score_with_verifier(is_correct, s) for k, s in separations.items()
}
coverage_curve = []
vote_curve = []
bon_curves = {k: [] for k in separations}
for n in sample_counts:
block_answers = answers[:, :n]
block_correct = is_correct[:, :n]
coverage_curve.append(block_correct.any(axis=1).mean())
vote_curve.append((plurality_vote(block_answers) == true_answer).mean())
for name in separations:
picked = best_of_n(block_answers, verifier_scores[name][:, :n])
bon_curves[name].append((picked == true_answer).mean())ConsoleOut [15]Expand
N coverage plurality rand-ver weak-ver strong-ver 1 0.470 0.470 0.470 0.470 0.470 2 0.682 0.510 0.490 0.585 0.677 4 0.815 0.620 0.470 0.655 0.805 8 0.920 0.703 0.460 0.685 0.920 16 0.973 0.792 0.443 0.752 0.963 32 0.995 0.807 0.477 0.790 0.983
Coverage rises from 0.470 at one draw to 0.995 at 32. At 32, plurality voting gives 0.807 and the strong verifier reaches 0.983. The random verifier fluctuates near the one-draw baseline. In this run the weak verifier scores below plurality at budgets of 8 and above.
VisualizationOut [16]Expand

Coverage grows most over the early part of the sweep. The strong verifier stays close to coverage throughout this run. The gap between coverage and the weak verifier’s selected accuracy is widest at and narrows at the two larger budgets shown.
Adaptive stopping versus equal-total and fixed-cap baselines
All policies use each problem's existing sample pool. The adaptive policy stops after four unanimous responses and uses sixteen otherwise. The equal-total baseline uses the adaptive policy's observed aggregate count, then shuffles assignments of the two adjacent integer budgets without looking at any individual stopping decision. The fixed-cap baseline uses sixteen draws on every problem.
PythonIn [17]Expand
N0 = 4
N1 = 12
initial_answers = answers[:, :N0]
stopped = np.all(initial_answers == initial_answers[:, [0]], axis=1)
wrong_stop = stopped & (initial_answers[:, 0] != true_answer)
adaptive_budgets = np.where(stopped, N0, N0 + N1)
total_budget = int(adaptive_budgets.sum())
lower_budget, round_up_count = divmod(total_budget, N_PROBLEMS)
mean_matched_budgets = np.full(N_PROBLEMS, lower_budget)
order = np.random.default_rng(17).permutation(N_PROBLEMS)
mean_matched_budgets[order[:round_up_count]] += 1
assert mean_matched_budgets.sum() == adaptive_budgets.sum()
cap_matched_budgets = np.full(N_PROBLEMS, N0 + N1)
def prefix_accuracy(budgets):
selected = [
np.argmax(np.bincount(row[:budget], minlength=N_CHOICES))
for row, budget in zip(answers, budgets, strict=True)
]
return np.mean(np.asarray(selected) == true_answer)
adaptive_acc = prefix_accuracy(adaptive_budgets)
fixed_acc = prefix_accuracy(mean_matched_budgets)
fixed_worst_acc = prefix_accuracy(cap_matched_budgets)
power = N0 + 1
correct_mass = P_MAX**power - P_MIN**power
wrong_mass = ((1 - P_MIN) ** power - (1 - P_MAX) ** power) / (
N_CHOICES - 1
) ** (N0 - 1)
expected_stop_rate = (correct_mass + wrong_mass) / (power * (P_MAX - P_MIN))ConsoleOut [18]Expand
Adaptive: 0.792 accuracy, 14.38 samples per problem Mean-matched non-adaptive: 0.775 accuracy, 14.38 samples per problem Cap-matched fixed: 0.792 accuracy, 16.00 samples per problem Early stop: 0.135; wrong early stops: 0 Expected early-stop rate under the simulation distribution: 0.111
The adaptive and mean-matched policies both use 5,752 draws. In this run the adaptive policy reaches 0.792 accuracy versus 0.775 for the mean-matched policy. The cap-matched policy also reaches 0.792 while using 6,400 draws. These are observed results from one shared set of pools and one shuffle of the non-adaptive budgets.
The early-stop rate is 0.135 in the seeded suite. The expected rate is 0.111 when averaging over the simulator's distribution of . On a problem with given , the chance of four unanimous draws is . The second term is positive for even though this run has zero observed wrong early stops.
VisualizationOut [19]Expand

Verifier accuracy at a fixed sample budget
Next, hold the candidate pool and its budget fixed and vary verifier separation.
PythonIn [20]Expand
quality_levels = [0.0, 0.5, 1.0, 1.5, 2.0, 3.0]
N_SWEEP = 16
sweep_answers = answers[:, :N_SWEEP]
sweep_correct = is_correct[:, :N_SWEEP]
sweep_noise = rng.standard_normal(sweep_correct.shape)
sweep_bon = []
for q in quality_levels:
picked = best_of_n(sweep_answers, sweep_noise + q * sweep_correct)
sweep_bon.append((picked == true_answer).mean())
vote_at_n = (plurality_vote(sweep_answers) == true_answer).mean()ConsoleOut [21]Expand
Plurality vote at N=16: 0.792 verifier separation 0.0: best-of-16 accuracy 0.460 <- below voting verifier separation 0.5: best-of-16 accuracy 0.613 <- below voting verifier separation 1.0: best-of-16 accuracy 0.748 <- below voting verifier separation 1.5: best-of-16 accuracy 0.848 verifier separation 2.0: best-of-16 accuracy 0.917 verifier separation 3.0: best-of-16 accuracy 0.963
At zero separation, the expected accuracy matches that of one draw. The observed result is 0.460, and the first-draw result is 0.470. At separation 1, best-of-16 scores 0.748, below the plurality result of 0.792. At 1.5 it reaches 0.848. The sweep holds and every candidate's noise fixed, so only the correct-candidate bonus changes. This is an accuracy comparison. A cost comparison would also count the verifier calls.
Key Parameters
N_MAXandsample_countsset the maximum pool size and the prefixes used for the sweep.separationcontrols the mean score difference between correct and incorrect candidates. At zero, scores are independent noise and best-of- has the accuracy of one draw in expectation.N_PROBLEMSsets the size of the synthetic suite.N_CHOICESgives the number of answer labels. With uniform distractors, the correct label is uniquely most probable when .N0andN1give the initial batch size and the number of extra samples when the first batch disagrees.
Limitations & Impact
Coverage can grow while voting or learned reranking levels off. Brown et al. observed this gap on math word problems, where the correct reference answers were available to the benchmark but unavailable to the selector. In their checked code and formal-proof settings, coverage gains could translate into gains in measured success. For a new task, compare selected accuracy with both coverage and a vote over the same number of draws.
Report the resource you matched. Generated tokens, model FLOPs, tool execution, and wall-clock latency can each produce a different ranking of policies. Measure whether a policy tuned on one workload transfers when the difficulty mix or the scorer's candidate distribution changes.
Summary
- Distinguish the work of generating, scoring, and revising candidates. The stopping policy decides how to allocate the budget across these operations.
- Coverage is the accuracy ceiling for a selector that returns an existing candidate. For independent draws with the same success probability on a given problem, it is and is nondecreasing in and .
- Uniform selection gives single-draw accuracy in expectation. A learned verifier can score better or worse than this baseline, and its selected accuracy can fall as the pool grows.
- With independent draws from a fixed answer distribution, a uniquely most probable label wins the plurality with probability approaching one. The correct label is uniquely most probable above when the distractors divide the error mass equally.
- Process reward models score intermediate steps. Lightman et al.'s process-supervised verifier outscored their outcome-supervised verifier in the cited MATH reranking comparison.
- Measure the effect of revision by counting repaired errors and spoiled correct answers. Judge ranking and end-to-end revision accuracy measure different outcomes.
- For a given positive sample budget, the next-draw coverage gain peaks at . Mean-matched and cap-matched comparisons measure different properties of adaptive policies.
- Snell et al. found benefits from difficulty-aware allocation in their experiments. When comparing extra inference work with a larger model, keep the scorer, task mix, and compute accounting in view.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about search, reflection, and test-time compute.
Search, Reflection, and Test-Time Compute
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


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!