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-NN is the simplest way to spend more compute after a prompt arrives. The model samples NN 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-NN 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 0.500.50), plausible slip (0.250.25), clean correct (0.180.18, the only correct one) and rare exploit (0.070.07), 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 2.62.6, above the correct trace's 1.81.8. It is not random: it is a fixed misranking that gives the exploit 2.62.6 every time.

One pair, two verifiers. Take N=2N = 2 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 4×4=164 \times 4 = 16 ordered outcomes, and the second panel draws each one as a rectangle whose area is its probability, pi×pjp_i \times p_j. A correct trace is missed only in the 0.82×0.820.82 \times 0.82 block where neither draw is clean correct, so coverage is 1−0.822=0.32761 - 0.82^2 = 0.3276 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 2×0.18×0.07=0.02522 \times 0.18 \times 0.07 = 0.0252, and selected correctness falls from 0.32760.3276 to 0.30240.3024.

Changing NN is a different intervention. Switching the verifier keeps the generator's distribution and NN, and re-ranks every possible outcome. Changing NN changes the number of independent draws, and so the set of possible outcomes: with N=1N = 1 the verifier has nothing to choose between, and both verifiers return a correct trace with probability 0.180.18. The instrument at the end of the page opens at the figure's NN and verifier and computes every NN from 1 to 128. There, more draws keep raising coverage, while the noisy verifier's selected correctness peaks at N=6N = 6 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: 0.18×0.07=0.01260.18 \times 0.07 = 0.0126 for clean correct then rare exploit. The complement rule turns "at least one" into "not none": P(some draw is correct)=1−P(no draw is correct)=1−0.822P(\text{some draw is correct}) = 1 - P(\text{no draw is correct}) = 1 - 0.82^2. Ranking only orders the drawn traces by score, and best-of-NN 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)

Optional question

Two draws are fixed: clean correct and rare exploit. Switch the verifier from clean to noisy. What changes?

The figure is open. Use this question to check your understanding whenever you choose.

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

Rank the draws: the verifier returns the top score
Drawn: clean correct, then rare exploit. Clean verifier: clean correct 1.8, rare exploit 0.2; returns clean correct. Noisy verifier: clean correct 1.8, rare exploit 2.6; returns rare exploit. The draws are the same under both verifiers.

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.

All sixteen ordered pairs: area is probability
Rows are the first draw and columns the second, both in the clean verifier's rank order, lowest score first. Returned a correct trace: 0.3276. Sampled a correct trace but returned a wrong one: 0. No correct trace sampled: 0.6724.
  • 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.

What the verifier changes, N = 2
Clean verifierNoisy verifier
This outcome: clean correct, then rare exploit
Event probabilityhow often exactly these draws happen0.18 × 0.07 = 0.01260.18 × 0.07 = 0.0126
Correct trace sampledcoverage, for this outcomeyesyes
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.32761 − 0.82² = 0.3276
Selected correctnessP(the returned trace is correct) (differs between verifiers)1 − 0.82² = 0.32760.93² − 0.75² = 0.3024
Sampled, not returnedcoverage minus selection (differs between verifiers)02 × 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

  1. Not the verifier’s fault

    Find an outcome that returns a wrong trace where no verifier could have returned a correct one.

  2. 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
DrawsEvent probabilityCorrect sampledClean returnsNoisy returns
common wrong, then common wrong0.50 × 0.50 = 0.25nocommon wrongcommon wrong
common wrong, then plausible slip0.50 × 0.25 = 0.125noplausible slipplausible slip
common wrong, then clean correct0.50 × 0.18 = 0.09yesclean correct ✓clean correct ✓
common wrong, then rare exploit0.50 × 0.07 = 0.035norare exploitrare exploit
plausible slip, then common wrong0.25 × 0.50 = 0.125noplausible slipplausible slip
plausible slip, then plausible slip0.25 × 0.25 = 0.0625noplausible slipplausible slip
plausible slip, then clean correct0.25 × 0.18 = 0.045yesclean correct ✓clean correct ✓
plausible slip, then rare exploit0.25 × 0.07 = 0.0175norare exploitrare exploit
clean correct, then common wrong0.18 × 0.50 = 0.09yesclean correct ✓clean correct ✓
clean correct, then plausible slip0.18 × 0.25 = 0.045yesclean correct ✓clean correct ✓
clean correct, then clean correct0.18 × 0.18 = 0.0324yesclean correct ✓clean correct ✓
clean correct, then rare exploit0.18 × 0.07 = 0.0126yesclean correct ✓rare exploit
rare exploit, then common wrong0.07 × 0.50 = 0.035norare exploitrare exploit
rare exploit, then plausible slip0.07 × 0.25 = 0.0175norare exploitrare exploit
rare exploit, then clean correct0.07 × 0.18 = 0.0126yesclean correct ✓rare exploit
rare exploit, then rare exploit0.07 × 0.07 = 0.0049norare exploitrare exploit
Total1.000.32760.3276 correct0.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.

