IN THIS BREAKDOWN · 10 SECTIONS
You can read 24% of this breakdown.
The paper in one minute
After supervised fine-tuning, the usual way to make a model behave the way people prefer has been RLHF, as in InstructGPT. Collect pairs of responses where a person said which was better. Train a reward model to predict those preferences. Then use reinforcement learning, usually PPO, to make the language model produce high-reward responses while a KL penalty keeps it close to the original model. It works, but it means training several models, sampling from the language model inside the training loop, and tuning a finicky optimizer.
DPO, from Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher Manning and Chelsea Finn at Stanford, shows the reward model and the RL loop are unnecessary. The objective RLHF optimizes has a known optimal solution: the best policy for a reward r is the reference policy reweighted by exp(r/β). Rearranging that equation expresses the reward in terms of the policy. Substituting it into the standard preference model (Bradley-Terry), an intractable normalization term cancels, and what remains is a loss you can compute directly from the language model's probabilities: raise the log-probability of the preferred response and lower the rejected one, both measured relative to a frozen reference model, with a logistic loss.
So DPO is a classification loss on preference pairs. No reward model to train, no sampling during training, and one main hyperparameter, β, which sets how far the model may move from the reference. The paper's subtitle sums it up: the language model is secretly its own reward model.
In experiments with models up to 6B parameters, DPO traced a better reward-versus-KL frontier than PPO on a controlled sentiment task, even PPO with access to the true reward. It matched or beat PPO on Reddit TL;DR summarization, generalized better to news articles, and was the only computationally efficient method that improved on the preferred responses in Anthropic's HH dialogue data.
Research notes: the problem, approach and results
replaces a reward model plus a PPO training loop with sampling
GPT-4 win rate against reference summaries on TL;DR, DPO vs PPO at temperature 0
of human judgments preferred DPO summaries over PPO summaries
RLHF works but is complicated and unstable: train a reward model on human preferences, then run PPO, sampling from the model during training and tuning many hyperparameters.
For the KL-constrained objective RLHF optimizes, the best policy can be written in closed form in terms of the reward. Invert that, and the preference likelihood becomes a simple loss on the policy itself.
DPO beat PPO on the reward-versus-KL trade-off in a controlled task, on TL;DR summarization (about 61% vs 57% win rate) and out of distribution, and was the only efficient method to improve on Anthropic HH.
Why it matters to an FDE
DPO and its variants are now the standard way to do preference tuning on open models, including in fully open recipes like Tülu 3. If a customer wants a model to prefer one kind of answer over another, this is usually what you will run.
Preference data is easier to collect than demonstrations. People who cannot write the ideal answer can usually say which of two answers is better. Support leads, analysts and reviewers can label pairs quickly, and existing ratings or edits can sometimes be turned into pairs.
It fits in a normal fine-tuning pipeline. DPO is a loss function on pairs, so it runs with the same tools as supervised fine-tuning, including LoRA and QLoRA. That makes it practical on one or a few GPUs.
It still needs a good starting point. DPO assumes a reference model close to the data: the pairs should come from something like the model being tuned. When no such model exists, the paper first fine-tunes on the preferred responses. In practice: supervised fine-tuning first, then DPO.
β is the main dial. Lower β lets the model move further from the reference to match preferences; higher β keeps it close. Watch for over-optimization: preference tuning can make answers longer or more confident without making them better.
Evaluate with something other than the training preferences. The paper used GPT-4 as a judge and checked it against people; even then the prompt changed results. Use a held-out set and some human review.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 49 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
The derivation in plain words, what the experiments show, and the misreadings to avoid
Free account - 04How it works
The pipeline, the derivation step by step, the gradient, and the experimental setups
Premium - 05The numbers that matter
The results, the judge study, and where the comparisons are weaker than they look
Premium - 06Try it yourself
Implement DPO from scratch on a toy problem whose optimal policy is known, and watch it converge
Premium - 07Where it breaks
The open questions the authors list, and the ones practice has since confirmed
Premium - 08Using it on a deployment
Running preference tuning for a customer with DPO, from data to evaluation
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
