Papers · 2023 · Reading: 24 min, plus 3 in closed details.
Paper · NeurIPS 2023 (Outstanding Main Track Runner-Up) · arXiv 2305.18290

Direct Preference Optimization: Your Language Model is Secretly a Reward Model (DPO)

Rafael Rafailov*, Archit Sharma*, Eric Mitchell*, Stefano Ermon, Christopher D. Manning, Chelsea Finn (* equal contribution)
Stanford University, CZ Biohub · May 2023 (arXiv v1); v2 December 2023 (adds the CNN/DailyMail test); v3 July 2024

In one line: DPO collapses RLHF's reward-model-plus-PPO pipeline into one binary cross-entropy loss by reparameterising the reward as the policy/reference log-ratio, which the paper reports as matching or beating PPO on its three tasks at 2023 scales.

61.7 vs 57.0 %
TL;DR win rate against the human reference summaries at temperature 0, DPO against PPO (GPT-4 judge)
158 and 146 of 256 prompts, read from the figure's vector data; about 1.1 standard errors apart · Figure 2
0.91 vs 0.49 reward
IMDb sentiment: best true reward at KL ≤ 2, DPO against PPO with a learned reward
26 of PPO's 27 evaluation points are beaten by a DPO point on both axes · Figure 2
0 samples
drawn from the policy during training; PPO samples every step and keeps a reward model loaded
4 forward passes per pair, 2 of them cacheable · §4

How far to trust it: Believe the derivation (it is exact) and the recipe (simple, cheap, adopted everywhere). Treat the head-to-head wins over PPO as suggestive rather than settled: each is a single run judged by GPT-4, the summarisation margin over PPO is about one standard error, and later controlled studies found well-tuned on-policy RL ahead on harder tasks. The evidence, judged.

The idea in one sentence: the best policy for any reward under RLHF's KL-constrained objective is the reference reweighted by exp(reward / β), so every reward can be written as β log π/πref plus a prompt-only term that cancels in a preference comparison; fitting the preference pairs with that reward is one logistic loss on the policy itself, with no reward model, no sampling and no RL.

You need: the RLHF pipeline (reward model, KL penalty, PPO), taught on Alignment: SFT, RLHF, DPO family, RLVR, and cross-entropy as a likelihood (Loss functions). DPO's successors (IPO, KTO, SimPO, ORPO) and the online-against-offline evidence since are compared on the alignment page; PPO and GRPO for LLMs on RL for LLMs; this page is the paper. New terms: πref (the frozen starting model, usually the SFT model); β (the KL penalty's weight: small β lets the policy move far); implicit reward (β log π/πref, the reward a DPO policy defines); frontier (reward reached at each KL from πref); Preferred-FT (supervised fine-tuning on the chosen answers only); Unlikelihood (push chosen up and rejected down with no weight); PPO-GT (PPO on the true reward, an oracle).

Same data, same objective: RLHF fits a reward model and runs RL against it; DPO fits the policy directly
RLHF: preference data, maximum likelihood fits a reward model; reinforcement learning then loops between the reward model labelling rewards and the LM policy sampling completions
DPO: preference data, maximum likelihood, directly to the final LM
r(x, y) = β log π(y|x) / πref(y|x) + β log Z(x)  ⟶  σ(r(yw) − r(yl)): the Z(x) terms cancel
Notice what disappears on the right: the reward model and the sample-and-score loop. Both sides still fit preference data by maximum likelihood; DPO does it with the reward parameterised by the policy (the bar under the figure: Eq. 5 put into Bradley-Terry, Eq. 1; derived in Idea). Figure 1 of the paper (arXiv 2305.18290), by Rafailov, Sharma, Mitchell, Ermon, Manning and Finn, CC BY 4.0; split into its two panels so each stays legible on a phone.

Problem

§1, §3, Eq. 1 to 3