Every plan up to 26 units: cost against selected correctness
  • 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.

Best plan: clean ranker, 4 draws
Draws n4
Generation4 × 1 = 4
Scoring4 × 2 = 8
Setup0
Total cost12
Budget12, leaving 0 unused
Selected correctness1 − 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
PlanCostWithin B = 12?Selected correctness
one unscored draw1 generation + 0 scoring + 0 setup = 1yes0.18
clean ranker, 2 draws2 generation + 4 scoring + 0 setup = 6yes0.3276
clean ranker, 3 draws3 generation + 6 scoring + 0 setup = 9yes0.448632
clean ranker, 4 draws4 generation + 8 scoring + 0 setup = 12yes0.54787824
clean ranker, 5 draws5 generation + 10 scoring + 0 setup = 15no, over by 30.6292601568
clean ranker, 6 draws6 generation + 12 scoring + 0 setup = 18no, over by 60.695993328576
clean ranker, 7 draws7 generation + 14 scoring + 0 setup = 21no, over by 90.75071452943232
clean ranker, 8 draws8 generation + 16 scoring + 0 setup = 24no, over by 120.795585914134503
noisy ranker, 2 draws2 generation + 2 scoring + 0 setup = 4yes0.3024
noisy ranker, 3 draws3 generation + 3 scoring + 0 setup = 6yes0.382482
noisy ranker, 4 draws4 generation + 4 scoring + 0 setup = 8yes0.43164576
noisy ranker, 5 draws5 generation + 5 scoring + 0 setup = 10yes0.4583836818
noisy ranker, 6 draws6 generation + 6 scoring + 0 setup = 12yes0.469011667824
noisy ranker, 7 draws7 generation + 7 scoring + 0 setup = 14no, over by 20.46821698388882
noisy ranker, 8 draws8 generation + 8 scoring + 0 setup = 16no, over by 40.459468894625978
noisy ranker, 9 draws9 generation + 9 scoring + 0 setup = 18no, over by 60.445326396709191
noisy ranker, 10 draws10 generation + 10 scoring + 0 setup = 20no, over by 80.427668792469821
noisy ranker, 11 draws11 generation + 11 scoring + 0 setup = 22no, over by 100.407868409644638
noisy ranker, 12 draws12 generation + 12 scoring + 0 setup = 24no, over by 120.386919945455293
noisy ranker, 13 draws13 generation + 13 scoring + 0 setup = 26no, over by 140.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

Two example step-score vectors, reduced by: last step
SolutionStep scoresWeight
P0.10, 0.900.90
Q0.80, 0.800.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.

  1. assumed joint law
  2. extracted answer IDs
  3. count
  4. return
  5. graded afterwards
Joint law
Inspect one ordered outcome (slots 1, 2, 3)

A dashed outline marks a row that cannot occur under the selected law. It can still be inspected.

Change the law: the inspected row keeps its count, its return and its grade; only its probability can change.

Where the three answers come from, and what the voter sees

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.

All eight ordered outcomes. Both laws’ masses stay visible; the selected law is marked.
OutcomeVotesReturnsGraded afterwardsP, three independent draws (selected)P, one copied draw
C C CC 3 · W 0Ccorrect27/1253/5
C C WC 2 · W 1Ccorrect18/1250
C W CC 2 · W 1Ccorrect18/1250
W C CC 2 · W 1Ccorrect18/1250
C W WC 1 · W 2Wwrong12/1250
W C WC 1 · W 2Wwrong12/1250
W W CC 1 · W 2Wwrong12/1250
W W WC 0 · W 3Wwrong8/1252/5
Total mass11
Returns C: the rows graded correct81/1253/5
At least one C: coverage, a different event117/1253/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 guessed
Optional: 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.

Quantityt = 3/25t = 27/125, three independent drawst = 7/25
P(K = 0)4/258/1250
P(K = 1)036/12512/25
P(K = 2)18/2554/1256/25
P(K = 3)3/2527/1257/25
Each slot answers C3/5, 3/5, 3/53/5, 3/5, 3/53/5, 3/5, 3/5
Each pair answers C C9/25, 9/25, 9/259/25, 9/25, 9/259/25, 9/25, 9/25
P(C C C)3/2527/1257/25
Returns C21/25 = 0.8481/125 = 0.64813/25 = 0.52
Mutually independentnoyesno

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Selected correctness of the two available plans

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

Scores and supplied final-answer grades for the same candidates
SlotBaselineChangedGrade
A0.30.9Correct
C0.950.7Wrong

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”.

Fixed pool; only the chosen score contrast changes the second score column
SlotAnswerBaselineChangedGrade
APresent0.30.9Correct
BPresent0.40.8Correct
CPresent0.950.7Wrong
DPresent0.60.2Wrong
ENo answer11No eligible answer
FMissing slot——No eligible answer
Every ordered draw under the selected sampling order; score first, grade afterwards
DrawEligibleBaseline → gradeChanged → grade
A, BA, BB → correctA → correct
A, CA, CC → wrongA → correct
A, DA, DD → wrongA → correct
A, EAA → correctA → correct
A, FAA → correctA → correct
B, AB, AB → correctA → correct
B, CB, CC → wrongB → correct
B, DB, DD → wrongB → correct
B, EBB → correctB → correct
B, FBB → correctB → correct
C, AC, AC → wrongA → correct
C, BC, BC → wrongB → correct
C, DC, DC → wrongC → wrong
C, ECC → wrongC → wrong
C, FCC → wrongC → wrong
D, AD, AD → wrongA → correct
D, BD, BD → wrongB → correct
D, CD, CC → wrongC → wrong
D, EDD → wrongD → wrong
D, FDD → wrongD → wrong
E, AAA → correctA → correct
E, BBB → correctB → correct
E, CCC → wrongC → wrong
E, DDD → wrongD → wrong
E, FNoneNone → failureNone → failure
F, AAA → correctA → correct
F, BBB → correctB → correct
F, CCC → wrongC → wrong
F, DDD → wrongD → wrong
F, ENoneNone → failureNone → 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 xx, let the base model define a finite distribution over complete candidate traces. Each trace has hidden task correctness and a verifier score:

pi=πbase(τi∣x),∑ipi=1,ui∈{0,1},si=sϕ(τi).p_i=\pi_{\mathrm{base}}(\tau_i\mid x), \qquad \sum_i p_i=1, \qquad u_i\in\{0,1\}, \qquad s_i=s_\phi(\tau_i).

Best-of-NN draws NN independent traces from pp 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 s1<⋯<sKs_1 < \cdots < s_K:

τ⋆=arg⁡max⁡τ∈{τ(1),…,τ(N)}sϕ(τ),Fk=∑i=1kpi,F0=0,PN(k selected)=FkN−Fk−1N,A(N)=∑kuk(FkN−Fk−1N),coverageN=1−(1−∑ipiui)N.\begin{aligned} \tau^\star &= \arg\max_{\tau\in\{\tau^{(1)},\dots,\tau^{(N)}\}} s_\phi(\tau),\\ F_k &= \sum_{i=1}^k p_i,\qquad F_0=0,\\ P_N(k\ \mathrm{selected}) &= F_k^N-F_{k-1}^N,\\ A(N) &= \sum_k u_k \left(F_k^N-F_{k-1}^N\right),\\ \mathrm{coverage}_N &= 1-\left(1-\sum_i p_i u_i\right)^N. \end{aligned}

Where the rank formula comes from. Fix a verifier and number the traces by its score, lowest first. FkF_k is the cumulative rank: the probability that a single draw ranks at or below trace kk. The returned trace ranks at or below kk exactly when every one of the NN draws does. If the draws are independent, those NN events multiply, so the returned trace ranks at or below kk with probability FkNF_k^N. Subtracting Fk−1NF_{k-1}^N, the probability that every draw ranks strictly below kk, leaves FkN−Fk−1NF_k^N-F_{k-1}^N, the probability that trace kk is returned. Here kk 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 c=∑ipiuic=\sum_i p_i u_i the probability that one draw is correct, all NN draws miss with probability (1−c)N(1-c)^N.

