Foundations to Frontier
Tests
F. NLP and Large Language Models › F12 Reasoning Models

Test-time compute scaling

A model can be made more accurate by spending more computation when answering, not only when training. It can think longer in one chain, sample many answers and vote, sample many and let a verifier pick, or revise its own answer repeatedly. Reasoning models such as OpenAI o1 and DeepSeek-R1 showed accuracy rising steadily with test-time compute. Which way of spending it works best depends on the problem's difficulty and on how good the selection signal is. In the exercises you write self-consistency voting, best-of-n and verifier-weighted voting. You then simulate 1200 problems at four difficulty levels with budgets of 1 to 64 samples. Majority voting rose from 0.31 to 0.48 at 16 samples, then fell to 0.45 at 64. On the hardest level the vote was never right, although a right answer was among the 64 samples for 91% of problems. A noisy verifier kept improving (0.70 at 64), and revision plateaued (0.68). Choosing the strategy per difficulty level reached 0.72, a gain of 0.5 to 2 points over the best single strategy depending on the seed.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Thinking longer, or asking more times

When a question is hard you can think about it longer, try several approaches and see which answers agree, or try several and ask an expert which is right. Language models can do all three at answer time. More effort usually helps, but not in the same way for every question: for easy ones a second look fixes slips; for hard ones the right answer may appear only occasionally and needs a good judge to be picked out. The demo shows voting and verification as the number of attempts grows.

Reasoning lab
With 16 samples: majority vote 29% (yellow), best-of-n with a 80%-accurate verifier 80% (green). Voting needs the right answer to be the most common; a verifier only needs one right sample, but is capped by its own accuracy.
Why engineers care

Test-time compute is now a main lever for model capability: the same model scores very differently depending on how much it is allowed to think.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Test-time compute is spent…
  2. 2. Self-consistency…
  3. 3. A verifier helps by…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Sequential: longer chains of thought, self-revision, ‘wait’ tokens and budget forcing (s1); reasoning models learn long chains with RL (F12-4).
  • Parallel: sample n answers; select by majority vote (self-consistency), by a verifier or reward model (best-of-n, weighted voting), or by tests for code.
  • Search: beam search or tree search guided by process reward models (F12-2, F12-3).
  • Coverage vs selection: pass@n (some sample is right) grows steadily with n; turning coverage into accuracy needs a selector. Voting fails when a wrong answer is more common than the right one.
  • Compute-optimal scaling: allocate test-time compute by estimated difficulty (Snell et al., 2024); small models with smart test-time compute can match larger ones on some tasks.
  • Costs: tokens and latency grow linearly with samples or chain length; overthinking wastes compute on easy problems.
📝 Quick check (Level 1)
0/3 answered
  1. 1. pass@n measures…
  2. 2. Voting fails when…
  3. 3. Compute-optimal scaling allocates compute by…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Spending test-time compute

Exercise 1.

  • Majority vote with vote share.
  • Best-of-n by score.
  • Verifier-weighted voting.

Practice.

  • Reasoning models expose an effort or thinking-budget setting (OpenAI reasoning effort, Anthropic extended thinking budget, Gemini thinking budget).
  • For open models: sample n with temperature 0.6–1.0, extract final answers, vote; add a reward model or tests to select.
  • Use the vote share as a confidence signal: low agreement means a hard problem.
  • Measure accuracy against tokens, not just samples; stop early when answers agree.
  • Check for overthinking: long chains on easy problems cost without helping.
answers, scores = [], []
for _ in range(16):
    out = llm(prompt, temperature=0.8)
    answers.append(extract_final(out)); scores.append(reward_model(prompt, out))
a, share = majority(answers)
final = a if share >= 0.6 else weighted_vote(answers, scores)   # vote when confident, else trust the verifier
🐍 Exercise 1: voting and verification
Write self-consistency voting, best-of-n and verifier-weighted voting.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Anthropic's setting for reasoning length:
  2. 2. Low vote share signals…
  3. 3. Plot accuracy against…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Coverage. With per-sample accuracy p, at least one of n samples is right with 1 − (1 − p)^n, which approaches 1 even for small p. This is the ceiling for any selection method.