In 2023, steering a pretrained model towards what people prefer meant RLHF (Ziegler et al., Stiennon et al., Bai et al., InstructGPT), in three stages (§3):

  1. Supervised fine-tuning on good demonstrations gives a model πSFT.
  2. Reward modelling. πSFT answers each prompt x twice; people pick yw over yl. Preferences are assumed to come from a hidden reward r* through Bradley-Terry, and a reward network rφ (πSFT with a scalar head) is fitted by maximum likelihood:
    p*(y1 ≻ y2 | x) = σ(r*(x, y1) − r*(x, y2)),   ℒR = −𝔼 log σ(rφ(x, yw) − rφ(x, yl))
    Equations 1 and 2 (Eq. 1, Eq. 2); rewards are usually normalised to mean zero.
  3. Reinforcement learning. The policy πθ maximises the learned reward while a KL penalty keeps it near πref = πSFT, where the reward model is accurate and the text stays diverse:
    maxπθ 𝔼x, y∼πθ[rφ(x, y)] − β 𝔻KL[πθ(y|x) ‖ πref(y|x)]
    Equation 3 (Eq. 3). Text is discrete, so this is not differentiable; the standard approach folds the penalty into the reward, rφ − β(log πθ − log πref), and runs PPO.

The third stage is the painful one: several language models at once and sampling inside the training loop; PPO keeps four networks in play (policy, frozen reference, reward model, a learned value function), and it is notoriously unstable and sensitive to hyperparameters (§1, §5.2). The question: is the reinforcement learning necessary at all? The paper's answer is no: the same KL-constrained objective can be optimised exactly with one binary cross-entropy loss on the preference pairs: no separate reward model, no sampling, no RL (§1). (The pipeline in general, with InstructGPT's numbers, is taught on Alignment: SFT, RLHF, DPO family, RLVR; above is the paper's own statement of it.)

Idea: change variables from rewards to policies

§4, Eq. 4 to 7, Figure 1

The key move is a change of variables. Three steps, each a line of algebra (§4, Appendix A.1 and A.2):

1. The best policy for any reward has a closed form. For a reward r, the maximiser of Eq. 3 over all policies is a reweighting of the reference, a standard result from KL-regularised control (Peters and Schaal; Peng et al.; Korbak et al.; Go et al.):

