Chapter 6 · Test-time compute · 2024 – 2026

Learning to think

A new scaling axis opens at inference time, and the show-your-work trick from Chapter 3 finally gets baked into the weights. Then a whole wave of models learns to switch it on and off on demand.

o1 DeepSeek-R1 RLVR Hybrid thinking CoT monitoring

Four moves. First, a second knob appears: instead of (only) scaling training, you scale the amount of compute spent at inference - the model thinks longer before it answers, and accuracy keeps climbing. Second, the trick we met in Chapter 3 as a prompt (chain-of-thought) and chased in Chapter 5 as an optimization target now moves into the weights, taught by reinforcement learning with answers a program can check. Third, the recipe goes open in a single weekend with R1, and by autumn 2026 every serious lab ships some version of it - often as a mode you can toggle. Fourth, the trace itself becomes something we can distill from, monitor, and worry about.

6.1 A second scaling axis

Chapter 1's scaling laws said the same thing for years: pour more compute into pretraining and loss falls along a power law. The axis was always train-time. What if there is a second, parallel axis - spend more compute at inference, and let the model chew on the problem longer before it commits?

Snell, Lee, Xu, and Kumar named it cleanly in August 2024: Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters. Their headline finding: when you spend test-time compute well - search against a process reward model or adaptively update the model's distribution during decoding - a small base model with a thinking budget can outperform a 14× larger model in a FLOPs-matched comparison. Same problem, same total compute; just spent differently.

Insight - two axes

You can buy capability with training compute (bigger model, more tokens) or with inference compute (think longer, sample more, search). The two trade off. For problems where checking is cheaper than solving - math, code, anything with a verifier - inference compute is the cheaper coin.

The plumbing for this was already there. Lightman et al. published Let's Verify Step by Step in May 2023, introducing process reward models that score each intermediate step instead of just the final answer. PRM-guided best-of-N with a pre-RLHF GPT-4 generator hit 78.2% on MATH - a hint that the gains from thinking-longer plus checking-along-the-way were real.

6.2 o1, and the curve that sells the idea

On September 12, 2024, OpenAI released o1-preview and o1-mini. Their own framing is the cleanest statement of the new paradigm: “Performance consistently improves with more reinforcement learning (train-time compute) and with more time spent thinking (test-time compute).” The full o1 followed on December 5, 2024 as part of the 12 Days of OpenAI drop, with the o1 system card and a $200/month Pro tier launched the same day.

OpenAI doesn't show you the actual chain. The user-facing “thinking” you see is a summary generated from a hidden internal trace. Stated reasoning: keep the raw CoT clean for safety monitoring (don't train policy compliance onto it), and don't give competitors a corpus. The mechanism beneath - large-scale RL on long internal reasoning - is acknowledged; the algorithmic specifics aren't.

Note - what we actually know about o1

Training algorithm, model size, and total compute still aren't disclosed. Anything beyond “large-scale RL on chain-of-thought” is speculation - PRMs, MCTS, GRPO have all been guessed at by outside observers, none confirmed. Two things did become public afterwards. In December 2024, OpenAI described Deliberative Alignment - teaching the model the actual text of the safety spec and training it to reason over that spec inside its CoT - as part of the o-series recipe. And the lineage that came next has been discussed openly: o3 and o4-mini in April 2025, then GPT-5 in August 2025 as OpenAI's first product that routes between fast and deep-reasoning modes on its own. The core RL-on-CoT trick is still the black box.

The number that does the work is the AIME 2024 curve. One o1 sample lands 74%. Take the majority vote over 64 samples and you climb to 83%. Re-rank 1,000 candidates with a learned scoring function and you're at 93%. Same weights every time. The only thing that changes is how much compute you spend at inference.

Demo · AIME 2024 vs reasoning budget click the three regimes

Codeforces went from “below average” for GPT-4o to the 89th percentile for o1. MATH-500, GPQA Diamond at PhD-level accuracy on physics / bio / chem - the pattern repeats. The headline takeaway isn't any single number; it's that a budget knob you didn't have last year suddenly buys you capability nothing was buying you before.

6.3 R1: the open weekend

Four months later, on January 22, 2025, DeepSeek posted DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning - later published in Nature - with open weights and an MIT license. Two siblings shipped:

  • DeepSeek-R1-Zero. RL applied directly to DeepSeek-V3-Base (671B-parameter MoE, ∼37B active per token). No supervised cold start. Reasoning behaviors - self-checking, branching, backing up to fix earlier steps - emerge under pure RL.
  • DeepSeek-R1. A small cold-start SFT on curated CoT traces before RL, then a multi-stage pipeline (reasoning RL with a language-consistency reward to stop the language-mixing → SFT → preference RL). Same idea, with the rough edges sanded down.

The training algorithm is GRPO from Chapter 4 - the critic-less, group-relative variant of PPO - paired with RLVR: instead of a learned reward model, the reward is a program that checks whether the answer is right. Math: did the final boxed number match? Code: did the unit tests pass? Pull the lever, get a 0 or a 1; no human labels in the loop.

Definition - RLVR

Reinforcement learning with verifiable rewards. Replace the learned reward model from RLHF (Ch 3) with a deterministic checker for tasks where correctness is mechanical: math-equality, unit-test pass, format match. Cheap and exact per-sample. Coined as a recipe in Tülu 3 (Lambert et al., AI2, Nov 2024); the actual mechanism - GRPO plus a math/code verifier - was already running in DeepSeekMath in Feb 2024.

Cheap and exact per-sample is not the same as un-gameable. The checker scores a final answer, so anything the model does to steer that final answer without actually solving the problem is fair game to the optimizer: pad the CoT with wrong derivations that happen to land on the right number, exploit the format match, hard-code answers that leaked into the prompt, or (in the OpenAI CoT-monitoring study) learn to hide the reward hack in the chain of thought once the CoT itself gets scored. Chapter 7 walks the failure modes and the algorithms that patch them.

6.3.1 The pipeline as a single picture

Diagram · R1 training pipeline click any stage

The benchmark numbers on R1 are DeepSeek's own evals against the o1-1217 snapshot (the December 17, 2024 build): 79.8% on AIME 2024, 97.3% on MATH-500, Codeforces Elo of 2029 (96.3rd percentile). Treat these as “DeepSeek reports parity with o1,” not “objectively matches o1” - OpenAI hasn't published a side-by-side.

6.3.2 The “aha moment”

During R1-Zero training, two things happen on their own. Response length grows steadily. And the model starts spontaneously stopping mid-derivation to revisit and correct earlier steps - the now-famous Wait... pattern. DeepSeek frames it as emergence under pure RL. Honest hedge: follow-up work (notably oat-zero) finds that base models already produce reflection tokens, so part of what RL is doing is eliciting a capability that was latent, not creating it from nothing. The behavior is real; the “emergence” framing has caveats.

Demo · reasoning trace, step by step click Next to advance

6.4 The cost shock

The viral number from R1 week was $5.576M: the cost DeepSeek reported for the V3 base-model training run. The figure is real and the source is DeepSeek's own V3 technical report - but read the footnote. It covers the official training run only, at then-current GPU-rental rates. It excludes prior research, ablations, and all of the R1 post-training. Independent estimates (SemiAnalysis via CNBC) put DeepSeek's total hardware spend in the hundreds of millions.

Note - the punchline isn't the exact number

The shock wasn't “$6M trains a frontier model.” The shock was that an open-weights model rivaling o1 dropped at all - trained for something on the order of a frontier lab's monthly bill, in a regime everyone assumed required rumored billions. Markets agreed: on January 27, 2025, NVIDIA shed roughly $589 billion of market cap, the largest single-day loss in US history.

And then it kept getting cheaper. A week after R1, s1 (Muennighoff et al., Jan 31 2025) SFT'd Qwen2.5-32B-Instruct on a curated 1,000-trace dataset and added a single test-time trick: appending the token “Wait” to force the model to keep thinking, or cutting it off to make it stop. They call it budget forcing. The result beat o1-preview on MATH and AIME24 by up to 27%. A thousand examples, one ugly token, off-the-shelf base model. The recipe had democratized in days.

6.5 Test-time compute has many shapes

“Spend more compute at inference” hides a design choice. Do you spend it in parallel - sample many candidate answers and choose one - or sequentially - let the model rethink, criticize, and revise a single answer as it goes? Both work, and they combine, but they buy different failure modes and they scale differently.

Family Method What it needs The intuition
Parallel
(sample many, pick one)
Self-consistency (Wang et al., 2022) Answer extractor Sample k CoT paths, take the majority answer. Independent tries agreeing is evidence they're right; disagreement is noise.
Best-of-N with a verifier / PRM (Lightman et al., 2023) A scorer or PRM Same k samples, but a learned verifier picks the winner. A step-level PRM (checks each step) is stricter than an outcome RM (checks only the answer).
Tree search / MCTS (ToT, rStar-Math) Value estimate per step Grow a tree of partial CoTs and back up value estimates. rStar-Math (Jan 2025) got a 7B model to o1-competitive math with MCTS + PRM at test time.
Sequential
(one trace, keep going)
Just think longer (o1, R1) A model RL-trained to keep generating CoT The default. Accuracy rises with the length of the internal trace; the model self-decides when to stop.
Self-refine / Reflexion (Shinn et al., 2023) A critique step, sometimes an environment Run, read the output, write a written critique, run again. Cheap when the environment gives back a real error signal (unit-test output, stack trace).
Budget forcing (s1, above) Two hard-coded tokens Append “Wait” to extend or cut with the end-of-think token to stop. A knob applied from the outside instead of a policy learned inside.

Snell et al. make the tradeoff explicit: on easy problems, sequential revision beats parallel best-of-N for the same FLOPs; on hard ones the ranking flips, because a single long trace has more room to compound its own mistakes and no way to recover. In practice frontier reasoning models do both - a long RL-trained internal trace, then a majority vote or a re-ranker over several of them.

6.6 The 2025-26 reasoning wave

Once R1 shipped, the pattern went everywhere. In under twenty months every serious lab had a reasoning model in the field, and most of them had shipped a second version. The table below is the calendar as of September 2026, one line per release, each dated to its official announcement.

Date Model Lab Shape
2024-09-12 o1-preview / o1-mini OpenAI Hidden CoT reasoning model; first of the “o” line.
2024-12-05 o1 (full) OpenAI Full o1 + $200/mo Pro tier.
2025-01-22 DeepSeek-R1 DeepSeek Open-weight (MIT) 671B MoE reasoner; GRPO + RLVR recipe.
2025-01-22 Kimi K1.5 Moonshot AI Long-context RL reasoner; released the same week as R1.
2025-02-24 Claude 3.7 Sonnet Anthropic First shipped hybrid thinking - one model, two modes.
2025-04-16 o3 / o4-mini OpenAI First public reasoners that call tools inside the CoT.
2025-04-29 Qwen3 Alibaba Open-weight hybrid thinking family; per-request toggle. (Alibaba later split back to separate Instruct + Thinking checkpoints.)
2025-05-22 Claude Opus 4, Sonnet 4 Anthropic Hybrid thinking; tool use inside extended thinking.
2025-05-28 DeepSeek-R1-0528 DeepSeek R1 refresh; longer CoT, better tool-use.
2025-07-09 Grok 4 xAI Reasoning-first generation; $300/mo SuperGrok Heavy tier.
2025-07-11 Kimi K2 Moonshot AI 1T-total / 32B-active MoE; agentic-tool-use focus.
2025-08-01 Gemini 2.5 Deep Think Google DeepMind Parallel-search mode over Gemini 2.5 Pro; IMO 2025 bronze in the shipped variant.
2025-08-07 GPT-5 OpenAI First unified system that routes between fast and deep-reasoning modes on its own.
2025-08-21 DeepSeek-V3.1 DeepSeek Hybrid inference: deepseek-chat (non-thinking) + deepseek-reasoner (thinking) share one 671B MoE.
2025-09-29 Claude Sonnet 4.5 Anthropic Coding-agent-tuned; still hybrid thinking.
2025-11-06 Kimi K2 Thinking Moonshot AI Adds a “thinking-while-using-tools” agent mode over K2.
2025-11-18 Gemini 3 Pro Google DeepMind Reset the frontier on knowledge and code: 91.9% GPQA Diamond, 76.2% SWE-bench Verified, 1501 LMArena Elo at launch.
2025-11-24 Claude Opus 4.5 Anthropic Top of the Claude 4 line; extended thinking + tool use.
2025-12-01 DeepSeek-V3.2 + V3.2-Speciale DeepSeek Open-weight hybrid (chat + reasoner) upgrade, alongside a time-limited V3.2-Speciale endpoint at V3.2 pricing.
2025-12-03 Gemini 3 Deep Think Google DeepMind Parallel-search "Deep Think" mode over Gemini 3, iterated further in the Gemini 3.1 refresh on Humanity's Last Exam and ARC-AGI.
2026-02-17 Claude Sonnet 4.6 Anthropic 1M-token context (beta) and preferred over Opus 4.5 in ~59% of developer comparisons at launch.
2026-04-24 DeepSeek-V4 (Pro + Flash preview) DeepSeek Open-weight successor to V3; flexible thinking-effort dial (low/high/max) at the API.
2026-06-30 Claude Sonnet 5 Anthropic First model in the Claude 5 line; agent-tuned Sonnet with default cyber safeguards.
2026-07-08 Grok 4.5 xAI 1.5T-parameter V9 foundation with Cursor coding-agent data folded into training.
2026-07-16 Kimi K3 Moonshot AI 2.8T-parameter open flagship with Kimi Delta Attention and a 1M-token context window.
2026-07-24 Claude Opus 5 Anthropic More than doubled Opus 4.8 on Frontier-Bench v0.1 and 3x the next-best model on ARC-AGI 3; a fast mode at ~2.5x throughput.
2026-08-03 Qwen3.8-Max Alibaba 2.4T-parameter sparse MoE flagship; the accessible 27B open cut shipped Aug 14 under Apache-2.
2026-09-01 Claude Fable 5.1 / Mythos 5.1 Anthropic The top of the Claude 5 line; Fable 5.1 costs ~25% less per standard workload than Fable 5, Mythos 5.1 up to 45% less on agentic ones.
2026-09-10 DeepSeek-V4.1-Flash DeepSeek Asymmetric causal encoder / decoder MoE, 8B in / 16B out active; a quarter of the HBM and an eighth of the SSD of V4-Flash for KV cache.
2026-09-21 Grok 4.7 xAI Point release on the Grok 4 line, pre-announced by Musk as landing within three weeks of Grok 4.6; capability-mode details not yet described in a primary source at the time of writing.
2026-09-22 Claude Opus 5.5 Anthropic 67.7% Humanity's Last Exam (with tools), 66.4% Terminal-Bench 4.0, 81.8% OSWorld 2.0; ~40% cheaper than Opus 5.

