The Reward Model Was Hiding in the Policy
The reward model RLHF pays a full training run to fit is already implied by the policy; Direct Preference Optimization turns that identity into a single classification loss.
Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Read the paperWhile large-scale unsupervised language models (LMs) learn broad world knowledge and some reasoning skills, achieving precise control of their behavior is difficult due to the completely unsupervised nature of their training. Existing methods for gaining such steerability collect human labels of the relative quality of model generations and fine-tune the unsupervised LM to align with these preferences, often with reinforcement learning from human feedback (RLHF). However, RLHF is a complex and often unstable procedure, first fitting a reward model that reflects the human preferences, and then fine-tuning the large unsupervised LM using reinforcement learning to maximize this estimated reward without drifting too far from the original model. In this paper we introduce a new parameterization of the reward model in RLHF that enables extraction of the corresponding optimal policy in closed form, allowing us to solve the standard RLHF problem with only a simple classification loss. The resulting algorithm, which we call Direct Preference Optimization (DPO), is stable, performant, and computationally lightweight, eliminating the need for sampling from the LM during fine-tuning or performing significant hyperparameter tuning. Our experiments show that DPO can fine-tune LMs to align with human preferences as well as or better than existing methods. Notably, fine-tuning with DPO exceeds PPO-based RLHF in ability to control sentiment of generations, and matches or improves response quality in summarization and single-turn dialogue while being substantially simpler to implement and train.1
Before you read
This paper assumes you already picture the standard alignment pipeline. A base language model is first fine-tuned on demonstrations (SFT). Then a separate reward model is trained to score a response, fit from human comparisons of response pairs under the Bradley-Terry model, which says the probability a human prefers one response is a logistic function of the difference in their scalar rewards. Finally the policy is optimized to maximize that reward while a Kullback-Leibler (KL) penalty holds it near the reference model, so it does not chase reward off a cliff into gibberish. If the terms logits, log-probability, and KL divergence are familiar, you have what you need; the one piece of RL machinery worth naming is PPO, the policy-gradient method that usually does that last step.
Why alignment kept an RL loop it did not want
By 2022, reinforcement learning from human feedback had become the default way to make a language model helpful. InstructGPT fit a reward model from rankings, then fine-tuned the policy with reinforcement learning against it, and a 1.3B model tuned this way was preferred to raw 175B GPT-3.2 The catch was the last stage. Optimizing a policy against a learned reward with PPO means sampling from the model in the loop, juggling several model copies at once, and tuning an RL algorithm that is delicate on language.3 Practitioners wanted the alignment that preferences buy without the reinforcement learning that pays for it. DPO's answer is a single move: a change of variables that makes the language model be its own reward model, so a dataset of preference pairs trains it directly with a classification loss and no sampling and no RL loop.1
The pipeline DPO deletes
The idea of learning from comparisons rather than a hand-written reward is older than instruction tuning. Christiano and colleagues showed in 2017 that you could train agents on non-expert human preferences between pairs of trajectory segments, fitting a reward model from those comparisons and optimizing it with RL.4 Applied to language, the recipe has three stages. Collect pairs of responses to the same prompt and a human label of which is better. Fit a reward model r(x, y) so that preferred responses score higher, under Bradley-Terry. Then optimize the policy against that reward with PPO.2
Every failure mode DPO advertises lives in that third stage. The reward model is a frozen approximation, so a policy optimizing hard against it can find responses that score well and read badly. To keep that in check the objective adds a KL penalty toward the reference model, which then has to be tuned. And PPO itself alternates sampling from the current policy with gradient updates on a clipped surrogate objective, which is why the pipeline holds a policy, a reference, a reward model, and a value estimate in memory at once.3 The reward model is a means to an end. It exists only to define the objective the policy eventually chases.
The change of variables
That objective has a known closed-form solution. The policy that maximizes expected reward minus the KL penalty is the reference distribution tilted by the exponentiated reward:
πr(y | x) = (1 / Z(x)) · πref(y | x) · exp( (1 / β) · r(x, y) )
The term Z(x) is a partition function, a sum over every possible response that normalizes the tilted distribution back into a probability. That sum is intractable for language, which is exactly why nobody solves RLHF this way and reaches for PPO instead.1 DPO's insight is not to compute Z(x) but to route around it. Take the logarithm of both sides and solve for the reward rather than the policy:
r(x, y) = β · log( πr(y | x) / πref(y | x) ) + β · log Z(x)
As we will describe next in detail, our key insight is to leverage an analytical mapping from reward functions to optimal policies, which enables us to transform a loss function over reward functions into a loss function over policies.1
Read that second equation as a definition. Any reward function corresponds to some optimal policy, and that reward can be rewritten as β times the log-ratio between that policy and the reference, plus a term that depends only on the prompt. The reward is no longer a separate network. It is a simple function of the policy you were going to train anyway.
Why the intractable term dies
The reparameterized reward still carries the intractable β · log Z(x). Here the choice of preference model earns its keep. Bradley-Terry does not depend on the rewards of two responses separately, only on their difference. When you substitute the reparameterized reward into the preference probability, both responses share the same prompt x, so both carry the identical β · log Z(x) term, and the subtraction erases it. What survives is a preference probability written entirely in quantities you can compute: the log-probabilities the policy and the reference assign to the two responses. The winning and losing completions yw and yl reduce to a logistic loss:
LDPO = − E[ log σ( β log( πθ(yw | x) / πref(yw | x) ) − β log( πθ(yl | x) / πref(yl | x) ) ) ]
This is ordinary binary cross-entropy. It needs the log-probabilities of the preferred and dispreferred responses under the model being trained and under a frozen reference, and nothing else. No reward network, no sampling from the policy during training, no value function, no RL. The objective is differentiable, so the gradient is exact rather than estimated.1
In contrast, DPO directly optimizes for the policy best satisfying the preferences with a simple classification objective, fitting an implicit reward model whose corresponding optimal policy can be extracted in closed form.1
What the gradient is actually doing
The loss deserves suspicion. If it only pushed up the log-probability of preferred responses and pushed down dispreferred ones, it would be a naive ratio objective, and the paper reports that such an objective degenerates. The sigmoid saves it. Differentiate the loss and a scalar weight appears in front of every update, and that weight is the sigmoid of how badly the model's own implicit reward, r̂(x, y) = β log( πθ / πref ), currently ranks the pair. When the model already prefers the right response, the weight is near zero and the example barely moves the parameters. When the model has the pair backwards, the weight is large and the update is strong.
Intuitively, the DPO update increases the relative log probability of preferred to dispreferred responses, but it incorporates a dynamic, per-example importance weight that prevents the model degeneration that we find occurs with a naive probability ratio objective.1
This clears up the misreading DPO invites. It is tempting to say DPO removes reward modeling. It does not. The objective is the reward model's own training loss, and the reward still lives in the system, folded into the log-ratio of the policy against its reference.5 Nathan Lambert's account puts the same point structurally: DPO reaches the RLHF objective without ever training an intermediate reward network, because the log-ratio parameterization is the reward, learned by gradient descent on the preference data.6 The reward model was never a separate thing that had to exist. It was a view of the policy.
What the experiments show, and what they leave open
The paper tests three settings. Controlled sentiment generation on IMDb prefixes, where a sentiment classifier supplies ground-truth preferences and the reward-versus-KL frontier can be traced exactly. TL;DR summarization, judged by GPT-4 win rate against reference summaries. And single-turn dialogue on Anthropic's Helpful and Harmless data. On sentiment, DPO sits on the efficient frontier: for every level of KL divergence from the reference, it reaches higher reward than PPO. On summarization at temperature zero, DPO wins about 61% against human reference summaries where PPO reaches 57% at its best temperature, and DPO holds up better as sampling temperature rises.1
Read like a reviewer, the evidence is real but bounded. The strongest result is the frontier plot, because it measures the actual optimization objective against a reward the experimenters control rather than a proxy. The dialogue and summarization wins lean on GPT-4 as judge, which the authors defend with a human study showing GPT-4 agreement with people is typically similar to or higher than agreement between human annotators. The honest limitation is generalization. On out-of-distribution CNN/DailyMail articles the win rates fall for both methods, and the authors write plainly that whether DPO policies generalize out of distribution as well as an explicit reward model is a question their initial results only begin to answer.1
- The derivation is exact, not an approximation of RLHF: same objective, closed-form solution.
- It removes the RL loop, the reward network, and policy sampling during training, which is why practitioners adopted it fast.
- On its own benchmarks it matches or beats PPO while being far simpler to run.
- DPO trains on a fixed offline preference set; it never samples fresh completions the way online RL does.
- Out-of-distribution behavior versus an explicit reward model is left open by the authors themselves.
- Later work argues the gap to a well-tuned PPO is real on hard tasks.
The three years since have argued the open question hard, and the reconstruction should not paper over it. A 2024 study tuning PPO carefully found it surpassing DPO across their benchmarks, including code competitions, and pointed to fundamental limits of DPO's offline setup.7 A theoretical analysis showed DPO can overfit when preferences are near deterministic, because it inherits the Bradley-Terry approximation along with the reward reparameterization.8 And SimPO dropped the reference model entirely, using a length-normalized average log-probability as the implicit reward, and reported gains over DPO on chat benchmarks.9 None of this unwinds the core identity DPO wrote down. It sharpens the verdict: the change of variables is correct and durable, and it seeded a family of direct-alignment methods, but it is a starting point for preference optimization rather than its last word.
Read it yourself
A full read adds the formal statements this reconstruction stated plainly: the theorem that the reparameterization loses no generality, the complete partition-function derivation, and the experimental tables behind the win-rate summary.
- read §4 Direct Preference Optimization: the change of variables, the loss, and the gradient interpretation. This is where the whole idea lives; read it slowly.
- read Appendix A.1: the derivation of the optimal policy and the reward reparameterization, the two steps the main text compresses.
- skim §6 Experiments: stare at Figure 2, the reward-versus-KL frontier. It is the cleanest evidence because the reward is controlled rather than a proxy.
- skim §5 Theoretical Analysis: the equivalence-class argument for why the reparameterization is fully general; skim unless you doubt the derivation.
- skip §2 Related Work: the reconstruction already placed the paper against RLHF and the direct-alignment methods that followed.
One thing first-time readers miss: the sigmoid weighting is not a detail of the loss, it is the reason the method works at all. Without it the naive ratio objective degenerates.
Sources
- arXiv · Rafailov et al., "Direct Preference Optimization: Your Language Model is Secretly a Reward Model" (2023)
- arXiv · Ouyang et al., "Training language models to follow instructions with human feedback" (2022)
- arXiv · Schulman et al., "Proximal Policy Optimization Algorithms" (2017)
- arXiv · Christiano et al., "Deep reinforcement learning from human preferences" (2017)
- Deep (Learning) Focus · Cameron R. Wolfe, "Direct Preference Optimization"
- RLHF Book · Nathan Lambert, "Direct Alignment Algorithms"
- arXiv · Xu et al., "Is DPO Superior to PPO for LLM Alignment? A Comprehensive Study" (2024)
- arXiv · Azar et al., "A General Theoretical Paradigm to Understand Learning from Human Preferences" (2023)
- arXiv · Meng, Xia, Chen, "SimPO: Simple Preference Optimization with a Reference-Free Reward" (2024)