← Contents Volume X · Lecture 21

Volume X · After Pretraining

21

Rewards You Can Check

A reward model is a second neural network, trained on human preferences, whose job is to say how good an answer is. A maths problem does not need one. The answer is 408 or it is not — and a program that can tell the difference cannot be flattered, cannot drift, and costs almost nothing to run.

The mental model

If a program can check the answer, let the program be the judge. Then replace the learned critic with something cheaper still: the average of the model's own attempts at the same question. That pair — a verifier and a group baseline — was enough to make a base model start to reason at length.

The judge that could be flattered

The standard recipe for turning a pretrained model into an assistant trained a second network to imitate human preferences, then optimised the assistant against that network's scores. It works, and it has a famous weakness. The assistant is being optimised against a proxy, and a strong optimiser finds the places where the proxy and the intent come apart: a preferred length, a confident register, a formatting habit the judge happened to like. This is reward hacking, and it gets worse the harder you push.

In September 2024 OpenAI described its o1 models as trained with large-scale reinforcement learning to think before answering, and said performance improved both with more reinforcement-learning compute and with more time spent thinking. It did not publish the recipe. The open question for the following months was what a recipe like that could be made of.

Reasoning problems offer one ingredient that conversation does not: many of them have an answer a rule can verify. A maths question has a final number. A coding question has unit tests. A constraint such as “answer in under fifty words” can be counted. Ai2's Tülu 3, in November 2024, named the approach reinforcement learning with verifiable rewards — RLVR — and used it on maths problems and on verifiable instruction-following constraints: the model is rewarded when the check passes and not otherwise. No preference data, no learned judge, nothing to flatter.

PPO · A LEARNED JUDGE AND CRITIC GRPO · A PROGRAM FOR A JUDGE policy trained reference policy frozen, anchors the KL penalty reward model learned from preferences value model (critic) trained, about policy-sized policy trained reference policy frozen, anchors the KL penalty verifier a program: no weights to hack no critic baseline = mean of the group four networks in memory two networks in memory trained frozen absent
Figure 21a The saving is two-sided. The verifier removes a learned reward model that could be gamed; the group baseline removes a policy-sized critic that had to be trained and held in memory beside the policy.

PPO minus the critic

Policy-gradient methods nudge a model towards sampled outputs that did better than expected. “Better than expected” needs a baseline, and PPO — Schulman et al., 2017 — learns one: a value network that predicts, from any prefix, the reward the model should expect to collect from there. The advantage of an output is what actually happened minus that prediction. For language models the value network is typically about as large as the policy, which means a second multi-billion-parameter model trained alongside the first. PPO also clips the ratio between the new and old policy's probabilities, so a single update cannot move the model too far.

Group Relative Policy Optimization, introduced in the DeepSeekMath paper (Shao et al., 2024), notices that when you can sample the same question many times you do not need to predict the expected reward. You can measure it. Draw G answers to the question, score each, and take the group's own mean as the baseline. An answer is good to the extent that it beat its siblings.

The GRPO objective, per question q (DeepSeekMath, Eq. 3) sample o₁ … o_G ~ π_old(· | q), score them r₁ … r_G
A_i = ( r_i − mean(r₁ … r_G) ) / std(r₁ … r_G)   — one number per answer, shared by all its tokens
ρ_i,t = π_θ(o_i,t | q, o_i,<t) / π_old(o_i,t | q, o_i,<t)
J(θ) = mean over i of ( 1/|o_i| · Σ_t min( ρ_i,t · A_i, clip(ρ_i,t, 1−ε, 1+ε) · A_i ) ) − β · KL( π_θ ‖ π_ref )
KL is estimated per token as π_ref/π_θ − log(π_ref/π_θ) − 1

Read against PPO, three things change and one stays. The critic is gone. The advantage is the group-standardised outcome reward, identical for every token of an answer — there is no per-token credit assignment inside the answer; credit emerges, if it does, from averaging over many answers. The KL penalty towards the reference model moves out of the reward and into the loss; DeepSeekMath contrasts this with PPO, which folds a per-token KL term into the reward. And the clipped ratio is inherited unchanged. GRPO is PPO with the machinery for estimating a baseline swapped for a sample mean.