Three quantities stay distinct. An event probability, such as pipjp_ip_j for an ordered pair, says how often one particular set of draws occurs. A cumulative rank FkF_k describes a single draw under a single verifier. Selected correctness A(N)A(N) adds up the event probabilities of every outcome whose returned trace is correct. Coverage and A(N)A(N) 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 N=2N=2 returns one with probability 0.3024/0.3276=12/13≈0.9230.3024/0.3276=12/13\approx0.923.

The worked case, N=2N=2. The four traces are common wrong, plausible slip, clean correct and rare exploit, with p=(0.50,0.25,0.18,0.07)p=(0.50,0.25,0.18,0.07); only clean correct has u=1u=1, so c=0.18c=0.18 and coverage is 1−0.822=0.32761-0.82^2=0.3276 for either verifier. The clean verifier ranks clean correct highest, with F=0.82F=0.82 just below it and F=1F=1 at it, so A(2)=1−0.822=0.3276A(2)=1-0.82^2=0.3276: every outcome that covers a correct trace returns it. The noisy verifier puts rare exploit above it, with F=0.75F=0.75 below and F=0.93F=0.93 at it, so A(2)=0.932−0.752=0.3024A(2)=0.93^2-0.75^2=0.3024. The difference, 0.0252=2×0.18×0.070.0252=2\times0.18\times0.07, 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:

sϕ(τi)=∑t=1Tirϕ(hi,t−1,ai,t).s_\phi(\tau_i) = \sum_{t=1}^{T_i} r_\phi(h_{i,t-1},a_{i,t}).

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

S(N)=∑ksk(FkN−Fk−1N).S(N) = \sum_k s_k \left(F_k^N-F_{k-1}^N\right).

Selected correctness and sampled-correct coverage can be very different. Sampling a correct trace is coverage. Returning it is selection. More samples can make S(N)S(N) rise while A(N)A(N) falls if the highest-scoring trace is a verifier error.

A simple cost model is

C(N)=N(cgen+cscore).C(N)=N(c_{\mathrm{gen}}+c_{\mathrm{score}}).

Here NN 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 N=1N=1 there is nothing to choose between: A(1)=c=0.18A(1)=c=0.18 under any verifier, and selected correctness equals coverage. A verifier matters only once N≥2N\ge 2.

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 A(N)A(N) is defined.

Dependent draws. Both FkNF_k^N and (1−c)N(1-c)^N come from multiplying NN 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 cc, but the two fail together:

P(both attempts miss)=1−c≠(1−c)2,coverage=c.P(\text{both attempts miss})=1-c\ne(1-c)^2, \qquad \mathrm{coverage}=c.

For a code patch that passes with probability 0.50.5, two copies cover a passing patch with probability 0.50.5, not 1−0.52=0.751-0.5^2=0.75. 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 pp differs between prompts, with mean pˉ\bar p. Because 1−(1−p)N1-(1-p)^N is concave in pp, the average coverage is at most 1−(1−pˉ)N1-(1-\bar p)^N, with equality when every prompt has the same pp or when N=1N=1. 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 g=1g=1 and scoring one trace costs snoisy=1s_{\text{noisy}}=1 or sclean=2s_{\text{clean}}=2; every trace in a scored plan is scored. A scored plan with ranker vv and nn draws, 2≤n≤1282\le n\le128, costs and is correct with probability

Cv(n)=n (g+sv)+hv,Aclean(n)=1−0.82n,Anoisy(n)=0.93n−0.75n,C_v(n)=n\,(g+s_v)+h_v, \qquad A_{\text{clean}}(n)=1-0.82^n, \qquad A_{\text{noisy}}(n)=0.93^n-0.75^n,

where hvh_v is a one-time setup charge, zero unless stated. One unscored draw costs g=1g=1 and is correct with probability c=0.18c=0.18; with a single draw there is nothing to choose between, so no scoring is charged. That makes 1+127+127=2551+127+127=255 actions. Within a budget BB the decision is

a⋆(B)=arg⁡max⁡a:  C(a)≤BA(a),a^\star(B)=\arg\max_{a:\;C(a)\le B}A(a),

