Skip to content

Lambert's RLHF / Post-Training Course

optionalcorefundamentalcourserubric 10/122026 · ~600 min

Nathan Lambert

Status

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 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.
Lambert course lectures with book chapters, coloured by site section Fourteen boxes in two rows of seven. Each shows the lecture number, a short title and the matching RLHF book chapters: L0 ML basics, L1 overview (Ch 1 to 3), L2 IFT, reward models and rejection sampling (Ch 4, 5, 9), L3 RL math (Ch 6), L4 RL practice (Ch 6), L5 reasoning (Ch 7), L6 DPO (Ch 8), L7 synthetic data (Ch 12), L8 preferences (Ch 10 to 11), L9 over-optimization (Ch 14, App B), L10 regularization (Ch 15), L11 tools (Ch 13), L12 evaluation (Ch 16), L13 character (Ch 17). Colours mark RL algorithms, RLHF and rewards, and failure modes, evaluation and agents. L0 ML basics prereqs L1 Overview Ch 1–3 L2 IFT, RM, RS Ch 4, 5, 9 L3 RL math Ch 6 L4 RL practice Ch 6 L5 Reasoning Ch 7 L6 DPO Ch 8 L7 Synth. data Ch 12 L8 Preferences Ch 10–11 L9 Over-optim. Ch 14, B L10 Regularize Ch 15 L11 Tools Ch 13 L12 Evaluation Ch 16 L13 Character Ch 17 RL algorithms RLHF, preferences, rewards failure modes, evals, agents Reader Q&A 1 after L4 · Q&A 2 after L7 · Q&A 3 after L11
Original sketch. The 14 lectures, their book chapters, and the part of this site each one feeds, coloured by site section.
LectureBookOfficial chapters (jump links)Prepares you forPriority
L0 ML Foundations (24 min, slides)—1:37 LM overview; 4:29 Softmax and log-probs; 12:14 Cross-entropy; 15:25 KL and entropy; 19:36 Sigmoid and pairwise likelihood; 20:29 RL framing (MDP)MDPs and returnsSkim if rusty
L1 Overview (46 min, slides)Ch 1–315:21 RL (and RLHF) fundamentals; 23:51 The 3-step InstructGPT recipe; 39:15 The scaling RL eraInstructGPT, Christiano et al.Core
L2 IFT, Reward Models and Rejection Sampling (50 min, slides)Ch 4, 5, 92:24 IFT and chat templates; 21:18 RM overview and derivation; 33:44 RM variants; 43:57 Rejection samplingReward modeling, Outcome vs process, STaRCore
L3 RL Motivation and Math (58 min, slides)Ch 6 (part 1)6:04 PG intuitions and math; 25:38 Wiring RLHF for LMs; 28:38 REINFORCE and RLOO; 34:18 PPO; 50:04 GRPO and modern variantsREINFORCE, RLOO, PPO, GRPOCore
L4 RL Implementation and Practice (54 min, slides)Ch 6 (part 2)2:24 PG into code; 10:57 PPO; 33:30 GRPO and friends; 38:51 Training infrastructure; 42:34 Practical engineering; 45:04 Loss aggregationPPO, Dr. GRPO, DAPO, Async RLHF, RL infraCore
L5 Rise of Reasoning Models (45 min, slides)Ch 710:41 2025 Cambrian explosion; 34:54 Common implementation patterns; 42:42 Open questionsDeepSeek-R1, Kimi k1.5, Tülu 3, RL reasoning boundaryCore
L6 Direct Preference Optimization (43 min, slides)Ch 88:01 Derivation: optimal policy; 19:19 Recover the reward; 21:11 Bradley–Terry; 24:23 Loss and gradient; 30:16 Weaknesses and likelihood displacement; 33:30 IPO, ORPO, SimPO; 40:33 Where DPO standsDPO, DPO family, IPO, ORPO, SimPOCore
L7 Synthetic Data (50 min, slides)Ch 1210:50 Knowledge distillation; 37:11 CAI and AI feedback; 45:50 Rubrics as rewardsOn-policy distillation, GKD, Constitutional AI, Rubrics as rewardsRecommended
L8 Preferences (36 min, slides)Ch 10–117:34 History of preferences; 20:17 Preference data overview; 31:11 Open questions in RLHF dataChristiano et al., Summarize from feedback, Reward modelingRecommended
L9 Over-optimization (24 min, slides)Ch 14, App B4:20 Goodhart; 9:57 Signatures of over-optimization; 14:47 Beyond just style; 20:13 Llama 4 and leaderboardsReward hacking, RM over-optimization, Length correlationsCore
L10 Regularization (32 min, slides)Ch 152:50 KL penalty in RL; 10:53 RL as a reverse-KL loss; 21:09 Why RL generalizes better than SFT; 25:15 Other regularization toolsPPO (KL term), DPO, On-policy distillationCore
L11 Tools (38 min, slides)Ch 137:29 Why LMs need tools; 15:30 How tool calls work; 24:17 Training for tool useLong-horizon tool agents, RAGEN, ArCHerCore for search agents
L12 Evaluation (32 min, slides)Ch 163:39 Eras of post-training eval; 17:36 Agentic evals; 21:19 Can you trust the number?Evaluating reasoning RL, RewardBenchCore
L13 Character (33 min, slides)Ch 176:22 Character, constitutions, model specs; 19:21 In practice; 23:23 Elicitation without gradient stepsConstitutional AIOptional

Timestamps are from the course page.

  1. Fundamentals first (Silver L1–L7 or Spinning Up Part 3). Lecture 0 is a refresher if you skip them.
  2. Lectures 1–4 (about 3.5 h): the RLHF pipeline, reward models, and policy gradients for LMs, then the InstructGPT and GRPO pages.
  3. Lectures 5, 9, 10, 12: reasoning RL, over-optimization, regularization and evaluation, for the reasoning and reward-hacking sections.
  4. 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.

  1. 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.
  2. 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.
  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.
  4. 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.
  • 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.

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.

Done with this page?

Status