πr(y | x) = πref(y | x) exp(r(x, y) / β) / Z(x),   Z(x) = Σy πref(y | x) exp(r(x, y) / β)
Equation 4 (Eq. 4; proof in A.1 by Gibbs' inequality). Exact but useless as it stands: Z(x) sums over every possible answer.

2. Turn it round: a reward is a log-ratio of policies. Take logs and rearrange:

r(x, y) = β log [πr(y | x) / πref(y | x)] + β log Z(x)
Equation 5 (Eq. 5): every reward is a scaled policy-to-reference log-ratio plus a term that depends only on the prompt.

3. Bradley-Terry only sees differences, so Z cancels. Put Eq. 5 into Eq. 1 and the two β log Z(x) terms cancel: the preference probability depends only on π* and πref (Eq. 6). Fitting that by maximum likelihood, as Eq. 2 fits a reward model, gives the DPO objective:

ℒDPO(πθ; πref) = −𝔼(x, yw, yl)∼𝒟 log σ( β log [πθ(yw|x) / πref(yw|x)] − β log [πθ(yl|x) / πref(yl|x)] )
Equation 7 (Eq. 7): logistic regression on a difference of log-ratios. Per pair: four forward passes (two of them the frozen reference's, computable once), one backward pass, no sampling.
Rankings of more than two answers (Appendix A.3)

The same derivation works for rankings of more than two answers under the Plackett-Luce model, where it gives a softmax over the ranked answers' log-ratios (Appendix A.3, Eq. 20).

Both pipelines on the same pairs

What that saves, on this page's toy (Train DPO and RLHF: 4-word reviews, 5,229 pairs labelled by a sentiment classifier), both pipelines on the same data (Fig. 1). The models are the glass plates at the back; switch to DPO and the reward model's plate is an empty frame. The value network is dashed: the toy's PPO uses the batch mean as its baseline. The plinth at the front holds one pair's two rewards: the reward model's in RLHF, the policy's own implicit reward in DPO. The general picture (one RL step model by model, and the memory bill of PPO, GRPO and DPO) is on Alignment: SFT, RLHF, DPO family, RLVR; this figure is the paper's claim on its toy.

  1. Start from the SFT model. The reference πref = πSFT (the purple plate) is a model of how reviews are usually written. Every method starts from it and is judged by how far it moves (the KL) for how much true reward it gains.
  2. Collect and label pairs. πref writes 4 answers per group and the classifier ranks every pair of them, as the paper does for IMDb: 5,229 labelled pairs. Both pipelines use exactly these.
  3. Fit a reward model (Eq. 2). A separate network rφ (gold) learns to score answers so that σ(rφ(yw) − rφ(yl)) matches the labels: 3 epochs, 98.7% of held-out pairs ordered correctly. On the plinth, its scores for pair 3 of Fig. 2, "plot is not bad" over "plot is not good": +2.48 and +0.27 (centred, since a reward is defined only up to a constant). It must stay loaded for the whole RL stage.
  4. Copy the SFT model as the policy. The policy πθ (green) starts equal to πref. PPO normally adds a fourth network, a value function that predicts each answer's reward: the dashed frame, since the toy uses the batch mean instead.
  5. RL loop: sample from the policy. Every step, πθ generates 64 fresh answers. This sampling inside the training loop is what makes RLHF slow at scale: generation is sequential.
  6. Score them. Each answer gets rφ(y) − β (log πθ(y) − log πref(y)): one pass of the reward model and one of the frozen reference per sample.
  7. PPO update, and repeat 400 times. A clipped surrogate, 4 epochs on the batch, β nudged towards the target KL. After 400 steps: 25,600 answers generated, KL 0.99, true reward 0.786, 0.015 below the best possible at that KL.

The toy's own counts and runs (toy_sweep.mjs: the sweep runs "PPO, target KL 1" and "DPO, β = 1"), recomputed in your browser; pair 3's implicit rewards come from the same DPO run as Fig. 2.

The loss, and what its gradient does

§4, Appendix A.4 and B

The quantity inside the sigmoid is a reward in its own right, the implicit reward r̂θ(x, y) = β log [πθ(y|x) / πref(y|x)]. DPO is exactly reward-model fitting under this parameterisation, so the trained language model doubles as its own reward model, the title's claim. Its gradient (§4, derived in Appendix A.4) reads:

∇θℒDPO = −β 𝔼[ σ(r̂θ(x, yl) − r̂θ(x, yw)) · (∇θ log π(yw|x) − ∇θ log π(yl|x)) ]
Push the chosen answer up and the rejected one down, each pair weighted by how wrongly the implicit reward currently orders it. Pairs already ranked correctly contribute little; confidently wrong pairs dominate. Appendix A.4 has two sign slips that this page's checks list; the §4 form above is the right one (PyTorch autograd agrees with it).

The weight, on four real pairs

The authors' claim is that the weight matters: "a naïve version of this method without the weighting coefficient can cause the language model to degenerate" (§4). The naive version is the paper's Unlikelihood baseline, maximise log π(yw) and minimise log π(yl) (Appendix C.3). In Fig. 2 the same four training pairs of the toy go through both, during real training runs computed in your browser; the nine checkpoints of each 600-step run (0, 5, 10, 25, 50, 100, 200, 400, 600 steps) play in five stretches. The numbers in the steps are for β = 1; the counters follow the β you pick.

  1. Start: πθ = πref. One plinth per pair: the chosen answer's bar (blue) and the rejected one's (orange) show each answer's log πθ/πref on its plinth, up when the answer gained probability, hanging below when it lost; the grey trough in front is filled to the pair's weight. Every log-ratio is 0, so every margin is 0 and every weight is σ(0) = ½.
  2. The first 10 steps. Every bar is still within 0.2 nats of zero and the four weights sit between 0.45 and 0.48: while the margins are small next to 1/β, every pair pushes at nearly the same strength, and the update is close to the unweighted one.
  3. Steps 10 to 50: the margins open. In pairs 2 and 3 the chosen answer rises (to +0.70 and +0.71) as the rejected one falls. In pairs 1 and 4 the chosen answer falls too, only more slowly than the rejected one: answers share word-pair parameters with answers in other pairs, on either side. The weights fall to 0.30 to 0.39.
  4. Steps 50 to 200: well-ordered pairs push less. The weights fall to 0.16 to 0.29 as the margins grow, so the remaining gradient comes increasingly from pairs still ranked wrongly. KL 0.52, true reward 0.675 (from 0.368 at the start).
  5. Steps 200 to 600: the gap grows, not the chosen answer. Pair 4 ("film was so dull" over "film was very bad", both negative) ends at −4.29 for the chosen answer and −6.27 for the rejected one, weight 0.12; pair 1's weight is down to 0.06. KL 1.05, true reward 0.795. At β = 0.1 the weights stay between 0.26 and 0.45 even at 600 steps, which is why the paper's default behaves like the unweighted loss for so long.

Bars: each answer's log πθ/πref in nats, to scale; the implicit reward is β times it. Grey trough: the pair's weight σ(r̂(yl) − r̂(yw)) (Unlikelihood: 1). Counters exact over all 20,736 sequences; settings as in the Train tab. The same push on one illustrative pair for eight losses, token by token, is on the alignment page, section 5.

DPO at the paper's default β = 0.1, trained for 600 steps on the toy (about 7 passes over the data). On average over the training pairs, what happened to the probability of the chosen answers?
At β = 0.1 both answers lose probability; only the gap between them grows

Average log πθ/πref of the chosen and rejected answers over the training pairs, during 600 steps of DPO on the toy. From the sweep runs of toy_sweep.mjs (identical when rerun in the browser). Llama 3 added a negative log-likelihood term on the chosen answers for exactly this reason (Llama 3 §4.1.4); why shared parameters cause it is on the alignment page.

The recipe (§4, DPO outline, Appendix B): label pairs sampled from πref; use πref = πSFT when the data came from it, otherwise fine-tune on the chosen answers first (Preferred-FT) to reduce the shift between data and πref. The loss is about ten lines of PyTorch (Appendix B); TRL logs the implicit rewards as rewards/chosen, rewards/rejected and rewards/margins (TRL docs). Settings: What it takes.

Theory: your language model is secretly a reward model

§5, Lemmas 1 and 2, Theorem 1, Eq. 8 to 10

Is anything lost by insisting that the reward be a log-ratio of a policy and the reference? Section 5 says no (§5.1): rewards that differ only by a function of the prompt give the same preferences and the same optimal policy, and Theorem 1 shows every such class contains exactly one reward of the form β log π(y|x)/πref(y|x) (given πref > 0 everywhere and β > 0).

Definition 1, Lemmas 1 and 2, Theorem 1 as the paper states them (§5.1, Appendix A.5 and A.6)
  • Definition 1. Two rewards are equivalent when they differ by a function of the prompt only, r(x, y) − r′(x, y) = f(x).
  • Lemma 1. Equivalent rewards induce the same preference distribution under Plackett-Luce and Bradley-Terry: the well-known under-specification of these models, which is why reward models need an identifiability constraint such as zero mean.
  • Lemma 2. Equivalent rewards induce the same optimal policy under the KL-constrained objective.
  • Theorem 1. If πref(y|x) > 0 everywhere and β > 0, every equivalence class contains exactly one reward of the form β log π(y|x)/πref(y|x) (uniqueness is Proposition 1 in A.6). The projection f(r) = r − β log Z(x) (Eq. 8) picks it: the member whose Eq. 4 normaliser is exactly 1 (Eq. 9).

Proofs in Appendix A.5 and A.6.

So restricting to log-ratios loses no reward class, and it is exactly what makes Eq. 4 tractable for every prompt. The same lens explains PPO's trouble (§5.2, Eq. 10): β log Z(x) is the reference's soft value function. It does not move the optimum, but without it the policy gradient has high variance; PPO learns a value function for it (hard to optimise), earlier work used a human-written completion as a one-sample baseline, and DPO's reward needs no baseline.

The toy checks this. Its policy class and reward-model class match exactly (both are sums of word-pair terms; the toy), so the DPO loss over policies and the Bradley-Terry loss over rewards should reach the same minimum. They do: . But only margins between compared answers are pinned down: trained to convergence without early stopping, the DPO policy put of its probability on sequences that never appeared in the data. The figure plots the implicit reward of a normally trained policy (600 steps) against the true reward.

Each dot is one of the 391 distinct sequences in the training pairs, area by its reference probability; the true reward is the toy's sentiment classifier. Computed live in your browser.

Experiments: three tasks, two kinds of evaluation

§6, Appendix C

Tasks: IMDb sentiment with GPT-2-large and a sentiment classifier as the true reward (so the reward-KL frontier can be measured exactly); Reddit TL;DR summarisation from a GPT-J SFT model with Stiennon et al.'s human preferences; Anthropic HH dialogue with Pythia-2.8B. Sentiment is scored on the frontier, the other two by GPT-4 win rates.

The three tasks in full: models, data, labellers (§6, Appendix C.1)
  • Sentiment (IMDb): continue a 2 to 8 token review prefix positively. GPT-2-large, fine-tuned one epoch on IMDb, samples 4 completions for each of 25,000 prefixes; the classifier siebert/sentiment-roberta-large-english turns them into 6 pairs per prefix and is also the ground-truth reward (Appendix C.1).
  • Summarisation (Reddit TL;DR) with Stiennon et al.'s human preferences (collected on a different but similar SFT model); DPO, PPO and Preferred-FT all start from the public GPT-J SFT model CarperAI/openai_summarize_tldr_sft, PPO through TRLX.
  • Dialogue (Anthropic HH): 170,000 dialogues ending in two responses and a human preference; with no SFT model available, Pythia-2.8B fine-tuned on the preferred responses serves as πref.

Evaluation: on IMDb, each method's frontier of true reward against sequence-level KL to πref; elsewhere, win rates against the test set's reference summaries or preferred responses, judged by gpt-4-0314 with the answer order randomised (Appendix C.2).

Every baseline (§6)

Baselines: zero-shot GPT-J and 2-shot Pythia-2.8B; SFT; Preferred-FT (supervised on yw); Unlikelihood with a coefficient α on the push-down term; PPO on a learned reward; PPO-GT, an oracle PPO on the true reward (IMDb only; an off-the-shelf TRL version and the authors' tuned one); and Best of N, which samples N answers and keeps the one the learned reward likes best: strong, but N samples per query at test time (§6).

Results

§6.1 to 6.4, Figures 2 to 4, Tables 1 and 2

How well does DPO optimise the RLHF objective? On IMDb, 22 runs sweep each method's conservativeness (PPO target KL ∈ {3, 6, 9, 12}; DPO β ∈ {0.05, 0.1, 1, 5}; Unlikelihood α ∈ {0.05, 0.1, 0.5, 1}; seeds for Preferred-FT), evaluated every 100 steps. DPO gives by far the best frontier, the most reward at every KL, even against PPO-GT on the true reward; as both optimise the same objective, the authors read this as DPO being the better optimiser (§6.1, Figure 2 left). The figure is rebuilt from the paper's vector data (177 points).

IMDb: DPO's points reach more reward at every KL than PPO's, even PPO on the true reward

Dots: every evaluation the figure plots; lines: each method's best-so-far envelope. Every PPO and PPO-GT point except the untrained starting checkpoints is beaten by some DPO point on both axes. Full version with toggles: the figures tab.

This page's toy has a working PPO, and the exact best possible frontier is known. Run the same sweep there. Which method lands closest to the best possible reward-KL trade-off?
On the toy, PPO-GT reaches the exact frontier; DPO's distance depends on β

Every evaluation of the 19 toy runs (reward against KL), computed by toy_sweep.mjs; the exact Eq. 4 frontier and the full sweep are on the Train tab.

Summarisation. At temperature 0, DPO wins about 61% of GPT-4 comparisons against the reference summaries and PPO 57% at its best temperature (also 0); DPO also beats the best Best of N (which plateaus at 64 to 128 samples, Figure 4), with β not meaningfully tuned. DPO is much more robust to temperature: PPO falls towards the base GPT-J at high temperature, and Preferred-FT barely improves on SFT (§6.2, Figure 2 right). Read from the figure's vector data, every point is a count out of 256 test prompts, with ±1 binomial standard error bars: DPO 158 and PPO 146 at temperature 0 (61.7% and 57.0%); at temperature 1, DPO 99 and PPO 18.

Dialogue. DPO is "the only computationally efficient method that improves over the preferred completions" of Anthropic HH, roughly matching the expensive Best of 128 at each method's best temperature: 62.9% against 60.8%, both at temperature 1.0, though at 0.25 DPO is at 37.0% and Best of 128 at 54.2% (§6.2, Figure 3). There is no PPO here: a public PPO model (reciprocate/ppo_hh_pythia-6B) could not beat the base Pythia-2.8B at any prompt or temperature tried, so Best of 128 stands in as "a rough proxy for PPO-level performance". DPO reaches its level quickly and stays there.

A new input distribution (added in v2, December 2023): on CNN/DailyMail news, the TL;DR policies win 0.36 (DPO) against 0.26 (PPO) at temperature 0 and 0.31 against 0.23 at 0.25, versus the ground-truth summaries, though PPO also saw extra unlabelled Reddit prompts (§6.3, Table 1).

GPT-4 as a stand-in for people. On TL;DR, three methods against greedy PPO: DPO at temperature 0.25 (272 respondents), SFT at 0.25 (122) and PPO at 1.0 (199). With the concise prompt GPT-4 (C), GPT-4 agrees with people 67%, 79% and 85% of the time, against 65% and 87% human-human agreement; people preferred DPO 58% of the time. The simple prompt GPT-4 (S) prefers longer, more repetitive summaries, so the main results use GPT-4 (C) (§6.4, Table 2).

DPO wins 158 of 256 TL;DR comparisons and PPO 146 of 256 (temperature 0, separate runs on the same prompts). How many standard errors apart are they?

Limitations the authors list (§7): out-of-distribution generalisation against an explicit reward; whether self-labelling can use unlabelled prompts as RLHF does; reward over-optimisation in DPO (perhaps the slight late decline in Figure 3 right); scale beyond 6B; and the GPT-4 judge's prompt dependence. They suggest DPO for other generative modalities too.

How much of this to believe

§6, Figures 2 to 4, Tables 1 to 3, Appendix A

What holds up. The derivation is exact and checkable: Eq. 4 is a textbook result, the cancellation is one line, the gradient is what autograd computes (this page checks the toy's losses and gradients against PyTorch to 1e-13). The IMDb frontier uses a ground-truth reward and 22 runs, and its gap is large: at a KL of at most 2, DPO reaches 0.91 against PPO's 0.49. TL;DR's temperature robustness is far outside the noise. The recipe has been reproduced by almost everyone since (Zephyr, Mixtral, Llama 3, Qwen2, Tülu 3, OLMo 2; Why it matters). And the authors flag scale, the judge's prompt sensitivity and out-of-distribution behaviour themselves, which counts in their favour.

What is weaker, concretely:

  • single runs Every win-rate point is one training run evaluated on 256 prompts (TL;DR) or about 250 (HH): DPO against PPO on TL;DR is 4.7 ± 4.3 points (z ≈ 1.1); DPO against Best of 128 is z ≈ 1.0 on TL;DR and 0.5 on HH. "Exceeds PPO's best-case performance" is a point estimate within one standard error (figures; standard errors, paired tests and how many items a gap needs, in general: Eval statistics).
  • not like for like There is no PPO on the dialogue task; Best of 128 is called "a rough proxy for PPO-level performance". Each method is compared at its own best temperature, chosen on the same test prompts. On IMDb the paper's PPO and PPO-GT barely move the reward below a KL of 2, which suggests a weak PPO more than a weak objective: in this page's toy, where PPO is easy to get right, PPO-GT sits on the exact frontier and DPO at the paper's default β = 0.1 does not (toy sweep). Later controlled studies with carefully tuned PPO found it ahead, especially on code (Xu et al. 2024).
  • a proxy judge GPT-4 with a prompt chosen because it matched people better; the human study is 122 to 272 respondents per comparison with repeated human judgments for two of the three, and human-human agreement on the DPO comparison was only 65%. The 58% human preference for DPO over PPO is 2.7 standard errors above 50%. Judge biases (length, position) and calibration against people in general: LLM-as-judge.
  • the weighting claim The evidence that the weight prevents degeneration (§4, "Appendix Table 3") is two Unlikelihood samples at temperature 1.0 on TL;DR, not an ablation. The toy supports the direction: without the weight the policy loses its grammar after enough steps (grammatical mass from 91% to 0.3% by 4,000 steps). It also shows that DPO itself degenerates when trained far past the sweep, more slowly (the toy).
  • small slips Appendix A.4 swaps yw and yl inside Eq. 21 and ends with the weight σ(r̂w − r̂l), the opposite of §4; §5.2 says "the optimal policy from Eq. 7" where it means Eq. 4. Neither affects the method (checks).

Verdict. Believe the derivation and the recipe: DPO optimises the RLHF objective without RL, with two models instead of four and no sampling, and it works well enough that it became the default. Treat "better than PPO" as unproven by this paper: the dialogue comparison has no PPO, the summarisation margin is one standard error, and the sentiment frontier mostly shows that the paper's PPO was hard to make work.

What it takes to use this

Appendix B; the code
  • Code. The authors' reference implementation (Apache 2.0): SFT then DPO with FSDP, and switches for conservative DPO (loss.label_smoothing) and IPO (loss=ipo). In production most people use Hugging Face TRL's DPOTrainer, which exposes the variants as loss_type.
  • Data. Pairs sampled from the model being tuned (or a close relative) match the theory best; with someone else's pairs, first fine-tune on the chosen answers, as the paper does for HH.
  • When it pays off. Offline preference or style alignment from a fixed set of pairs, where maintaining a reward model and a PPO loop is the main cost. When it buys little: tasks with a checkable reward (maths, code), where on-policy RL such as GRPO and RLVR now dominates; and near-deterministic preferences, where DPO keeps widening margins and drifts from πref unless stopped early (the motivation for IPO and conservative DPO; see Then and now). Watch rewards/chosen: if it goes negative, the chosen answers are losing probability.
Hardware and the settings that worked (README, Appendix B, Tülu 3, Llama 3)
  • Hardware. The README's example on Pythia 2.8B with Anthropic HH: on four 80 GB A100s, SFT takes about 1 h 30 min and DPO about 2 h 45 min. Memory is a trainable policy plus a frozen reference; the reference's log-probabilities can be computed once and cached, which Tülu 3 did for its 70B runs. In Tülu 3's controlled comparison DPO took about 4 hours on one node and PPO about 28 hours on two, for slightly better scores (Tülu 3 §5.4).
  • Settings that worked. β = 0.1 (0.5 for TL;DR), batch 64, RMSprop at 1e-6 with 150 warmup steps (Appendix B); the README suggests β between 0.1 and 0.5. Llama 3 used β = 0.1 at 1e-5, masked formatting tokens out of the loss and added a negative log-likelihood term (weight 0.2) on the chosen answers to stop their probability falling.

Why it matters (beyond the paper)

later work

It commoditised preference tuning. A fine-tuning loss anyone can run on preference pairs, with two models in memory and no sampling, became the standard alignment stage of open post-training pipelines within a year (which ones, dated, below).

It did not settle DPO against PPO. Later controlled studies found well-tuned online RL ahead, especially on code and reasoning, and offline DPO better at classifying pairs than at generating; on-policy samples and iterating (online DPO) close part of the gap (Xu et al. 2024, Tang et al. 2024, Tajwar et al. 2024; the evidence is compared on Alignment: SFT, RLHF, DPO family, RLVR). DPO also pushes the chosen answers' probability down, as the toy above shows (DPO-Positive, likelihood displacement).

It spawned a family, each fixing one weakness: IPO (a squared loss, so near-deterministic preferences cannot drive margins to infinity), conservative DPO and rDPO (label noise), KTO (unpaired thumbs up or down), ORPO (no reference), SimPO (reference-free, length-normalised), CPO, TR-DPO (the reference updated during training) and DiscoPOP (losses found by automated search). The alignment page compares the main ones on one pair and animates the push each puts on a pair against its margin, with their outcomes on this page's toy; the long runs train several here. GRPO is a separate line with the same motive of deleting RLHF machinery, there the value model (DeepSeekMath).

"Policy log-ratio = reward" became a reusable tool: DPO models are scored as reward models (RewardBench evaluates them beside classifiers), their implicit rewards build the next round's preference data (DICE), and the derivation pattern (solve the KL-regularised objective in closed form, substitute back) recurs across post-training papers (RewardBench, DICE).

Adoption and the debate in detail, sources read 3 October 2026 (dated; it will change)
  • It commoditised preference tuning: a fine-tuning loss anyone can run on preference pairs. Zephyr-7B (October 2023) showed it at 7B on UltraFeedback's AI-feedback pairs (Zephyr), and it became the standard alignment stage of open pipelines: Mixtral Instruct (SFT then DPO, Mixtral §4), Llama 3 (which "found that DPO required less compute for large-scale models and performed better" than PPO, Llama 3 §4.1.4), Qwen2 (offline DPO, then online DPO on its own samples, Qwen2), Tülu 3 and OLMo 2.
  • The DPO against PPO debate. Xu et al. ("Is DPO Superior to PPO for LLM Alignment?", 2024) showed DPO can find solutions on answers the data never covered and found well-tuned PPO ahead in every testbed, including competitive code (2404.10719). Google DeepMind's online-against-offline study found offline methods better at classifying pairs but worse at generating (Tang et al.); on-policy samples and a "negative gradient" both help (Tajwar et al.); and DPO tends to push the chosen answers' likelihood down too (DPO-Positive, likelihood displacement). The rough consensus as of 2026: DPO is the cheap, stable choice for general preference and style alignment; online RL (PPO, and above all GRPO and RL with verifiable rewards, as in DeepSeek-R1) wins for reasoning and frontier-scale post-training; iterative and online DPO close part of the gap; labs commonly run a DPO stage then RLVR, as in Tülu 3 and OLMo 2.

Connections