taken over every affordable action, with exact ties broken by lower cost and then by plan ID. If nothing is affordable (B<1B<1), 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 BB stays affordable at B+1B+1, so the best attainable correctness never decreases as BB grows, even though the preferred ranker can switch: clean n=3n=3 at B=9B=9 (0.4486320.448632), noisy n=5n=5 at B=10B=10 (0.45838368180.4583836818), clean n=4n=4 at B=12B=12 (0.547878240.54787824). At B=14B=14 noisy n=7n=7 is affordable but gives 0.468216983888820.46821698388882, below noisy n=6n=6. 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 hclean=4h_{\text{clean}}=4 on this prompt, a hypothetical charge chosen to show what omitted overhead can do, makes clean n=4n=4 cost 16 and clean n=2n=2 cost 10, so at B=12B=12 noisy n=6n=6 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 N(k+1)N(k+1) 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 r1,…,rTr_1,\dots,r_T into one weight: the last step rTr_T, the product ∏trt\prod_t r_t, or the sum ∑trt\sum_t r_t, which is the additive score of the third equation above. For the example step scores P=(0.10,0.90)P=(0.10,0.90) and Q=(0.80,0.80)Q=(0.80,0.80), the last step ranks PP first (0.900.90 against 0.800.80), while the product (0.090.09 against 0.640.64) and the sum (1.001.00 against 1.601.60) rank QQ first.

Across solutions, a rule returns one answer from a batch of candidates jj with final-answer keys and weights wjw_j. Returning the highest single candidate takes arg⁡max⁡jwj\arg\max_j w_j. Summing by final answer takes

W(a)=∑j1[answerj=a] wj,a^=arg⁡max⁡aW(a),W(a)=\sum_j \mathbf{1}[\text{answer}_j=a]\,w_j, \qquad \hat a=\arg\max_a W(a),

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 W(A)=1.20>W(B)=0.90W(A)=1.20>W(B)=0.90. 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 W(A)=0.72<W(B)=0.81W(A)=0.72<W(B)=0.81, 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 [0,1][0,1] 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 B=12B=12 and no setup charge. For a whole batch, chosen once and independently of the draws, it uses the clean ordering with probability rr and the noisy ordering otherwise, so

Aproposed(4;r)=r⋅0.54787824+(1−r)⋅0.43164576.A_{\text{proposed}}(4;r)=r\cdot0.54787824+(1-r)\cdot0.43164576 .

Against noisy n=6n=6 (0.4690116678240.469011667824), both at cost 12, the proposed plan is better exactly when r>r⋆≈0.321475613563r>r^\star\approx0.321475613563. Over the assumed range r∈[0.2,0.6]r\in[0.2,0.6] it runs from 0.4548922560.454892256 to 0.5013852480.501385248, so the stated information does not identify a better plan. The range is not a confidence interval or a measurement. For a given rr the formula gives expected correctness conditional on that rr; at r=0.4r=0.4, for example, it is 0.4781387520.478138752. The range supplies no distribution or mean for the unknown rr, so it does not identify expected correctness averaged over that uncertainty, and its midpoint is a what-if value, not an estimate of rr. Were the known-clean plan still available, its 0.547878240.54787824 would beat both options for every allowed r∈[0.2,0.6]r\in[0.2,0.6], and nothing would be unresolved; the proposed plan reaches it only at r=1r=1, 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 n∈{1,2}n\in\{1,2\} be the number of distinct slots drawn. An ordered prefix d=(i1,…,in)d=(i_1,\ldots,i_n) samples uniformly without replacement from a shuffled pool. Thus the set Ωn\Omega_n contains 6 prefixes when n=1n=1 and 6⋅5=306\cdot5=30 when n=2n=2. 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 ar(d)a_r(d) returns the highest score under rule rr, keeping the first in sampled order on a tie. It returns no answer for an empty eligible set. Let y(a)y(a) be 1 for a correct final answer and 0 otherwise, including no answer. Selection never reads yy.

Rr=1∣Ωn∣∑d∈Ωny(ar(d)),Δ=1∣Ωn∣∑d∈Ωn[y(achanged(d))−y(abaseline(d))].R_r=\frac{1}{|\Omega_n|}\sum_{d\in\Omega_n}y(a_r(d)), \qquad \Delta=\frac{1}{|\Omega_n|}\sum_{d\in\Omega_n} \left[y(a_{\mathrm{changed}}(d))-y(a_{\mathrm{baseline}}(d))\right].

