# Post-Training, Explained

> An illustrated explainer on LLM post-training: how supervised fine-tuning, reward models, RLHF with PPO, DPO and GRPO turn a pre-trained language model into an assistant.

Web page: https://qrsntu.org/learn/post-training/ (content last changed 2026-11-14)
Site index for agents: https://qrsntu.org/llms.txt

QRS explainer · Large language models

How a model that predicts the next word becomes an assistant that answers, follows instructions and reasons.

Pre-training teaches a language model what text looks like. Post-training reshapes what it chooses to say: first by imitating good answers, then by learning which of its own answers people prefer, and most recently by rewarding answers that can be checked.

[Read the guide](https://qrsntu.org/learn/post-training/guide/)

The pipeline at a glance · [中文版指南](https://qrsntu.org/learn/post-training/zh/)

A long read in seven parts, from the history to the derivations and the practice, with ten interactive figures.

By **Yuhe Sui** · Last reviewed: 14 October 2026

Illustrative probabilities, not measurements from a real model.

## The pipeline at a glance

The classic recipe runs left to right. The last column shows the two main departures from it.

1. Starting point
   ### Pre-training
   Predict the next token on a very large amount of text. Knowledge and skills, but no notion of answering.
   [History →](https://qrsntu.org/learn/post-training/guide/#history)
2. Imitate
   ### Supervised fine-tuning
   Train on prompt–response demonstrations with the same next-token loss, counted on the response only.
   [SFT →](https://qrsntu.org/learn/post-training/guide/#sft)
3. Compare
   ### Reward model
   Fit a scalar score to human comparisons with the Bradley–Terry model: the preferred reply should score higher.
   [Reward model →](https://qrsntu.org/learn/post-training/guide/#reward-model)
4. Optimise
   ### RL with PPO
   Sample replies, score them, and push the policy towards high reward while a KL penalty keeps it near the SFT model.
   [PPO →](https://qrsntu.org/learn/post-training/guide/#ppo)
5. Departures
   ### DPO
   Skip the reward model and the RL loop: a classification-style loss on preference pairs, derived from the same objective.
   ### RLVR and GRPO
   Replace learned rewards with checkable ones (a correct maths answer, passing tests) and the critic with a group of samples.
   [DPO →](https://qrsntu.org/learn/post-training/guide/#dpo)   [GRPO →](https://qrsntu.org/learn/post-training/guide/#grpo)

**What the optimise step is, as geometry.** Take the running example’s six replies and gather them into three kinds, one per corner. A model’s answer distribution is then a single point: its three coordinates are the probability it puts on each kind. Grouping the replies is a projection, so two policies that differ only inside a corner share a point, and the KL quoted here is the real KL over all six replies, not a distance in the triangle. The base model sits near the off-target corner; SFT moves it onto plain answers. The curve is not a training path: it is where the KL-regularised optimum lands for each value of β, the weight on the KL from the SFT model. Tight, and that optimum barely leaves the SFT model. Loose, and it lands in the corner of the flattering reply, the one the reward model scores highest (2.2, above the plain full sentence at 1.6): the reward model over-rates flattery, and without the KL leash that is where all the probability goes. Illustrative probabilities and reward-model scores, not measurements from a real model.

## What you will learn

1. [From task models to pre-train and adapt](https://qrsntu.org/learn/post-training/guide/#history)
   ULMFiT, GPT-1, BERT, GPT-2, T5 and GPT-3, and the question they leave open.
2. [Supervised fine-tuning](https://qrsntu.org/learn/post-training/guide/#sft)
   The objective, derived; chat templates and loss masks; why a little data goes a long way.
3. [Learning from preferences](https://qrsntu.org/learn/post-training/guide/#preference)
   Why comparisons, the Bradley–Terry reward model, and reward hacking.
4. [Reinforcement learning, from scratch](https://qrsntu.org/learn/post-training/guide/#rl-setup)
   MDPs, returns, policy gradients, value functions, Bellman equations, TD and GAE.
5. [RLHF in practice](https://qrsntu.org/learn/post-training/guide/#trpo-ppo)
   Trust regions, PPO’s clipped objective, the InstructGPT pipeline and its limits.
6. [Beyond PPO](https://qrsntu.org/learn/post-training/guide/#dpo)
   DPO, verifiable rewards, GRPO and DeepSeek-R1.
7. [In practice](https://qrsntu.org/learn/post-training/guide/#compare)
   The methods side by side, reported settings, memory costs, failure diagnosis, evaluation and open questions.

An explainer, not a QRS research project. The toy figures are illustrative; every other claim cites its source in the guide’s [references](https://qrsntu.org/learn/post-training/guide/#references).
