v9.1.1
Menu
Paper breakdownLLM ReasoningFREE2024

Scaling Test-Time Compute

Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters

Charlie Snell, Jaehoon Lee, Kelvin Xu, Aviral Kumar

10

Concepts

10

Formulas

11

Figures

5

Demos

Paper Overview

Scaling LLM Test-Time Compute Optimally (Snell, Lee, Xu & Kumar, UC Berkeley and Google DeepMind, 2024) asks a question that sounds like budgeting and turns out to be about how models should be built. Suppose a language model may spend a fixed but non-trivial amount of computation at inference time on a hard prompt. How much better can its answer get? And if extra thinking can stand in for extra parameters, should FLOPs go into pretraining a bigger model, or into letting a smaller one think longer?

Earlier work gave mixed answers. Some papers showed LLMs improving their outputs with more inference compute; others found that self-correction and search did little on hard reasoning like competition math. This paper's diagnosis is that both camps were averaging over the wrong thing. How well a test-time method works depends on how hard the prompt is for the base model. Revising an answer helps when the first attempt is nearly right. Broad search helps when it is not. A single fixed strategy wastes compute on one group or the other.

So the authors define a compute-optimal scaling strategy, which chooses how to spend the test-time budget per prompt, and approximate it by binning questions into five difficulty levels. They study it along two axes, on MATH with PaLM 2-S*: searching against a process reward model (PRM), and refining the proposal distribution with a model fine-tuned to revise its own answers.

The results are concrete. Choosing the strategy by difficulty matches or beats a best-of-N baseline with up to 4x less test-time compute in both settings. In a FLOPs-matched comparison against a ~14x larger pretrained model, the small model with test-time compute wins on easy and intermediate questions when the inference load is modest. On the hardest questions, and when inference tokens far outnumber pretraining tokens, pretraining still wins. The two kinds of compute are not one-to-one exchangeable.

Explainer video

Chapter Roadmap

Click any topic to jump in

Interactive demo
1
Parameters or Thinking Time?

If a model may spend a fixed but non-trivial amount of inference compute, how much better can it get, and can that replace a bigger model?

unified as
2
Proposer and Verifier

Every test-time method either changes the distribution answers are sampled from, or uses a verifier to choose among them.

tuned per prompt by
3
Compute-Optimal Strategy

Pick the test-time hyper-parameters per prompt. Question difficulty, binned into five levels, serves as the sufficient statistic.

applied along two axes

Verifier axis and proposal axis

4
A PRM Without Human Labels

Per-step correctness from Monte Carlo rollouts, last-step scoring and best-of-N weighted voting.

5
Revision Models

PaLM 2-S* fine-tuned to fix its own earlier attempts. Pass@1 keeps climbing past the four revisions it was trained on.

spent via

How the budget is spent

6
Search Against the PRM

Best-of-N, beam search and lookahead search. Beam search wins at low budgets and on medium questions, then over-optimizes.

7
Sequential vs Parallel

Easy questions want pure revisions. Harder ones want a mix of revision chains and independent samples.

combined into
8
Results: 4x Less Compute

Choosing the strategy by difficulty matches or beats best-of-N with up to 4x fewer generations, for both search and revisions.

weighed against

Exchange rate and caveats

9
Test-Time vs Pretraining FLOPs

In a FLOPs-matched test, a small model with test-time compute beats a ~14x larger model on easy and medium questions when inference load is low.

10
Limits and Open Problems

Hard questions barely improve, estimating difficulty costs compute, and both capabilities needed task-specific fine-tuning.

Concept by concept

10 sections, in reading order.

01 / 10Parameters or Thinking Time?

People think longer about hard problems, and the extra time makes their decisions more reliable. The paper asks whether today's LLMs can do the same, and frames it as a question with a number attached: if an LLM may use a fixed but non-trivial amount of inference-time compute, how much can it improve on a challenging prompt?

The answer matters in two ways. In deployment, if pretrained model size can be traded for inference computation, a small on-device model could do work that currently needs a datacenter-scale LLM. In research, a model that turns extra computation into better outputs can label its own data, which gives a route to self-improvement with less human supervision.

The prior evidence pointed both ways. Self-critique, multi-agent debate and similar methods improved outputs in some settings. Elsewhere, especially on math reasoning, careful studies found that LLMs cannot reliably self-correct without outside feedback. The authors argue that the conflict calls for a systematic analysis. Best-of-N, which samples NN answers in parallel and keeps the one a verifier likes best, is the simplest and best-studied method. It is not the only way to spend inference compute, and it may not be the most efficient.

Figure 1 summarizes the paper's answer. On the left, a strategy that adapts to difficulty pulls away from best-of-N as the budget grows, for both revisions and PRM search. On the right, test-time compute is compared with a ~14x larger model at equal FLOPs. Bars above zero mean test-time compute was the better buy. They are mostly above zero for easy questions and mostly below zero for hard ones once the inference load is large.

Parameters or Thinking Time? diagram

Key Points

  • 1

    The question: with a fixed, non-trivial inference budget, how much can an LLM improve on a hard prompt, and can that substitute for a larger model?

  • 2

    Best-of-N (sample NN answers, keep the one a verifier scores highest) is the standard baseline. The paper asks whether there are more efficient ways to spend the same budget

  • 3

    Prior results conflicted: self-critique and debate sometimes helped, but LLMs were found unable to self-correct on reasoning tasks without external feedback

  • 4

    Testbed: the MATH benchmark (the 12k train / 500 test split of Lightman et al.) with PaLM 2-S* (Codey). The model scores well above zero on MATH but is far from saturating it

  • 5

    Both test-time capabilities studied, verifying steps and revising answers, needed capability-specific fine-tuning. Prompting alone did not produce them in the base model

  • 6

    Headline findings: up to 4x more efficient than best-of-N, and FLOPs-matched wins over a ~14x larger model where the small model already has a non-trivial success rate