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

Test-time compute scaling can beat scaling model parameters when allocated per prompt

Charlie Snell, Jaehoon Lee, Kelvin Xu, Aviral Kumar · arXiv · 2024-8-6

- **Problem** Prior work on extra inference-time compute gives mixed results, and gains on hard math reasoning look highly limited. It is unclear how far a fixed inference budget can improve a model on a challenging prompt.
- **Method** Compute-optimal scaling picks the test-time strategy for each prompt based on its difficulty. Difficulty is estimated from the base model's pass@1 rate, and the strategy is chosen per difficulty bin on a validation set.
- **Results** Compute-optimal search nearly matched PRM best-of-N using 4x less test-time compute. The comparison used 16 generations against 64 for the baseline.

## Why extra inference compute gives mixed results

Prior work on inference-time computation reports mixed results, and that leaves open how much extra compute helps a hard prompt. Other work shows that these methods remain highly limited on complex tasks such as math reasoning. The authors argue that reasoning problems often require drawing inferences from existing knowledge rather than learning new knowledge.

That gap is why the paper asks how far an LLM can improve on a challenging prompt with a fixed, non-trivial inference budget.

The authors expect test-time compute to help most when the model already has the knowledge and the challenge lies in drawing inferences from it. They use the MATH benchmark because it tests this kind of inference over knowledge the model already has. The simplest method is best-of-N sampling, which draws N answers in parallel from a base LLM.

A learned verifier or reward model then scores those answers, and the highest-scoring one is kept.

Best-of-N is not the only option, because the proposal distribution can be changed. For example, the base model can revise its original responses sequentially. The verifier can also be changed, for example by training a process-based dense verifier and searching against it. The paper finds that which of these methods works best depends on both the problem and the base LLM.

Easier problems may favor sequential revisions, whereas harder problems may favor parallel sampling or tree search against a process-based reward model.

## A per-question allocation of compute

The key idea is to choose the test-time strategy for each prompt, based on how hard the prompt is for the base model, instead of applying one recipe everywhere. The authors view every method as changing the model's output distribution in one of two ways: by adding input tokens that condition the LLM, or by sampling candidates and then scoring them.

The paper studies two independent axes: modifying the proposal distribution, and using a verifier to choose among outputs. Sequential revisions sit on the proposal axis, since each attempt is conditioned on earlier ones, while PRM tree search sits on the verifier axis.

Formally, Target(θ, N, q) is the distribution over output tokens for prompt q under hyperparameters θ and a generation budget N. Written out, the compute-optimal choice is \\\[\\theta^\*\_{q,y^\*(q)}(N) = \\arg\\max\_{\\theta} \\mathbb{E}\_{y\\sim \\mathrm{Target}(\\theta,N,q)}\[\\mathbf{1}\_{y=y^\*(q)}\],\\\] where y\*(q) is the ground-truth correct response for q.

Because the ground truth is unknown at deployment, the authors approximate this optimum with difficulty bins, choosing the best strategy for each bin on a validation set. Difficulty is the base model's pass@1 rate, estimated from 2048 samples per question and split into five quantiles. Model-predicted difficulty replaces the ground truth with the averaged final score of a learned verifier over the same samples.

## Models and benchmark for the test-time compute analysis

The analysis runs on the MATH benchmark, which holds high-school competition math problems across a range of difficulty levels. The authors use the MATH split of 12k train and 500 test questions, the same split Lightman et al. used. Because the authors expect test-time compute to help most when a model already has the knowledge needed, they chose a math task where the main challenge is drawing complex inferences from that knowledge.

The experiments use models finetuned on MATH with PaLM-2 base models, so the revision and verification skills are present.

The base model is PaLM 2-S\* (Codey), which the authors chose because it reaches non-trivial MATH accuracy without saturating. The authors argue that this model represents many contemporary LLMs, so they expect their findings to transfer to similar models. Base models lack revision and verification abilities on MATH, so the authors finetune models for those capabilities.

They expect future LLMs to gain these skills through pretraining, so the finetuning step is a stand-in for that.

The revision model follows the recipe of Qu et al., while the verifier is a process reward model trained without human labels.

## Searching against a process reward model

The PRM800k data from Lightman et al. proved largely ineffective for the PaLM 2 models, because a PRM trained on it was easy to exploit. The authors suspect the cause is a distribution shift between the GPT-4 generated samples in that dataset and their own PaLM 2 outputs. Rather than collecting crowd-worker labels, they applied the approach of Wang et al.

to supervise PRMs without human labels. That approach estimates per-step correctness from Monte Carlo rollouts launched at each step of a solution. The PRM consistently outperformed the ORM baseline in their comparison, so every search experiment in this section uses it.

Each answer's final score is the PRM's prediction at its last step, not a product or minimum over all steps. The authors found this last-step aggregation performed best among the aggregation methods they studied. Best-of-N weighted then sums the verifier's scores over all solutions that share a final answer and selects the answer with the greatest total.

