Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Skip the reward model and RL. Align language models with one loss.
Direct Preference Optimization: Your Language Model is Secretly a Reward Model
RLHF works, but the pipeline is fragile
Fit a reward model on preference pairs, then run PPO against it while sampling from the policy. Four models in memory, unstable training, heavy tuning.
A change of variables shows the optimal policy defines its own reward. Train directly on preference pairs with a classification-style loss. No sampling, no reward model.
Your language model is secretly a reward model.
The whole method is one log-sigmoid loss
Raise the likelihood of the preferred answer and lower the rejected one, both measured against a frozen reference so the policy cannot drift far.
- yw
- Preferred, winning completion
- yl
- Rejected, losing completion
- πref
- Frozen SFT model that anchors the policy
- β
- Strength of the implicit KL penalty
From preference pairs to an aligned model
- 1
Start from an SFT model
Fine-tune on demonstrations first; a frozen copy becomes the reference πref.
- 2
Collect preference pairs
For each prompt, one chosen and one rejected completion. Existing RLHF datasets work as they are.
- 3
Minimize the DPO loss
Ordinary supervised training. The gradient upweights pairs the implicit reward currently ranks wrongly.
Better reward per unit of KL, and higher win rates

Left: on IMDb sentiment, DPO traces the best reward-versus-KL frontier. Right: on TL;DR summarization, DPO beats PPO across sampling temperatures and degrades far less as temperature rises.
Open questions the paper flags itself
Out-of-distribution behavior
How DPO policies generalize beyond the preference data, compared with policies trained on an explicit reward, was untested.
Reward over-optimization
Whether DPO over-fits its implicit reward the way PPO over-fits a learned one remained open.
Tested up to 6B parameters
Experiments stopped at 6B; behavior on frontier-scale models was left for future work.
Why it matters
- The KL-regularized RLHF objective has a closed-form optimum, so a classification loss can replace RL.
- Two models in memory instead of four: the policy and a frozen reference.
- DPO and its variants became a standard recipe for aligning open-weight chat models.
74 upvotes on Hugging Face 7 slides, 2 min
29 May 2023