For years, the recipe for a better language model was to make training bigger: more parameters, more data, more compute. Recently a second dial has become just as important: spending more compute when the model is used. Let the model think longer, or try many times and pick the best attempt, and the same model can solve problems it would otherwise get wrong.
This is test-time scaling (also called inference-time scaling). This reading explains why reasoning matters, then covers the two main families of test-time scaling: parallel scaling (sample many answers and choose one) and sequential scaling (make a single reasoning chain longer).
1Reasoning is the key
Chain-of-thought (CoT) prompting showed that language models answer multi-step questions much better when they write out intermediate steps before the final answer. Given “A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?”, a model asked for the answer directly may say 8. Adding just “Let's think step by step” (zero-shot CoT; Kojima et al., 2022) leads it to write “There are 16 balls in total. Half of the balls are golf balls. That means there are 8 golf balls. Half of the golf balls are blue. That means there are 4 blue golf balls”, and get it right.
Writing out steps helps because each generated token gives the model more computation: a hard problem gets broken into easier sub-steps, each conditioned on the previous ones. So a natural question is: how can we encourage models to produce better and longer reasoning chains?
Reasoning models
Models such as OpenAI's o1 and DeepSeek-R1 are trained to do exactly this. Before answering, a reasoning model produces a long internal reasoning trace (for example, between <think> and </think>), often thousands of tokens long. In these traces the model tries approaches, checks its work, and backtracks: DeepSeek-R1's traces famously contain moments like “Wait, wait. That's an aha moment I can flag here. Let's reevaluate this step-by-step…”. Such models are typically trained with reinforcement learning on problems with checkable answers. Crucially, they tend to perform better the longer they are allowed to think.
2What is test-time scaling?
Test-time scaling means improving a model's performance at inference time by allocating more computation while answering, without changing the model's size or retraining it from scratch.
| Train-time scaling | Test-time scaling | |
|---|---|---|
| What grows | parameters, training data, training compute | computation per question at inference |
| When the cost is paid | once, before deployment | every time a question is answered |
| Examples | a 70B model instead of an 8B model | sampling 64 answers and voting; thinking for 10,000 tokens |
The two can trade off: a smaller model with more test-time compute can sometimes match a larger model. There are two basic ways to spend that compute:
- Parallel scaling: generate many independent outputs for the same input, then pick one.
- Sequential scaling: generate one output, but make it longer, with each step building on the previous ones.
3Parallel scaling: repeated sampling
The simplest test-time strategy: sample many outputs for the same problem. Because sampling is random, different attempts take different paths, and some may be correct even if most are not. This is the idea behind the paper Large Language Monkeys (Brown et al., 2024), named after the infinite monkey theorem: a monkey hitting random keys on a typewriter for an infinite amount of time will almost surely type any given text, even the complete works of Shakespeare. A language model is a far better typist than a monkey, so it needs far fewer tries.
pass@k
To measure how often repeated sampling can succeed, we use pass@k (also called coverage): sample $k$ outputs for a problem; the problem counts as solved if at least one of the $k$ outputs is correct. If a single sample is correct with probability $p$, and samples are independent,
$$\text{pass@}k = 1-(1-p)^k.$$Even a small $p$ grows quickly: with $p=0.01$, pass@100 is already about 63%. Large Language Monkeys found that coverage on math and coding benchmarks keeps rising steadily as the number of samples grows into the thousands.
4Choosing the final answer
Majority vote (self-consistency)
Self-consistency (Wang et al., 2023): sample several chain-of-thought reasoning paths, extract the final answer from each, and return the answer that appears most often. Different reasoning paths that arrive at the same answer support each other; errors tend to scatter across different wrong answers.
Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder for 2 dollars per egg. How much does she make every day?
Majority voting is simple and needs no extra model, but it has limits. It only works when answers can be compared (a number, a multiple-choice letter), not for free-form text or code. And it saturates: if the model is consistently wrong in the same way, more votes only make it more confidently wrong. In Hugging Face's experiments on the MATH-500 benchmark, majority voting with Llama 3.2 1B improved accuracy from about 26% to about 45% as the number of samples grew to 256, but leveled off well below a larger 8B model.
Best-of-N with a verifier
Instead of counting votes, we can train a verifier: a model that reads a (question, solution) pair and outputs a score for how likely the solution is correct (Cobbe et al., 2021). Best-of-N samples $N$ solutions, scores each with the verifier, and returns the highest-scoring one.
Training a verifier. Take training problems with known answers. Sample many solutions from the model, and label each one 1.0 if its final answer matches the ground truth and 0.0 otherwise. Train the verifier (typically a language model with a scoring head) to predict these labels. At test time, no ground truth is needed: the verifier has learned what correct solutions tend to look like.
- Outcome reward model (ORM): scores only the complete solution, as above.
- Process reward model (PRM): scores every intermediate step, so it can catch a mistake as soon as it happens. PRMs can also guide a search, for example keeping only the most promising partial solutions at each step (beam search).
5Sequential scaling
Parallel samples are independent: attempt 7 learns nothing from attempts 1–6. In sequential scaling, later computation builds on earlier computation: a single, longer reasoning chain in which the model can check and revise its own work, or several rounds in which each new output is produced after seeing the previous one.
Do longer reasoning chains lead to better performance? For reasoning models, often yes. But that raises a practical question: how can we control how long a model thinks?
Budget forcing
The paper s1: Simple test-time scaling (Muennighoff et al., 2025) proposed budget forcing, a simple way to control the length of a reasoning trace at decoding time:
- To make the model think longer: when it tries to end its reasoning, suppress the end-of-thinking token and append “Wait”. The model then reconsiders, and often catches its own mistakes.
- To make the model stop: once the budget is used up, append the end-of-thinking token and “Final Answer:”, forcing it to answer now.
With budget forcing, the s1 model (Qwen2.5-32B-Instruct fine-tuned on only 1,000 carefully chosen reasoning examples) improved steadily on PhD-level science questions (GPQA Diamond) as its thinking budget grew, reaching about 60% accuracy. In the same plot, majority voting with the original Qwen2.5-32B-Instruct improved much more slowly. One caution when reading this comparison: the two curves use different models (one fine-tuned for reasoning, one not), so it shows the promise of sequential scaling rather than a strict head-to-head test.
6Parallel vs. sequential
| Parallel | Sequential | |
|---|---|---|
| How | generate many independent outputs | one longer reasoning chain (or rounds of revision) |
| Choosing the answer | majority vote, or best-of-N with a verifier | the final answer of the chain |
| Strengths | outputs can run in parallel (low latency); simple | later steps use earlier work; self-correction |
| Limitations | needs a good selection method; voting saturates | steps run one after another (high latency); can overthink |
- They can be combined: sample several long reasoning chains and vote among them.
- The best strategy depends on the problem. Snell et al. (2024) found that easier problems benefit more from sequential revision while harder ones benefit from parallel search, and that allocating test-time compute well can let a small model outperform a model 14 times larger on some problems.
- Costs. Every extra token costs time and money at every query. Reasoning models can also overthink, spending thousands of tokens on easy questions.
7Summary
- Chain-of-thought reasoning helps models solve multi-step problems; reasoning models produce long reasoning traces before answering.
- Test-time scaling improves performance by spending more computation at inference rather than training a bigger model.
- Parallel scaling samples many outputs. pass@k $=1-(1-p)^k$ measures what an oracle could achieve; in practice we choose with majority vote (self-consistency) or best-of-N with a trained verifier (ORM or PRM).
- Sequential scaling makes one reasoning chain longer; budget forcing controls its length by appending “Wait” or forcing “Final Answer:”.
- Both trade extra inference cost for accuracy, and they can be combined.
8Practice
Exercise 1: pass@k
A model solves a coding problem with probability $p=0.2$ per sample. What is pass@1, pass@5, and pass@10? (Use $0.8^5\approx 0.33$.)
Exercise 2: majority vote
Five sampled answers are 18, 26, 18, 14, 18. What does majority vote return? If the model's answer distribution were 26 with probability 0.5 and 18 with probability 0.3, what would majority vote return with very many samples?
Exercise 3: training a verifier
For a problem whose ground-truth answer is 42, the model produces three solutions ending in 42, 40, and 42. What training labels does an outcome verifier get? What extra labels would a process verifier need?
Quick quiz
9Further reading
- Beeching, Tunstall & Rush (2024). Scaling Test-Time Compute with Open Models. Hugging Face blog. (Majority vote, best-of-N, and search with verifiers, with plots.)
- Weng (2025). Why We Think. (A survey of test-time compute and reasoning.)
- Muennighoff et al. (2025). s1: Simple Test-Time Scaling.
- Brown et al. (2024). Large Language Monkeys: Scaling Inference Compute with Repeated Sampling.
- Wang et al. (2023). Self-Consistency Improves Chain of Thought Reasoning in Language Models. ICLR.
- Snell, Lee, Xu & Kumar (2024). Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters.