1 Knowledge isn't manners
A freshly pretrained model is a strange thing to talk to. It knows an enormous amount, but its only skill is continuing text, so it'll happily complete your question with more questions, ramble, or echo the worst of its training data. It has no notion that it should be helpful, that it should follow an instruction, or that one answer might be better than another.
Post-training — alignment — is the stage that turns that raw model into something you'd want to use. The knowledge is already there; what's missing is a sense of what a good response looks like. And the cleanest signal for "good" turns out not to be a perfect example, but a comparison: this answer is better than that one. Most of modern alignment is about learning from those comparisons.
2 SFT: imitate the good answers
The first and simplest step is supervised fine-tuning. You collect a set of high-quality (instruction, ideal response) pairs — written by humans or distilled from a stronger model — and train the model to reproduce them, exactly the next-token objective from Chapter 8, now on curated data. This alone is transformative: it teaches the model the assistant format and basic helpfulness, and turns the text-completer into something that answers.
But SFT can only imitate. It learns from positive examples — "produce this" — and never from "this is worse than that." If your demonstration is merely good and a better answer exists, SFT has no way to find it; it concentrates the model's probability on the example it was shown, whatever its quality. To go further, you need a signal about relative quality.
3 RLHF: a reward model, then RL
Reinforcement learning from human feedback brings in the comparison signal. You show people two responses and ask which they prefer; from thousands of these pairs you train a reward model that scores any response with a number predicting human preference. Then you use reinforcement learning — classically PPO — to update the policy so it produces responses the reward model rates highly, with a leash (a KL penalty) keeping it from drifting too far from the SFT model.
This is powerful: the model can now exceed its demonstrations, discovering high-reward responses no human wrote, because it's optimizing a score rather than copying examples. It's also a lot of moving parts — a separate reward model, an RL loop that's famously finicky to stabilize, and the risk of the policy learning to game the reward model rather than genuinely improve.
4 DPO: skip the reward model
Direct preference optimization is the insight that you don't actually need the reward model or the RL loop. The math of RLHF can be rearranged so that the optimal policy is expressed directly in terms of the preference data — which means you can train the policy on the preference pairs with a single, stable supervised-style loss. No reward model, no PPO, no sampling loop.
The DPO loss simply pushes up the probability of each chosen response relative to its rejected partner, anchored to the reference model by a strength knob. It's far easier to implement and to stabilize than RLHF, which is why it became the default for preference tuning in the open-source world. The trade is that it learns only from the comparisons you give it — it can't explore for new high-reward responses the way an RL loop can.
5 GRPO: group-relative, for reasoning
Group relative policy optimization, popularized by the DeepSeek reasoning models, is an RL method tuned for tasks where you can check the answer — math, code, anything with a verifier. For each prompt it samples a whole group of responses, scores them, and computes each one's advantage as its reward minus the group's average. Responses better than their peers are reinforced; worse-than-average ones are pushed down.
The clever part is that the group's own average serves as the baseline, so GRPO needs no separate value model — a big simplification over PPO. Paired with a verifier that gives a clean reward (the code passes its tests, or it doesn't), it lets a model bootstrap strong reasoning by practising against itself, which is much of how the recent reasoning models were trained.
6 Reading the playground
The same starting policy — a distribution over six candidate responses, each with a hidden true reward — is post-trained three ways with the real update rules: SFT's imitation gradient, the DPO preference loss, and GRPO's group-relative policy gradient. Watch where they end up.
Four distributions: the reference policy and the result of SFT, DPO, and GRPO — over the same six responses, with their true rewards shown beneath.
Step through training and watch each method's probability mass move — SFT toward its demonstration, DPO toward the preferred pairs, GRPO toward the highest reward.
The comparison table — what each method needs, and where they diverge.
The reading is the setup. The playground is the point.