Walk me through the classic RLHF pipeline end to end.
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
The InstructGPT recipe, three stages after pretraining.
Full worked answer with diagram
The InstructGPT recipe, three stages after pretraining.
Stage 1 - SFT: fine-tune the base model on high-quality demonstrations (human-written or curated) so it can follow instructions at all. This is the initialization for everything downstream; RL can't fix a policy that never samples good behaviour.
Stage 2 - Reward model: collect preference data - sample two or more responses per prompt from the SFT model, have humans rank them (pairwise comparison is used because it's far more reliable than absolute scoring; annotators agree more on "A > B" than on "A is a 7/10"). Train an RM - usually the SFT model with a scalar head - with the Bradley-Terry loss: $-\log\sigma(r(x, y_w) - r(x, y_l))$, pushing the chosen response's score above the rejected one's.
Stage 3 - PPO: the SFT model becomes the policy. Sample responses to prompts, score them with the RM, and update the policy with PPO to increase expected reward - with a KL penalty against the frozen SFT (reference) model so the policy can't wander into degenerate text that happens to fool the RM. The effective objective is roughly $\mathbb{E}[r(x,y)] - \beta,\mathrm{KL}(\pi | \pi_{ref})$.
Why RL at all, instead of more SFT? Preferences encode relative quality on the model's own outputs - signal you can't easily express as demonstrations - and it's much cheaper for humans to rank than to write. The known failure mode is reward hacking: the RM is an imperfect proxy, and unconstrained optimisation exploits its blind spots (length bias, sycophancy), which is exactly what the KL term and fresh preference data are there to contain.
Worth sketching. the SFT checkpoint feeds three arrows, and that is the thing people miss.
flowchart LR
A["Pretrained base"] --> B["Stage 1: SFT<br/>on demonstrations"]
B --> C["Stage 2: reward model<br/>on preference pairs"]
B --> D["Stage 3: PPO policy"]
C -->|"reward signal"| D
B -->|"frozen reference for KL"| D
D --> E["Aligned model"]
What a good answer covers
- The InstructGPT recipe, three stages after pretraining
- Stage 1 - SFT: fine-tune the base model on high-quality demonstrations (human-written or curated) so it…
- This is the initialization for everything downstream; RL can't fix a policy that never samples good behaviour
- Stage 2 - Reward model: collect preference data - sample two or more responses per prompt from the SFT…
- Train an RM - usually the SFT model with a scalar head - with the Bradley-Terry loss
Key terms: Stage 1 - SFT · Stage 2 - Reward model · Stage 3 - PPO · reward hacking
In the glossary: Reward model · Bradley-Terry · PPO · KL penalty · Reward hacking · Sycophancy
Interviewer follow-ups to expect
Why pairwise preferences instead of absolute ratings?
What breaks if you skip SFT and run PPO on the base model?
Where does DPO short-circuit this pipeline?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep