JA EN
LearnLarge Language Models
·★ MEMBER·PAPER·13 min read

Test-Time Scaling — How Models Get Better by Thinking Longer

The same model scores higher when you let it think longer. This article builds the idea from scratch: chain-of-thought as purchased compute steps, self-consistency by majority vote, verifiers that pick the winner, and o1-style models that learned the thinking itself — and what it means for compute to shift from training to inference.

ModalitytextTaskreasoning

Chain-of-Thought Prompting Elicits Reasoning in Large Language Models

Primary source — what this article is built on

undefined2022-01-28undefined2026-08-274y 7mo later

Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans et al. · 2022-01-28 · v6arXiv:2201.11903Paper page·PDF
Self-Consistency Improves Chain of Thought Reasoning in Language ModelsarXiv:2203.11171Paper page·PDF
Training Verifiers to Solve Math Word ProblemsarXiv:2110.14168Paper page·PDF
Let's Verify Step by SteparXiv:2305.20050Paper page·PDF
Large Language Monkeys: Scaling Inference Compute with Repeated SamplingarXiv:2407.21787Paper page·PDF
Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model ParametersarXiv:2408.03314Paper page·PDF
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement LearningarXiv:2501.12948Paper page·PDF
undefined

We explore how generating a chain of thought -- a series of intermediate reasoning steps -- significantly improves the ability of large language models to perform complex reasoning. In particular, we show how such reasoning abilities emerge naturally in sufficiently large language models via a simple method called chain of thought prompting, where a few chain of thought demonstrations are provided as exemplars in prompting. Experiments on three large language models show that chain of thought prompting improves performance on a range of arithmetic, commonsense, and symbolic reasoning tasks. The empirical gains can be striking. For instance, prompting a 540B-parameter language model with just eight chain of thought exemplars achieves state of the art accuracy on the GSM8K benchmark of math word problems, surpassing even finetuned GPT-3 with a verifier.


The long think and the snap answer

People spend more time on harder problems. A chess player will sit motionless for ten minutes over a difficult position, then answer "what's 3 plus 4?" without pausing. Matching effort to difficulty is so ordinary that we never notice we're doing it.

Language models spent years without that ability. Whether you ask "what's 1 plus 1?" or "solve this open problem," producing one token costs exactly the same amount of arithmetic, because the layer count is fixed. A 24-layer model runs 24 layers' worth of computation on any input and emits the next word. It cannot think harder, and it cannot coast.

Picture an exam instead. If the instructions say "no working — write the answer only," you can solve whatever you can do in your head, and nothing more. Hand you scratch paper and suddenly three-digit multiplication is within reach. Your ability didn't change; you were given somewhere to work. Test-time scaling is the practice of handing that scratch paper to a language model — and the paper turns out to be the model's own stream of output tokens.

Compute has two places to live

The cost of a large model splits by when you pay it. Training compute is estimated from parameter count NN and training tokens DD roughly as:

Ctrain6NDC_{\text{train}} \approx 6ND
(1)

Read it as: total training cost is a fixed number of operations per parameter, per token. The constant 6 comes from counting the multiply-adds in the forward and backward passes together. Spelled out in words: NN is how many knobs the model has and DD is how much text it was shown, which says that doubling either one doubles the electricity bill for training. Budgeting against this equation is exactly what scaling laws are about.

Inference compute, by contrast, is governed by the number of tokens TT you push through:

Cinfer2NTC_{\text{infer}} \approx 2NT
(2)

Read it as: about two operations per parameter per token — smaller than training's constant because there is no backward pass. Put in words, TT counts every token read and written, so the bill grows with how much the model writes even though the weights never change.

The decisive difference is how many times you pay. Training is paid once and amortized across every user forever; inference is paid on every single request. That asymmetry is why the industry spent years trying to shrink inference — quantization, distillation, KV caching. Test-time scaling takes the opposite bet: deliberately inflate TT, and buy accuracy with the extra compute.

Why emitting tokens makes a model smarter

This is the crux. When a Transformer produces one token, the compute available to it is capped at "layers × cost per layer." One token is one step of computation, and no more. A problem that genuinely requires several stages of reasoning does not fit inside that one step.

