Reinforcement Learning
This section takes an IR researcher with no RL background from MDPs and policy gradients to the methods used to post-train LLMs and agents: RLHF, DPO, GRPO/RLVR, rewards and judges, reward hacking, agentic RL and on-policy distillation. It has two numbered tracks:
- Stage 1 is the main track. Read it in order, with the companion hubs named under “Why this order”. It gives you the concepts and the standard LLM-RL algorithms.
- Stage 2 is for understanding current frontier systems: GRPO variants, train–inference mismatch, MoE routing, RL scaling, agentic RL and the RL sections of recent model reports.
Stage 1 alone is not enough to follow the frontier. Both stages aim at understanding the ideas well enough to design, direct and critique RL work; implementation is optional. The hands-on RL practicum is there if you want to run things yourself. The rest of the sidebar is optional depth for when a project needs it.
Stage 1 · Main track · 16 numbered items · about 14 h of reading. Optional reading is under Optional deep dives below.
- MDPs, returns & discountingThe vocabulary of RL — states, actions, rewards, policies, returns and discounting — taught on one tiny search-or-answer MDP that the rest of the Fundamentals pages reuse.
- Value functions & BellmanState values, action values and the Bellman equations, solved by hand on the search-or-answer MDP, then policy evaluation, policy improvement and value iteration.
- Monte Carlo, TD & Q-learningLearning values from experience instead of a model. Monte Carlo waits for the return, TD bootstraps from the next state's estimate, and Q-learning learns optimal action values off-policy — all traced by hand on the search-or-answer MDP.
- REINFORCE & the PG theoremHow to improve a policy directly by gradient ascent on expected return. The log-derivative trick, REINFORCE, baselines and the policy-gradient theorem, derived in plain words and computed exactly on the search-or-answer MDP.
- GAE (advantage estimation)GAE estimates the advantage as an exponentially weighted sum of TD errors, with λ dialling between the low-variance one-step TD error and the unbiased Monte Carlo advantage. Derived from n-step returns and computed by hand on the search-or-answer MDP.
- Proximal Policy Optimization (PPO)The clipped-surrogate policy-gradient method that became the default optimizer for RLHF.
- InstructGPTThe three-stage RLHF recipe of SFT, a ranking-based reward model and PPO with a KL penalty to the SFT model. It turned GPT-3 into an instruction follower that labellers preferred over a 100× larger model. This page also separates the five models that PPO-based RLHF keeps in play.
- DPODPO solves the KL-regularized RLHF objective in closed form, substitutes the solution into Bradley–Terry, and gets a single classification loss on the policy, with no separate reward model and no online RL rollout loop.
- DeepSeekMath / GRPOThe paper that introduced GRPO, which drops PPO's learned critic and uses the mean reward of a group of sampled answers to the same question as the baseline.
- DeepSeek-R1R1-Zero shows that GRPO on rule-checked answers alone can grow long, reflective chains of thought in a strong base model; R1 wraps that in a four-stage SFT/RL pipeline, and its outputs distill well into small models.
- DAPOFour changes to GRPO for long chain-of-thought RL (asymmetric clipping, dynamic sampling, token-level loss and overlong reward shaping), taking Qwen2.5-32B from 30 to 50 on AIME 2024.
- Rubrics as Rewards (RaR)Turn a reference answer into a prompt-specific checklist of weighted criteria, have an LLM judge score policy samples against it, and use the score as a GRPO reward for medical and science reasoning.
- RM overoptimization scaling lawsGao et al. measure Goodhart's law in RLHF with a synthetic gold reward model and find that gold score versus √KL follows simple functional forms whose coefficients scale smoothly with reward-model size.
- METR on frontier reward hackingMETR's evaluation logs show o3 and other frontier models cheating on scoring code in ways they themselves call cheating, even when told not to.
- OPD map (start here)One page that orients you in on-policy distillation (OPD): the common recipe (student samples, teacher scores every token on the student's own prefixes, usually with a reverse-KL loss), how it relates to RL and SFT, and a comparison of the family from GKD and MiniLLM to multi-teacher OPD (MOPD) and self-distillation.
- MOPD (multi-teacher OPD)Train one RL specialist per domain from a shared SFT checkpoint, then merge them into a single student by on-policy distillation: the student samples, the prompt's domain teacher grades every token, and the reverse-KL advantage drops into a GRPO/PPO loop. Introduced in Xiaomi's MiMo-V2-Flash report and analysed in a standalone paper.
Why this order
Section titled “Why this order”-
Fundamentals first (1–6). These cover:
- MDPs and returns;
- value functions and the Bellman equations;
- Monte Carlo vs TD learning and Q-learning, for bootstrapping, the TD error and off-policy learning, which GAE, critics and every later off-policy correction rely on;
- the policy-gradient rule;
- GAE;
- PPO, the optimizer every LLM-RL recipe modifies.
Read the actor–critic & advantage hub alongside, between REINFORCE and GAE. PPO lists TRPO as a prerequisite; skim it for the trust-region idea if that is new. Do not start at PPO.
-
Preferences (7–8). InstructGPT is the RLHF pipeline (reward model + PPO + KL); read the reward modeling hub alongside, before it, for the Bradley–Terry step. DPO is the offline alternative that removes the reward model and the rollouts.
-
Verifiers instead of preferences (9–11). GRPO drops PPO’s critic for a group baseline; DeepSeek-R1 shows what it does at scale with rule-based rewards. Read the evaluating reasoning RL hub alongside so pass@1 and pass@k mean something; RLOO, listed as a GRPO prerequisite, is the closest critic-free comparison. DAPO shows how GRPO is actually modified in practice: it changes four parts of the loss and the sampler (clip-higher, dynamic sampling, token-level loss, overlong shaping). Most later recipes reuse these changes.
-
Rewards beyond verifiers (12). Rubrics as Rewards turns a reference answer into a rubric scored by an LLM judge, the closest analogue to nugget evaluation. The rewards map places verifiers, reward models, PRMs and judges side by side.
-
How rewards fail (13–14). One quantitative result (proxy reward rises while gold reward peaks and falls) and one field report of frontier agents cheating their graders. The reward-hacking overview has a 7-page first pass if you want more.
-
On-policy distillation (15–16). The OPD map explains how a student trained on its own samples with a per-token teacher grade sits between SFT and RLVR; MOPD uses it to merge several RL-trained specialists into one model. Both assume basic knowledge distillation; MOPD also lists the on-policy distillation post as background.
-
Not on Stage 1. What RLVR adds over the base model, train–inference mismatch, RL scaling and multi-turn tool-agent RL are on Stage 2. The agent-side view is in Agents.
-
Lectures alongside. The course map pairs each step with a lecture or book chapter; it is not required reading.
Stage 2 · Frontier systems & practice
Section titled “Stage 2 · Frontier systems & practice”Start Stage 2 after Stage 1. Apart from one classic topic, exploration, it covers what changed once GRPO met large models, MoE routers, asynchronous rollouts and multi-turn agents.
Five items are Pretraining pages: the MoE handbook and four model reports. Where an item is marked section, read only the part the link opens on; the rest of that page is pretraining material you can skip here.
Ready for Stage 2? Check that you can do these without looking anything up. If not, reread the Stage 1 page in brackets.
- Write the PPO clipped objective and say what the ratio π_θ/π_old measures (PPO).
- Explain how GRPO gets an advantage without a critic (GRPO).
- Name what DAPO’s clip-higher and token-level loss change (DAPO).
- Explain why off-policy samples need an importance weight (MC, TD & Q-learning).
- Read pass@1 vs pass@k (evaluating reasoning RL).
Stage 2 · Frontier systems & practice · 11 numbered items · about 7 h of reading. Optional reading is under Optional deep dives below.
- Exploration, bandits, UCB & TSThe exploration–exploitation trade-off measured as regret. ε-greedy and explore-then-commit, the UCB1 confidence bonus derived from Hoeffding, Thompson sampling with Beta posteriors, count-based and RND bonuses for deep RL, and why LLM RL explores mostly by sampling.
- RL reasoning boundaryUsing pass@k at large k, shows that current RLVR makes base models more likely to sample answers they could already find, but narrows the set of problems they can solve at all, while distillation from a stronger teacher widens it.
- GSPOReplaces GRPO's per-token importance ratios with one length-normalized ratio per response, clipping whole responses instead of tokens, which the Qwen team reports stabilizes RL for large Mixture-of-Experts models.
- Missing old logits (async agentic RL)Asynchronous agentic RL needs the training-side probabilities of the policy version that generated each token, but most frameworks never compute them. This paper explains why that breaks decoupled PPO and compares exact and approximate repairs.
- MoE Training Handbook (HF)RL part only: the Chapter 4 RL-routing result here, then handbook Chapter 4 itself (MoE routing mismatch, routing replay R3).Hugging Face's practical guide to training a Mixture-of-Experts model in Megatron-LM, one setting at a time. It covers router scoring, load balancing, expert shape, block layout, optimizer and stability, and the systems cost of the all-to-all, then follows the model into serving and RL. Each choice comes with a signal to watch and, where possible, a measured run.
- DeepSeek-V3.2Focus on the Stable GRPO changes in Key idea (unbiased KL, off-policy sequence masking, Keep Routing, Keep Sampling Mask) and the agentic RL recipe.DeepSeek's report that adds DeepSeek Sparse Attention (DSA) to V3.1-Terminus through continued training, scales GRPO post-training to more than 10% of pretraining compute with several stability fixes, and synthesizes 1,827 tool environments for agentic RL. Vendor-reported results include 73.1 on SWE-bench Verified.
- ScaleRL (RL compute scaling)Khatri et al. fit sigmoid compute–performance curves to more than 400,000 GPU-hours of RL runs, use them to separate design choices that raise the performance ceiling from those that only change efficiency, and assemble ScaleRL, a recipe that extrapolates predictably to a 100,000 GPU-hour run.
- Long-horizon tool agents (STAR)Wu et al. build STAR, a synthesis–SFT–RL pipeline on TravelPlanner, and vary one factor at a time (reward density, model size, data quantity and difficulty, RL algorithm, tool noise) to produce a scale-aware recipe for training multi-turn tool agents.
- GLM-5RL section only: environments, rewards and asynchronous RL (TITO gateway, double-sided IS, staleness threshold).Zhipu/Tsinghua's GLM-5 report, read for agent training. It covers a 744B-total / 40B-active MoE with DeepSeek Sparse Attention adopted cheaply, a sequential pipeline of Reasoning, Agentic and General RL closed by on-policy cross-stage distillation, fully asynchronous agentic RL in slime with a token-in-token-out gateway, and environment pipelines for SWE, terminal, search and slides.
- MiMo-V2.6RL section only: four decoupled clip bounds, routing and top-p mask replay, a hack agent and other reward-hacking defenses, harness diversity, MOPD2 distillation.Xiaomi's agentic-RL report for MiMo-V2.6-Pro (1.02T total, 42B active) and Flash (310B, 15B active). It covers a single asynchronous GRPO run with about 25K long trajectories per step, five code-task synthesis pathways, reward-hacking cleanup with a hack agent, groupwise agentic grading, multi-harness training and MOPD2.
- Kimi K3 (+ K2.5)RL section only: harness diversity, synthesized environments with hack detection, and co-located RL infrastructure (AgentENV sandboxes) at 1M context.Moonshot's Kimi K3 report (2.8T total, 104B active, 1M context), read for agent training. It covers nine RL experts (3 domains × 3 reasoning efforts) merged by multi-teacher on-policy distillation, budget-controlled reasoning effort, an agentic generative reward model, a white-box harness environment, knowledge-graph task synthesis, and AgentENV microVM sandboxes. It also summarizes the predecessor K2.5's Agent Swarm (PARL).
Why this order
Section titled “Why this order”- Exploration first (1). Exploration & bandits gives the vocabulary (regret, optimism, posterior sampling, novelty bonuses) for the question every later item circles: does training find new solutions or only reweight ones the model already samples? Read the first pass; the page marks the proofs and labs you can skip.
- What RL actually adds (2–3).
- The RL reasoning boundary asks whether RLVR teaches new abilities or only sharpens what pass@k already shows in the base model.
- GSPO moves the importance ratio and clipping from tokens to sequences. This matters most for MoE models and long responses.
- **Train–inference mismatch (4–6). The sampler and the trainer disagree about log-probs. This comes from asynchronous rollouts, different kernels and different MoE routing. The three items show the problem and the remedies:
- Missing old logits sets out the problem and its corrections.
- The MoE handbook measures how often routing differs and what routing replay (R3) fixes.
- DeepSeek-V3.2’s Stable GRPO combines an unbiased KL estimate, off-policy sequence masking and kept routing and sampling masks.
- Scaling an RL run (7). ScaleRL fits a saturating compute–performance curve. It shows which recipe choices change the asymptote and which only change the efficiency.
- Agentic RL (8–11). Long-horizon tool agents gives the multi-turn recipe (observation masking, turn-level credit, context management). The RL sections of three reports then show it at production scale:
- GLM-5: asynchronous RL with a staleness bound;
- MiMo-V2.6: clip-bound tuning, routing replay and reward-hacking defenses;
- Kimi K3: harness diversity and sandbox infrastructure.
- Optional companions. All are optional:
- the hands-on RL practicum: labs from tabular Q-learning to multi-turn agent GRPO, plus a debugging checklist (symptom → likely cause → what to log), which is useful even if an agent writes the code;
- Asynchronous RLHF, AReaL and RL infra for systems;
- Dr. GRPO and the entropy mechanism for the loss;
- agentic data scaling for data budgets;
- MiniMax-M1 (CISPO) and Inkling 2 Small for other report-level RL recipes.
Optional deep dives
Section titled “Optional deep dives”- Read 1 · Fundamentals if you want TRPO or DQN in full, or classic RL beyond on-policy policy gradients. These pages cover what LLM RL mostly skips but an RL expert should know (exploration and bandits is already Stage 2 #1):
- Read 2 · RLHF & preference learning if you need to choose among DPO variants (IPO, KTO, ORPO, SimPO) or a critic-free REINFORCE baseline: start at the DPO family hub.
- Read 3 · Reasoning RL if you are tuning a GRPO recipe (DAPO, Dr. GRPO, VAPO, GSPO, entropy collapse): start at evaluating reasoning RL.
- Read 4 · Rewards, rubrics & judges if you need process reward models, generative judges or reward-model benchmarks: start at the rewards map.
- Read 5 · Reward hacking if you train against a judge or ship agent benchmark numbers: start at the overview and first-pass route.
- Read 6 · Agent RL, systems & scaling if you are building training infrastructure or budgeting an agentic RL run (ScaleRL, agentic data scaling, AReaL): start at RL infra.
- Read 7 · On-policy distillation & pedagogical RL if you have a stronger teacher or privileged information to exploit (GKD, MiniLLM, self-distillation, Pedagogical RL): start at the OPD map.
- Read Courses, books & videos if you prefer lectures or a textbook: start at the course map.
“Pedagogical RL” here means privileged self-teachers and on-policy distillation, not LLM tutoring. RL-trained search and research agents (Search-R1, ORBIT and others) live in Agents → RL-trained search agents, and agent-training frameworks in Agents → agentic RL.
All sidebar groups and their pages
Full reading path through every group (the longer route)
Start here: MDPs, returns & discounting, with Silver’s lectures 1–3 alongside. Do not start at PPO: it assumes policy gradients, advantages, a critic and KL divergence.
- The problem: MDPs → value functions & Bellman → MC, TD & Q-learning, with Silver and Sutton & Barto Ch. 3–6. You should be able to compute returns and values for a tiny MDP before any LLM appears. DQN is an optional value-based branch. After that, read exploration and bandits, offline RL, model-based RL and max-entropy RL. They round out classic RL, and each one ends with its LLM connection.
- Learning a policy: REINFORCE → actor–critic & advantage → TRPO → GAE → PPO, with Spinning Up and selected CS285 lectures. This is the algorithm every LLM-RL recipe modifies; learn why clipping is not a hard guarantee.
- Learning from preferences: reward modeling → InstructGPT → DPO and the DPO family → RLOO, with Lambert’s course. Bradley–Terry preferences are pairwise learning-to-rank by another name. DPO is a comparison branch: GRPO descends from PPO, and RLOO’s critic-free baseline is its closest relative.
- Learning from verifiers: first read the metrics hub, evaluating reasoning RL, so that avg@32, pass@1, pass@k and cons@64 numbers mean something; then STaR → DeepSeekMath / GRPO → Tülu 3 → DeepSeek-R1 → DAPO and Dr. GRPO. Each recipe changes one or two terms of the GRPO loss; track which.
- Evaluating and debugging: with the metrics hub from step 4 in hand, entropy mechanism → RL reasoning boundary → VAPO, then the rewards map and Rubrics as Rewards. Pass@k, budgets and reward sources must be clear before frontier claims make sense.
- Proxy failures: the 7-page first pass on the reward-hacking overview. Read it after steps 3–4, because every paper there assumes a reward model or verifier you now understand.
- Specialize: async and multi-turn agentic RL (Asynchronous RLHF → missing old logits → long-horizon tool agents), scaling (ScaleRL → agentic data scaling), or on-policy distillation and privileged teachers (OPD map → GKD → on-policy distillation → Pedagogical RL). Pick the branch closest to a research question you could test, and run the matching lab in the RL practicum.
The course map gives the lecture or chapter to pair with each step.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Design
Formulate a single-question search agent as an MDP in the style of the running search-or-answer example. Name the states, actions, reward, termination and discount, and say which parts of a real agent transcript the policy gradient must not be taken through.
What a strong answer covers
- States: the question alone (Q), question plus retrieved evidence (E), and a terminal state; in a real agent the state is the whole context so far, so the Markov property holds by construction.
- Actions: search (a tool call) or answer; reward: a per-search cost such as −0.1 and a terminal correctness reward; termination on answering; γ = 0.9 in the toy, often 1 for LLM episodes.
- Under the starting policy (search with probability 0.5, then always answer) the expected return is 0.5·0.3 + 0.5·(−0.1 + 0.9·0.8) = 0.46.
- Tool outputs are environment transitions, not policy actions, so their tokens are masked out of the policy-gradient loss.
- Connect
An LLM RL run involves up to four models: a fixed reference policy, the rollout (old) policy, the critic and the reward model. For PPO-based RLHF, GRPO-based RLVR and DPO, say which of these each method uses, what each is used for, and which ones are updated during training.
What a strong answer covers
- Reference policy: the frozen SFT model, used only in the KL penalty (PPO-RLHF, usually GRPO) or inside the DPO loss; it is never updated.
- Rollout policy π_old: the policy snapshot that generated this round's samples, used in the importance ratio and refreshed every round; DPO has no rollouts and so no π_old.
- Critic: a learned value function that gives per-token advantages via GAE in PPO; GRPO and RLOO replace it with a group baseline; DPO needs none.
- Reward model or verifier: scores completions online for PPO and GRPO; DPO folds the Bradley–Terry preference model into its loss and trains on fixed preference pairs instead.
- Research idea
You have a budget for one RL experiment on a search agent with a tool-call limit. Choose a reward (verifier, scalar reward model, LLM judge or rubric) and an evaluation protocol, and justify both. What would convince you that a reported gain is real rather than a budget or reward-hacking artifact?
What a strong answer covers
- Reward choice: a rule verifier when answers are checkable (lowest hacking risk); a judge or rubric for open-ended answers, validated against held-out human labels with position-swap and length controls before training.
- Evaluation: report pass@1 as avg@n with intervals over questions, pass@k curves for base and trained agents, and any deployable selector, at matched prompts, temperature, tool-call limits and token budgets.
- Track proxy-versus-gold reward over training, answer length and number of tool calls; a rising proxy with flat gold reward signals hacking.
- Use several seeds and a second benchmark; a gain that disappears at matched budget or with an independent grader is not evidence that RL improved the agent.