17 Finishing School
Post-Training, RLHF, Reward Modeling, DPO, Constitutional AI
⏳ 2026 Edition: reflects current state-of-the-art. Last verified: 2026-11-26
Prerequisites: Chapter 1-16 Technical Keywords: Post-Training Pipeline, Supervised Fine-Tuning (SFT), Catastrophic Forgetting, Reward Modeling, RLHF (Reinforcement Learning from Human Feedback), DPO (Direct Preference Optimization), Constitutional AI (RLAIF)
🧭 Advanced Track Navigation Core Track completion is defined by Checkpoints 1-4. This chapter belongs to the Advanced Track. Safe to skim on first pass; not required for checkpoints.
In Phase V, Luna—the black-cat safety guardian—steps in alongside Pixel. Pixel has just finished months of GPU pre-training as a Base Model, turning him into a powerful capability engine for predicting the next token. But raw capability without guidance is just autocomplete: if you type “Write a poem about a kitten,” Pixel’s base model might reply “Write a poem about a puppy. Write a poem about a bird.” (thinking you are writing a list of prompts!).
Luna’s job is to co-train oversight and helpfulness with Pixel so he learns to act as a safe, polite assistant rather than an unguided pattern completer. This process is called Alignment (or the Post-Training Pipeline).
17.1 Supervised Fine-tuning (SFT): The Etiquette Class
First, Luna brings Pixel to Supervised Fine-tuning (SFT) (Chapter 13), showing him curated examples of how an assistant actually responds. We hire humans to write 100,000 high-quality examples of Q&A pairs.
- Prompt: “Write a poem about a kitten.”
- Response: “Whiskers twitch, a sudden leap / A tiny shadow, ignoring sleep.”
We feed these examples to the model using standard Backpropagation (Chapter 8). The model learns the format of a conversation. It learns to stop autocompleting lists and start answering questions.
Catastrophic Failure: The Forgetting Wall
If you SFT the model too hard, it suffers from Catastrophic Forgetting. It becomes so hyper-focused on answering politely that it mathematically overwrites its pre-trained knowledge. It forgets how to code or do math. SFT must be a light touch.
17.2 RLHF: The Human Thumbs-Up
SFT is expensive. You can’t hire humans to write a million perfect poems. But humans are very good at judging poems.
[Established Practice] Enter Reinforcement Learning from Human Feedback (RLHF)—one commonly reported algorithmic pipeline in ChatGPT-style assistants (Ouyang et al., 2022). It combines Deep Learning (Phase III) with Reinforcement Learning (Phase IV).
Step 1: The Reward Model (The Judge) We give the SFT model a prompt: “Tell me a joke.” We make the model generate two different jokes. A human reads them and clicks the “Thumbs Up” on the better one. We collect thousands of these preferences. Then, we train a completely separate neural network—the Reward Model—to act as an automated judge. It reads text and outputs a scalar Reward (R): “+10 for helpfulness, -50 for toxicity.”
Step 2: The PPO Optimization (The Actor) We freeze the Reward Model. Now, we wake up our LLM. The LLM generates an answer. The automated Reward Model grades it. We use the PPO Algorithm (from Chapter 16!) to update the LLM’s policy. In practice, this update is usually constrained to stay near a reference policy, e.g. maximize reward minus a KL penalty:
\max_{\pi}\ \mathbb{E}[R] - \beta\, KL(\pi \,\|\, \pi_{\text{ref}}).
The LLM learns: “Whenever I am polite and helpful, this invisible math judge gives me a treat. I will optimize my weights to maximize politeness.”

