AI State of the Art
SOTA/Reasoning Models/21 min
Section 172

Test-time Compute Scaling: More Compute at Inference

Listen as a podcast →

A New Axis: Thinking Rather Than Growing

For years, improving an LLM meant the same thing: more parameters, more training data, more GPUs for training. It was a race for size. Bigger = better, and Kaplan et al.'s scaling laws seemed to set this in stone.

Test-time compute scaling breaks this logic. The idea: instead of investing the entire compute budget into training, you also invest at inference time. You keep the same model, but give it more time to think before answering. It's a fundamental paradigm shift.

The inverted paradigm

The old question: "Which model is big enough to solve this problem?" The new question: "How much thinking time does the model need to solve this problem?"

The Three Dimensions of Test-Time Compute

1. Reasoning Tokens

The model generates intermediate thinking tokens before producing its final answer. It's the most natural form of test-time compute: the model "thinks out loud."

  • o1/o3: hidden reasoning tokens, invisible to the user
  • DeepSeek-R1: fully visible reasoning between <think> tags
  • Claude extended thinking: structured and accessible "thinking" block

The more reasoning tokens the model generates, the more it can decompose the problem, verify its steps, explore alternatives, and correct its errors. It's like giving a student more scratch paper on an exam.

2. Multiple Sampling (Self-Consistency)

Instead of generating a single answer, you generate N independently with temperature > 0:

  • Self-consistency: take the majority answer (vote)
  • Best-of-N: select the best according to a reward model
  • Iterative revision: improve the answer step by step

Each sample takes a slightly different reasoning path. By aggregating, you filter noise and converge toward the correct answer.

Two stacked diagrams starting from the same maths question. On top, Parallel Sampling: the question enters a blue LM block that produces three answers A side by side and independent of each other, two in red and one in green; a note says the model proposes answers independently, in parallel. At the bottom, Sequential Revisions: the same question enters the LM block, which produces a first answer that leads by an arrow to a second, then to a third, the last one in green; a note says each revision is conditioned on the previous revisions.
The two ways to spend a token budget. On top, you draw N answers in parallel, each blind to the others, and aggregate at the end. At the bottom, you produce a single chain in which every version corrects the previous one. The parallel mode is faster because everything runs at once; the sequential mode is slower but each step benefits from the previous step's feedback.Source : Snell et al. paper (Scaling LLM Test-Time Compute Optimally), via the LLM Foundations course

You explore multiple reasoning paths in a structured way:

  • Tree of Thoughts: BFS/DFS exploration on a tree of thoughts
  • MCTS: Monte Carlo Tree Search guided by rewards
  • Beam search: keep the K best branches at each step

It's the most sophisticated approach, but also the most expensive.

Three tree diagrams side by side, each starting from a blue box named Question. Best-of-N: four long curves run straight down to four complete solutions, only one green (kept by the verifier) and three red (rejected). Beam Search: the tree advances step by step, each intermediate step framed in dashed purple to show the verifier being applied, keeping the green branches and cutting the red ones. Lookahead Search: same structure as beam search, but black arrows show that each step is first rolled out k steps ahead, the value obtained at the end then being propagated back to the current step. A legend at the bottom gives the colour code: green means selected by the verifier, red means rejected.
Three ways to use a verifier. On the left, you let the model write N complete solutions and keep the best one. In the middle, you score each step as it comes and prune the losing branches before they get expensive. On the right, you simulate a few extra steps before judging, which gives a more reliable score but multiplies the compute.Source : Snell et al. paper (Scaling LLM Test-Time Compute Optimally), annotated by Sebastian Raschka

Technical Corner: Test-Time Scaling Laws

Empirically, when you double test-time compute, the gains follow predictable curves:

  • Doubling reasoning tokens: a lot of gain at the start, then the pace gradually slows
  • Doubling the number of samples (self-consistency): same logarithmic curve shape, it is plotted in the self-consistency lesson
  • Returns diminish but remain significant much longer than previously thought

Key result: in the reference study by Snell et al. (DeepMind / Berkeley), allocating test-time compute optimally lets a model (on problems where the smaller model already has a non-trivial success rate) outperform a model 14x larger at equal total compute. Model size is no longer the only lever.

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

Comparison: Test-Time vs Training-Time

ApproachWhenImpact
More parametersTrainingAll tasks
More dataTrainingAll tasks
More test-time computeInferenceReasoning mostly
Test-time compute dominates on reasoning

A medium-sized model with a well-allocated test-time budget can outperform a model 14x larger on reasoning tasks, that's the figure from the Snell et al. abstract, valid on problems where the small model already has a reasonable chance of success. However, for factual knowledge or creativity, test-time compute helps little, because those are capabilities that depend on what was learned during training.

Practical Allocation Strategies

Fixed Budget: How to Distribute It?

You have a fixed inference token budget. How best to use it?

Three options:

  • 1 long reasoning chain (lots of thinking tokens)
  • 10 short reasoning chains (fewer tokens each, then vote)
  • A structured search tree

The right choice depends on problem difficulty:

DifficultyRecommended Strategy
Easy1 short CoT is more than enough
MediumSelf-consistency with N=10N=10
HardLong CoT or tree search
Two charts side by side. On the left, Comparing PRM Search Methods: the y axis is MATH benchmark accuracy from 10 to 40 percent, the x axis is the generation budget on a logarithmic scale from 2 to 2 to the power 9. Seven curves are drawn; the green majority-vote curve is the lowest everywhere and plateaus around 29 percent; the blue and red beam search curves rise fastest at small budgets, reach about 34 percent and then dip slightly; the orange weighted best-of-N curve starts lower but overtakes them at large budgets, reaching 38 percent. On the right, Comparing Beam Search and Best-of-N by Difficulty Level: stacked bars for five levels of increasing difficulty; at level 1 the three methods are close, around 80 percent; scores fall as difficulty rises and at levels 4 and 5 only the blue beam search share keeps a visible edge.
Why the right strategy depends on both budget and difficulty. On the left: at small budgets, verifier-guided search wins; at large budgets, plain best-of-N takes the lead again. On the right: on easy questions all methods are equivalent, the gap only opens up on the hard levels. This is exactly the argument of the table above, measured.Source : Snell et al. paper (Scaling LLM Test-Time Compute Optimally), via AGI Frontier

Adaptive Compute: Investing Based on Difficulty

The most pragmatic idea: don't apply the same budget to every problem.

  1. Generate a quick answer (few tokens)
  2. Estimate the model's confidence (log-likelihood, coherence)
  3. If confidence is low: invest more compute (more samples, longer reasoning)
Simple heuristic for detecting difficulty

Generate 3 quick answers. If they agree? Return the answer immediately, it's an easy problem. If they diverge? Difficult problem, invest more compute. This heuristic is free (3 samples is very few) and very effective in practice.

Concrete Implementations

Best-of-N with Reward Model

def best_of_n(prompt, model, reward_model, n=10):
    responses = [model.generate(prompt, temperature=0.7) for _ in range(n)]
    scores = [reward_model.score(prompt, r) for r in responses]
    return responses[argmax(scores)]

You generate many answers, and a separate evaluation model selects the best one. Simple, parallelizable, and surprisingly effective.

Iterative Revision

def iterative_revision(prompt, model, max_iterations=3):
    response = model.generate(prompt)
    for i in range(max_iterations):
        critique = model.generate(f"Critique this answer: {response}")
        if "correct" in critique.lower():
            break
        response = model.generate(f"Improve based on: {critique}")
    return response

You generate, critique, improve, and repeat. Each iteration refines the answer. Less parallelizable than Best-of-N but sometimes more effective because each iteration benefits from the previous one's feedback.

Limitations to Know

Cost

N=10 samples means 10 times the cost in tokens. N=100 = 100 times more expensive. You need to decide whether the quality gain justifies the investment, and for many applications, the answer is no.

Latency

More compute = more waiting. For an interactive application where the user expects a response in under 500ms, generating 100 samples isn't feasible. Test-time compute shines on batch tasks or latency-tolerant applications.

Diminishing Returns

Beyond a certain point, more compute no longer helps. This threshold depends on the model and the problem, but it always exists. Doubling compute from 100 to 200 samples rarely helps as much as going from 1 to 2.

A targeted tool, not a universal solution

Test-time compute helps mostly for reasoning, verifiable tasks where the model can iterate and converge toward the correct answer.

For "What is the capital of Switzerland?" (memorized knowledge), more compute adds nothing.

For creative writing (subjective style), more compute can even degrade the result, because the model "overthinks" and loses naturalness.

It's a powerful but targeted tool, not a magic wand.

The Change in Perspective

Test-time compute scaling has transformed the fundamental question of applied AI.

Before: "Which model should I buy?"

Now: "Which model, with what thinking budget, for what type of problem?"

It's a transition toward adaptive intelligence that allocates resources intelligently based on task difficulty. Instead of a single model that always responds the same way, you have a system that can think for 100ms on a simple question and 10 minutes on a complex theorem.

This has been the major direction in AI since 2024-2025, and it's accelerating.

It also has a silent variant: instead of writing more tokens, pass several times through the same layers before writing a single one. That is the subject of looped transformers.

Check your understanding0 / 4

1. The page quotes a striking result from Snell et al.: a medium-sized model can outperform a model 14 times larger. Under what conditions does that number hold?

2. Why does thinking longer add nothing for a question like the capital of Switzerland, and why can it even hurt creative writing?

3. You have a budget of N generations. What is the difference between sampling them in parallel and producing N successive revisions?

4. What nearly free heuristic does the page suggest for deciding how much compute to invest in a given question?