Beam search starts by sampling N initial predictions for the first step and scoring them with the PRM. It then keeps the top N×M highest scoring steps and samples M proposals from each, yielding N/M×M candidate prefixes. The search runs until a solution ends or 40 rounds of beam expansion are reached, then applies best-of-N weighted selection to the N final candidates.

Lookahead search rolls out up to k steps at temperature 0 and scores each step by the PRM value at the rollout's end. Beam search is the special case of lookahead search with k = 0, and lookahead costs N×(k+1) samples.

With smaller generation budgets, beam search significantly outperformed best-of-N in the comparison. As the budget grew, those gains greatly diminished, and beam search often fell below the best-of-N baseline. The authors attribute the diminishing returns to exploitation of the PRM, where search produces repetitive low-information steps or overly short solutions.

Split by difficulty, beam search degraded on levels 1 and 2 as the budget rose, while on levels 3 and 4 it consistently beat best-of-N. The authors explain the easy-question drop by saying the verifier already makes mostly correct assessments there, so further optimization only amplifies its spurious features.

Choosing the best search setting for each difficulty bin, compute-optimal search nearly outperformed PRM best-of-N with 4x less test-time compute. The comparison used 16 generations against 64 for the baseline, in the low generation budget regime. Using predicted difficulty, some of these benefits diminish at higher budgets, while oracle bins still show continued improvements.

The takeaway is that beam search suits harder questions and lower budgets, while best-of-N suits easier questions and higher budgets.

## Sequential revisions on the proposal side

Plain prompting rarely makes LLMs fix their own reasoning mistakes, so the authors finetune revision models instead. They follow the Qu et al. recipe but build multi-turn data after the fact from 64 responses sampled in parallel at a higher temperature. Each training context pairs a correct answer with up to four incorrect ones, and the count is sampled uniformly from 0 to 4.

A character edit distance metric picks incorrect answers that resemble the correct one, because random pairing gives uncorrelated context. At test time the model runs longer chains by keeping only its most recent four revised responses in context. Pass@1 rises gradually at each step, even beyond the four revision steps used in training.

With both verifier-based and majority-based selection, sequential sampling narrowly outperforms parallel sampling at the same budget. The authors also found a distribution shift: the model sometimes turns a correct answer in context into an incorrect one. Around 38% of correct answers were converted back to incorrect ones under a naive approach.

So the authors select the final answer with sequential majority voting or verifier-based selection.

Parallel sampling acts as a global search that can cover many different high-level approaches. Sequential sampling acts as a local refinement process for responses already somewhat on the right track. The paper suggests splitting the budget N as √N for parallel samples and √N for sequential revisions. Easy questions benefit most from purely sequential compute, while difficult questions do best with a balance of the two.

At higher generation budgets, parallel sampling plateaus, whereas compute-optimal scaling keeps improving.

## Trading test-time compute for pretraining

The authors ask whether a fixed FLOPs budget is better spent on a larger pretrained model or on test-time compute for a smaller one. They scale model parameters by a factor of M and keep the training data amount fixed, following the open-source LLaMA series approach. Pretraining FLOPs are approximated as X = 6N D\_pretrain, and inference FLOPs as Y = 2N D\_inference.

Multiplying the parameters by M multiplies both pretraining and inference FLOPs by M, giving M(X+Y) total FLOPs. To match this, the smaller model's inference compute is multiplied by M + 3(D\_pretrain / D\_inference)(M − 1).

The ratio R is defined as the inverse of D\_pretrain / D\_inference, so R depends on the production setting. Large production settings may have R \>\> 1, because they expect many more inference tokens than pretraining tokens. Many self-improvement setups generate significantly fewer inference tokens than pretraining tokens, which gives R \<\< 1.

The authors use the stars in Figure 9 to show the greedy pass@1 of a base model pretrained with about 14 times more parameters.

The authors test three values of R: 0.16 (R \<\< 1), 0.79 (R about 1), and 22 (R \>\> 1). A star below the line means test-time compute is more effective than scaling model parameters. On easy questions or at R \<\< 1, test-time compute can generally outperform scaling model parameters. On harder questions or at R \>\> 1, pretraining is the more effective way to improve performance.

For very difficult questions in bins 4 and 5, pretraining is often more effective.

Test-time and pretraining compute are not one-to-one exchangeable, so the answer depends on difficulty and inference load. Self-improvement pipelines, which need fewer inference tokens, fall on the side where test-time compute helps. The authors didn't test a compute-optimal pretraining scaling, which scales data and parameters equally.

## Limits of the current evidence

The experiments rest on MATH and one base model, PaLM 2-S\*, so the authors expect their findings to transfer to similar models without testing that. Across the evaluated schemes, the gains on hard problems stayed small. The authors didn't combine PRM tree search with revisions, and they didn't study critique and revise.

