KatInterview

From Demonstrations to Preferences: SFT, DPO and PPO Compared

Machine LearningModel answer
MediumModel answerMachine Learningpost-trainingDPOPPO

Last updated

Explain SFT's token-likelihood objective, DPO's pairwise log-ratio loss, and how PPO fits into KL-regularized post-training.

You are asked to walk through the main stages of post-training an autoregressive language model and to compare three approaches: supervised fine-tuning (SFT), Direct Preference Optimization (DPO), and PPO-style reinforcement learning with a reward derived from preferences.

Part 1 — SFT

Describe the SFT training objective and explain why a pipeline often still runs SFT before any preference-based stage. Cover how the loss is computed over tokens, which tokens are masked out, and what SFT does and does not teach the model.

Part 2 — DPO versus PPO

Describe what the standard DPO loss optimizes, given pairs of chosen and rejected responses and a frozen reference model. Then contrast the DPO training loop with a PPO loop that uses preference-derived rewards: where data comes from, what is sampled, what is estimated, and what is updated. Explain why SFT, DPO and PPO-style RL are often combined rather than treated as mutually exclusive replacements.

Part 3 — The KL claim

A colleague says: "DPO has no KL term, so it needs no KL regularization." Evaluate that statement carefully. Separate (a) the fact that the usual DPO loss contains no explicitly computed KL penalty from (b) the KL-regularized objective that DPO is derived from and its dependence on the reference policy. Also explain the role of DPO's temperature / regularization coefficient β.

Assumptions

Discuss the standard formulations; acknowledge that later variants may differ. Assume an autoregressive model, demonstration data for SFT, and paired response preferences for the preference stage. Do not assume one method is universally best.

Questions you may want to ask first

  • What data is available: demonstrations, preference pairs, or an online reward signal?
  • Is the focus on the training loss, the full data-collection pipeline, or final model quality?
  • Are we allowed to sample new responses from the current policy during training?

Hints

Hint 1

SFT is plain next-token cross-entropy on demonstrations; write down what the target token is and which positions you zero out.

Hint 2

DPO never rolls out a policy to score samples: it turns the Bradley–Terry preference model into a closed-form loss on log-probability ratios between the policy and a frozen reference model.

Hint 3

The usual DPO loss hides its KL term inside the reference model — it is implicit in the log-ratio, not computed separately. β sets how strongly the policy is tied to the reference.