FDEInterviews logo
NeurIPS 2023

Direct Preference Optimization: Your Language Model is Secretly a Reward Model

The 2023 Stanford paper that replaced RLHF's reward model and PPO loop with one classification loss on preference pairs, and became the default way to tune models on human preferences.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2023
AUTHORS
Rafailov, Sharma, Mitchell, Ermon, Manning, Finn
FROM
Stanford University
PUBLISHED
May 2023 · NeurIPS 2023
CITED BY
11,126Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 24% of this breakdown.

01

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.

THE IDEA, VISUALLY
THE SAME OBJECTIVE, WITHOUT THE RL LOOP RLHF (PPO) SFT model reward model fit on pairs PPO sample, score, update two models to train, sampling during training, many knobs DPO SFT model also the reference one loss on preference pairs raise chosen, lower rejected, vs reference no reward model, no sampling, one hyperparameter β The trick: under the KL-constrained objective, the best policy for a reward r is π_ref · exp(r/β) / Z. Solve for r, plug it into the preference model, and Z cancels. The policy is its own reward model. Each pair is weighted by how wrongly the model currently orders it; without that weight, training degenerated. AS GOOD OR BETTER, UP TO 6B TL;DR, GPT-4 win rate vs reference (temp 0) DPO ~61% PPO ~57% CNN/DailyMail, out of distribution (temp 0) DPO 36% PPO 26% Humans, DPO (temp 0.25) vs PPO (temp 0) DPO preferred 58% On Anthropic HH dialogue, DPO was the only efficient method to beat the dataset's preferred responses. The off-the-shelf PPO model tested there did not beat the base model, so best-of-128 stood in for PPO.
DPO optimizes the same objective as RLHF without a separate reward model or reinforcement learning, and matched or beat PPO in the paper's tests up to 6B parameters.
Research notes: the problem, approach and results
1 loss

replaces a reward model plus a PPO training loop with sampling

~61% vs 57%

GPT-4 win rate against reference summaries on TL;DR, DPO vs PPO at temperature 0

58%

of human judgments preferred DPO summaries over PPO summaries

THE PROBLEM

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.

THE IDEA

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.

THE RESULT

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.

02

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.

THE FULL BREAKDOWN

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

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The derivation in plain words, what the experiments show, and the misreadings to avoid

    Free account
  2. 04How it works

    The pipeline, the derivation step by step, the gradient, and the experimental setups

    Premium
  3. 05The numbers that matter

    The results, the judge study, and where the comparisons are weaker than they look

    Premium
  4. 06Try it yourself

    Implement DPO from scratch on a toy problem whose optimal policy is known, and watch it converge

    Premium
  5. 07Where it breaks

    The open questions the authors list, and the ones practice has since confirmed

    Premium
  6. 08Using it on a deployment

    Running preference tuning for a customer with DPO, from data to evaluation

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →