Foundation reference

Test-Time Compute & Inference Scaling

Test-time compute is the computation spent producing an answer at inference, for example by generating candidate answers or longer reasoning sequences. OpenAI reported that the performance of o1, a model trained to reason at length before answering, improves with more reinforcement-learning training and with more time spent reasoning at test time (OpenAI, 2024).

A newer notebook covers this concept. This older page keeps its summary, math and sources.

Concept 74 of 100Scaling & AlignmentStudy phase 11
Key equation
y∗=arg⁡max⁡y∈{y1,…,yN}V(x,y)y^* = \arg\max_{y \in \{y_1, \dots, y_N\}} V(x, y)
Reading map and next steps

Study guide

Where to start

Concept 74 of 100Test-Time ComputeScaling & Alignment · Study phase 11: Reasoning at inference time & synthetic data
Question

When can extra inference compute on a smaller model replace a larger model, and on which problems does it stop helping (Snell et al., 2025)?

How to study this pagePredict · Check · Generalize · Continue
PredictSay what you expect.

Before you use the demo in the newer notebook, say what you expect to change.

CheckCheck against the math and the papers.

Compare what the notebook demo shows with the key equation here and with the papers cited below.

GeneralizeName what stays the same.

Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.

ContinueContinue in the newer notebook.

The newer notebook covers the same concept and has an interactive demo.

Why It Matters for Modern Models

  • Test-time compute is the computation spent producing an answer at inference, for example by generating candidate answers or longer reasoning sequences. OpenAI reported that the performance of o1, a model trained to reason at length before answering, improves with more reinforcement-learning training and with more time spent reasoning at test time (OpenAI, 2024).
  • The best use of test-time compute depends on the question: Snell et al. (2025) found that allocating it per prompt according to difficulty was more than 4× as efficient as best-of-N, and that on problems where a smaller model already had some success, extra inference compute could outperform a 14× larger model at equal FLOPs.
  • A verifier makes search possible: Cobbe et al. (2021) generated many solutions to grade-school math problems and kept the one their trained verifier ranked highest, which improved accuracy significantly.

Questions to Think About

  • Best-of-N is only as good as its verifier; what happens when the verifier can be fooled, so that drawing more samples finds more answers that score well but are wrong?
  • How does scoring partial solutions with a process reward model let a search abandon a poor line of reasoning early, and what does that cost?

Interactive Demo

The interactive demo for this concept is in the newer notebook.

Open the notebook demo

Core Math

If you prefer intuition first, try the demo in the newer notebook, then come back for the math.

Key Equation
y∗=arg⁡max⁡y∈{y1,…,yN}V(x,y)y^* = \arg\max_{y \in \{y_1, \dots, y_N\}} V(x, y)

Test-time compute is computation spent on each question at inference, for example by generating many candidate answers or longer chains of reasoning and choosing among them.

Best-of-NN sampling draws NN responses to a prompt xx and keeps the one a verifier VV scores highest (Cobbe et al., 2021):

y∗=arg⁡max⁡y∈{y1,…,yN}V(x,y)y^* = \arg\max_{y \in \{y_1, \dots, y_N\}} V(x, y)

Process reward models score each intermediate step of a solution. Lightman et al. (2024) define the solution score as the probability, under the PRM, that every step is correct, implemented as the product of per-step predictions with neutral labels counted as positive:

RPRM(s1,…,sk)=∏i=1kP(step i correct∣s1,…,si)R_{\text{PRM}}(s_1, \dots, s_k) = \prod_{i=1}^k P(\text{step } i \text{ correct} \mid s_1, \dots, s_i)

Tree search over reasoning steps decides which partial solution to extend next, for example with the upper-confidence rule of Monte Carlo tree search, where V(s)V(s) is the estimated value of node ss and NN counts visits:

UCB(s)=V(s)+clog⁡NparentNs\text{UCB}(s) = V(s) + c\sqrt{\frac{\log N_{\text{parent}}}{N_s}}

How much accuracy improves with more inference compute is an empirical question that depends on the model, the task and how the compute is spent; it is not a fixed law (Snell et al., 2025).

Key Papers

Scaling LLM Test-Time Compute Optimally Can be More Effective than Scaling Parameters for Reasoning

Snell et al.2025ICLR
Read paper →

Let's Verify Step by Step

Lightman et al.2024ICLR
Read paper →

Training Verifiers to Solve Math Word Problems

Cobbe et al.2021arXiv
Read paper →

Learning to Reason with LLMs

OpenAI2024OpenAI (blog post)
Read paper →

Connections

Where to go next

A newer notebook covers Test-Time Compute, with an interactive demo.

Continue in the newer notebook