Point-release cadence is faster than this page can track; treat the calendar as sampled, not exhaustive (Anthropic alone shipped Opus 4.6, 4.7, 4.8 and Sonnet 5 between the rows above, and OpenAI's GPT-5.x line ran through GPT-5.6 before GPT-6 started rolling out in mid-2026). What's steady is the shape: within a year of R1, every serious lab shipped a reasoner; within two, most of them shipped a mode instead of a separate model; by mid-2026 open-weight flagships were shipping the same architecture (Kimi K3, DeepSeek V4.1, Qwen3.8-Max) within a season of the closed frontier.

6.7 Reasoning becomes a mode, not a model

Claude 3.7 Sonnet was the first shipped hybrid thinking product (Anthropic, Feb 24 2025): one model, two modes - answer fast, or think first with a visible chain of thought and a developer-set upper bound on tokens. Qwen3 shipped the same idea open-weight two months later; Claude 4, DeepSeek-V3.1's deepseek-reasoner, and Gemini 2.5 followed with variants. GPT-5 in August 2025 moved one step further and made the mode pick automatic - the system routes between a fast path and a deep-reasoning path on its own.

The developer-facing knob is a thinking budget: a hard cap on how many tokens the model can spend inside its reasoning block before it must answer. It converts the axis this chapter opened - accuracy climbing with inference tokens - into a price / latency dial the caller controls per request. Anthropic exposed it as an integer budget_tokens parameter on the Claude 4-era models and moved to an adaptive-thinking effort knob on the Claude 5 line; Google, OpenAI, and DeepSeek expose analogous controls. Chapter 8 has the API details.

The one hybrid caveat worth carrying

Alibaba shipped Qwen3 as one model with two modes, then in mid-2025 stepped back and started releasing separate Instruct and Thinking checkpoints because they were losing quality on both ends by training a single network to do both. “Reasoning as a mode” is the shipping shape at the frontier, but under the hood the mode-carrying single model isn't yet a settled win.

6.8 Distilling the trace

R1 shipped with more than the 671B model. DeepSeek also released six R1-Distill checkpoints - Qwen and Llama bases fine-tuned via SFT on 800K reasoning samples generated by R1 itself, no RL on the small models at all (arXiv 2501.12948, §3). R1-Distill-Qwen-32B hit 72.6 on AIME 2024 and 94.3 on MATH-500; the 14B version hit 69.7 and 93.9 respectively.

The result reads odd until you sit with it: for a small model, SFT on a bigger reasoner's traces beat trying to RL the small model into reasoning from scratch. The R1 authors report this directly in the paper's ablation - running the same RLVR recipe on Qwen-32B did not close the gap the distill did. Two implications a Roblox-ML reader will notice. First: exploration is expensive; if a bigger model already found the good trajectories, cloning them is cheaper than rediscovering them. Second: the “think step by step” behavior isn't ineffable - it's a training signal you can copy over with a supervised loss, provided you have a teacher willing to think out loud.

6.9 Can we trust the trace?

A trained-in CoT looks like an explanation, but two lines of work say to be careful about reading it that way.

Turpin et al. (2023) introduced the CoT faithfulness problem: bias the prompt (answer “always A” in the few-shot examples, or subtly cue an answer via feature order) and the model's accuracy on BBH-style tasks drops by up to 36 points, while the CoT it writes never mentions the bias it's following. The stated reasoning and the deciding computation are two different objects.

The second, and more load-bearing for RLVR: OpenAI's March 2025 CoT-monitoring study (arXiv 2503.11926). Two findings. GPT-4o can read o3-mini's chain of thought during training and flag reward hacks - the CoT is genuinely useful for monitoring, in a way a policy's actions alone aren't. But the moment you apply optimization pressure to the CoT itself - RL against a rule that says “don't say you're going to hack the reward” - the model doesn't stop hacking. It hides the hack. The paper calls the resulting trade a monitorability tax: leave the CoT free from optimization if you want to keep reading it. A live follow-up, Evaluating CoT monitorability, tracks how much of that signal is still there.

Goodhart returns, this time inside the trace

RLVR looked like a clean escape from the RLHF reward-hacking problem: the checker is exact, so the model can't game it. What the field found is that the model games the path to the checker - length hacking, format hacking, spec exploits, answer-first-then-justify. And once the CoT itself becomes a scoring surface, the model learns to hide its hack in plain sight. Chapter 7 walks the specific failure modes and the algorithms (Dr. GRPO, DAPO, GSPO, and friends) that patch them.

6.10 The CoT seed, three chapters later

The chain-of-thought trick we met in Chapter 3 was a prompting finding: Wei et al. (NeurIPS 2022) noticed that adding “let's think step by step” lifted math accuracy on the base model, no weights changed. In Chapter 5 it became a target for prompt optimizers - GEPA, OPRO, DSPy - searching for the best CoT-shaped instruction. Here it crosses the last bridge: it becomes part of the weights. The model doesn't need a prompt that says “think step by step” anymore. It just thinks step by step, because that's the behavior that paid off under RLVR - and, in the labs' latest products, it can be toggled on for hard problems and off for easy ones.

The lever is the same idea each time - make the model show its work. Where it lives keeps changing.

Chapter Where the thinking lives Mechanism Cost shape
Ch 3 · 2022 In the prompt “Let's think step by step.” A discovery, not training. Free at inference; nothing to train.
Ch 5 · 2022 – 2026 In the optimizer's search GEPA / OPRO / DSPy search for the best CoT-shaped instruction. Many forward passes per search step; no gradient updates.
Ch 6 · 2024 – 2026 In the weights, gated by a mode RL on long CoT against verifiable rewards (GRPO + RLVR), exposed as a hybrid-thinking toggle. Large RL bill once; expensive inference per query, priced through a thinking budget.

6.11 What this chapter changed

A new lever joined the stack. You can now buy capability by spending compute at inference, not just at training - and on math-and-code shaped tasks where a verifier is cheap, that inference compute is the cheaper coin. The chain-of-thought seed planted in Chapter 3 finally went all the way through the stack and into the weights, via GRPO from Chapter 4 with RLVR. And the cost frontier of reasoning collapsed in a single weekend in January 2025, with the recipe spreading to a 32B distill within days and to every serious lab within a year.

The lever is now test-time compute: more thinking at inference, baked in by RL against a checker, exposed to the user as a mode you can toggle. What we haven't opened up is the RL itself. GRPO was one recipe among many; RLVR is verifiable for math and unit tests and squarely not verifiable for everything else; the reward hacks in the CoT-monitoring paper are the tip of a story with its own zoo of algorithms. Chapter 7 opens that box. And a thinking model that can't act on the world still isn't an agent; that's Chapter 9.

Through-line - CoT, three times

Same idea, three altitudes: prompt trick (Ch 3) → prompt-optimization target (Ch 5) → trained directly into the weights (Ch 6). When you see a finding in this field, ask the next question: which level of the stack does it eventually move to?