These are exact averages over a finite, fully specified calculation, not estimates from 30 independent observed problems. At n=2n=2, the baseline succeeds in 10/30 prefixes and the changed ranking in 18/30, giving Δ=8/30\Delta=8/30. 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 30−12=1830-12=18 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): 2+8=102+8=10. 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 n=2n=2 denominator is 4⋅3=124\cdot3=12, 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. 1 · Worked example

    One pair, then all sixteen outcomes

    Best-of-2 on the page's four traces, with p=(0.50, 0.25, 0.18, 0.07)p = (0.50,\ 0.25,\ 0.18,\ 0.07) 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.

    1. The pair's event probability. Independent draws multiply: P(clean correct, then rare exploit)=0.18×0.07=0.0126P(\text{clean correct, then rare exploit}) = 0.18 \times 0.07 = 0.0126. 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. 2 · Finish it

    Add a third draw

    Now N=3N = 3 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.

    1. Coverage. 1−0.823=1−0.551368=0.4486321 - 0.82^3 = 1 - 0.551368 = 0.448632, up from 0.32760.3276 at N=2N = 2.

    2. Cumulative ranks under the noisy verifier. They describe a single draw, so NN does not change them: F=0.75F = 0.75 just below clean correct and F=0.93F = 0.93 at it.

    3. Your turn.

  3. 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 0.50.5. 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 1−0.52=0.751 - 0.5^2 = 0.75.

    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. 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 0.50.5, 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. 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 2×2+2×1+1=72\times2 + 2\times1 + 1 = 7 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. 6 · On your own

    What the number measures

    A report says: "Each of our four sampled answers is correct with probability 0.30.3, and they are sampled independently, so best-of-4 is correct with probability 1−0.74≈0.761 - 0.7^4 \approx 0.76." 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 0.760.76 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.

    Choose one

  7. 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.

    1. Costs. A noisy plan with nn draws costs n(1+1)=2nn(1 + 1) = 2n, a clean plan n(1+2)=3nn(1 + 2) = 3n, and one unscored draw 11. Within 12 units the noisy ranker can afford up to n=6n = 6 and the clean ranker up to n=4n = 4.

    Say the next step to yourself first.
  8. 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.

    1. Clean costs. 3n+43n + 4: n=2n = 2 costs 10, and n=3n = 3 would cost 13, over budget.

    2. Noisy costs are unchanged: 2n2n, so n=6n = 6 still costs 12.

    3. Your turn.
    Choose one

  9. 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.

    Choose one

  10. 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. 11 · On your own

    What would you ask for?

    In the separate scenario at the end of the budget sections, you can buy noisy n=6n = 6 or a proposed expensive ranker with n=4n = 4, both for 12 units. The proposed ranker orders a whole batch like the clean ranker with an unknown probability rr, known only to lie in [0.2,0.6][0.2, 0.6]. What would you do now, and what evidence would settle the choice? Write your first answer before opening the rubric.

  12. 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 N=2N=2 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 10/3010/30 success when sampling all slots before filtering with the challenger's 6/126/12 after filtering to answered slots first. It attributes the rise from 3313%33\frac13\% to 50%50\% 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. 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, nn, 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

  1. In best-of-NN, what is the difference between coverage and selected correctness?

    Answer from memory, then check

    Coverage is the chance that at least one of the NN draws is correct: 1−(1−c)N1-(1-c)^N 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 N=1N = 1 they are equal under any verifier; for N≥2N \ge 2 they are equal only when the verifier ranks every correct trace above every wrong trace that can be drawn.

  2. Why is the chance that trace kk is returned equal to FkN−Fk−1NF_k^N - F_{k-1}^N?

    Answer from memory, then check

    The returned trace ranks at or below kk exactly when all NN draws do, which has probability FkNF_k^N when the draws are independent. Subtracting Fk−1NF_{k-1}^N, the chance that every draw ranks strictly below kk, leaves the chance that the best draw is exactly trace kk.

  3. On this page, keep the generator and N=2N = 2 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 NN, and neither changed. On this page, coverage stays 0.32760.3276 at N=2N = 2 while selection falls from 0.32760.3276 to 0.30240.3024.

  4. 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 N=6N = 6 (about 0.4690.469) and falls to about 0.0100.010 by N=64N = 64, while coverage keeps rising.

  5. 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. 1−0.65≈0.921 - 0.6^5 \approx 0.92 would assume independent attempts. With fresh samples that are independent given the problem but solve rates that differ between problems, 1−(1−pˉ)51 - (1 - \bar p)^5 with the averaged rate is an upper bound on the fraction solved, exact only when every problem has the same rate.

  6. 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 n=4n = 4 at cost 12: noisy n=7n = 7 fits but gives 0.468216983888820.46821698388882, below noisy n=6n = 6, and clean n=5n = 5 would cost 15.

  7. 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 NN. 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.

Next thoughtIf complete traces are expensive and a verifier can score partial ones, which prefixes deserve the next unit of compute?Tree Search Reasoning: Allocating Inference Budget Across Prefixes →
The full instrument: both verifiers for any N from 1 to 128, with coverage, selected correctness and how often the exploit is returned

Limits of this page

  • Four traces with hand-chosen probabilities and scores for a single prompt. They are a teaching object, not measured model behavior; nothing on this page samples a model.
  • The opening model's draws are independent and identically distributed for one fixed prompt. A success rate averaged over prompts is not a per-prompt probability: if draws are independent given the prompt but the rate pp differs between prompts, 1−(1−pˉ)N1-(1-\bar p)^N is an upper bound on the average coverage, with equality when every prompt has the same pp or when N=1N = 1.
  • Verifier scores are distinct, deterministic and fixed per trace. The noisy verifier is a fixed misranking, the exploit scored 2.62.6 every time, not random scores. Ties need a stated tie-break rule, and a stochastic verifier would add randomness of its own.
  • Coverage and selected correctness are unconditional: they average over every batch of draws, including batches with no correct trace. At N=2N = 2 the noisy verifier returns a correct trace in 0.3024/0.3276=12/130.3024 / 0.3276 = 12/13 of the batches that contain one.
  • The figure enumerates N=1N = 1 and N=2N = 2 exactly; the instrument computes NN from 1 to 128 with the same formula and opens at the figure's NN and verifier.
  • Costs are abstract units of a single compute resource: generation 1, noisy scoring 1 and clean scoring 2 per trace, and an optional one-time clean setup charge of 4. They are chosen for teaching, not measured, and are not tokens, latency, dollars or human-review time. Choosing a batch size before buying it is not a rule for stopping after seeing samples.
  • The M1 and M2 batches and the P and Q step scores are invented. Each isolates one operation and is not a complete implementation of Snell et al. or Lightman et al., whose step scores are trained on different targets.
  • The proposed ranker's two-regime mixture and its range for rr are assumed for teaching. No measurement, confidence interval or study stands behind them. The what-if control gives expected correctness conditional on a chosen rr; the range gives no distribution for the unknown rr, so no expected correctness averaged over that uncertainty is identified.
  • The answer-voting section's two answer IDs, their truth and its two joint laws are invented for one fixed task and one fixed extraction rule. Its fractions are exact sums over eight hypothetical outcomes, not observed trials, model samples or measured accuracy, and unlike the four traces its copied law is not independent. Its uniform choice among tied answers is this page's own convention, and three answer slots are not three independent units of compute.
  • Practice checks compare your answer with a key stored in the page, and review cards are self-rated. A correct check after a hint or a shown solution, a match with a rubric you have read, or a remembered card is practice, not evidence of independent or delayed learning. Exercise attempts are not stored. Review cards and their schedule are saved in this browser only if you choose to add them.
  • The source-to-test continuation uses a different, explicit finite law: one or two slots drawn without replacement from six invented slots. Its scores and grades are supplied, and the first maximum in sampled order wins a tie. Its exact prefix counts are not independent measured problems, model evaluation results or evidence about training-supervision effects.
  • The Python runs on your machine, not in the page.

Sources

  1. Wang et al. (2023). Self-Consistency Improves Chain of Thought Reasoning in Language Models.

    Samples several reasoning paths for one question and returns the most frequent final answer (self-consistency): repeated sampling with answer aggregation, a simple way to spend more inference compute (ICLR 2023).

  2. Lightman et al. (2024). Let's Verify Step by Step.

    Trains process-supervised reward models on step-level human labels and evaluates them as verifiers by best-of-N selection on MATH problems (ICLR 2024; section numbers on this page refer to arXiv v1).

  3. Snell et al. (2025). Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters.

    Finds that the best use of inference compute depends on prompt difficulty and, FLOPs-matched, can beat a 14 times larger model where the small one sometimes succeeds (ICLR 2025 as "...Scaling Parameters for Reasoning"; sections: arXiv v1).

  4. OpenAI contributors. PRM800K evaluation source — pinned implementation.

    The source pads, shuffles, takes a prefix, filters unanswered entries, selects the first maximum and reads a stored correctness label. This page substitutes invented scores and exact enumeration, and adds paired draws.