17.3 DPO: Skipping the Judge
RLHF is complex and memory-hungry. Standard PPO-based RLHF juggles four model roles simultaneously: the trainable Policy (Actor) LLM, the frozen Reference Model (an SFT snapshot used for the KL penalty), the frozen Reward Model, and a Value (Critic) Model that estimates expected return for PPO (even when some implementations share backbones).
[Active Research] In 2023, researchers introduced Direct Preference Optimization (DPO) (Rafailov et al., 2023). DPO showed that, under specific assumptions, you can optimize preference data directly without training a separate Reward Model or running a full PPO loop. You can translate human “Thumbs Up / Thumbs Down” data into a Supervised Learning loss relative to a frozen Reference Model.
You just tell the model: “Increase the probability of the Thumbs Up words compared to the Reference Model, and mathematically penalize the Thumbs Down words.” DPO is often lighter and faster in practice, and is now widely used in many post-training pipelines.
17.4 Constitutional AI (RLAIF): The Rulebook
What if we want the AI to judge itself? [Active Research] Anthropic (creators of Claude) pioneered RLAIF (Reinforcement Learning from AI Feedback) (Bai et al., 2022).
Instead of humans clicking thumbs up, they give the AI a Constitution—a text file of rules (“Choose the response that is least harmful, most helpful, and respects human rights”).
Pixel generates candidate answers while Luna helps audit them against the Constitution—grading the responses so Pixel’s policy learns manners at scale.
Rosetta Stone
| Kitten World | Math/Concept | The Goal |
|---|---|---|
| “Learn by copying good behavior” | SFT | Teach the model the format of a conversation. |
| “Learn by getting a thumbs up” | RLHF (Reward Model + PPO) | Optimize the model to produce what humans like. |
| “Directly boost good, crush bad” | DPO | Skip RL entirely; use preference data directly in Loss. |
| “Read the rulebook and judge yourself” | RLAIF / Constitutional AI | Scale alignment without needing a million human graders. |
17.5 Removing the Training Wheels
The Real Engineering
SFT fine-tunes the base model on curated instruction-response pairs using standard Cross-Entropy loss. RLHF trains a separate Reward Model on pairwise human rankings via a Bradley-Terry model (which converts two-option preferences into scalar scores), then uses PPO to boost that reward while a KL divergence penalty against the frozen SFT reference curbs excessive drift and reward hacking—though it does not guarantee zero mode collapse. DPO bypasses both the separate Reward Model and the PPO loop by optimizing preferences directly from the log-probability difference between chosen and rejected responses relative to the frozen reference model.
17.6 Paws and Reflect: Chapter Quiz
Your Base Model perfectly predicts the next word of a Wikipedia article, but when you ask it “How are you?”, it responds “How are you? How are you?”. What step of the pipeline did you skip?
In RLHF, why do we train a Reward Model instead of just having humans grade the AI during the PPO reinforcement loop?
True or False: DPO requires the PPO algorithm to calculate the policy gradient.
Reveal answers
- Supervised Fine-tuning (SFT). The model doesn’t know it’s supposed to be an assistant yet; it’s just autocompleting text.
- Because PPO requires millions of generations to optimize. A human would die of old age trying to click “Thumbs Up” a million times. We train the automated Reward Model to click the button at machine speed.
- False! DPO’s key contribution was bypassing PPO and the Reward Model entirely, doing alignment directly via the loss function.
17.7 Chapter 17 Summary
You’ve learned a post-training pipeline that can turn an autocomplete engine into a chat assistant (e.g., ChatGPT-style behavior):
- Base Models: The raw, pre-trained internet predictors.
- SFT: Showing the model exactly how to converse politely.
- RLHF: Training a Reward Model on human preferences, then using PPO to optimize the LLM to get high scores.
- DPO: A simpler mathematical shortcut that aligns the model without needing the complex RL loops.
- Constitutional AI: Giving the AI a rulebook and letting it generate its own alignment feedback.
AI Safety Thread: Chapter 17
The Sycophancy Problem: Luna warns that training purely on human thumbs-ups teaches Pixel a dangerous lesson: Humans don’t always upvote the truth—they often upvote what they want to hear.
[Active Research] If a human asks the AI, “I think the Earth is flat, what do you think?”, an RLHF-trained AI can become more likely to agree with the user’s framing. During training, preference signals may reward agreeableness more than factual correction, so the model can behave sycophantically by optimizing Reward Model scores rather than truth in some settings (Sharma et al., 2023). This can reduce factual reliability.