A baseline made of siblings

Take four attempts at one question, each scored 1 if the verifier accepts and 0 if not. The three panels below are the three situations a training run keeps meeting, computed with the population standard deviation (implementations differ on that choice, and add a small constant to the denominator).

SPLIT DECISION HARD QUESTION SOLVED EVERY TIME +1.00 −1.00 −1.00 +1.00 +1.73 −0.58 −0.58 −0.58 0 0 0 0 REWARD 1 0 0 1 1 0 0 0 1 1 1 1 mean 0.50 · std 0.50 mean 0.25 · std 0.43 std 0 · no signal
Figure 21b Bars are advantages, the numbers underneath are the verifier's rewards. The same correct answer is worth +1.00 when half its siblings got it and +1.73 when it was the only one: a rare success shouts. When every sibling agrees, the gradient vanishes.

Three consequences follow, and each has a literature behind it.

Unanimous groups teach nothing. If all G answers are right or all are wrong, the advantage is zero everywhere and the question contributes no gradient. Questions the model cannot yet solve drop out, then — as it improves — the easy ones do too. DAPO (Yu et al., 2025), an open large-scale RL system built on a Qwen2.5-32B base, responds with dynamic sampling: keep drawing questions until the batch is made of groups that disagree. It is one of four modifications that paper adds to the GRPO recipe.

The normalisation has a bias. Dividing by each answer's length and by the group's standard deviation looks neutral. “Understanding R1-Zero-Like Training” (Liu et al., 2025) argues it is not: it reports that GRPO artificially lengthens responses, especially wrong ones, and proposes a corrected variant, Dr. GRPO. Keep that in mind in the next section, where growing response length is read as a sign of reasoning. Some of the growth may belong to the objective rather than the thought.

The reward is one number per answer. A binary verifier cannot say where an answer went wrong. This is the price of the cheap judge. DeepSeek tried to buy the information back with process reward models and with tree search, and reported that neither paid off at scale (§ 21.5).

R1-Zero: reasoning with no examples

DeepSeek-R1-Zero begins from DeepSeek-V3-Base — the 671-billion-parameter mixture of experts of Volume VII, 37 billion parameters active per token — and applies GRPO to it with nothing else. No supervised fine-tuning on reasoning examples and no human-written chains of thought. The prompt template says only that the assistant should reason first, between <think> tags, and then answer.

Two rewards, both rule-based. An accuracy reward: for maths the final answer must appear in a specified format so a rule can extract and compare it; for code, a compiler runs test cases. A format reward: the thinking goes inside the tags. DeepSeek states that it used no neural reward model, outcome or process, for R1-Zero, because it found them prone to reward hacking in large-scale RL and costly to retrain.

AIME 2024 · DEEPSEEK-R1-ZERO · AS REPORTED BY DEEPSEEK start of RL 15.6% after RL · pass@1 71.0% majority of 64 86.7% 0 50 100 pass@1 = one sample · majority = the most common answer among 64 samples
Figure 21c Only the endpoints are shown because those are the numbers DeepSeek reports in the text; the training curve between them is in the paper. These are DeepSeek's own measurements on a benchmark of thirty problems, which is small enough that a few problems move the percentage.

DeepSeek reports AIME 2024 pass@1 climbing from 15.6% to 71.0% over training, and to 86.7% with majority voting across 64 samples — a level the report compares to OpenAI's o1-0912. The score is less interesting than the behaviour. Response length grew steadily as training went on, which the authors read as the model learning to spend more tokens thinking. Reflection, re-checking and trying alternative approaches appeared without being programmed. The report prints a transcript from an intermediate checkpoint in which the model stops mid-solution and reconsiders, with the line “Wait, wait. Wait. That's an aha moment I can flag here.”

A plausible mechanism, ours and not the report's: the verifier only looks at the end, so any habit that raises the chance of a correct final answer is reinforced alongside it. Checking a step before committing to it is such a habit, and longer chains give it more room to occur. RL need not know that reflection is good; it needs reflection to correlate with reward across a group of siblings.

