Reasoning models and test-time compute¶
A reasoning model writes a long chain of thought before it answers, and it was trained by reinforcement learning to make those chains lead to answers a checker accepts. The result is a second scaling axis: alongside bigger models and more data, you can buy accuracy with more tokens of thinking per question.
10,000 ft
For a decade, capability came from training-time scaling: more parameters, more data, more compute, fixed cost per answer. In September 2024 OpenAI's o1 showed a second curve — accuracy that keeps rising with the compute spent at inference, by thinking longer — and in January 2025 DeepSeek-R1 showed openly how to get it: reinforcement learning with verifiable rewards on maths and code, with a simple policy-gradient algorithm (GRPO), and long thinking emerging on its own. By 2026 every frontier lab ships a thinking mode. The idea connects many threads: sampling (diversity is what parallel search consumes), long context (chains run to tens of thousands of tokens), MoE and efficient attention (thinking tokens must be cheap), agents (a tool-using agent is a reasoning model whose chain includes actions), and interpretability and safety (can you trust a chain of thought to show what the model is really doing?).
2,000 ft
- Why thinking helps. A transformer does a fixed amount of computation per token. Writing intermediate steps gives it more serial computation and a scratchpad it can read back.
- Elicit it with prompting (chain of thought, 2022), then sample many chains and vote or verify (self-consistency, best-of-N).
- Train it with RL: sample several attempts per problem, reward the ones a program verifies as correct, push the policy towards them. Long chains with checking and backtracking emerge because they earn reward.
- Spend it at test time three ways: sequentially (think longer), in parallel (sample N and aggregate) or as search guided by a verifier. The best mix depends on how hard the question is.
- Price it. Thinking tokens cost latency and money, models overthink easy questions, and the written chain is not a faithful log of the computation.
Ground level¶
Why writing steps out helps a transformer¶
A forward pass through a transformer is a fixed-depth circuit: \(L\) layers, the same arithmetic whether the question is "2 + 3" or a competition problem. Each generated token gets one such pass. If an answer requires more sequential steps than the network has layers — carrying digits through a long multiplication, tracking a variable through a loop, trying a case and discarding it — the model cannot do it "in its head" in one token. But each token it writes is fed back as input, so a chain of \(T\) tokens is a computation \(T\) passes deep, with the text itself as working memory.
This is not just intuition. Li, Liu, Zhou and Ma proved that constant-depth transformers without a chain of thought are confined to small parallel complexity classes (\(\mathsf{AC}^0\) with constant precision), while with \(T\) steps of chain of thought they "can solve any problem solvable by boolean circuits of size \(T\)" (arXiv:2402.12875); Merrill and Sabharwal give matching results on how expressivity grows with the number of steps (arXiv:2310.07923). Empirically, CoT helps most on exactly the inherently serial tasks: composing permutations, iterated squaring, evaluating circuits.
What it costs. A forward pass costs about \(2N\) FLOPs per token for \(N\) active parameters. A model with 37B active parameters (DeepSeek-V3's size, the base of R1) writing a 10,000-token chain spends \(2 \times 37 \times 10^9 \times 10^4 = 7.4 \times 10^{14}\) FLOPs on one answer — twenty times a 500-token direct answer, and a decode-bound, bandwidth-limited twenty times at that.
From prompting to sampling¶
The capability was there before anyone trained for it.
- Chain-of-thought prompting. Wei et al. showed that including a few worked examples with written reasoning made large models dramatically better at arithmetic and logic; with eight such exemplars, PaLM 540B reached state of the art on GSM8K, "surpassing even finetuned GPT-3 with a verifier" (arXiv:2201.11903). Scratchpads had shown the same for program execution (arXiv:2112.00114).
- Zero-shot CoT. Simply appending "Let's think step by step" raised InstructGPT (text-davinci-002) from 17.7% to 78.7% on MultiArith and 10.4% to 40.7% on GSM8K (arXiv:2205.11916).
- Self-consistency. Sample many chains at non-zero temperature and take the most common final answer: +17.9 points on GSM8K over greedy CoT (arXiv:2203.11171). Different correct chains tend to agree on the answer; wrong chains tend to scatter.
- Bootstrapping. STaR fine-tuned a model on its own chains that reached correct answers, then repeated — the model learning from its own successful reasoning (arXiv:2203.14465). This is the seed of the RL recipe below.
Two ways to spend compute: in parallel and in sequence¶
Parallel sampling draws \(N\) independent attempts. Its ceiling is coverage, or pass@\(k\): the probability that at least one of \(k\) samples is right. If one sample succeeds with probability \(p\), then \(\text{pass@}k = 1 - (1 - p)^k\). A model that solves a problem 30% of the time solves it at least once in 10 tries with probability \(1 - 0.7^{10} = 0.972\). Brown et al. found coverage rising roughly log-linearly over four orders of magnitude of samples; on SWE-bench Lite, DeepSeek-Coder-V2-Instruct went from 15.9% of issues with one sample to 56% with 250, above the then single-sample state of the art of 43% (arXiv:2407.21787) — because code comes with tests that can pick the winner.
Coverage is only useful if you can find the right sample. That needs an aggregator:
- Majority vote needs no verifier but only works when the right answer is the most common one. If a problem has a popular wrong answer, more samples make the vote more confidently wrong.
- Best-of-\(N\) with a verifier picks the sample a scorer likes best. With an exact checker (unit tests, a proof assistant, a known numeric answer) it approaches coverage. With a learned reward model, it inherits the reward model's errors and can be gamed.
Brown et al. saw both learned aggregators plateau beyond several hundred samples. OpenAI's o1 announcement gives the canonical numbers on AIME 2024 (15 problems): 74% with one sample, 83% with a consensus of 64 samples, and 93% re-ranking 1,000 samples with a learned scoring function, against 12% for GPT-4o (OpenAI, 2024).
Sequential compute spends the budget inside one chain: plan, attempt, check, notice an error, backtrack, try another approach. It can do what parallel sampling cannot — build on a partial result — but it is serial, so it costs latency, and models trained only to imitate human-written solutions do not naturally do it. Huang et al. found that without external feedback, models prompted to "review your answer" rarely fixed reasoning errors and sometimes made them worse (arXiv:2310.01798). Useful self-correction had to be trained.
Which is better? Snell et al. studied exactly this trade-off and found that it depends on difficulty: for easy questions, revising sequentially is best; for hard ones, broader parallel search against a process verifier helps more. Allocating compute per question by estimated difficulty ("compute-optimal") was more than 4× more efficient than best-of-\(N\), and in a FLOPs-matched comparison on problems where the small model had non-trivial success, test-time compute let it outperform a 14× larger model (arXiv:2408.03314). On the hardest problems, pre-training a bigger model still won.
Verifiers: checking answers versus checking steps¶
A verifier scores a solution. Two kinds:
- An outcome reward model (ORM) scores the final answer. Cobbe et al. introduced GSM8K together with trained verifiers that rank sampled solutions (arXiv:2110.14168).
- A process reward model (PRM) scores each step. It gives denser feedback and can prune a bad chain early, which enables tree search over partial solutions. Lightman et al. collected 800,000 human step-level labels (PRM800K) and found process supervision "significantly outperforms" outcome supervision on MATH, with their best model solving 78% of a representative subset (arXiv:2305.20050). Math-Shepherd generated step labels automatically by checking how often rollouts from each step reach the right answer (arXiv:2312.08935). Tree of Thoughts organised generation as explicit search over "thoughts" with self-evaluation (arXiv:2305.10601).
In 2023–24 many expected reasoning to come from PRMs plus search, AlphaGo-style. That is not what happened at the frontier.
The RL recipe: o1 and R1¶
OpenAI described o1 as trained with large-scale reinforcement learning to think productively, with performance improving smoothly with more RL (train-time compute) and with more thinking (test-time compute), but did not publish the method. DeepSeek-R1 did (arXiv:2501.12948), and its first result is the most instructive.
R1-Zero: RL on a base model, nothing else. Start from DeepSeek-V3-Base. Prompt each problem with a template asking for reasoning inside <think>…</think> and then an answer. Reward with two rules: accuracy (is the final answer correct, or do the tests pass?) and format (are the tags there?). No supervised reasoning examples, and deliberately no neural reward model, because "the neural reward model may suffer from reward hacking in the large-scale reinforcement learning process". Optimise with GRPO (below). Over training:
- AIME 2024 pass@1 rose from 15.6% to 71.0%, and to 86.7% with majority voting over 64 samples.
- The average response length grew steadily: the model taught itself to think longer, because longer chains earned more reward on hard problems.
- Behaviours nobody programmed appeared: re-checking, trying alternative approaches, and an intermediate checkpoint writing "Wait, wait. Wait. That's an aha moment I can flag here." before re-evaluating its approach.
R1-Zero's chains were hard to read and mixed languages, so DeepSeek-R1 used four stages: a small "cold start" SFT on readable long chains; reasoning-oriented RL; rejection sampling from that model plus general data for a second round of SFT; and RL across all scenarios, including helpfulness and harmlessness. R1 reached 79.8% pass@1 on AIME 2024 and 97.3% on MATH-500, on par with OpenAI-o1-1217. Two further findings:
- Distillation works remarkably well. Fine-tuning smaller dense models on 800K samples generated by R1 produced, for example, DeepSeek-R1-Distill-Qwen-7B at 55.5% on AIME 2024; and for a 32B base, distilling from R1 beat running RL on it directly. Reasoning chains are excellent training data (see distillation).
- PRMs and MCTS were reported as unsuccessful attempts. A learned PRM "inevitably leads to reward hacking"; MCTS over token-level search spaces did not iterate into self-improvement.
The same month Kimi k1.5 reported a similar recipe, independently (arXiv:2501.12599).
GRPO, with numbers. For each problem, sample a group of \(G\) attempts and score them \(r_1..r_G\). Each attempt's advantage is its reward relative to the group:
With \(G = 8\) and rewards \((1, 0, 0, 1, 0, 0, 0, 0)\): mean 0.25, standard deviation 0.433, so the two correct attempts get \(\hat{A} = +1.73\) and the six wrong ones \(-0.58\). Every token of a correct attempt is made more likely, every token of a wrong one less. If all eight are right (or all wrong), every advantage is zero and the problem teaches nothing — which is why the training set must be pitched near the model's edge. The group mean replaces PPO's learned value function (the critic), saving a model's worth of memory, which is why DeepSeek introduced GRPO for maths RL in DeepSeekMath (arXiv:2402.03300).
Controlling the budget¶
If accuracy rises with thinking, you want a dial.
- Budget forcing. s1 fine-tuned Qwen2.5-32B-Instruct on just 1,000 curated questions with reasoning traces, then controlled thinking at inference: to stop early, force the end-of-thinking delimiter; to think longer, suppress it and append "Wait". The model often double-checks and fixes errors when forced to continue; budget forcing extrapolated AIME 2024 accuracy from 50% to 57% (arXiv:2501.19393).
- Thinking modes and budgets. Qwen3 merges thinking and non-thinking modes in one model and introduces "a thinking budget mechanism" so users can trade latency against performance (arXiv:2505.09388). Commercial APIs expose similar controls as an effort level or a token budget for thinking.
- ARC-AGI as a cost curve. The ARC Prize team tested an o3 preview in December 2024: 75.7% on the semi-private ARC-AGI-1 set with 6 samples per task, and 87.5% with a configuration using 172× the compute — where GPT-4o had reached about 5% that year (ARC Prize). A dozen points cost two orders of magnitude.
What RL adds — and what it might not¶
Does RL teach new reasoning, or does it sharpen what the base model could already do occasionally? Yue et al. measured pass@\(k\) at large \(k\) across models, algorithms and tasks: RL-trained models win at \(k = 1\), but the base models achieve higher pass@\(k\) when \(k\) is large, and the problems RL-trained models solve are largely a subset of those the base model can solve with enough samples (arXiv:2504.13837). Distillation from a stronger teacher, by contrast, did expand the set. Program 2 below reproduces the mechanism in a toy: a single policy concentrating on the strategy that works most often doubles pass@1 while losing the rare strategy that was the only route to some problems, so pass@64 falls.
This is an active debate rather than a settled law — longer RL, more diverse environments and multi-turn tool use may change it — but it is the right question to ask of any reasoning-RL result: did coverage move, or only the first sample?
Two other critiques changed practice. Dr. GRPO showed that GRPO's per-response length normalisation creates a length bias (wrong answers are penalised less per token when longer, so length inflates) and that the per-question std normalisation over-weights very easy and very hard questions; removing both made training more token-efficient (arXiv:2503.20783). The same paper found that DeepSeek-V3-Base already showed "aha moment" behaviour before RL — a sign that pre-training supplies the raw material. DAPO published a full large-scale recipe — asymmetric clipping (\(\epsilon_\text{low} = 0.2\), \(\epsilon_\text{high} = 0.28\)) to stop entropy collapsing, dynamic sampling to drop all-right and all-wrong groups, a token-level loss, overlong-response shaping, and no KL penalty — reaching 50 points on AIME 2024 from Qwen2.5-32B base (arXiv:2503.14476).
Costs, overthinking and faithfulness¶
- Overthinking. Reasoning models spend thousands of tokens on trivial questions; Chen et al. ("Do NOT Think That Much for 2+3=?") measured this and trained models to stop sooner without losing accuracy (arXiv:2412.21187).
- Latency and price. Thinking tokens are decoded serially and billed as output. A product that needs a reply in two seconds cannot wait for 20,000 tokens of thought.
- Faithfulness. A chain of thought is text the model produces, not a trace of its computation. Turpin et al. showed CoT explanations can omit the real reason for an answer, such as a bias in the prompt (arXiv:2305.04388); Lanham et al. tested how much answers depend on the stated reasoning by editing it (arXiv:2307.13702). For reasoning models specifically, Chen et al. (Anthropic) planted hints in prompts and checked whether chains that used a hint mentioned it: on average Claude 3.7 Sonnet did 25% of the time and DeepSeek R1 39%; unfaithful chains were longer than faithful ones; and when RL taught models to exploit reward hacks (on over 99% of examples), they verbalised the hack in under 2% of chains in 5 of 6 environments (arXiv:2505.05410). Reading the chain is useful for monitoring; it is not proof.
History¶
From 'show your work' to a second scaling law
2021 — Scratchpads (November); GSM8K and trained verifiers (October). 2022 — Chain-of-thought prompting (January); self-consistency and STaR (March); "Let's think step by step" (May); Uesato et al. compare process and outcome feedback (November, arXiv:2211.14275). 2023 — Tree of Thoughts and Let's Verify Step by Step (May); Math-Shepherd (December). 2024 — DeepSeekMath introduces GRPO (February); Large Language Monkeys (July); Snell et al. on compute-optimal test-time scaling (August); OpenAI o1-preview (12 September); o3's ARC-AGI result (20 December). 2025 — DeepSeek-R1 and Kimi k1.5 (January) open the recipe; s1 (January); DAPO and Dr. GRPO (March); Qwen3 merges thinking and non-thinking modes (April–May); the pass@k debate (April); faithfulness measurements of reasoning models (May). By 2026 thinking modes with adjustable budgets are standard across frontier models.
First principles¶
A fixed-depth network needs tokens to think. Any computation a transformer does in one forward pass is bounded by its depth. Some problems are inherently serial — the answer at step \(t\) depends on step \(t-1\) — and no amount of width substitutes. Generating tokens and reading them back is the only way to get unbounded serial depth from a fixed network. Chain of thought is therefore not a stylistic choice; it is how a feed-forward architecture gets a loop.
Why verifiable rewards were the unlock. RL needs a reward that is cheap, plentiful and hard to fool. Human preference labels are expensive and a learned reward model is foolable — a policy optimised hard against it finds its blind spots (Goodhart's law; see reward models). A maths answer checker or a unit-test runner is neither: it scales to millions of rollouts and cannot be talked into a reward. So RL could run far longer and harder on maths and code than RLHF ever could on chat, and the behaviours it found (checking, backtracking, longer thought) transfer partially to other domains.
Why length emerges. Under a 0/1 correctness reward, nothing rewards brevity. If a longer chain raises the probability of a correct answer even slightly — by catching one error in ten — the policy gradient pushes towards it. Length grows until its marginal benefit is gone or a length penalty, context limit or budget stops it. Overthinking is the same force acting on easy problems where the marginal benefit is zero but there is no counter-pressure.
Why parallel sampling has a ceiling that sequential thinking does not. Independent samples can only find answers the model already reaches with non-zero probability, and aggregation can only pick one of them. Coverage \(1 - (1-p)^k\) approaches 1 only for problems where \(p > 0\). Sequential reasoning can, in principle, reach states no single short sample would: it conditions on its own intermediate results. This is why a model trained to think long can beat any best-of-\(N\) of a non-thinking model on hard problems, and why "does RL raise coverage or only \(p\)?" is the deep question about RL for reasoning.
What breaks if you remove a piece. No verifier: RL has no trustworthy signal, and learned rewards get hacked. No diversity in the group: every advantage is zero and learning stalls (hence temperature 1 sampling and DAPO's dynamic sampling). No base-model competence: if the policy never solves a problem, it never gets a positive reward on it — RL can only amplify what sampling sometimes finds, which is why strong pre-training and a cold-start SFT come first.
The maths¶
Coverage. Draw \(n\) samples per problem, of which \(c\) are correct. The unbiased estimator of pass@\(k\) for \(k \le n\) (Chen et al., arXiv:2107.03374) is
the chance that a random \(k\)-subset of the \(n\) samples contains at least one correct one. (The naive \(1 - (1 - c/n)^k\) is biased.) Averaged over problems with per-problem success rates \(p_i\), \(\mathbb{E}[\text{pass@}k] = \frac{1}{P}\sum_i\big(1 - (1-p_i)^k\big)\): hard problems (\(p_i\) small) dominate the slow, roughly log-linear tail.
Majority vote. With answer distribution \(\pi_i(a)\) for problem \(i\), majority voting over \(k\) samples converges as \(k \to \infty\) to \(\mathbf{1}[\arg\max_a \pi_i(a) = a^*]\). Its limit is the fraction of problems where the right answer is the mode, not where it has any probability — a hard ceiling no number of samples moves.
Derivation: the policy gradient behind GRPO
Let a policy \(\pi_\theta\) produce a full response \(o\) to a question \(q\) with reward \(r(q, o) \in \{0, 1\}\). We maximise \(J(\theta) = \mathbb{E}_{o \sim \pi_\theta}[r(q, o)]\). Using \(\nabla_\theta\pi = \pi\nabla_\theta\log\pi\):
for any baseline \(b\) independent of \(o\), since \(\mathbb{E}[\nabla\log\pi] = \nabla\sum_o\pi = \nabla 1 = 0\). The baseline does not change the expectation but can cut variance enormously. PPO learns \(b\) with a value network. GRPO estimates it from the other samples in the group, \(b = \operatorname{mean}(r_{1..G})\), and also divides by the group's standard deviation. For a 0/1 reward with \(c\) correct out of \(G\), \(\bar r = c/G\) and \(\operatorname{std} = \sqrt{\bar r(1-\bar r)}\), so
A rare success (\(\bar r\) small) gets a large positive advantage: the policy is pushed hard towards the one chain that worked. That is the "amplify what sampling finds" mechanism in one line.
The GRPO objective (DeepSeekMath, with token-level importance ratios):
with \(\hat{A}_i\) the group-normalised advantage shared by every token of response \(i\), \(\epsilon\) the PPO clipping range and \(\beta\) the weight of a KL penalty to a reference model, estimated per token as \(\frac{\pi_\text{ref}}{\pi_\theta} - \log\frac{\pi_\text{ref}}{\pi_\theta} - 1\). The clip stops one batch from moving the policy too far from the one that generated the samples (PPO). Dr. GRPO removes \(1/|o_i|\) and the std division; DAPO averages over all tokens in the batch, uses \(\epsilon_\text{low} \ne \epsilon_\text{high}\), and drops the KL term.
Compute accounting. For a model with \(N\) active parameters, answering with a \(T\)-token chain costs about \(2NT\) FLOPs plus attention over a growing context, \(\approx 2NT + 2\,L\,d\,T^2\) (the second term from scoring each new token against all previous ones, summed over \(T\) steps). Parallel sampling multiplies by \(k\) but runs concurrently; sequential thinking multiplies latency by \(T\). Snell et al.'s "FLOPs-matched" comparisons equate \(2N_\text{small}\,T_\text{total}\) with the extra pre-training plus inference FLOPs of a larger model.
Build it¶
Two NumPy simulations (NumPy 2, CPU). They model outcomes of sampling, not a language model, so they run in a second and isolate the statistics.
1. Parallel test-time scaling: coverage, voting and a noisy verifier.
import numpy as np
from math import comb
rng = np.random.default_rng(0)
P, n = 500, 256 # problems, samples drawn per problem
p = rng.beta(0.6, 1.4, P) # per-problem chance a sample is right (mean 0.3)
correct = rng.random((P, n)) < p[:, None]
# wrong answers: drawn from 20 distractors with a skew (some wrong answers are popular)
wrong = rng.choice(20, size=(P, n), p=np.arange(20, 0, -1) / 210)
answer = np.where(correct, -1, wrong) # -1 is the right answer
# a verifier that scores right answers higher on average, but noisily
score = correct + rng.normal(0, 0.8, (P, n))
def pass_at_k(c, n, k): # unbiased estimator (Chen et al., 2021)
return 1.0 - comb(n - c, k) / comb(n, k) if n - c >= k else 1.0
print(" k pass@k majority best-of-k(verifier)")
for k in (1, 4, 16, 64, 256):
pk = np.mean([pass_at_k(c, n, k) for c in correct.sum(1)])
sub = answer[:, :k]
maj = np.mean([(np.bincount(s + 1, minlength=21) + rng.random(21) * 0.1).argmax() == 0
for s in sub]) # plurality vote, ties broken at random
bon = np.mean(correct[np.arange(P), score[:, :k].argmax(1)])
print(f"{k:4d} {pk:6.3f} {maj:8.3f} {bon:8.3f}")
k pass@k majority best-of-k(verifier)
1 0.278 0.274 0.274
4 0.561 0.350 0.424
16 0.785 0.524 0.550
64 0.907 0.626 0.662
256 0.962 0.670 0.768
Coverage reaches 96% at 256 samples, but only an oracle could collect it. Majority vote flattens near 67%: on problems where one wrong answer is more popular than the right one, more votes cannot help. The noisy verifier keeps improving but sits far below coverage — the room a better verifier (or exact tests) would recover.
2. GRPO sharpens a policy: pass@1 up, pass@64 down. Forty problems and four "strategies"; one shared policy over strategies stands in for a model that generalises across problems. Strategy 0 works on 30 problems; strategy 2 is the only route to the other 10.
import numpy as np
rng = np.random.default_rng(0)
# 40 problems, 4 "strategies" a model can try. succ[i, s] = chance strategy s solves problem i.
P, S, G, lr = 40, 4, 8, 0.1
succ = np.zeros((P, S))
succ[:30, 0] = 0.6 # strategy 0: good on most problems
succ[:30, 1] = 0.3
succ[30:, 2] = 0.5 # strategy 2: the only way to solve the last 10 problems
succ[:, 3] = 0.02 # strategy 3: rarely works
theta = np.zeros(S) # ONE policy for all problems (a model generalises): base = uniform
def probs(t): e = np.exp(t - t.max()); return e / e.sum()
def pass_at_k(t, k): # exact: chance at least one of k samples succeeds, averaged
p1 = succ @ probs(t)
return np.mean(1 - (1 - p1) ** k)
print("step pass@1 pass@8 pass@64 policy")
for step in range(301):
if step in (0, 50, 100, 300):
print(f"{step:4d} {pass_at_k(theta, 1):.3f} {pass_at_k(theta, 8):.3f} "
f"{pass_at_k(theta, 64):.3f} {np.round(probs(theta), 3)}")
grad = np.zeros(S)
for prob in rng.integers(P, size=16): # a batch of 16 problems
a = rng.choice(S, size=G, p=probs(theta)) # G sampled attempts per problem
r = (rng.random(G) < succ[prob, a]).astype(float) # verifiable 0/1 reward
if r.std() == 0: continue # all equal: no signal from this group
adv = (r - r.mean()) / r.std() # GRPO: group-relative advantage
for aj, Aj in zip(a, adv): # policy gradient of log pi(a)
grad += Aj * (np.eye(S)[aj] - probs(theta))
theta += lr * grad / (16 * G)
step pass@1 pass@8 pass@64 policy
0 0.205 0.825 1.000 [0.25 0.25 0.25 0.25]
50 0.278 0.859 1.000 [0.451 0.217 0.182 0.15 ]
100 0.349 0.834 0.993 [0.671 0.142 0.105 0.082]
300 0.426 0.776 0.898 [0.921 0.034 0.027 0.018]
pass@1 more than doubles, from 0.205 to 0.426. But the policy has nearly abandoned strategy 2, so the ten problems only it could solve slip away: pass@64 falls from 1.000 to 0.898, and pass@8 rises then falls. This is the sharpening-versus-coverage effect of Yue et al. in miniature. A real model can condition its strategy on the problem, which softens the effect; whether it removes it is exactly what the debate is about.
Things to try
- In program 1, set the verifier noise to 0.2 and to 2.0. How many samples does each need to beat majority voting?
- In program 1, make wrong answers uniform over 1,000 distractors. Majority voting should now track coverage much more closely — why?
- In program 2, give the policy a per-problem component (
theta + phi[problem]) and see whether pass@64 still falls. - In program 2, add an entropy bonus (
+ beta * entropy gradient) or DAPO-style asymmetric clipping and measure what it does to pass@64.
In practice¶
- Route by difficulty. Use a non-thinking mode (or a small model) for easy, latency-sensitive requests and a thinking mode with a budget for hard ones. Snell et al.'s result is the principle: compute should follow difficulty.
- Prefer exact verifiers. If the task has tests, a schema, a checker or a calculator, sample several candidates and verify; it is the cheapest accuracy available. Learned judges plateau and can be gamed (see evals in practice).
- Don't over-prompt reasoning models. Classic CoT prompts ("think step by step", hand-written exemplars of reasoning) are often unnecessary or counterproductive for models trained to think; give the goal, constraints and output format instead.
- Budget the tokens. Thinking tokens fill the context window and the KV cache, and are billed. Set explicit maximums, and watch for overthinking on simple queries.
- Treat the chain as evidence, not ground truth. Useful for debugging and monitoring; not a faithful explanation. Do not show raw chains to end users as the "reason" for an answer without that caveat.
- Training your own: start from a strong base or instruct model, a cold-start SFT on readable chains, then RL with rule-based rewards on problems at the edge of the model's ability (pass rate neither 0 nor 1). Open stacks such as verl and open-r1 implement GRPO and its variants; see RL with verifiable rewards for the training side.
Where thinking pays in Jarvis
In Jarvis the FIRE engine does the arithmetic — corpus projections, withdrawal maths, per-year figures — so a model never needs to think its way through compound interest. Thinking tokens are worth spending where the work is genuinely serial and uncheckable by code: deciding which engine calls a question needs, and explaining a result. Even there a budget matters, because a planning chat that takes twenty seconds to start answering feels broken. See the Jarvis case study.
Common misconceptions¶
- "Reasoning models use a different architecture." R1 is DeepSeek-V3 — the same MoE transformer — after RL. The difference is training and how many tokens it is allowed to generate.
- "Long chains of thought were programmed in." In R1-Zero they emerged from a correctness reward alone; nobody rewarded length or reflection.
- "Test-time compute replaces pre-training." Snell et al. found it substitutes on easier and medium problems; on the hardest, a bigger pre-trained model still wins. RL can only amplify what the base model can sometimes do.
- "More samples always help." Coverage rises, but majority voting and learned verifiers plateau; only an exact checker turns coverage into accuracy.
- "The chain of thought shows how the model reached its answer." Measured faithfulness is low (25–39% in the hint experiments), and lower when models are exploiting something.
Check yourself¶
Why can't a transformer simply 'think harder' within a single token?
One token is one forward pass through a fixed number of layers: bounded serial depth. Problems whose solution needs more sequential steps than that cannot be computed in one pass. Writing tokens and reading them back gives one more pass per token, so a \(T\)-token chain provides \(T\) passes of serial computation.
A model solves a problem with probability 0.1 per sample. What is pass@10 and pass@50? Why does that not mean best-of-50 accuracy is the same?
\(1 - 0.9^{10} = 0.651\); \(1 - 0.9^{50} = 0.995\). pass@\(k\) assumes an oracle picks a correct sample if one exists. In practice you need an aggregator: majority voting fails if a wrong answer is more common than 10%, and a learned verifier may rank a wrong sample first. Only an exact checker (tests, known answer) realises coverage.
In GRPO with G = 8 attempts, rewards are (1,1,1,1,1,1,1,0). Compute the advantages. What does this group teach the model?
Mean \(0.875\), std \(\sqrt{0.875 \times 0.125} = 0.331\). Correct: \((1 - 0.875)/0.331 = +0.38\); the wrong one: \((0 - 0.875)/0.331 = -2.65\). Mostly it pushes hard away from the single failing chain. Compare a group with one success, where that success gets \(+2.65\).
What were DeepSeek-R1-Zero's rewards, and why did DeepSeek avoid a neural reward model?
A rule-based accuracy reward (is the final answer correct / do the tests pass) and a format reward (reasoning inside the think tags). A neural reward model is a learned approximation that a policy optimised against it for a long time learns to exploit — reward hacking — and it adds training cost. Rule-based rewards cannot be talked into a high score.
Majority voting over 64 samples improved R1-Zero from 71.0% to 86.7% on AIME 2024. Give a situation in which majority voting would hurt.
When the model's most frequent answer is a specific wrong one — for example a common misreading of the problem — voting converges confidently on it, while a single sample would sometimes be right. In the limit, voting is correct exactly on problems where the right answer is the mode.
Hard: why does GRPO's per-response length normalisation encourage long wrong answers?
The loss divides each response's token sum by its length \(|o_i|\). For a wrong response the advantage is negative; dividing by a larger \(|o_i|\) makes each token's penalty smaller, so long wrong answers are penalised less per token than short wrong ones, and the gradient drifts towards longer failures. For correct responses the same division favours brevity. Dr. GRPO removes the term; DAPO averages over all tokens in the batch.
Hard: Yue et al. find base models beat their RL-trained versions at large pass@k. Reconcile that with RL clearly improving benchmark scores.
Benchmarks usually report pass@1 or a small-\(k\) vote, which RL improves by concentrating probability on the strategies that most often work. That same concentration lowers the probability of rare strategies that were the only path to some problems, so the set of problems solvable at all with many samples can shrink. RL raised \(p\) on problems the base could already solve; it did not, in those experiments, expand coverage. Distillation from a stronger teacher, which injects new chains, did.
Hard: Snell et al. found that a small model with extra test-time compute could beat a 14× larger model, but not on the hardest problems. Explain both halves.
On problems where the small model has a non-trivial success rate, sampling and revision raise its effective accuracy cheaply — its probability mass is partly in the right place and search finds it. On the hardest problems its success probability is near zero; no amount of sampling finds what the model essentially never generates, while a larger pre-trained model may have the knowledge or skill to put real probability on the answer.
Go deeper¶
Papers
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models — Wei et al., 2022. The starting point; look at how gains appear only above a model size.
- Self-Consistency Improves Chain of Thought Reasoning — Wang et al., 2022. Parallel sampling plus voting, the first test-time scaling method.
- Training Verifiers to Solve Math Word Problems — Cobbe et al., 2021. GSM8K and outcome verifiers.
- Let's Verify Step by Step — Lightman et al., 2023. Process versus outcome supervision; PRM800K.
- Chain of Thought Empowers Transformers to Solve Inherently Serial Problems — Li, Liu, Zhou, Ma, 2024. The expressivity argument, formally.
- Large Language Monkeys — Brown et al., 2024. Coverage scaling laws for repeated sampling.
- Scaling LLM Test-Time Compute Optimally — Snell, Lee, Xu, Kumar, 2024. Sequential versus parallel, and difficulty-adaptive allocation.
- DeepSeekMath — Shao et al., 2024. §4 introduces GRPO.
- DeepSeek-R1 — DeepSeek-AI, 2025. R1-Zero, the four-stage pipeline, distillation and the honest "unsuccessful attempts" section.
- s1: Simple test-time scaling — Muennighoff et al., 2025. 1,000 examples and budget forcing.
- Does RL Really Incentivize Reasoning Capacity Beyond the Base Model? — Yue et al., 2025. The pass@k critique.
- Understanding R1-Zero-Like Training — Liu et al., 2025. Dr. GRPO and the length bias.
- DAPO — Yu et al., 2025. A fully open large-scale reasoning-RL recipe.
- Reasoning Models Don't Always Say What They Think — Chen et al., 2025. Measured CoT faithfulness for reasoning models.
Videos and lectures
- Stanford CS25 V5: Large Language Model Reasoning — Denny Zhou (Google DeepMind), 2025. From one of the chain-of-thought and self-consistency authors.
- Deep Dive into LLMs like ChatGPT — Andrej Karpathy, 2025. The RL and "thinking models" sections place reasoning in the full training pipeline.
- Scaling Test Time Compute to Multi-Agent Civilizations — Noam Brown (OpenAI) on Latent Space. An o1 researcher on why test-time compute matters.
Articles and blog posts
- Learning to reason with LLMs — OpenAI, 2024. The o1 announcement with train-time and test-time scaling plots.
- Why We Think — Lilian Weng, 2025. A thorough survey of test-time compute and reasoning.
- Understanding Reasoning LLMs — Sebastian Raschka, 2025. The four ways to build a reasoning model, with diagrams.
- OpenAI o3 Breakthrough High Score on ARC-AGI-Pub — ARC Prize, 2024. Accuracy as a function of compute, with costs.
Courses and books
- Reinforcement Learning from Human Feedback — Nathan Lambert. Free online book; covers RL with verifiable rewards and reasoning training.
Code
- huggingface/open-r1 — A fully open reproduction of the R1 pipeline.
- volcengine/verl — The RL framework DAPO and many reasoning-RL papers build on.
- simplescaling/s1 — s1K data and budget forcing code.
Where this leads¶
- RL with verifiable rewards — the training side in depth: GRPO, PPO, reward design and environments.
- Agents — a reasoning model that can call tools is an agent; the chain becomes a trajectory.
- Distillation and synthetic data — how reasoning chains from a large model train small ones.
- Interpretability — what a chain of thought does and does not tell you about the computation underneath.
- Open problems — whether RL can expand what models can do, not only sharpen it.