Test-Time Compute: Spending Inference Budget on Search
When does more inference compute help, and when does it make the answer worse?
The idea
A correct answer can be sampled and still be discarded. Keep the draws fixed and change the verifier to see how coverage and selection can come apart.
Builds on Probability Basics.
The picture
Best-of- is the simplest way to spend more compute after a prompt arrives. The model samples complete answers, called traces; a verifier scores each one; the system returns the trace with the highest score. It has two jobs that can fail separately: the draws must cover a correct trace, and the verifier must select it. Here "search" means parallel best-of- over complete traces, not prefix expansion or tree search.
This page uses one small, fixed model of a single prompt. Four traces can come out: common wrong (probability ), plausible slip (), clean correct (, the only correct one) and rare exploit (), a wrong trace that a flawed verifier likes. There are two verifiers. The clean one scores clean correct highest. The noisy one agrees with it everywhere except the exploit, which it scores , above the correct trace's . It is not random: it is a fixed misranking that gives the exploit every time.
One pair, two verifiers. Take and hold the draws fixed at clean correct and rare exploit. The first panel ranks them under both verifiers. The clean verifier returns the correct trace; the noisy verifier returns the exploit. The draws did not change, so the pair covers a correct trace either way. Only the selection changed.
All sixteen outcomes. Two independent draws give ordered outcomes, and the second panel draws each one as a rectangle whose area is its probability, . A correct trace is missed only in the block where neither draw is clean correct, so coverage is under either verifier. With the noisy verifier, exactly two outcomes, the worked pair in either order, cover a correct trace without returning it. Together they have probability , and selected correctness falls from to .
Changing is a different intervention. Switching the verifier keeps the generator's distribution and , and re-ranks every possible outcome. Changing changes the number of independent draws, and so the set of possible outcomes: with the verifier has nothing to choose between, and both verifiers return a correct trace with probability . The instrument at the end of the page opens at the figure's and verifier and computes every from 1 to 128. There, more draws keep raising coverage, while the noisy verifier's selected correctness peaks at and then falls, because each extra draw raises the chance that the exploit is among the draws. The honest question is not "does thinking longer help?" but whether, for this prompt, generator, verifier and cost, another sample is worth buying.
A short probability bridge. An outcome here is an ordered list of draws, and an event is a set of outcomes, such as "some draw is clean correct". Because the draws are independent, the probability of an ordered outcome is the product of its draws' probabilities: for clean correct then rare exploit. The complement rule turns "at least one" into "not none": . Ranking only orders the drawn traces by score, and best-of- returns the top one. Probability Basics covers events, complements and independence in full. Training-time scaling and learned verifiers explain where the generator and verifier come from; this calculation does not depend on them.
Background. For training-time scaling, Kaplan et al., "Scaling Laws for Neural Language Models", and Hoffmann et al., "Training Compute-Optimal Large Language Models". For learned verifiers, Cobbe et al., "Training Verifiers to Solve Math Word Problems", Uesato et al., "Solving Math Word Problems With Process- and Outcome-Based Feedback", and Lightman et al., "Let's Verify Step by Step". For repeated sampling, Brown et al., "Large Language Monkeys: Scaling Inference Compute with Repeated Sampling", and Wang et al., "Self-Consistency Improves Chain of Thought Reasoning in Language Models". For when inference compute beats a larger model, Snell et al., "Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters".
Check your understanding (optional)
Hold the draws fixed. Change only the verifier.
Best-of-N samples N complete traces, scores each with a verifier and returns the highest score. Having a correct trace among the draws is coverage; getting it back is selection. The figure opens on one worked outcome with N = 2: clean correct, then rare exploit.
Showing N = 2: clean correct, then rare exploit (the worked outcome); clean verifier
Lines join the same trace under the two verifiers. Only the exploit’s line moves, and it crosses the correct trace’s. Dashed lines mark traces absent from the current draws.
- returned a correct trace0.3276
- sampled a correct trace, returned a wrong one0
- no correct trace sampled0.6724
Area is event probability: row heights and column widths are the priors (common wrong 0.50, plausible slip 0.25, clean correct 0.18, rare exploit 0.07). The ticks are clean correct’s cumulative ranks; the dashed squares are their squares, and the band between them is where clean correct is returned. Choose the draws above, select a cell, or focus a cell and use the arrow keys.
The clean verifier scores clean correct 1.8 and rare exploit 0.2, so it returns clean correct, a correct trace. Switch to the noisy verifier: the same draws, but rare exploit outscores clean correct and is returned instead.
| Clean verifier | Noisy verifier | |
|---|---|---|
| This outcome: clean correct, then rare exploit | ||
| Event probabilityhow often exactly these draws happen | 0.18 × 0.07 = 0.0126 | 0.18 × 0.07 = 0.0126 |
| Correct trace sampledcoverage, for this outcome | yes | yes |
| Returnedthe top-scoring draw (differs between verifiers) | clean correct (correct) | rare exploit (wrong) |
| All sixteen outcomes | ||
| CoverageP(a correct trace is sampled) | 1 − 0.82² = 0.3276 | 1 − 0.82² = 0.3276 |
| Selected correctnessP(the returned trace is correct) (differs between verifiers) | 1 − 0.82² = 0.3276 | 0.93² − 0.75² = 0.3024 |
| Sampled, not returnedcoverage minus selection (differs between verifiers) | 0 | 2 × 0.0126 = 0.0252 |
Highlighted rows differ between the verifiers. The draws, their event probabilities and coverage never do; only what is returned can.
Check yourself optional · start one, then change the figure; a hint comes before any answer
Not the verifier’s fault
Find an outcome that returns a wrong trace where no verifier could have returned a correct one.
The other outcome that flips
The worked pair returns a different trace under each verifier. Find the one other ordered outcome that does.
All sixteen outcomes as a table
| Draws | Event probability | Correct sampled | Clean returns | Noisy returns |
|---|---|---|---|---|
| common wrong, then common wrong | 0.50 × 0.50 = 0.25 | no | common wrong | common wrong |
| common wrong, then plausible slip | 0.50 × 0.25 = 0.125 | no | plausible slip | plausible slip |
| common wrong, then clean correct | 0.50 × 0.18 = 0.09 | yes | clean correct ✓ | clean correct ✓ |
| common wrong, then rare exploit | 0.50 × 0.07 = 0.035 | no | rare exploit | rare exploit |
| plausible slip, then common wrong | 0.25 × 0.50 = 0.125 | no | plausible slip | plausible slip |
| plausible slip, then plausible slip | 0.25 × 0.25 = 0.0625 | no | plausible slip | plausible slip |
| plausible slip, then clean correct | 0.25 × 0.18 = 0.045 | yes | clean correct ✓ | clean correct ✓ |
| plausible slip, then rare exploit | 0.25 × 0.07 = 0.0175 | no | rare exploit | rare exploit |
| clean correct, then common wrong | 0.18 × 0.50 = 0.09 | yes | clean correct ✓ | clean correct ✓ |
| clean correct, then plausible slip | 0.18 × 0.25 = 0.045 | yes | clean correct ✓ | clean correct ✓ |
| clean correct, then clean correct | 0.18 × 0.18 = 0.0324 | yes | clean correct ✓ | clean correct ✓ |
| clean correct, then rare exploit | 0.18 × 0.07 = 0.0126 | yes | clean correct ✓ | rare exploit |
| rare exploit, then common wrong | 0.07 × 0.50 = 0.035 | no | rare exploit | rare exploit |
| rare exploit, then plausible slip | 0.07 × 0.25 = 0.0175 | no | rare exploit | rare exploit |
| rare exploit, then clean correct | 0.07 × 0.18 = 0.0126 | yes | clean correct ✓ | rare exploit |
| rare exploit, then rare exploit | 0.07 × 0.07 = 0.0049 | no | rare exploit | rare exploit |
| Total | 1.00 | 0.3276 | 0.3276 correct | 0.3024 correct |
Four hand-chosen traces for one prompt and exact arithmetic over every ordered outcome. Nothing here samples a model or measures one. Changing N changes the number of independent draws, and with it the set of possible outcomes. The instrument at the end of the page opens at this figure’s N and verifier and computes every N from 1 to 128.
Choose within a budget
The same four traces and two rankers, now with prices in abstract units of a single compute resource: generating a trace costs 1, scoring it costs 1 with the noisy ranker and 2 with the clean one, and every trace in a scored plan is scored. The objective is the chance that the returned trace is correct. The budget is a limit, not a target.
Decision
Within 12 units, score 4 draws with the clean ranker: cost 12, all 12 units used, selected correctness 0.54787824.
- Best clean plan4 draws, cost 12, 0.54787824
- Best noisy plan6 draws, cost 12, 0.469011667824
- One unscored drawcost 1, 0.18
The setup charge is hypothetical, chosen to show what omitted overhead can do: 4 units charged once for choosing the clean scored plan on this prompt, not per trace and not shared with other prompts. It is not a price from a paper or a provider.
Change the budget to see which plans become affordable; the quality of each plan does not change.
- one unscored draw
- clean ranker, labelled by n
- noisy ranker, labelled by n
- over budget (shaded side)
- best within budget
- best attainable at each budget
More draws are not always better: noisy n = 7 (cost 14) gives 0.46821698388882, below n = 6. This compares plans before any batch is bought; it is not a rule for stopping after seeing samples.
| Draws n | 4 |
|---|---|
| Generation | 4 × 1 = 4 |
| Scoring | 4 × 2 = 8 |
| Setup | 0 |
| Total cost | 12 |
| Budget | 12, leaving 0 unused |
| Selected correctness | 1 − 0.82⁴ = 0.54787824 |
Just out of reach: clean ranker, 5 draws (costs 15 units, 3 more than the budget of 12); noisy ranker, 7 draws (costs 14 units, 2 more than the budget of 12).
Units bridge and a changed check
Add costs in the same units. With generation 1 and clean scoring 2, one scored draw costs 1 + 2 = 3. Within a budget of 8, two scored draws cost 2 × 3 = 6 and three would cost 9, so three are unavailable. One unscored draw costs only its generation, 1: with a single draw there is nothing to choose between, so no scoring is charged.
Changed check. With the noisy ranker (1 to generate, 1 to score) and a budget of 11, how many scored draws fit, and what is left?
Answer. Five draws cost 5 × 2 = 10, leaving 1 unit unused; six would cost 12. The best plan at 11 units is still decided by comparing every affordable plan, not by filling the budget.
Every plan up to 26 units, as a table
| Plan | Cost | Within B = 12? | Selected correctness |
|---|---|---|---|
| one unscored draw | 1 generation + 0 scoring + 0 setup = 1 | yes | 0.18 |
| clean ranker, 2 draws | 2 generation + 4 scoring + 0 setup = 6 | yes | 0.3276 |
| clean ranker, 3 draws | 3 generation + 6 scoring + 0 setup = 9 | yes | 0.448632 |
| clean ranker, 4 draws | 4 generation + 8 scoring + 0 setup = 12 | yes | 0.54787824 |
| clean ranker, 5 draws | 5 generation + 10 scoring + 0 setup = 15 | no, over by 3 | 0.6292601568 |
| clean ranker, 6 draws | 6 generation + 12 scoring + 0 setup = 18 | no, over by 6 | 0.695993328576 |
| clean ranker, 7 draws | 7 generation + 14 scoring + 0 setup = 21 | no, over by 9 | 0.75071452943232 |
| clean ranker, 8 draws | 8 generation + 16 scoring + 0 setup = 24 | no, over by 12 | 0.795585914134503 |
| noisy ranker, 2 draws | 2 generation + 2 scoring + 0 setup = 4 | yes | 0.3024 |
| noisy ranker, 3 draws | 3 generation + 3 scoring + 0 setup = 6 | yes | 0.382482 |
| noisy ranker, 4 draws | 4 generation + 4 scoring + 0 setup = 8 | yes | 0.43164576 |
| noisy ranker, 5 draws | 5 generation + 5 scoring + 0 setup = 10 | yes | 0.4583836818 |
| noisy ranker, 6 draws | 6 generation + 6 scoring + 0 setup = 12 | yes | 0.469011667824 |
| noisy ranker, 7 draws | 7 generation + 7 scoring + 0 setup = 14 | no, over by 2 | 0.46821698388882 |
| noisy ranker, 8 draws | 8 generation + 8 scoring + 0 setup = 16 | no, over by 4 | 0.459468894625978 |
| noisy ranker, 9 draws | 9 generation + 9 scoring + 0 setup = 18 | no, over by 6 | 0.445326396709191 |
| noisy ranker, 10 draws | 10 generation + 10 scoring + 0 setup = 20 | no, over by 8 | 0.427668792469821 |
| noisy ranker, 11 draws | 11 generation + 11 scoring + 0 setup = 22 | no, over by 10 | 0.407868409644638 |
| noisy ranker, 12 draws | 12 generation + 12 scoring + 0 setup = 24 | no, over by 12 | 0.386919945455293 |
| noisy ranker, 13 draws | 13 generation + 13 scoring + 0 setup = 26 | no, over by 14 | 0.365537292637756 |
The other 235 of the 255 actions cost more than 26 units at this setup, so none is affordable with this control. The code below and the tests enumerate all 255.
Inspect the aggregation rule
A scored batch still needs a rule that returns one answer. Two operations are easy to run together: reducing one solution’s step scores to a single weight, and combining weights across solutions. Each can change the answer on its own.
Within one solution
| Solution | Step scores | Weight |
|---|---|---|
| P | 0.10, 0.90 | 0.90 |
| Q | 0.80, 0.80 | 0.80 |
P ranks higher. The last step favours P (0.90 against 0.80); the product (0.09 against 0.64) and the sum (1.00 against 1.60) favour Q.
Snell et al. (arXiv v1, §5.1) take a solution’s final-step prediction; Lightman et al. (arXiv v1, §2.6) multiply step probabilities, counting neutral steps as positive. This page’s additive step score sums within one trace and is neither paper’s exact convention. The vectors are invented, and the two papers train their step scores on different targets, so values in [0, 1] are not interchangeable.
Across solutions
W(a) = Σ weights with answer a: W(A) = 0.60 + 0.60 = 1.20; W(B) = 0.90 = 0.90
Returns B: candidate b1 has the highest single weight, 0.90.
Graded afterwards The correct answer, fixed in advance, is A, so this answer is wrong. Neither rule reads this.
Squaring M1’s weights keeps every candidate’s order but turns the totals 1.20 against 0.90 into 0.72 against 0.81: grouped sums depend on magnitudes, not only on order. Totals above 1 are sums of weights, not probabilities. Ties go to the smallest candidate ID or answer key, a rule for this teaching example rather than either paper’s. A repeated candidate ID is rejected, never counted twice. Choosing an answer this way does not certify any one derivation that reached it. M1 and M2 hold the weights fixed and change only this rule; they are not complete implementations of either paper.
Count answers under a joint law
Three response slots each hold the correct answer with probability 3/5. Does returning their most frequent answer do better than reading one slot? The 3/5 alone cannot say. It depends on how the three answers occur together: their joint law.
This example has a single wrong answer ID. For several wrong answers, ties and extraction, see when counting applies.
- C
- the correct answer ID, fixed by the evaluator
- W
- one particular wrong answer ID, not every wrong answer
- Slots 1, 2, 3
- three answers to one fixed task, each reduced to an ID by a fixed extraction rule
- The voter
- counts one vote per slot and returns the most frequent ID; it sees the IDs and nothing else
- The evaluator
- grades the returned ID against C, afterwards
One row, before any probability
In the row C W W, slot 1 answers C and slots 2 and 3 answer W. The voter counts C 1 · W 2 and returns W. Graded afterwards, W is wrong, although a correct answer was available in slot 1. None of this depends on a law; a law says only how often the row occurs.
- assumed joint law
- extracted answer IDs
- count
- return
- graded afterwards
Change the law: the inspected row keeps its count, its return and its grade; only its probability can change.
Slots C, W, W. Count C 1 · W 2, so the voter returns W. Graded afterwards against C: wrong, although a correct answer was available in slot 1. Under three independent draws this row has probability 3/5 × 2/5 × 2/5 = 12/125.
| Outcome | Votes | Returns | Graded afterwards | P, three independent draws (selected) | P, one copied draw |
|---|---|---|---|---|---|
| C C C | C 3 · W 0 | C | correct | 27/125 | 3/5 |
| C C W | C 2 · W 1 | C | correct | 18/125 | 0 |
| C W C | C 2 · W 1 | C | correct | 18/125 | 0 |
| W C C | C 2 · W 1 | C | correct | 18/125 | 0 |
| C W W | C 1 · W 2 | W | wrong | 12/125 | 0 |
| W C W | C 1 · W 2 | W | wrong | 12/125 | 0 |
| W W C | C 1 · W 2 | W | wrong | 12/125 | 0 |
| W W W | C 0 · W 3 | W | wrong | 8/125 | 2/5 |
| Total mass | 1 | 1 | |||
| Returns C: the rows graded correct | 81/125 | 3/5 | |||
| At least one C: coverage, a different event | 117/125 | 3/5 | |||
Sum over rows, under three independent draws
P(return C) = 27/125 + 18/125 + 18/125 + 18/125 = 81/125 = 0.648
- P(slot 1 answers C) = C C C + C C W + C W C + C W W = 27/125 + 18/125 + 18/125 + 12/125 = 3/5
- P(slot 2 answers C) = C C C + C C W + W C C + W C W = 27/125 + 18/125 + 18/125 + 12/125 = 3/5
- P(slot 3 answers C) = C C C + C W C + W C C + W W C = 27/125 + 18/125 + 18/125 + 12/125 = 3/5
Within a row the voter tallies three unit ballots; across rows the evaluator adds masses. A mass never weights a ballot. Under three independent draws, rows C W W, W C W, W W C hold a C but return W, together 36/125: they count toward coverage, 117/125 = 0.936, and not toward the returned answer, 81/125 = 0.648. The fractions are hypothetical masses, not 125 observed trials.
The same example in symbols
Let A1, A2, A3 ∈ {C, W} be the extracted IDs in slots 1, 2 and 3, Xi = 1[Ai = C] and K = X1 + X2 + X3. A joint law q gives each ordered outcome a = (a1, a2, a3) a mass q(a) ≥ 0, and the eight masses sum to 1.
The voter computes n(b) = Σi 1[Ai = b] for each ID b and returns an ID that maximizes n. It reads the IDs and nothing else. With two IDs and three slots the maximizer is unique, and it is C exactly when K ≥ 2. With more IDs, count maximization is a plurality and can tie.
P(return C) = Σa q(a) · 1[K(a) ≥ 2]
The law enters only through q. Each slot’s marginal is P(Ai = C) = Σa q(a) Xi(a), which is 3/5 under both laws.
- Three independent draws
- q(a) = Πi pXi(1 − p)1 − Xi, so P(return C) = 3p²(1 − p) + p³ = 54/125 + 27/125 = 81/125 at p = 3/5. The product is justified by independence, not by the marginals.
- One copied draw
- Z ∈ {C, W}, with P(Z = C) = p, and Ai = Z in every slot, so q(CCC) = p, q(WWW) = 1 − p, every other row has mass 0, and P(return C) = p = 3/5. Each slot still has marginal p; the product formula does not apply.
- The sign of the change
- Pind(return C) − p = p(1 − p)(2p − 1): positive for 1/2 < p < 1, negative for 0 < p < 1/2, and zero at p = 0, 1/2 or 1. At p = 1/4, three independent votes return C with 5/32, a change of −3/32: the count makes a mostly wrong answer more likely to be returned.
- Coverage, a different event
- Under independent draws P(K ≥ 1) = 1 − (1 − p)³ = 117/125; under the copied draw P(K ≥ 1) = p = 3/5. It says a correct answer was available, not that it was returned.
When counting applies
The main example has one wrong ID, so three votes cannot tie. Real answers need more rules. The same voter counts each example below; none consults the truth.
One wrong ID, or two
Answers C, W1, W1: C 1 · W1 2, returns W1.
Answers C, W1, W2: C 1 · W1 1 · W2 1, a tie among C, W1, W2: unresolved without a tie rule.
Both batches have the correctness flags correct, wrong, wrong. The flags cannot tell a wrong winner from a tie; the answer IDs can. Count maximization is a plurality in general. With two IDs and an odd number of slots, as in the main example, the winner is guaranteed to have a strict majority.
A convention of this page, not taken from Wang et al.: choose uniformly among tied IDs. Under it, the tie returns C with probability 1/3. It picks among the tied IDs and never checks which is correct.
Extraction must be specified
Raw final answers “18”, “18.0”, “17”. Counted as exact text: 18 1 · 18.0 1 · 17 1, a tie among 18, 18.0, 17: unresolved. With a fixed map that identifies 18.0 with 18: 18 2 · 17 1, returns 18. The raw text stays beside each extracted ID (“18” → 18, “18.0” → 18, “17” → 17). The map is a fixed lookup for these strings, not a general parser.
Answers C, no final answer, W: refused (record d2 has no answer under the fixed extraction rule; the batch is not counted, and the slot is neither dropped nor reassigned). Dropping the empty slot would leave C 1 · W 1, a tie; counting it as W would return W. Neither is the batch as given.
Record identity is not independence
Draws d1, d2, d3 answering C, C, W are three votes: C 2 · W 1, returns C.
The same record d1 listed twice is a data error: refused (record d1 appears twice; a repeated record is refused, not merged).
A copying protocol can fill three distinct slot IDs from one draw, so distinct IDs do not show independence.
A refused batch is not a zero-mass row. C W W under the copied law is valid input: the voter returns W, and the law only gives the row no probability. A refused batch is invalid input, and no answer is computed from it.
What the count establishes
81/125 belongs to the stated independent law, not to the count rule or to three answers. Before a claim about vote correctness is carried to another procedure, someone has to decide what justifies the law behind it.
- One observed triple settles little. A mixed triple such as C W W rules out the exact copied law for that batch but does not establish independence; a unanimous triple can occur under both laws.
- A matching triple does not establish dependence, and vote share is not calibrated confidence: under independent draws, W W W still has mass 8/125.
- Three slots are not three independent units of compute: the copied law has one random source. This page makes no cost comparison.
- Both laws hold one task, prompt, model setting, decoder and extraction rule fixed. Pooling tasks changes the conditioning. If draws are independent given the task Q but its chance p(Q) of a correct draw varies, correctness pooled over a random task has Cov(Xi, Xj) = Var(p(Q)). That is a warning about pooled rates, not evidence of dependence within one task.
Evidence for a next test. Keep complete within-task batches: raw and extracted IDs, parser failures, counts and ties, independently judged returned correctness, the configuration and a budget fixed in advance. Compare rules on the same batches; a changed sampler can change more than dependence. No benchmark improvement is imported here.
Source. Wang et al., Self-Consistency Improves Chain of Thought Reasoning in Language Models, arXiv:2203.11171v4 (7 March 2023). §2 and Figure 1 sample several reasoning paths for one question and return the most frequent final answer; footnote 1 makes answer extraction task-specific; Eq. 1 and Table 1 compare weighted alternatives with the plain count; §3.2 samples each run’s outputs independently. The two IDs, their truth, the copied law and every probability here are invented for this page, not a description of the paper’s decodes. The original v1 (21 March 2022, page 3, footnote 2) breaks ties by the answer encountered first; the v4 text checked for this page states no tie rule, and the uniform choice above is this page’s own. The weighted rules in the aggregation section above stay different operations: there candidates’ weights are summed, here each slot is one unit ballot.
The same example in Python
Standard library only (fractions and itertools). It enumerates the eight rows, builds both laws, counts IDs, grades afterwards, sums masses and checks the sums against the formulas above. It runs on your machine, not in this page.
Show the Python code and what it prints
from fractions import Fraction
from itertools import product
C, W = "C", "W" # the stipulated correct ID, and one particular wrong ID
P = Fraction(3, 5) # each slot's chance of answering C, under both laws
# The eight ordered outcomes (A1, A2, A3), grouped by how many slots answer C.
OUTCOMES = sorted(product((C, W), repeat=3), key=lambda a: -a.count(C))
def independent_law(p):
"""Three independent draws: the three slots' probabilities multiply."""
law = {}
for a in OUTCOMES:
mass = Fraction(1)
for answer in a:
mass *= p if answer == C else 1 - p
law[a] = mass
return law
def copied_law(p):
"""One draw Z, copied into all three slots: only CCC and WWW can occur."""
return {a: p if a == (C, C, C) else 1 - p if a == (W, W, W) else Fraction(0) for a in OUTCOMES}
def check_law(law):
"""Refuse anything but an exact, nonnegative mass for each of the eight outcomes, summing to 1."""
if not isinstance(law, dict) or set(law) != set(OUTCOMES):
raise ValueError("a law gives a mass to exactly the eight ordered outcomes")
if not all(isinstance(m, Fraction) and m >= 0 for m in law.values()):
raise ValueError("every mass must be a nonnegative Fraction; nothing is converted")
if sum(law.values()) != 1:
raise ValueError("the masses must sum to exactly 1; nothing is renormalized")
return law
def vote(ids):
"""The voter: one unit ballot per slot. It receives answer IDs only, never the
truth, a law mass or a correctness flag. Returns the most frequent IDs and the counts."""
if not isinstance(ids, (list, tuple)) or len(ids) != 3:
raise ValueError("a batch has exactly three answer slots")
if not all(isinstance(a, str) and a for a in ids):
raise ValueError("every slot needs an extracted answer ID; none is dropped or guessed")
counts = {}
for a in ids:
counts[a] = counts.get(a, 0) + 1 # a repeated answer is one more vote
top = max(counts.values())
return [a for a in counts if counts[a] == top], counts # several IDs: an unresolved tie
def returned_id(ids):
winners, _ = vote(ids)
if len(winners) != 1:
raise ValueError(f"tied IDs {winners}: no tie rule is declared")
return winners[0]
def summarize(law, truth=C):
"""Within a row the voter tallies ballots; across rows the evaluator sums law masses."""
check_law(law)
return {
"total": sum(law.values()),
"marginals": [sum(m for a, m in law.items() if a[i] == truth) for i in range(3)],
"returns_truth": sum(m for a, m in law.items() if returned_id(a) == truth),
"truth_available": sum(m for a, m in law.items() if truth in a),
}
laws = {"independent": independent_law(P), "copied": copied_law(P)}
print(f"{'row':3} {'votes':5} {'returns':7} {'graded':7} {'independent':>11} {'copied':>6}")
for a in OUTCOMES:
counts = vote(a)[1]
returned = returned_id(a)
graded = "correct" if returned == C else "wrong" # evaluation, afterwards
print(f"{''.join(a):3} C{counts.get(C, 0)} W{counts.get(W, 0)} {returned:7} {graded:7} "
f"{str(laws['independent'][a]):>11} {str(laws['copied'][a]):>6}")
iid, copy = summarize(laws["independent"]), summarize(laws["copied"])
for name, s in (("independent", iid), ("copied", copy)):
print(f"{name}: total {s['total']}; each slot C {' '.join(map(str, s['marginals']))}; "
f"returns C {s['returns_truth']}; at least one C {s['truth_available']}")
assert iid["returns_truth"] == 3 * P**2 * (1 - P) + P**3 # the product rule: independent draws only
assert copy["returns_truth"] == P and iid["marginals"] == copy["marginals"] == [P, P, P]
assert returned_id((C, W, W)) == W # the row's count and return do not depend on the law
assert laws["independent"][(C, W, W)] == Fraction(12, 125) and laws["copied"][(C, W, W)] == 0
assert summarize(laws["independent"], truth=W)["returns_truth"] == 1 - iid["returns_truth"]
low = Fraction(1, 4)
gain = summarize(independent_law(low))["returns_truth"] - low
assert gain == low * (1 - low) * (2 * low - 1) < 0
print(f"p = {low}: independent majority returns C {low + gain}, a change of {gain}")
def count_law(k_masses):
"""Choose K, the number of C answers, then one of the rows with that K uniformly."""
rows = [[a for a in OUTCOMES if a.count(C) == k] for k in range(4)]
return {a: k_masses[k] / len(rows[k]) for k in range(4) for a in rows[k]}
def pair_table(law, i, j):
"""(CC, CW, WC, WW) for slots i and j."""
return tuple(sum(m for a, m in law.items() if (a[i], a[j]) == pair) for pair in product((C, W), repeat=2))
for t in (Fraction(3, 25), P**3, Fraction(7, 25)):
law = check_law(count_law([Fraction(7, 25) - t, 3 * t - Fraction(9, 25), Fraction(27, 25) - 3 * t, t]))
tables = {pair_table(law, i, j) for i, j in ((0, 1), (0, 2), (1, 2))}
s = summarize(law)
assert s["marginals"] == [P, P, P] and tables == {(P * P, P * (1 - P), (1 - P) * P, (1 - P) ** 2)}
assert s["returns_truth"] == 3 * P * P - 2 * law[(C, C, C)] # pairs fixed; the triple term is free
assert (law == laws["independent"]) == (t == P**3) # mutually independent only at t = 27/125
print(f"t = {t}: every pair (CC, CW, WC, WW) = {' '.join(map(str, tables.pop()))}; "
f"P(CCC) = {law[(C, C, C)]}; returns C {s['returns_truth']}")
try:
vote((C, None, W)) # a slot with no extracted answer
except ValueError as refusal:
print("refused:", refusal)
It prints:
row votes returns graded independent copied
CCC C3 W0 C correct 27/125 3/5
CCW C2 W1 C correct 18/125 0
CWC C2 W1 C correct 18/125 0
WCC C2 W1 C correct 18/125 0
CWW C1 W2 W wrong 12/125 0
WCW C1 W2 W wrong 12/125 0
WWC C1 W2 W wrong 12/125 0
WWW C0 W3 W wrong 8/125 2/5
independent: total 1; each slot C 3/5 3/5 3/5; returns C 81/125; at least one C 117/125
copied: total 1; each slot C 3/5 3/5 3/5; returns C 3/5; at least one C 3/5
p = 1/4: independent majority returns C 5/32, a change of -3/32
t = 3/25: every pair (CC, CW, WC, WW) = 9/25 6/25 6/25 4/25; P(CCC) = 3/25; returns C 21/25
t = 27/125: every pair (CC, CW, WC, WW) = 9/25 6/25 6/25 4/25; P(CCC) = 27/125; returns C 81/125
t = 7/25: every pair (CC, CW, WC, WW) = 9/25 6/25 6/25 4/25; P(CCC) = 7/25; returns C 13/25
refused: every slot needs an extracted answer ID; none is dropped or guessedOptional: equal pairs, different majority
Keep every slot’s marginal at 3/5 and make every pair of slots independent. Is the chance that the count returns C now fixed? No. Choose K first, with masses (7/25 − t, 3t − 9/25, 27/25 − 3t, t) for K = 0, 1, 2, 3 and 3/25 ≤ t ≤ 7/25, then place the C answers uniformly among the rows with that K. Every slot answers C with 3/5 and every pair answers C together with 9/25 = (3/5)², so each pair is independent.
| Quantity | t = 3/25 | t = 27/125, three independent draws | t = 7/25 |
|---|---|---|---|
| P(K = 0) | 4/25 | 8/125 | 0 |
| P(K = 1) | 0 | 36/125 | 12/25 |
| P(K = 2) | 18/25 | 54/125 | 6/25 |
| P(K = 3) | 3/25 | 27/125 | 7/25 |
| Each slot answers C | 3/5, 3/5, 3/5 | 3/5, 3/5, 3/5 | 3/5, 3/5, 3/5 |
| Each pair answers C C | 9/25, 9/25, 9/25 | 9/25, 9/25, 9/25 | 9/25, 9/25, 9/25 |
| P(C C C) | 3/25 | 27/125 | 7/25 |
| Returns C | 21/25 = 0.84 | 81/125 = 0.648 | 13/25 = 0.52 |
| Mutually independent | no | yes | no |
At both endpoints, each of the three pair tables (slots 1 and 2, 1 and 3, 2 and 3) is (CC, CW, WC, WW) = (9/25, 6/25, 6/25, 4/25).
Why the pairs do not settle it: 1[K ≥ 2] = X1X2 + X1X3+ X2X3 − 2X1X2X3 for every row, so P(return C) = 27/25 − 2 P(C C C). The pair tables fix the first three terms and leave the triple term free. Mutual independence needs P(C C C) = 27/125, which is the independent law itself; neither endpoint has it. Pairwise independence is not mutual independence.
Optional practice on this table, with answers shown
A self-check on the example above. The answers are on the page, so matching one is practice, not a graded or recorded result.
Under the copied law, which rows have nonzero mass, and why does the voter return C with exactly 3/5?
Show an answer
Only C C C (3/5) and W W W (2/5). The voter returns C on C C C and W on W W W, so C is returned with 3/5: three equal votes carry one draw.
Under independent draws, which rows hold a C but return W, and what is their total mass?
Show an answer
C W W, W C W, W W C, 12/125 each: 36/125, which is 117/125 − 81/125. A correct answer was available and was not returned.
If the evaluator’s truth were W instead of C, which table columns would change?
Show an answer
In the eight rows, only “Graded afterwards”: the votes and returns never read the truth. The sum of the rows graded correct changes with it: the returned answer would then be graded correct with 44/125 under independent draws and 2/5 under the copied law.
Under the copied law, why is C W W still in the table?
Show an answer
The rule is defined for any supplied IDs, and on C W W it returns W. The copied law gives the row mass 0, so it cannot occur there, and no probability conditional on it is defined.
Decide what is unknown
A separate scenario with its own fixed setting: budget 12, no setup charge for anyone. The known-clean ranker is no longer available. In its place is an unvalidated proposed ranker at the clean ranker’s price, which uses the clean ordering for the whole batch with probability r and the noisy ordering otherwise. The regime is set once per batch, independently of the draws, and is not revealed when the plan is chosen; scoring costs 2 per trace either way.
What the stated information supports
Neither plan is better for every allowed r in [0.2, 0.6]. The noisy ranker, 6 draws (cost 12) gives 0.469011667824. The proposed expensive ranker, 4 draws (cost 12) gives r · 0.54787824 + (1 − r) · 0.43164576, which over the stated range r ∈ [0.2, 0.6] runs from 0.454892256 to 0.501385248 and crosses the noisy plan at r ≈ 0.3215.
The range is an assumed set of possibilities, not a confidence interval, measurement or posterior. For a given r, the formula gives the proposed plan’s expected correctness conditional on that r, which the what-if control below computes. The range supplies no distribution or mean for the unknown r, so it does not identify expected correctness averaged over that uncertainty; its midpoint is a what-if value, not an estimate. Preferring the plan with the better worst case would be an extra decision rule, not a proof that it is better.
Thick segment: the stated range of r. Hollow circle: the earlier known-clean result, which is not an available action here. Were it available, it would beat both plans for every allowed r in [0.2, 0.6], and nothing would be unresolved. The proposed plan reaches it only at r = 1, outside that range, where the two are equal.
If r were 0.20, the proposed plan would give 0.454892256, below the noisy plan’s 0.469011667824. A what-if at one value, not an estimate of r.
What would decide it
- A same-batch comparison isolates ranker behaviour: score the same candidates with both rankers and grade the returned answers against an independent criterion. A same-budget comparison concerns whole plans with different numbers of candidates; the two answer different questions.
- One proposed same-budget design: pregenerate six candidates per prompt and give the expensive plan a four-candidate subset fixed in advance, chosen without looking at the truth. Keep prompts grouped, count generation, scoring and setup in the same units, keep the cost of the evaluation separate from the cost of deploying either plan, and choose the strategy on different prompts from those used to evaluate it.
- Measure the real ranker’s correctness directly rather than forcing it into this two-regime toy. An evaluator’s own high scores cannot establish that it is right.
A defensible provisional move: keep the affordable noisy plan for now and ask for that comparison, naming what could reverse the choice (here, r, or the real ranker’s behaviour). This is an exercise in designing evidence; no study, model run or data collection happens here.
From a paper to a test
Did the selector improve?
A higher success rate can come from a different ranking rule or a different set of available answers. Compare both rules on exactly the same draws before attributing the difference.
Source question. Lightman et al. report 78.2% for a large process-supervised reward model, 72.4% for an outcome-supervised model and 69.6% for majority voting at best-of-1860 on 500 held-out MATH problems (§3). Their large training sets differ, so this observation alone does not isolate the effect of supervision. Below we investigate a smaller question: what changes when supplied scores select from the same answers?
An invented pool. Six slots for one problem. A and B have correct final answers, C and D have wrong answers, E returned output with no answer, and F is missing. The scores and final-answer grades are made up for teaching; scores are not probabilities, and this example does not reproduce the paper’s percentages.
Take 2 of six slots → remove missing or unanswered entries → choose the first highest score → count its supplied grade, or failure if empty. N counts sampled slots, not guaranteed answers.
Try one-slot draws, or scores that keep their order
One draw leaves no choice to a selector. Squaring these nonnegative scores changes their sizes but keeps their order. That holds for picking the single highest score; the earlier example that sums scores by answer can behave differently.
One matched draw · A, C
| Slot | Baseline | Changed | Grade |
|---|---|---|---|
| A | 0.3 | 0.9 | Correct |
| C | 0.95 | 0.7 | Wrong |
Baseline returns C; changed rule returns A. The grade is read after selection. Neither rule can create an answer that was not drawn.
All 30 equally likely ordered draws
Across these same draws, the baseline succeeds on 10/30 and the changed rule on 18/30. A correct eligible answer is available in 18/30 draws. 2/30 leave no eligible answer and count as failures.
Changed-only successes: 8. Baseline-only successes: 0. Paired difference: (8 − 0)/30 = 8/30.
Exact enumeration of one invented pool, without replacement. These are not independent measured problems or an uncertainty interval.
The changed ranking wins on eight ordered draws where the baseline fails. Both see exactly the same candidates. The two unanswered slots still consume a place in a draw. An empty eligible set remains a failure.
Inspect the pool and every ordered draw
Order matters for a tie: the first sampled candidate wins. This differs from the tie rule by ID in the aggregation example above. These selectors take one highest-scored candidate; they do not sum weights by answer. Empty results are shown as “None”.
| Slot | Answer | Baseline | Changed | Grade |
|---|---|---|---|---|
| A | Present | 0.3 | 0.9 | Correct |
| B | Present | 0.4 | 0.8 | Correct |
| C | Present | 0.95 | 0.7 | Wrong |
| D | Present | 0.6 | 0.2 | Wrong |
| E | No answer | 1 | 1 | No eligible answer |
| F | Missing slot | — | — | No eligible answer |
| Draw | Eligible | Baseline → grade | Changed → grade |
|---|---|---|---|
| A, B | A, B | B → correct | A → correct |
| A, C | A, C | C → wrong | A → correct |
| A, D | A, D | D → wrong | A → correct |
| A, E | A | A → correct | A → correct |
| A, F | A | A → correct | A → correct |
| B, A | B, A | B → correct | A → correct |
| B, C | B, C | C → wrong | B → correct |
| B, D | B, D | D → wrong | B → correct |
| B, E | B | B → correct | B → correct |
| B, F | B | B → correct | B → correct |
| C, A | C, A | C → wrong | A → correct |
| C, B | C, B | C → wrong | B → correct |
| C, D | C, D | C → wrong | C → wrong |
| C, E | C | C → wrong | C → wrong |
| C, F | C | C → wrong | C → wrong |
| D, A | D, A | D → wrong | A → correct |
| D, B | D, B | D → wrong | B → correct |
| D, C | D, C | C → wrong | C → wrong |
| D, E | D | D → wrong | D → wrong |
| D, F | D | D → wrong | D → wrong |
| E, A | A | A → correct | A → correct |
| E, B | B | B → correct | B → correct |
| E, C | C | C → wrong | C → wrong |
| E, D | D | D → wrong | D → wrong |
| E, F | None | None → failure | None → failure |
| F, A | A | A → correct | A → correct |
| F, B | B | B → correct | B → correct |
| F, C | C | C → wrong | C → wrong |
| F, D | D | D → wrong | D → wrong |
| F, E | None | None → failure | None → failure |
Trace this question to the paper and released code
The paper’s §4.1 separately compares three forms of supervision on identical training solutions: process labels from a large reward model, outcome labels from that model, and final-answer outcome labels. This is distinct from the large-model comparison above. A final-answer grade does not certify the reasoning.
The released evaluation script pads incomplete pools, shuffles, takes N slots, filters unanswered records, chooses the highest score, then reads the selected record’s existing is_correct label. Our finite calculation preserves this order and its first-in-list tie rule. It substitutes invented slots and exhaustive enumeration for the released data and random trials.
Pairing both rules on identical draws is our added control: the released script runs one method at a time, with fresh shuffles. We checked its selection behavior on our invented inputs. We did not rerun the reported accuracy, train reward models or obtain new model outputs. Its problem denominator and our ordered-draw count are different quantities.
The paper scores a solution by multiplying its step probabilities (§2.6), counting neutral steps as positive (Appendix F.2). Here we supply one number per solution instead. The evaluation script does not produce those scores, grade mathematics or implement majority voting. Its denominator counts the problems present in its input; a problem missing from the input entirely would need a separate list to be noticed.
Filtering before sampling also differs from discarding empty results afterwards. At N = 2, dropping only the two empty original draws would give 10/28 and 18/28. It would not give 2/12 and 10/12.
Choose a test that could change your mind
A controlled intervention changes one specified part while retaining a comparison. Here change the selector while holding the prompts, candidate slots, N, eligibility, tie rule and grading fixed. A headline comparison that also changes which candidates are available leaves those effects entangled.
For a held-out evaluation, record paired wins and losses, failures, and candidate availability. A positive paired difference supports better selection in that setting; a negative difference weakens that claim. Zero can hide offsetting wins and losses, so inspect the paired record. Both ranking and availability can matter. These possible results are a proposed test, not new observations.
This tests frozen selectors. A claim about how supervision caused a better trained model requires a separate training comparison with matched examples, architecture, budget and evaluation. Neither replaying this toy nor repeating a source percentage establishes that claim.
The mathematics
For one prompt , let the base model define a finite distribution over complete candidate traces. Each trace has hidden task correctness and a verifier score:
Best-of- draws independent traces from and returns the sampled trace with the highest verifier score. Assume verifier scores are distinct and sort traces from lowest to highest verifier score, so :
Where the rank formula comes from. Fix a verifier and number the traces by its score, lowest first. is the cumulative rank: the probability that a single draw ranks at or below trace . The returned trace ranks at or below exactly when every one of the draws does. If the draws are independent, those events multiply, so the returned trace ranks at or below with probability . Subtracting , the probability that every draw ranks strictly below , leaves , the probability that trace is returned. Here is a position in one verifier's order, not a trace's identity: clean correct is rank 4 of 4 under the clean verifier and rank 3 under the noisy one, where the exploit takes rank 4. Coverage uses the same assumption through the complement: with the probability that one draw is correct, all draws miss with probability .
Three quantities stay distinct. An event probability, such as for an ordered pair, says how often one particular set of draws occurs. A cumulative rank describes a single draw under a single verifier. Selected correctness adds up the event probabilities of every outcome whose returned trace is correct. Coverage and are unconditional: they average over every batch of draws, including batches with no correct trace. Conditional on a batch containing a correct trace, the noisy verifier at returns one with probability .
The worked case, . The four traces are common wrong, plausible slip, clean correct and rare exploit, with ; only clean correct has , so and coverage is for either verifier. The clean verifier ranks clean correct highest, with just below it and at it, so : every outcome that covers a correct trace returns it. The noisy verifier puts rare exploit above it, with below and at it, so . The difference, , is the event probability of the worked pair in its two orders. They are the only outcomes of the sixteen whose returned trace depends on the verifier, because the exploit's score is the only score that changes. Enumerating the sixteen outcomes directly gives the same three numbers; the second code block below does exactly that.
To connect back to process reward models, a trace score might be an additive step score:
Treat this as a ranking score, not a calibrated probability of correctness. Sum-vs-mean aggregation, length normalization, and distribution shift can all change which traces receive high verifier score. This generic within-trace sum is not the exact convention of either paper: Lightman et al. multiply step-level probabilities, counting neutral steps as positive (§2.6, Appendix F.2), and Snell et al. reduce each solution to its final-step prediction, then sum those predictions across solutions that reach the same final answer (§5.1). The sum here runs over the steps of one trace, not over candidates, and the page's four trace scores are totals chosen by hand, not reconstructed from step-level data.
The expected selected verifier score is
Selected correctness and sampled-correct coverage can be very different. Sampling a correct trace is coverage. Returning it is selection. More samples can make rise while falls if the highest-scoring trace is a verifier error.
A simple cost model is
Here is only a teaching proxy for inference budget. Real serving cost also depends on generation length, verifier cost, batching, latency, and traffic volume.
Boundaries
One draw. At there is nothing to choose between: under any verifier, and selected correctness equals coverage. A verifier matters only once .
Ties. The rank formula assumes distinct scores. With ties, which trace is returned depends on a tie-break rule, and that rule must be stated before is defined.
Dependent draws. Both and come from multiplying probabilities, which is exactly the independence assumption. Suppose instead that the second attempt is a copy of the first, as when a harness reuses a cached output. Each attempt is still correct with probability , but the two fail together:
For a code patch that passes with probability , two copies cover a passing patch with probability , not . No verifier can repair this, because a verifier can only return an attempt that was sampled. Positively correlated attempts land between the two cases; attempts forced to differ can do better than independent ones. A success rate averaged over many prompts needs the same care. Suppose draws are independent given the prompt, but the per-prompt success probability differs between prompts, with mean . Because is concave in , the average coverage is at most , with equality when every prompt has the same or when . The formula with an averaged rate is then an upper bound, not the coverage.
Choosing within a budget
In abstract units of a single compute resource, generating a trace costs and scoring one trace costs or ; every trace in a scored plan is scored. A scored plan with ranker and draws, , costs and is correct with probability
where is a one-time setup charge, zero unless stated. One unscored draw costs and is correct with probability ; with a single draw there is nothing to choose between, so no scoring is charged. That makes actions. Within a budget the decision is
taken over every affordable action, with exact ties broken by lower cost and then by plan ID. If nothing is affordable (), no answer is produced, which is not an answer with zero accuracy. The objective is correctness within the budget, not correctness per unit, and the budget is a limit: unused units are allowed. Every action affordable at stays affordable at , so the best attainable correctness never decreases as grows, even though the preferred ranker can switch: clean at (), noisy at (), clean at (). At noisy is affordable but gives , below noisy . That is a reason not to buy the larger batch, decided before buying it; it is not a rule for stopping after seeing samples.
A one-time setup charge on this prompt, a hypothetical charge chosen to show what omitted overhead can do, makes clean cost 16 and clean cost 10, so at noisy wins. No candidate, probability or score changed. Snell et al. (§3.2) estimate prompt difficulty from 2,048 samples per question, exclude that cost from their comparisons and discuss reusing the estimation work during inference; genuinely reused work counts once, neither twice nor zero. Their §5.3 charges lookahead search generation-equivalents. Neither is a measured price, and the four units here neither estimate the paper's excluded overhead nor reverse its findings.
Two operations that must stay separate
Within one solution, a reduction turns step scores into one weight: the last step , the product , or the sum , which is the additive score of the third equation above. For the example step scores and , the last step ranks first ( against ), while the product ( against ) and the sum ( against ) rank first.
Across solutions, a rule returns one answer from a batch of candidates with final-answer keys and weights . Returning the highest single candidate takes . Summing by final answer takes
over distinct candidate IDs; a repeated ID is rejected rather than counted twice. In batch M1 (a1: A, 0.60; a2: A, 0.60; b1: B, 0.90) the highest candidate answers B, while . In M2 (a1: A, 0.90; b1 and b2: B, 0.60 each) the two rules swap. Squaring M1's weights keeps every candidate's order but gives , so grouped sums depend on magnitudes, not only on order. Totals above 1 are sums of weights, not probabilities. Ties go to the smallest candidate ID or answer key, a teaching convention rather than either paper's, and neither rule reads the correct answer, which is used only to grade the result. The cumulative-rank formula above describes the highest-trace rule; it does not become a formula for grouped sums.
Snell et al. (§5.1, Appendix D) train their verifier on Monte Carlo continuation returns under the base model's sampling policy, reduce each solution to its final-step prediction and sum by final answer. Lightman et al. (§2.1, §2.6, Appendix F.1–F.2) train on step labels, count neutral steps as positive in their main convention, multiply step probabilities, and evaluate the highest-scored solution against a separate final-answer grade. The targets differ, so scores in from the two are not interchangeable. M1 and M2 hold the weights fixed and change only the across-solution rule, so neither is a complete implementation of either paper.
When the ranker itself is uncertain
Replace the known-clean ranker with an unvalidated proposed ranker at the clean price, with and no setup charge. For a whole batch, chosen once and independently of the draws, it uses the clean ordering with probability and the noisy ordering otherwise, so
Against noisy (), both at cost 12, the proposed plan is better exactly when . Over the assumed range it runs from to , so the stated information does not identify a better plan. The range is not a confidence interval or a measurement. For a given the formula gives expected correctness conditional on that ; at , for example, it is . The range supplies no distribution or mean for the unknown , so it does not identify expected correctness averaged over that uncertainty, and its midpoint is a what-if value, not an estimate of . Were the known-clean plan still available, its would beat both options for every allowed , and nothing would be unresolved; the proposed plan reaches it only at , outside that range, where the two are equal.
Matched candidate pools
The source-to-test investigation uses a separate finite pool of six slots: A and B have correct final answers, C and D have wrong answers, E contains no answer and F is missing. The two score columns are invented. They are neither probabilities nor measurements from a model.
Let be the number of distinct slots drawn. An ordered prefix samples uniformly without replacement from a shuffled pool. Thus the set contains 6 prefixes when and when . This is different from the independent draws in the earlier model. Remove E and F only after the draw; they still consume a slot. Among the remaining candidates, selector returns the highest score under rule , keeping the first in sampled order on a tie. It returns no answer for an empty eligible set. Let be 1 for a correct final answer and 0 otherwise, including no answer. Selection never reads .
These are exact averages over a finite, fully specified calculation, not estimates from 30 independent observed problems. At , the baseline succeeds in 10/30 prefixes and the changed ranking in 18/30, giving . Both see a correct candidate in 18/30 prefixes. Neither returns an answer in 2/30. For example, on (A,C) the baseline chooses C and the changed ranking chooses A; the candidate availability did not change.
The counts have a direct check: 12 ordered pairs contain neither A nor B, so contain a correct answer. Baseline succeeds only on A/B together (two orders), or on one of A/B paired with E/F (eight orders): . The changed scores rank both correct candidates above both wrong ones, so all 18 available correct answers are selected. E/F together gives the two empty orders. Availability of any eligible answer is 28/30, a different quantity from availability of a correct answer.
Removing E/F before sampling defines a conditional question over four answered candidates. Its denominator is , with 2/12 and 10/12 successes. A percentage difference between the two sampling orders cannot isolate a ranking change. Squaring these nonnegative baseline scores preserves their order and every selection; a different score magnitude alone is not evidence of a better selector. A controlled comparison changes the scoring rule on the same prefixes, while preserving eligibility, ties and grading. Filtering first conditions on all sampled slots being answered. Merely dropping the two empty original outcomes instead would give 10/28 and 18/28; it would not give the filter-first results. A zero paired difference alone does not imply unchanged choices: wins and losses can cancel.
Try it
First a worked example, then one to finish, then problems on your own. Check your answer before you look at the solution. Answers typed here are not kept when you leave.
1 · Worked example
One pair, then all sixteen outcomes
Best-of-2 on the page's four traces, with for common wrong, plausible slip, clean correct and rare exploit; only clean correct is correct, and the two draws are independent. Follow the fixed pair (clean correct, rare exploit) through both verifiers, then add up all sixteen ordered outcomes.
The pair's event probability. Independent draws multiply: . The other order has the same probability. This says how often these exact draws happen, and nothing yet about what is returned.
Say the next step to yourself first.2 · Finish it
Add a third draw
Now with the noisy verifier. Adding a draw changes the number of independent draws, and so the distribution of outcomes; switching the verifier changes neither. Find the probability that the returned trace is correct, to three decimal places. The first steps are done. A hint is available before the solution.
Coverage. , up from at .
Cumulative ranks under the noisy verifier. They describe a single draw, so does not change them: just below clean correct and at it.
- Your turn.
3 · On your own
Two patches that are one patch
A coding agent writes a patch for a failing test, and each attempt passes the hidden tests with probability . The harness asks for a second attempt, but the second attempt repeats the first exactly: same prompt, same cached output. A colleague says that two attempts pass with probability .
What is the probability that at least one attempt passes? In a sentence or two, say which assumption decides it and whether a better verifier would change it.
Conditions: on-page practice beside this lesson, and the prompt states the key fact, that the second attempt is a copy. Write your first answer before opening the rubric; a calculator is fine.
4 · On your own
Copy or fresh, with a selector that discards
Two ways to get two code patches for the same task. Copy runs once and submits the output twice, so the two patches are identical. Fresh draws the two patches independently. In both designs each patch passes the hidden tests with probability , and the same selector then returns one patch. Assume the selector returns the failing patch whenever exactly one of the two passes.
For each design, find the probability that a passing patch is available and the probability that the returned patch passes, and say which outcomes you counted for each number.
This scenario is separate and does not change the page's four traces. Write your first answer before opening the rubric; a calculator is fine.
5 · On your own
A failed return, with one grade missing
Your decision: find out why this recorded return failed before choosing which stage to improve. A fixed test suite supplies a deterministic pass/fail criterion for this exercise; passing it would not establish correctness for every possible input.
The stored batch contains two code patches. The selector returns the larger ranking score. The scores are not pass probabilities.
Patch A: Score 0.91; returned; independently tested and failed.
Patch B: Score 0.63; not returned; test not run.
Generation costs 2 units per patch, scoring costs 1 per patch, and testing costs 1 per patch. The recorded batch has spent units, including A's test. The total budget is 9, leaving 2. Reusing a stored patch or score adds no generation or scoring charge; there is no setup charge.
Only three next actions are available: test stored B for 1 unit; run a new complete two-patch plan for 7 (generate and score both, then test the returned patch); or stop for 0. No hybrid plans or outcome probabilities are supplied.
Give two complete grading assignments consistent with the record. Choose a next action, account for its cost, and explain what either result would establish and leave unknown.
Separate record: the same complete plan is requested with a total budget of 6. Its policy checks affordability before doing anything and rejects the whole plan if 7 units are unavailable. What is spent, what is returned, and is there a failed patch grade?
Conditions: optional on-page practice, with this lesson available. Write an answer before comparing. The answer and the Python code expose the reasoning; viewing either is help, not an uncued assessment. No patch or test is executed here.
6 · On your own
What the number measures
A report says: "Each of our four sampled answers is correct with probability , and they are sampled independently, so best-of-4 is correct with probability ." The system returns the answer that a learned reward model scores highest, and that reward model sometimes scores a confident wrong answer above a correct one. What does measure? Conditions: on-page multiple choice beside this lesson, so the setting and the four options are themselves cues; this is practice, not an uncued test. Choose before opening the hint.
7 · Worked example
Twelve units, two rankers
With no setup charge and a budget of 12 units, find the best plan. Generating a trace costs 1 unit; scoring it costs 1 with the noisy ranker and 2 with the clean one; every trace in a scored plan is scored; one unscored draw costs 1. The budget section above shows the same numbers.
Costs. A noisy plan with draws costs , a clean plan , and one unscored draw . Within 12 units the noisy ranker can afford up to and the clean ranker up to .
Say the next step to yourself first.8 · Finish it
Count the setup charge
Same budget of 12 units, but choosing the clean scored plan now costs a one-time setup charge of 4 units on this prompt, in addition to its per-trace costs. Which plan is best? The setup control in the budget section shows the answer.
Clean costs. : costs 10, and would cost 13, over budget.
Noisy costs are unchanged: , so still costs 12.
- Your turn.
9 · On your own
Highest candidate or most-supported answer
Batch M2 has three candidates: a1 answers A with weight 0.90; b1 and b2 answer B with weight 0.60 each. The correct answer, given separately, is A. Which answer does each rule return? The aggregation section above shows this batch.
10 · On your own
Nine units, then ten
With no setup charge, compare the best plans at budgets of 9 and 10 units: their cost, selected correctness and unused units. Conditions: guided self-check. The budget section's plot and table already show the answer, so this is answer-exposed practice; write your answer before opening the rubric.
11 · On your own
What would you ask for?
In the separate scenario at the end of the budget sections, you can buy noisy or a proposed expensive ranker with , both for 12 units. The proposed ranker orders a whole batch like the clean ranker with an unknown probability , known only to lie in . What would you do now, and what evidence would settle the choice? Write your first answer before opening the rubric.
12 · On your own
An improvement with two things changed
A report compares two selectors on one invented problem. A and B have correct final answers; C and D are wrong. E is a returned record with no answer; F is missing. All grades are supplied, not computed by the selector. There are six distinct slots, and is sampled uniformly without replacement. Select the first highest-scored eligible candidate in the sampled order.
- A: baseline 0.30; challenger 0.65.
- B: baseline 0.40; challenger 0.55.
- C: baseline 0.95; challenger 0.85.
- D: baseline 0.60; challenger 0.15.
The report compares the baseline's success when sampling all slots before filtering with the challenger's after filtering to answered slots first. It attributes the rise from to to better ranking.
State the source claim this question relates to and its limit. Judge the ranking explanation, choose a comparison that could discriminate it, and calculate or justify its result. State what positive, zero and negative paired results would imply. What intervention does this check, and what additional comparison would a claim about training supervision require?
Missing record: another report gives only these two percentages, with no candidate list, score version, missingness record or grading rule. What conclusion and next action are justified?
Conditions: optional on-page practice with the source account available. Keep a first answer in your own notes before opening the rubric; a calculator and scratch work are allowed. The live calculation, Python, hints or outside assistance count as help. The page does not preserve an assessment record or establish independent learning.
13 · On your own
What result did you actually repeat?
You run the fifth Python example and obtain 10 baseline successes and 18 changed-score successes over 30 ordered draws. You also see that its selections agree with the pinned source's selection procedure on the six invented slots. A note says: “We replicated the published process-supervision advantage.”
Replace that note with an accurate positive account: name the result, versioned inputs, conditions, exact agreement criterion and scope. Which part of the source was checked, and which ingredients would still be needed to repeat its empirical result?
Record your statement before reading the answer, and name any code, source or outside help you used. No model evaluation runs in this page; if you rerun the code, keep its output yourself.
The code
This code uses the same four-trace model as the demo. With a clean verifier, more samples improve selected correctness. With a noisy verifier, selected verifier score improves while true correctness eventually falls.
def selected_distribution(candidates, n):
ranked = sorted(candidates, key=lambda item: item["score"])
cumulative = 0.0
selected = {}
for item in ranked:
p = item["prior"]
next_cumulative = cumulative + p
selected[item["id"]] = next_cumulative ** n - cumulative ** n
cumulative = next_cumulative
return selected
def expected(candidates, selected, key):
return sum(selected[item["id"]] * item[key] for item in candidates)
def scored(candidates, mode):
return [{**item, "score": item[f"{mode}_score"]} for item in candidates]
def expected_accuracy(candidates, n, mode):
rows = scored(candidates, mode)
return expected(rows, selected_distribution(rows, n), "correct")
def expected_score(candidates, n, mode):
rows = scored(candidates, mode)
return expected(rows, selected_distribution(rows, n), "score")
candidates = [
{"id": "common_wrong", "prior": 0.50, "correct": 0, "clean_score": -2.0, "noisy_score": -2.0},
{"id": "plausible_slip", "prior": 0.25, "correct": 0, "clean_score": -0.3, "noisy_score": -0.3},
{"id": "clean_correct", "prior": 0.18, "correct": 1, "clean_score": 1.8, "noisy_score": 1.8},
{"id": "rare_exploit", "prior": 0.07, "correct": 0, "clean_score": 0.2, "noisy_score": 2.6},
]
clean_1 = expected_accuracy(candidates, 1, "clean")
clean_32 = expected_accuracy(candidates, 32, "clean")
noisy_1 = expected_accuracy(candidates, 1, "noisy")
noisy_64 = expected_accuracy(candidates, 64, "noisy")
assert clean_32 > clean_1
assert noisy_64 < noisy_1
assert expected_score(candidates, 64, "noisy") > expected_score(candidates, 1, "noisy")
print(round(clean_32, 3), round(noisy_64, 3))
The same functions give the worked case. This check enumerates all sixteen ordered outcomes of two independent draws without using the closed form, then compares:
from itertools import product
def enumerate_outcomes(candidates, n, mode):
rows = scored(candidates, mode)
totals = {"coverage": 0.0, "selected_correct": 0.0}
for draws in product(rows, repeat=n):
probability = 1.0
for item in draws:
probability *= item["prior"] # independent draws: probabilities multiply
returned = max(draws, key=lambda item: item["score"])
totals["coverage"] += probability * any(item["correct"] for item in draws)
totals["selected_correct"] += probability * returned["correct"]
return totals
clean = enumerate_outcomes(candidates, 2, "clean")
noisy = enumerate_outcomes(candidates, 2, "noisy")
assert abs(clean["coverage"] - 0.3276) < 1e-12 and abs(noisy["coverage"] - 0.3276) < 1e-12
assert abs(clean["selected_correct"] - 0.3276) < 1e-12
assert abs(noisy["selected_correct"] - 0.3024) < 1e-12
assert abs(noisy["selected_correct"] - expected_accuracy(candidates, 2, "noisy")) < 1e-12
print(round(clean["selected_correct"] - noisy["selected_correct"], 4)) # 0.0252
# A copied second attempt adds no coverage: the complement rule needs independence.
p_patch = 0.5
independent = 1 - (1 - p_patch) ** 2 # 0.75
copied = 1 - (1 - p_patch) # 0.5: both attempts fail together
print(independent, copied)
The budget and replacement calculations reuse the same expected_accuracy. Separate fixed-batch selectors reproduce the two aggregation rules; they return an answer for a given batch and do not estimate either rule's expected accuracy. This check enumerates all 255 actions, compares every affordable one at each budget, runs both selectors on the example batches and recomputes the crossover values shown on the page:
SCORE_COST = {"noisy": 1, "clean": 2} # abstract units; generating a trace costs 1
def actions(clean_setup=0):
plans = [{"id": "direct", "n": 1, "cost": 1, "correct": 0.18}]
for ranker in ("clean", "noisy"):
setup = clean_setup if ranker == "clean" else 0 # once per prompt, not per trace
for n in range(2, 129):
plans.append({"id": f"score-{ranker}-{n:03d}", "n": n,
"cost": n * (1 + SCORE_COST[ranker]) + setup,
"correct": expected_accuracy(candidates, n, ranker)})
return plans
def best_within(budget, clean_setup=0):
feasible = [p for p in actions(clean_setup) if p["cost"] <= budget]
if not feasible:
return None # nothing is returned, which is not an answer with zero accuracy
return min(feasible, key=lambda p: (-p["correct"], p["cost"], p["id"]))
assert len(actions()) == 255 and best_within(0) is None
best_at = {1: "direct", 6: "score-noisy-003", 9: "score-clean-003", 10: "score-noisy-005",
12: "score-clean-004", 14: "score-clean-004"}
assert all(best_within(b)["id"] == plan for b, plan in best_at.items())
assert best_within(12, clean_setup=4)["id"] == "score-noisy-006"
best = [best_within(b) for b in range(1, 25)]
assert all(a["correct"] <= b["correct"] for a, b in zip(best, best[1:]))
def check_batch(batch):
ids = [cid for cid, _, _ in batch]
if not batch or len(ids) != len(set(ids)):
raise ValueError("a batch needs candidates with distinct IDs") # a repeated ID is ambiguous
if not all(0.0 <= w <= 1.0 for _, _, w in batch): # NaN fails every comparison
raise ValueError("each candidate weight must lie in [0, 1]")
def highest_individual(batch):
check_batch(batch)
return min(batch, key=lambda c: (-c[2], c[0]))[1] # ties: smallest candidate ID
def sum_by_answer(batch):
check_batch(batch)
totals = {}
for cid, answer, weight in sorted(batch): # sum in candidate-ID order; totals may exceed 1
totals[answer] = totals.get(answer, 0.0) + weight
return min(totals, key=lambda a: (-totals[a], a)) # ties: smallest answer key
M1 = [("a1", "A", 0.60), ("a2", "A", 0.60), ("b1", "B", 0.90)]
M2 = [("a1", "A", 0.90), ("b1", "B", 0.60), ("b2", "B", 0.60)]
M1_squared = [(cid, answer, w * w) for cid, answer, w in M1]
print([(highest_individual(m), sum_by_answer(m)) for m in (M1, M2, M1_squared)])
# [('B', 'A'), ('A', 'B'), ('B', 'B')]
a_clean4 = expected_accuracy(candidates, 4, "clean")
a_noisy4 = expected_accuracy(candidates, 4, "noisy")
a_noisy6 = expected_accuracy(candidates, 6, "noisy")
crossover = (a_noisy6 - a_noisy4) / (a_clean4 - a_noisy4)
low, high = (r * a_clean4 + (1 - r) * a_noisy4 for r in (0.2, 0.6))
print(round(crossover, 12), round(low, 9), round(high, 9)) # 0.321475613563 0.454892256 0.501385248
A partial patch record
The optional patch-record exercise changes the evidence available to the reader. These two stored patches and their costs are a separate example, not additional traces in the four-trace distribution above. The function below constructs records from supplied grades; it does not execute patches or tests. False means a test failed; None means no grade exists. Selection reads only ranking scores. The two compatible completions are not assigned probabilities.
PATCH_SCORES = {"A": 0.91, "B": 0.63}
PATCH_GENERATION_COST = 2
PATCH_SCORING_COST = 1
PATCH_TEST_COST = 1
PATCH_PLAN_COST = 2 * PATCH_GENERATION_COST + 2 * PATCH_SCORING_COST + PATCH_TEST_COST
def patch_record(budget, supplied_grades):
# A whole-plan preflight: no partial generation when the plan cannot fit.
if budget < PATCH_PLAN_COST:
return {"candidate_ids": [], "scores": {}, "returned": None,
"returned_grade": None, "spent": 0}
returned = max(PATCH_SCORES, key=PATCH_SCORES.get) # scores, never grades
return {"candidate_ids": list(PATCH_SCORES), "scores": dict(PATCH_SCORES),
"returned": returned, "returned_grade": supplied_grades[returned],
"spent": PATCH_PLAN_COST}
patch_complete_grades = [{"A": False, "B": True}, {"A": False, "B": False}]
patch_records = [patch_record(9, grades) for grades in patch_complete_grades]
assert patch_records[0] == patch_records[1] # same visible record, different availability
print([any(grades.values()) for grades in patch_complete_grades]) # [True, False]
patch_remaining = 9 - patch_records[0]["spent"]
assert PATCH_TEST_COST <= patch_remaining < PATCH_PLAN_COST
print(patch_records[0]["spent"] + PATCH_TEST_COST, patch_remaining - PATCH_TEST_COST) # 8 1
print(patch_record(6, patch_complete_grades[0]))
# {'candidate_ids': [], 'scores': {}, 'returned': None, 'returned_grade': None, 'spent': 0}
Testing stored B would distinguish these completions for this batch. The code supplies both possible grades to check the logic; the observation record exposes only the grade of the returned patch. It estimates no success rate or future policy value. Compare the same separation of search record and missing answer key.
A matched-pool selection check
This standalone Python program enumerates the same finite prefixes as the source-to-test section. It needs only the standard library. The public PRM800K evaluation code is the source for the sampling and selection procedure; the following program, its six slots and paired comparison are our own. Running it repeats this small calculation, not the published model evaluation. Preserve the code, ordered pool, scores and grades, , filtering order, tie rule and exact count criterion to repeat this result.
from itertools import permutations
# id, answer, baseline score, changed score. F is a missing slot.
POOL = (("A", "right", .30, .90), ("B", "right", .40, .80),
("C", "wrong-c", .95, .70), ("D", "wrong-d", .60, .20),
("E", None, 1., 1.), ("F", None, None, None))
GRADES = {"A": True, "B": True, "C": False, "D": False,
"E": False, "F": False}
def inspect(pool=POOL, n=2, before=False, monotone=False, grades=GRADES):
# A small finite pool: up to six slots; one or two drawn.
if n not in (1, 2) or not 1 <= len(pool) <= 6:
raise ValueError("Use one or two draws from at most six slots")
if monotone:
scores = [s[2] for s in pool if s[1] is not None]
if any((a < b) != (a*a < b*b) for a in scores for b in scores):
raise ValueError("Squared scores lose floating-point ordering")
universe = [s for s in pool if s[1] is not None] if before else pool
if len(universe) < n:
raise ValueError("Not enough slots")
traces = []
for drawn in permutations(universe, n):
retained = [s for s in drawn if s[1] is not None]
# max keeps the first in this sampled order on a tie.
base = max(retained, key=lambda s: s[2]) if retained else None
changed = (max(retained, key=lambda s: s[2]**2 if monotone else s[3])
if retained else None)
traces.append(dict(
drawn=[s[0] for s in drawn], eligible=[s[0] for s in retained],
baseline=base[0] if base else None,
changed=changed[0] if changed else None,
baselineCorrect=bool(base and grades[base[0]]),
changedCorrect=bool(changed and grades[changed[0]]),
covered=any(grades[s[0]] for s in retained)))
b = sum(r["baselineCorrect"] for r in traces)
c = sum(r["changedCorrect"] for r in traces)
return dict(traces=traces, total=len(traces), baselineCorrect=b,
changedCorrect=c, covered=sum(r["covered"] for r in traces),
empty=sum(not r["eligible"] for r in traces),
changedOnly=sum(r["changedCorrect"] and not r["baselineCorrect"] for r in traces),
baselineOnly=sum(r["baselineCorrect"] and not r["changedCorrect"] for r in traces),
difference=c-b)
if __name__ == "__main__":
for before in (False, True):
for monotone in (False, True):
r = inspect(before=before, monotone=monotone)
print("filter before:", before, "squared scores:", monotone,
"correct:", r["baselineCorrect"], r["changedCorrect"],
"out of", r["total"], "paired difference:", r["difference"])
The exact released source uses an explicit None eligibility test. Its
first-in-sampled-order tie rule is preserved here. The source CLI evaluates
one method per invocation with fresh shuffles; applying both to the same
prefixes is our added control. We substitute six invented slots and exhaustive
enumeration for the released scored corpus and random subsampling, and we do
not train, generate, score or regrade model solutions. The source artifact's
represented-problem denominator is different from this program's prefix count.
The source checks its stored is_correct labels; it does not run an answer
grader. Its absent answer key can fall back to given_answer, while an
explicit null cannot; the example here uses nonempty strings or null.
For these nonnegative example scores, squaring preserves order in both real
and floating-point arithmetic. The program rejects an ordering lost through
floating-point rounding or underflow instead of calling a new tie equivalent.
Keep it
In best-of-, what is the difference between coverage and selected correctness?
Answer from memory, then check
Coverage is the chance that at least one of the draws is correct: for independent draws, with no verifier involved. Selected correctness is the chance that the trace the verifier returns is correct. Selection never exceeds coverage. At they are equal under any verifier; for they are equal only when the verifier ranks every correct trace above every wrong trace that can be drawn.
Why is the chance that trace is returned equal to ?
Answer from memory, then check
The returned trace ranks at or below exactly when all draws do, which has probability when the draws are independent. Subtracting , the chance that every draw ranks strictly below , leaves the chance that the best draw is exactly trace .
On this page, keep the generator and fixed and switch from the clean verifier to the noisy verifier, which ranks the rare exploit above the correct trace. Which changes: coverage, selected correctness, or both?
Answer from memory, then check
Only selected correctness. Coverage depends on the generator's distribution and , and neither changed. On this page, coverage stays at while selection falls from to .
How can drawing more samples lower selected correctness?
Answer from memory, then check
If a rare wrong trace outscores the correct one, every extra draw is another chance to draw it, and once drawn it is returned. With this page's noisy verifier, selected correctness peaks at (about ) and falls to about by , while coverage keeps rising.
A team reruns a model five times per problem with greedy decoding, which gives the same output every time for the same prompt, and counts a problem solved if any run passes. One run solves 40% of problems. What fraction does the five-run version solve?
Answer from memory, then check
40%. The five runs are copies, so a problem that fails once fails every time, and coverage does not grow. would assume independent attempts. With fresh samples that are independent given the problem but solve rates that differ between problems, with the averaged rate is an upper bound on the fraction solved, exact only when every problem has the same rate.
Why can the best plan within a budget leave units unused?
Answer from memory, then check
The objective is the chance of a correct answer, not spending. At 14 units the best plan is still clean at cost 12: noisy fits but gives , below noisy , and clean would cost 15.
When do "return the highest-weight candidate" and "sum the weights for each final answer" disagree, and which is right?
Answer from memory, then check
When several lower-weight candidates share an answer. In M1 two candidates at 0.60 outvote one at 0.90 and the sum is right; in M2 the same rule is wrong. Squaring M1's weights keeps every candidate's order but reverses the grouped winner, so grouped sums depend on magnitudes, not only on order. Neither rule is right in general.
Recalling an answer from memory makes it last longer than rereading it (Roediger and Karpicke, 2006). Add these 7 cards and they come back tomorrow, then after gaps of 3, 7, 16, 35 and 75 days while you still remember them. They stay in this browser only.
The edge
This page ranks complete traces with one fixed verifier and a fixed . Practical systems decide how many samples each prompt deserves, combine verifier scores with majority voting, and search over partial traces instead of complete ones. Brown et al. (2024) report coverage rising with the number of samples over four orders of magnitude across tasks and models, while picking among samples by majority vote or a reward model plateaus beyond several hundred samples in domains without an automatic verifier. Snell et al. (2024) find that the best way to spend inference compute depends on how hard the prompt is for the model. How to allocate compute when the verifier is itself imperfect, and how to tell when it is, remain open.