Lambert's RLHF / Post-Training Course
Website ↗Code ↗Video ↗Slides (PDF) ↗
TL;DR. A 14-lecture video course (Lecture 0 plus Lectures 1–13, about 9.4 hours) by Nathan Lambert that follows his RLHF book chapter by chapter, with slides, three reader Q&A sessions and two conversations. It is the most direct course for the LLM half of the site: reward models, PPO and GRPO for language models, reasoning RL, DPO, over-optimization, regularization, tools and evaluation.
Why it matters now. CS285 and Spinning Up stop at PPO on control tasks. This course starts where they stop, it is current to 2026, and each lecture has official YouTube chapters, so you can jump to the exact segment a site page depends on.
Course facts (checked)
Section titled “Course facts (checked)”- Course page: rlhfbook.com/course, titled “Post-Training Course”. Recordings are in one playlist; each lecture has an HTML slide deck at
rlhfbook.com/teach/course/<deck>/and a PDF. - Prerequisites: the page says you do not need prior RL or language-modelling background, and suggests using LLMs as a tutor. It also notes that the slide decks are usually built with an LLM and then substantially revised by hand.
- Timestamps: the jump links below use the chapters in each video’s official description, with titles shortened. They are not YouTube’s automatic chapters.
- Extras: a welcome video, three reader Q&As (after Lectures 4, 7 and 11), two conversations (with Finbarr Timbers and with Scott Geng), and a bonus talk.
Lecture map
Section titled “Lecture map”Reader Q&A segments worth watching
Section titled “Reader Q&A segments worth watching”Timestamps are from the course page.
- Q&A 1 (after Lecture 4): token- vs sequence-level rewards (6:24); is GAE the only way to get advantages in PPO? (7:59); the shape of the importance ratio (9:15). These go with the PPO and GAE pages.
- Q&A 2 (after Lecture 7): corrections to the knowledge-distillation-as-RL slide (0:32), to calling KL a “distance” (1:40) and to the Bradley–Terry loss derivation (4:27); notation gotchas in Chapter 6 (8:14). Watch these if you watched Lectures 0, 2 or 7.
- Q&A 3 (after Lecture 11): why RLVR often omits the KL penalty (4:14); is RL just regularised SFT? (8:11). These go with DeepSeek-R1 and On-policy distillation.
Suggested order for this site
Section titled “Suggested order for this site”- Fundamentals first (Silver L1–L7 or Spinning Up Part 3). Lecture 0 is a refresher if you skip them.
- Lectures 1–4 (about 3.5 h): the RLHF pipeline, reward models, and policy gradients for LMs, then the InstructGPT and GRPO pages.
- Lectures 5, 9, 10, 12: reasoning RL, over-optimization, regularization and evaluation, for the reasoning and reward-hacking sections.
- Lectures 6–8, 11: DPO, synthetic data, preferences and tools, as needed for the rlhf, pedagogy and frontier sections.
Worked example: Lectures 2–4 on the search toy
Section titled “Worked example: Lectures 2–4 on the search toy”Toy (as on the course map): from s₀ (“no evidence”) the agent can search (−0.1, go to s₁) or answer (right with probability 0.2); from s₁, answer is right with probability 0.9.
- Reward model (Lecture 2). A rater prefers “search then answer” to “answer immediately”. A Bradley–Terry RM that scores them 1.5 and 0.5 predicts the preference with probability σ(1) ≈ 0.73. Adding 10 to both scores changes nothing, so only differences carry information.
- REINFORCE and RLOO (Lecture 3). Four sampled completions get rewards [1, 0, 0, 1]. RLOO’s baseline for completion 1 is the mean of the other three, 1/3, so its advantage is 2/3; for completion 2 it is 0 − 2/3 = −2/3.
- GRPO (Lectures 3–4). With the same rewards, mean 0.5 and standard deviation 0.5 give advantages ±1. These have the same signs as RLOO’s but are rescaled by the group’s spread.
- KL (Lecture 10). In RLHF the KL penalty keeps the policy from exploiting the RM, for example by learning that long, confident answers score well. With a correctness verifier (Lecture 5 and Q&A 3) many recipes drop it.
Limitations
Section titled “Limitations”- Lectures are short for their scope: Lecture 9 (over-optimization) is about 24 minutes. The book chapters carry the detail.
- No graded assignments; Q&A 2 discusses the request for programming and math assignments. Pair with CS285 HW4 for hands-on GRPO.
- Fundamentals (MDPs, Bellman equations, TD) are only reviewed in Lecture 0 and Lecture 3.
- The slides are partly LLM-generated (as the course page says) and have needed corrections, so check equations against the book.
Connections
Section titled “Connections”- Before: Spinning Up or CS285 L5–L10 for policy gradients and PPO.
- Alongside: the RLHF book, chapter by chapter.
- Hub: Course map.
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.
- Derive / compute
Lecture 2 and Chapter 5 model a preference with Bradley–Terry, P(A preferred to B) = σ(r_A − r_B). For a pair where the reward model gives r_A = 1.5 and r_B = 0.5 and the human prefers A, compute the predicted probability, the loss, and the gradient of the loss with respect to r_A. Then show what happens if you add 10 to both rewards, and say what that implies for using RM scores as RL rewards.
What a strong answer covers
- Gap 1, so P = σ(1) ≈ 0.731 and the loss is −log 0.731 ≈ 0.313.
- d loss / d r_A = −(1 − σ(1)) ≈ −0.269 (and +0.269 for r_B), so training pushes the gap wider, with smaller pushes once the pair is already well ranked.
- Adding 10 to both leaves the gap and therefore P and the loss unchanged: only reward differences are identified.
- So the absolute scale and offset of RM scores is arbitrary; RL pipelines normalise or baseline them, and group baselines (RLOO, GRPO) remove the offset automatically.
- Mechanism
Q&A 3 asks why RLVR (RL with verifiable rewards) often omits the KL penalty that classic RLHF uses. Explain the mechanism: what the KL penalty protects against in RLHF, why that protection matters less with a verifier, and what dropping it costs or buys.
What a strong answer covers
- In RLHF the KL to the reference model stops the policy from drifting into regions where a learned reward model is wrong and can be exploited (over-optimization, Chapter 14).
- A rule-based verifier for math or code is much harder to exploit than a learned reward model, so less protection is needed (the RLHF book's reasoning chapter makes this point).
- Without the KL the policy can move further from the base model and explore longer, different reasoning; it also saves the reference-model forward pass.
- The cost: nothing anchors style or general ability, and if the verifier has loopholes (format checks, weak parsers) there is no brake, so verifier quality matters more.
- What if…
Lecture 2 covers rejection sampling (sample N answers, keep the best, fine-tune on them) and Lectures 3–4 cover online RL. Design an ablation on a search-agent task that separates the benefit of on-policy RL from the benefit of simply filtering for good samples.
What a strong answer covers
- Arms at equal sampling budget: rejection sampling with SFT on the best of N; GRPO with the same N per prompt; GRPO with negatives removed (positive-only advantages).
- Hold fixed the prompts, the reward (answer correctness), the base model and the number of gradient steps.
- Measure pass@1 and pass@k on held-out questions, the number of searches per question, and KL to the base model.
- If positive-only GRPO matches full GRPO, the negative samples add little; if rejection sampling matches GRPO, the gain is mostly from filtering rather than online updates.
- Critique
A colleague says "DPO needs no reward model and no RL loop, so it is strictly better than PPO-style RLHF." Using Lecture 6 (DPO weaknesses and likelihood displacement) and Chapter 8, critique this claim.
What a strong answer covers
- DPO is derived from the same KL-regularised objective as RLHF, so it optimises the same target; it changes the optimiser, not the goal.
- It is offline: it learns from fixed preference pairs and never sees its own new samples, unlike online RL.
- Chapter 8 notes that training often lowers the probabilities of both the chosen and the rejected answers (the rejected one more), which can move mass to unseen outputs.
- Lecture 6 discusses variants (IPO, ORPO, SimPO) that change these dynamics, and where DPO stands; "strictly better" is not supported, and the choice depends on data, compute and whether online samples are available.
- Connect
Lecture 10 asks why RL generalises better than SFT, and Chapter 15 argues from forward versus reverse KL. Explain the argument and connect it to on-policy distillation on the pedagogy track.
What a strong answer covers
- SFT minimises forward KL (sampling from the data), which is mode-covering; RL with a KL penalty corresponds to reverse KL (sampling from the policy), which is mode-seeking.
- Naively mode-seeking should forget more, but Chapter 15 argues the opposite for multimodal LLMs: forward KL stretches mass away from old modes, while reverse KL can move one new mode without disturbing the others.
- So RL tends to forget less prior knowledge than SFT on the same task.
- On-policy distillation also trains on the student's own samples with a reverse-KL-style signal from a teacher, which is why it is discussed as combining the benefits of RL and distillation.
- Design
Using Lectures 4, 11 and 12, design a small RL project that trains a 1–7B model to use a search tool for open-domain QA. Specify the environment, reward, algorithm and loss aggregation choices, infrastructure, and an evaluation that you would trust.
What a strong answer covers
- Environment: multi-turn episodes where the model issues search calls and gets retrieved passages back; tool outputs are masked from the loss (Lecture 11 on how tool calls work).
- Reward: exact match or a judged correctness score at the end, possibly with a small cost per search; watch for format-only rewards.
- Algorithm: GRPO or RLOO with a group of 8–16 rollouts; choose per-token or fixed-length loss aggregation to avoid a length bias (Lecture 4 on loss aggregation); asynchronous rollouts if tool calls are slow.
- Evaluation (Lecture 12): held-out questions not seen in training, pass@1 with several seeds, contamination checks, and an agentic evaluation of search behaviour, not just final accuracy.