Future work, they write, should investigate how combining these approaches can further improve test-time compute scaling. Model-predicted difficulty still needs extra inference computation to estimate each question's difficulty. The experiments leave that cost out, largely for simplicity, because the goal was to show what is possible with allocating test-time compute.

Estimating difficulty more cheaply, or switching between estimating it and solving the question, is left to future work.

The authors expect future LLMs to be pretrained for verification and revision directly, which would avoid capability-specific finetuning. That remains an expectation, because the present study still relies on finetuned revision and verification models. The authors also envision feeding the outputs of test-time compute back into the base LLM as an iterative self-improvement loop.

## Paper info

- **Authors**: Charlie Snell, Jaehoon Lee, Kelvin Xu, Aviral Kumar
- **Venue**: arXiv · Preprint
- **First published**: 2024-8-6
- **Added**: 2026-11-12
- **Updated**: 2024-8-6
- **Version**: v1
- **arXiv**: 2408.03314
- **Category**: cs.LG · cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2408.03314v1) · [PDF ↗](https://arxiv.org/pdf/2408.03314v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Charlie Snell, Jaehoon Lee, Kelvin Xu, Aviral Kumar (2024). Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters. arXiv:2408.03314v1. https://arxiv.org/abs/2408.03314v1

**BibTeX**

```
@misc{snell2024scaling,
  title = {{Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters}},
  author = {Charlie Snell and Jaehoon Lee and Kelvin Xu and Aviral Kumar},
  year = {2024},
  eprint = {2408.03314},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.03314v1}
}
```

## Other paper commentary

- [Conditional Prompt Learning for Vision-Language Models](https://refivu.com/en/papers/aafdc9ad-313a-44a6-bed9-42556a8097ea-conditional-prompt-learning-for-vision-language-models.md)
- [Federated Learning for Mobile Keyboard Prediction](https://refivu.com/en/papers/e56197ce-a521-4965-9369-f978e10dc5fe-federated-learning-for-mobile-keyboard-prediction.md)
- [Ethical and social risks of harm from Language Models](https://refivu.com/en/papers/d42d41ba-833b-45f6-8837-7bfc3f4d36d8-ethical-and-social-risks-of-harm-from-language.md)
- [PaLM 2 Technical Report](https://refivu.com/en/papers/9930c339-e7c2-4330-9ea3-867aad7f3368-palm-2-technical-report.md)
- [A Survey on In-context Learning](https://refivu.com/en/papers/e3dcb216-0b54-4a23-8e0d-f077c493f505-a-survey-on-in-context-learning.md)
- [LaMDA: Language Models for Dialog Applications](https://refivu.com/en/papers/9474e307-9624-4203-a346-57d881b1a5d9-lamda-language-models-for-dialog-applications.md)
- [Return of Frustratingly Easy Domain Adaptation](https://refivu.com/en/papers/0a776e2c-6337-4850-9be1-86de976005d2-return-of-frustratingly-easy-domain-adaptation.md)
- [Celeb-DF: A Large-scale Challenging Dataset for DeepFake Forensics](https://refivu.com/en/papers/127fcad1-737e-4bb9-b7b5-7c87f1ab7614-celeb-df-a-large-scale-challenging-dataset-for.md)
- [Cascade R-CNN: High Quality Object Detection and Instance Segmentation](https://refivu.com/en/papers/484c94a6-ca7a-4e4d-a933-9ea5ec919a68-cascade-r-cnn-high-quality-object-detection-and.md)
- [DSSD : Deconvolutional Single Shot Detector](https://refivu.com/en/papers/800d2066-c083-45ac-bb3d-507e72445f62-dssd-deconvolutional-single-shot-detector.md)
- [Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models](https://refivu.com/en/papers/d7cee9c8-e38d-4e30-b35b-f069db83f282-qwen3-embedding-advancing-text-embedding-and-reranking.md)
- [Stacked Attention Networks for Image Question Answering](https://refivu.com/en/papers/aa94a5f2-b4fb-441a-af4b-22eda9ad2985-stacked-attention-networks-for-image-question-answering.md)

## Terms in this paper

- [beam search](https://refivu.com/en/terms/3e449f8f713b-beam-search)
- [pass@1](https://refivu.com/en/terms/0b5f8fd75383-pass-1)
- [MATH](https://refivu.com/en/terms/42d0fca44930-math)
- [Majority Voting](https://refivu.com/en/terms/20e954015dfd-majority-voting)
- [PaLM 2-S\*](https://refivu.com/en/terms/25ca8a17cf78-palm-2-s)
- [parallel sampling](https://refivu.com/en/terms/2d55973d4b78-parallel-sampling)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/350f97d7-d2c2-4a88-b5c0-509ed346afa9-scaling-llm-test-time-compute-optimally-can-be)
