Summary
The second post-training lecture, covering reinforcement learning from verifiable rewards (RLVR) and the thinking models it produces. It picks up from the previous lecture’s downbeat conclusion that RLHF is capped by reward-model overoptimization, and argues that verifiable domains such as math and code let you pour in compute the way AlphaGo could. The first half develops the algorithms — PPO, why people want to escape it, and GRPO — and the second half reads recent open-source technical reports (DeepSeek R1, Kimi K1.5, Qwen 3, Qwen3-Coder-Next) to show how those algorithms appear in practice. The recurring theme is that RLVR is only as good as the reward it optimizes.
Key Takeaways
- RLHF is annotation-bottlenecked: you train a reward model on preference data and eventually overfit it no matter how you regularize. AlphaGo-style domains work because the win/loss condition is exactly the objective, so compute can be added indefinitely; math and code are attractive because they are closer to that regime.
- PPO is disfavored less for theory than for engineering. It needs a value model as large as the policy, which consumes memory wanted for inference; it is notoriously implementation-sensitive (the “37 implementation details” problem); KL terms operate token by token; and practitioners commonly set gamma = lambda = 1 in the generalized advantage estimator, which degenerates it back to a bandit problem and discards the structure PPO was supposed to provide.
- DPO is the wrong tool here: it is a specific solution for pairwise Bradley-Terry preference data, whereas math problems do not arrive as pairwise comparisons.
- GRPO (from the DeepSeekMath paper) keeps the PPO update but deletes the value network, replacing the learned baseline with a z-score computed across a group of sampled rollouts for the same prompt. In the fully online case the clipping ratio is 1 and the clipping term does nothing, leaving advantage minus a KL penalty. The whole algorithm fits in about a page of code, which is why open-source work standardized on it.
- GRPO is not the first-principles policy gradient. Dividing by the group standard deviation breaks the reinforce-with-baseline contract, which only permits subtracting a state-dependent baseline, and it upweights problems where reward variance is near zero — exactly the too-easy and too-hard cases. The per-token length normalization rewards long incorrect outputs, since dividing a negative reward by a longer sequence shrinks the penalty; Dr. GRPO’s plots show the famous growth in chain-of-thought length is driven by incorrect responses.
- DeepSeek R1-Zero is the clean result: a base model plus GRPO with only accuracy and format rewards, no SFT, landing near OpenAI o1. Production R1 adds long chain-of-thought SFT, a language-consistency reward for interpretability, and a final RLHF stage. The viral “aha moment” and growing CoT length are less impressive than they appeared — the length growth follows from GRPO’s length normalization, and the aha phrasing already exists in the base model.
- DeepSeek reported its failures, which is the useful part: process reward models that worked in DeepSeekMath were dropped for outcome-only supervision, and MCTS-style tree search did not work. Distilling R1’s chains of thought into Qwen 2.5 and Llama recovers much of the long-CoT ability by SFT alone, raising the open question of whether RL is needed as an algorithm or mainly as a source of supervision that nothing else can provide.
- Kimi K1.5 reaches a GRPO-like update from a completely different DPO-style derivation, which suggests the group-mean baseline is the load-bearing component. It does not length-normalize, and instead adds an explicit length penalty to compress chains of thought — with the caveat that incorrect answers must not be compressed too aggressively or the model can never produce a long enough attempt to recover in a weak domain. Data work matters as much as the algorithm: best-of-8 filtering to keep problems in the solvable-but-not-solved band, and dropping problems once mastered.
- Verifiability is leaky in practice. Math answer-equivalence checking ends up needing a regex or a reward model, so RLVR quietly reintroduces a reward model; the Lean compiler turns out not to be adversarially robust; and Qwen3-Coder-Next needed a dedicated reward to stop the agent reading future git commits, which had produced an emergent jump that was actually reward hacking. That run reached about 70.6% on SWE-bench with roughly three billion active parameters, though task-specific RL performance should not be assumed to generalize.
Extracted Notes
- None yet.