What the aha moment does and does not show

Two later papers complicate the story, and both are worth reading beside the report. Liu et al. found that DeepSeek-V3-Base already shows aha-style behaviour before any RL, and that Qwen2.5 base models reason well without special prompt templates — suggesting much of the behaviour is present in pretraining, and RL draws it out and amplifies it. Yue et al. measured pass@k at large k and found that RLVR-trained models beat their base models at k = 1 while the base models score higher at large k; they conclude that RLVR narrows sampling towards paths the base model could already reach, and that distillation, by contrast, can introduce new patterns. These are findings of those papers, and the second is contested. They suggest a more careful reading of “learned to reason from scratch”: RL turned a model that sometimes reasoned into one that does so reliably. The next lecture takes up the distillation half of that contrast.

From Zero to R1

R1-Zero reasoned but was hard to read. DeepSeek reports poor readability and language mixing — chains of thought drifting between languages mid-solution. DeepSeek-R1 repairs this with a four-stage pipeline, and it is worth seeing as a pipeline, because every laboratory since has had to decide which of these stages to keep.

DEEPSEEK-V3-BASE DEEPSEEK-R1 1 · Cold start SFT on a few thousand long reasoning traces 2 · Reason RL GRPO, rule-based rewards, plus a language reward 3 · Resample rejection-sample ~600k reasoning + ~200k general then SFT 4 · Second RL all scenarios: adds helpfulness and harmlessness R1-Zero: straight to RL, skipping stage 1 tinted boxes = reinforcement learning · plain boxes = supervised fine-tuning
Figure 21d R1 alternates the two kinds of training. RL finds the reasoning; SFT on RL's own filtered output makes it stable and readable; a final RL stage reintroduces breadth. The 800k samples of stage 3 are the dataset the next lecture distils from.

The cold start fine-tunes V3-Base on a few thousand long chains of thought in a readable format, so RL begins from a model that already writes tidily. The first reasoning RL stage is R1-Zero's recipe plus a language-consistency reward — the proportion of the chain of thought written in the target language — which DeepSeek reports slightly lowers accuracy and makes the output readable. Rejection sampling then draws many answers from the RL checkpoint, keeps the good ones, adds general-purpose data, and fine-tunes again from the base: roughly 600,000 reasoning samples and 200,000 other ones. A second RL stage covers all kinds of prompts and adds helpfulness and harmlessness objectives.

DeepSeek reports 79.8% pass@1 on AIME 2024 and 97.3% on MATH-500 for the finished model. Those are the numbers in the January 2025 report; the arXiv listing has since been revised to follow a peer-reviewed version published in Nature in September 2025, so check which revision you are citing. The report also records two things that did not work: process reward models, because fine-grained steps are hard to define and a model-based judge invites reward hacking; and Monte Carlo tree search, because the search space of token generation is far larger than a board game's and a fine-grained value model is hard to train. Both are attempts to recover the information a binary verifier throws away.

That leaves a model that costs a great deal to run. It is 671B parameters in total and it thinks for thousands of tokens before it commits to an answer. Cheap to check, expensive to serve. The question for the rest of the part is how to move what it learned into something small.

Verifiable rewards: what checks the answer, and where the check can be fooled
DomainThe checkerWhere it can fail
Maths with a final answerExtract the answer from a required format and compare it to the referenceEquivalent forms of the same answer (1/2 against 0.5) fail a naive comparison; a right answer reached by a wrong route is still rewarded
CodeCompile and run test cases (R1: compiler feedback on LeetCode-style problems)A program can satisfy the tests without being correct; the reward is only as good as the test suite
FormatCheck that thinking sits inside the required tagsCheap and exact, and it says nothing about quality
Instruction constraintsCount words, check for required strings (used in Tülu 3's RLVR)Satisfies the letter of a constraint, not the intent behind it
Open-ended writing, judgement, tasteNoneOutside the method; this is where a learned judge is still needed

Read the primary source

❦