But if the model writes an intermediate result into its output, it can read that result back as input when producing the next token. The moment it writes, two things happen at once: the intermediate value is parked in external memory, and one more computation step is unlocked. Write ten tokens and you have effectively bought ten extra steps.

That is all chain-of-thought (CoT) really is. "Let's think step by step" is not a motivational phrase — it's a purchase order for additional compute steps. Which parts of the CoT paper (Wei et al., 2022) were actually demonstrated, and which parts of prompt folklore were never tested, is the subject of the science of prompt engineering. The finding that matters here is that CoT is emergent above a certain model scale. Ask a small model to show its working and it writes plausible-looking broken working, and accuracy drops. Scratch paper is useless if you have nothing to write on it.

A single chain snaps in the middle

CoT's weakness is that there is only one reasoning path. Generation is stochastic: at each step the model draws a token from a distribution. Get a sign wrong at step three and the answer is wrong no matter how careful the remaining steps are — and it will be wrong in a confident tone of voice.

Take a concrete case: "You save 30 dollars a month and spent 120 dollars along the way. What's the balance after 18 months?" There are several valid routes — total the 18 months first and then subtract, or track the running balance month by month. Every route reaches the same answer, but which route the model takes is decided at sampling time, by chance. And if it fumbles "30 × 18" as 520 somewhere along that route, everything after it is built on the error. A person would sanity-check the multiplication. CoT accepts whatever it just wrote and moves on.

How much variation there is comes down to temperature. Near zero, the model always takes the highest-probability token, so running it a hundred times returns the same answer a hundred times. Raise it and the distribution flattens, letting second- and third-choice paths surface. Use the figure below to feel how the distribution sharpens and flattens as you drag the temperature — that flatness is the fuel every technique in this article runs on.

FIG 1Lower the temperature and one path dominates (sample it repeatedly and you get the same answer every time); raise it and alternatives appear. Test-time scaling is the business of converting that diversity into compute

Sample sixteen times at temperature 0 and you get sixteen copies of one answer: sixteen times the bill for one answer's worth of information. Without diversity, solving repeatedly buys you nothing. Push temperature too high and the working itself falls apart. That tension is the first knob.

Solve it many times and take a vote

Once you can sample multiple paths, the next move is obvious: generate N solutions and take a majority vote on the final answer. This is Self-Consistency (Wang et al., 2022). The justification is marginalization — what you care about is the probability of the answer aa, not the path rr that produced it.

P(ax)=rP(a,rx)P(a \mid x) = \sum_{r} P(a, r \mid x)
(3)

Read it as: the probability of answer aa to problem xx is the sum of the probabilities of every route rr that arrives at aa — which says that an answer's standing comes not from the single likeliest route to it, but from how many routes land on it once you add them all up. Greedy CoT decoding looks at only the single highest-probability route in that sum and reports its answer. Different routes give different answers, and it counted exactly one vote.

The intuition: there are many roads to the right answer, but mistakes scatter. Correct solutions pile up on one value, while arithmetic slips land on a different wrong value each time and split the vote. The self-consistency paper reports a +17.9 point gain on GSM8K (grade-school word problems) over plain CoT with PaLM

What's behind this

§

Members-only from here

371 walkthroughs, 26 textbook chapters, 48 student units and 6 close readings — all included for $4.99/mo, with three new explainers every day. Cancel any time; access runs to the end of the period.

Already a member? Sign in to keep reading

References

  1. Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.. (2022-01-28) Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. arXiv:2201.11903Paper page·PDF
  2. Self-Consistency Improves Chain of Thought Reasoning in Language Models. arXiv:2203.11171Paper page·PDF
  3. Training Verifiers to Solve Math Word Problems. arXiv:2110.14168Paper page·PDF
  4. Let's Verify Step by Step. arXiv:2305.20050Paper page·PDF
  5. Large Language Monkeys: Scaling Inference Compute with Repeated Sampling. arXiv:2407.21787Paper page·PDF
  6. Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters. arXiv:2408.03314Paper page·PDF
  7. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv:2501.12948Paper page·PDF

This article is written from the source paper above. Where they differ, the original is authoritative.

Comments

Sign in to comment