What the claims rest on

Central claim: Test-time compute spends extra inference budget on sampling, verification, and selection; it helps when the generator can produce good candidates and the verifier ranks them reliably.

Each claim below lists the passages it cites and how far it has been checked against them. These are the site’s own checks, not independent replication.

Claim (checked against the cited passages): In the page's finite best-of-N model, extra test-time compute can improve selected correctness when more samples cover good traces and the verifier ranks them highly; as N grows, clean ranking can help, while a rare high-scoring verifier error can be selected more often.

Sources: Self-Consistency Improves Chain of Thought Reasoning in Language Models; Let's Verify Step by Step; Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters

What the sources support: Wang et al. ground drawing multiple reasoning paths and aggregating answers. Lightman et al. evaluate reward models by best-of-N search: select the sampled solution ranked highest by the reward model. Snell et al. analyze test-time compute via best-of-N and verifier/PRM search. The page's math, code and demo show the difference between coverage and selection, and the noisy verifier's failure.

On this page: the note on Self-Consistency Improves Chain of Thought Reasoning in Language Models, the note on Let's Verify Step by Step, the note on Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters, Equation 1, Equation 2, Code example 1, the figure

Caveat: This checks a finite, fixed-distribution best-of-N verifier model, not tree search, adaptive reasoning policies, universal scaling laws, exact serving costs, calibrated verifier probabilities, or guaranteed gains from more inference compute.

Claim (source notes read; a full check is still pending): With fixed toy costs, a larger budget cannot lower best attainable correctness. Setup costs can change the optimal plan and its correctness. Highest-weight and sum-by-answer rules can disagree on one batch; uncertainty about an unvalidated ranker can leave the choice open.

Sources: Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters; Let's Verify Step by Step

What the sources support: Snell et al. v1: §3.2 excludes 2,048-sample difficulty estimation from compared cost; §5.1 reduces each solution to its final-step prediction and sums by final answer; §5.3 charges lookahead N(k+1) generation-equivalents. Lightman et al. v1: §2.1 evaluates the highest-scored solution; §2.6 and Appendix F multiply step probabilities. The page's math, code and sections compute the toy.

On this page: the note on Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters, the note on Let's Verify Step by Step, Equation 3

Caveat: Costs, batches, step scores and the mixture range are invented for teaching. Nothing here estimates either paper's costs, reproduces its results or measures a ranker. The page's third equation is a generic within-trace sum, not either paper's convention.

Claim (source notes read; a full check is still pending): The six-slot calculation, with invented scores, changes one selector on identical ordered draws and distinguishes that effect from filtering before sampling. Its exact selection check does not reproduce the paper's model evaluation or isolate a training-supervision effect.

Sources: Let's Verify Step by Step; PRM800K evaluation source — pinned implementation

What the sources support: Lightman et al. v1 §3 reports final-answer selection results on 500 held-out MATH problems with differing large-model training sets; §4.1 separately controls training solutions across supervision types. The pinned code supplies the finite sampling, eligibility, first-maximum and stored-grade conventions. The page's Python and TypeScript agree with the extracted source statements on the same inputs.

On this page: the note on Let's Verify Step by Step, the note on PRM800K evaluation source — pinned implementation

Caveat: Pairing selectors is added here. Scores and grades are invented, the source's main and scored corpus are not run, and exhaustive prefixes of one problem are not independent measured problems. Source checking is not independent human review or learner evidence.

Connections

Builds on Probability Basics.

Leads to Tree Search Reasoning: Allocating Inference Budget Across Prefixes.

Cite this page

Continuous Function. “Test-Time Compute: Spending Inference Budget on Search.” Revised 2026-10-07. https://continuousfunction.ai/domains/scaling/test-time-compute/

BibTeX
@misc{cf-test-time-compute,
  title = {Test-Time Compute: Spending Inference Budget on Search},
  author = {{Continuous Function}},
  year = {2026},
  note = {Revised 2026-10-07},
  url = {https://continuousfunction.ai/domains/scaling/test-time-compute/}
}