Voting. Majority voting converges, as n grows, to the most likely answer under the model. If the model’s most common answer is wrong (a systematic trap), more samples make the vote more confidently wrong: accuracy on such problems goes to zero.

Verification. A verifier that ranks right samples above wrong ones turns coverage into accuracy; with a noisy verifier, more samples bring more wrong candidates that may outscore the right one, so gains slow, but continue while coverage grows.

Revision. Repeated self-revision with fix probability f and break probability b converges to f/(f + b); without external feedback it plateaus, often below what search reaches.

Allocation. The best method differs by difficulty; with a difficulty estimate, a per-problem choice beats any single method.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Majority voting converges to…
  2. 2. Revision without feedback converges to…
  3. 3. The ceiling for selection is…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

How do voting, verification and revision scale with test-time compute, and does the best choice depend on difficulty?

History.

  • X. Wang et al., “Self-consistency improves chain of thought reasoning” (ICLR 2023).
  • C. Snell et al., “Scaling LLM test-time compute optimally can be more effective than scaling model parameters” (2024).
  • OpenAI o1 (2024); DeepSeek-R1 (2025); N. Muennighoff et al., “s1: simple test-time scaling” (2025).

Exercise 2. 1200 problems in 4 difficulty levels; per-sample solve probability falls with difficulty; wrong answers favour a problem-specific trap answer (30–60% of wrong samples).

  • Verifier: scores right samples 1 and wrong 0, plus Gaussian noise of standard deviation 1.
  • Revision: each round fixes a wrong answer with probability 0.5p and breaks a right one with probability 0.05.
  • Compute-optimal: the best of the three methods chosen per difficulty level (oracle difficulty).
samples (or rounds) vote verifier revision best per level
1 0.305 0.305 0.297 0.319
4 0.471 0.460 0.463 0.494
16 0.478 0.589 0.642 0.665
64 0.447 0.702 0.678 0.720
at 64 easiest level 2 level 3 hardest
vote 0.893 0.773 0.120 0.000
verifier 0.900 0.867 0.700 0.340
revision 0.810 0.843 0.647 0.413
a right sample exists 0.997 1.000 1.000 0.913
  • Voting peaked and declined: on hard problems the trap answer was more common than the right one, so more samples entrenched it.
  • Coverage was nearly complete even on the hardest level; the bottleneck was selection.
  • The verifier kept improving with samples; revision plateaued as its fixed point predicts.
  • Difficulty mattered: voting and the verifier were best on easy problems, revision on the hardest, in this model.
  • Seeds 1 and 2: at 64, verifier 0.698 and 0.672, revision 0.635 and 0.633, best per level 0.703 and 0.683 (gain over the verifier 0.5 and 1.1 points).
  • Caveat: all rates are assumptions; which method wins at which difficulty depends on the model and verifier, so measure it.
🐍 Exercise 2 (research): how do voting, verification and revision scale with test-time compute, and does the best choice depend on difficulty?
Compare majority voting, verifier selection and self-revision at budgets of 1 to 64 across difficulty levels.

Test-time compute in AI, robotics and aerospace

  • Planning: sampling many candidate plans and checking them with a simulator or constraint checker is test-time compute with a strong verifier.
  • Engineering analysis: multiple solution attempts cross-checked by unit and conservation checks catch errors one attempt misses.
  • Latency budgets: onboard systems have strict time limits; test-time compute must be budgeted per decision.

References

  1. X. Wang et al. (2023). “Self-consistency improves chain of thought reasoning in language models.” ICLR.
  2. C. Snell, J. Lee, K. Xu and A. Kumar (2025). “Scaling LLM test-time compute optimally can be more effective than scaling model parameters.” ICLR.
  3. B. Brown et al. (2024). “Large language monkeys: scaling inference compute with repeated sampling.” arXiv:2407.21787.
  4. N. Muennighoff et al. (2025). “s1: simple test-time scaling.” arXiv:2501.19393.