CSCE 471 Natural Language Processing · Spring 2027

Test-Time Scaling

Kuan-Hao Huang · Course Website

Note: This page was created with the help of AI as a supplementary reading. It may contain errors or simplifications. The lecture slides are the primary reference for this course; please refer to them first.

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).

After reading this, you should be able to explain why chain-of-thought reasoning helps and what a reasoning model does · define test-time scaling and contrast it with train-time scaling · compute pass@k and explain why it assumes an oracle · choose final answers with majority voting and with a verifier · describe how verifiers are trained (outcome vs. process rewards) · explain sequential scaling and budget forcing · compare parallel and sequential scaling

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 scalingTest-time scaling
What growsparameters, training data, training computecomputation per question at inference
When the cost is paidonce, before deploymentevery time a question is answered
Examplesa 70B model instead of an 8B modelsampling 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:

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.

Number of samples $k$:
Figure 1 (interactive). pass@k $=1-(1-p)^k$ for problems of different difficulty, where $p$ is the chance that a single sample is correct. Hard problems ($p=0.01$) are rarely solved with one attempt but often solved with hundreds.
The catch: pass@k assumes an oracle. To count a problem as solved, someone has to recognize which of the $k$ outputs is correct. For code, unit tests can check each program; for a math problem with a known answer, we can compare. But when answering a new question, we do not know the answer. We must choose one output to return, and choosing well is the hard part.

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.

Problem

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?

Selection:
Figure 2 (interactive). Sampling reasoning paths for a GSM8K-style problem (correct answer: 18 dollars). Each path ends in an answer; majority vote returns the most common one, while best-of-N returns the path with the highest verifier score (shown on each card; illustrative). With only one or two samples the result can be wrong; with more samples the correct answer usually wins.

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.

Scenario:
Figure 3 (interactive). Simulated accuracy of three ways to use $N$ samples, on a toy problem (averaged over 2,000 random trials). pass@N assumes an oracle and is an upper bound. Majority vote follows the most common answer, so it fails when a wrong answer is the most common. Best-of-N uses an imperfect verifier that tends to score correct solutions higher. The answer distribution and verifier quality are illustrative.

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:

Budget:
Figure 4 (interactive). Budget forcing on “How many r in raspberry?”, adapted from the s1 paper. Stopping early or naturally gives the wrong answer 2; appending “Wait” makes the model re-read the question, recount, and answer 3.

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

ParallelSequential
Howgenerate many independent outputsone longer reasoning chain (or rounds of revision)
Choosing the answermajority vote, or best-of-N with a verifierthe final answer of the chain
Strengthsoutputs can run in parallel (low latency); simplelater steps use earlier work; self-correction
Limitationsneeds a good selection method; voting saturatessteps run one after another (high latency); can overthink

7Summary

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$.)

pass@1 $=0.2$. pass@5 $=1-0.8^5\approx 1-0.33=0.67$. pass@10 $=1-0.8^{10}\approx 1-0.11=0.89$. With unit tests to check each program, sampling 10 times solves the problem 89% of the time.

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?

18 (three votes). With very many samples, majority vote returns the most likely answer, 26, even if 18 is correct: more samples cannot fix a model that is consistently wrong. A verifier could still pick an 18 solution if it scores those higher.

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?

Outcome labels: 1.0, 0.0, 1.0. A process verifier needs a label for each step (correct or not), e.g., marking the step in the second solution where the reasoning went wrong. Such step labels are more informative but harder to obtain.

Quick quiz

9Further reading