In one breath
- The KL-regularized RLHF optimum $\pi^*\propto\piref\,e^{r/\beta}$ can be inverted: $r=\beta\log\frac{\pi^*}{\piref}+\beta\log Z(x)$. In a Bradley–Terry likelihood the intractable $\beta\log Z(x)$ cancels, so you can fit the policy directly to preference pairs with a logistic loss. That is DPO.
- DPO's gradient is "raise the chosen, lower the rejected", weighted by $\sigma(\hat r_l-\hat r_w)$: pairs the implicit reward already orders correctly stop mattering. $\beta$ is both the KL strength and the inverse temperature of that implicit reward.
- What DPO constrains is a difference of log-ratios on the data. Everything else is free: the chosen log-prob usually goes down (likelihood displacement), mass can flow to responses that appear in no pair, deterministic labels push the margin to infinity (IPO's critique), and length is a cheap way to win.
- The variants are patches to specific holes: IPO/cDPO bound the margin, DPO-Positive and NLL terms anchor the chosen, SimPO/R-DPO handle length, KTO drops the pairing, ORPO and SimPO drop the reference, and online/iterative DPO, OAIF, SPPO and friends put the sampling loop back.
- The biggest gap between DPO and RLHF is not the loss but the data distribution: offline pairs from other models versus fresh samples from the current policy. Open recipes in 2024 used DPO as a cheap stage; by 2025–2026 most pipelines that can afford it run online RL (often with verifiable rewards) and keep DPO-style losses for specific jobs.
§1Why "direct"? What DPO removes from RLHF
Classic RLHF trains a reward model, then runs an RL loop that keeps generating text from the policy, scoring it, and updating. DPO asks: if the optimal policy of that RL problem has a closed form, can we skip the reward model and the loop?
Recall the pipeline from Chapter 04. Stage one fits a reward model $r_\phi$ on human comparisons with a Bradley–Terry loss (Chapter 03). Stage two maximizes $\E[r_\phi]-\beta\,\KL(\pi\|\piref)$ with PPO, which in practice means four networks in memory (policy, reference, reward model, critic), autoregressive generation inside the training loop, and a long list of stabilizing tricks. Rafailov et al. (2023) observed that the second stage has a known solution in function space, and that you can fold the first stage into it. The result is a supervised-looking loss on a fixed file of pairs: no reward model, no critic, no sampling.
RLHF is a chef who cooks a dish, hands it to a trained food critic for a score, adjusts, and cooks again, hundreds of times. DPO is the same chef sitting down with a binder of past verdicts ("dish A beat dish B") and adjusting the recipe directly from the binder, never cooking. It is far cheaper. Where it breaks: the binder's dishes were mostly cooked by other chefs. Nothing in it tells you how your new dishes would be judged, and that gap is the subject of half this chapter.
Notice what is not on the DPO side. The reward model is gone, but not because the reward was unnecessary: it has been absorbed into the policy as an implicit reward. Generation is gone too, and that loss is real: the model never sees (and is never corrected on) its own outputs during training. Keep both facts in mind; the rest of the chapter is largely about their consequences.
§2The derivation, one step at a time
Four moves: solve the KL-regularized problem, invert the solution for the reward, plug the reward into Bradley–Terry, and watch the partition function disappear.
Move 1: the closed form. For a fixed prompt $x$, write the objective as a single expectation under $\pi$ and complete it into a KL divergence. Define $Z(x)=\sum_y\piref(y|x)\,e^{r(x,y)/\beta}$ and $\pi^*(y|x)=\piref(y|x)\,e^{r(x,y)/\beta}/Z(x)$. Then
The last term does not depend on $\pi$, and KL is non-negative and zero only at equality, so the unique maximizer is $\pi=\pi^*$. (This is Gibbs' inequality; Chapter 04 builds intuition for the "tilt".) The catch is $Z(x)$: a sum over every possible string. You cannot normalize, so you cannot sample from $\pi^*$, which is why RLHF uses RL to approximate it.
Move 2: invert. Take logs of the closed form and solve for the reward:
Read this as a change of variables: any reward function corresponds to exactly one optimal policy (given $\piref,\beta$), and that policy, together with the unknown per-prompt constant $\beta\log Z(x)$, determines the reward back.
Move 3: plug into Bradley–Terry. The preference model only ever sees reward differences between two responses to the same prompt: $p(y_w\succ y_l|x)=\sigma\big(r(x,y_w)-r(x,y_l)\big)$. Substitute Move 2 for both rewards, and the two copies of $\beta\log Z(x)$ (same $x$!) subtract to zero.
Move 4: fit the policy instead of the reward. Parametrize $\pi^*$ by our model $\pit$ and maximize the likelihood of the observed preferences. The scrollytelling figure walks through it.
The objective. Maximize expected reward while staying close (in KL) to the reference policy $\piref$, usually the SFT model. $\beta$ sets the exchange rate between reward and KL.
Its optimum is a tilt. The best policy reweights the reference by $e^{r/\beta}$ and renormalizes. The normalizer $Z(x)$ is a sum over all strings: intractable. RLHF gets around it by sampling with RL.
Invert it. Take logs and solve for $r$. The reward is $\beta$ times the log-ratio of optimal to reference policy, plus a per-prompt constant $\beta\log Z(x)$. In the picture, that constant is the gold block sitting on top of every response's reward for this prompt.
Bradley–Terry only looks at differences. The probability that $y_w$ beats $y_l$ is a sigmoid of the reward gap. The bracket in the picture is the only thing the human label constrains.
The constant cancels. Both rewards carry the same $\beta\log Z(x)$ because both responses answer the same prompt. Watch the gold block grow and shrink: the gap $\Delta$ never changes. The intractable term is gone, exactly, not approximately.
Fit the policy. Replace $\pi^*$ by the trainable $\pit$ and minimize the negative log-likelihood of the preferences. What remains needs four log-probabilities per pair: policy and reference, on the chosen and the rejected response. No sampling, no reward model.
The implicit reward. Read the loss backwards: $\hat r_\theta=\beta\log\frac{\pit}{\piref}$ is a reward model hiding inside your policy, defined only up to a per-prompt shift $f(x)$. Comparisons within a prompt are meaningful; comparing $\hat r_\theta$ across prompts is not.
- Fixed dataset of prompts with a preferred $y_w$ and a dispreferred $y_l$. Nobody samples from $\pit$.
- Policy log-probs: sums of token log-probs over the completion only.
- Reference log-probs: frozen; computable once and cached.
- β: KL strength in the original problem, and the scale of the implicit reward.
- Logistic link: Bradley–Terry. Swap it out and you get much of the family in §7.
Two people stand on a stage of unknown height. You want to know who is taller. You do not need the stage height: it adds equally to both. $\beta\log Z(x)$ is the stage. Where it breaks: each prompt has its own stage. Comparing implicit rewards of answers to different prompts is like comparing people on different stages, which is why $\hat r_\theta$ is a fine ranker within a prompt and a poor absolute scorer across prompts.
The DPO paper also proves that this reparametrization loses nothing: every equivalence class of reward functions (rewards that differ only by a function of $x$, which Bradley–Terry cannot distinguish anyway) contains exactly one reward of the form $\beta\log\frac{\pi(y|x)}{\piref(y|x)}$ for some policy $\pi$. So "fit a reward, then find its optimal policy" and "fit the policy directly" optimize over the same set, in the population limit. The same trick extends to Plackett–Luce rankings over $K$ responses. Keep the qualifier in italics in mind: with finite, off-policy data the two procedures diverge, and §6 is about how.
The gradient, and why it focuses on mistakes
Write $\hat r_w=\beta\log\frac{\pit(y_w|x)}{\piref(y_w|x)}$ and $\hat r_l$ likewise, and let $u=\hat r_w-\hat r_l$. Since $\frac{d}{du}\big[-\log\sigma(u)\big]=-\sigma(-u)$ and $\nabla_\theta u=\beta\big(\nabla_\theta\log\pit(y_w|x)-\nabla_\theta\log\pit(y_l|x)\big)$ (the reference terms are constants):
- Weight: near 1 when the implicit reward orders the pair wrongly, near 0 when it orders it confidently right.
- Push up the chosen response's log-likelihood (descent on $\mathcal L$ moves along $-\nabla\mathcal L$).
- Push down the rejected response's log-likelihood.
Without the weight, this is "unlikelihood on the rejected plus likelihood on the chosen", and the DPO paper reports that this naive version makes the model degenerate. The weight is what the KL term buys you: once a pair is ordered with a margin of a few units of $1/\beta$, it stops contributing. In terms of the raw log-ratio margin $h=\log\frac{\pit(y_w)}{\piref(y_w)}-\log\frac{\pit(y_l)}{\piref(y_l)}$, the weight is $\sigma(-\beta h)$, so it falls to $0.1$ at $h=\ln 9/\beta$. With the common $\beta=0.1$, that is about 22 nats. Twenty-two nats of log-ratio is an enormous move for a sequence probability; this is one reason sequence log-probs can move by tens of nats during DPO training.
A good tutor spends the hour on the problems you get wrong, not on the ones you already ace. DPO's weight is that tutor, and $\beta$ decides what counts as "already acing it". Where it breaks: the tutor's judgement is the implicit reward, not the truth. If a label is wrong (and annotators disagree with each other a lot on chat preferences), the tutor will obsess over that pair forever, because the model "keeps getting it wrong". That is exactly what cDPO and robust DPO (§4) fix.
What β means, three ways
- KL price. In the original objective, $\beta$ is the price of one nat of KL from the reference. Small $\beta$ means "trust the preferences, move far".
- Implicit-reward temperature. $\hat r=\beta\log\frac{\pit}{\piref}$. For a fixed preference strength, smaller $\beta$ requires a larger log-ratio to express it, so the policy must move further from the reference to fit the same data.
- Loss saturation point. The logistic loss is satisfied at margins of order $1/\beta$ nats. As a rough guide, below $\beta\approx 0.01$ the loss barely saturates on realistic margins; above $\beta\approx 0.5$ it saturates almost immediately and the model barely moves. Most published runs of standard DPO (summed log-probs) use $\beta\in[0.01,0.5]$, with $0.1$ the de facto default (the DPO paper's own default; it used $0.5$ for TL;DR summarization).
A subtlety that is easy to miss: in DPO, $\beta$ does not enforce a KL budget the way it does in PPO. In PPO the KL penalty is evaluated on the policy's own samples at every step. In DPO, $\beta$ only shapes a loss on fixed data; nothing measures the KL on the responses the model will actually produce. §4 and §6 show how that difference bites.
The implicit reward is a reward model you can query
After training, $\hat r_\theta(x,y)=\beta\log\frac{\pit(y|x)}{\piref(y|x)}$ scores any response. RewardBench-style evaluations do exactly that with DPO checkpoints. Two identities make it concrete. Averaged over the policy's own samples, $\E_{\pit}[\hat r_\theta]=\beta\,\KL(\pit\|\piref)\ge0$; averaged over the reference's samples, $\E_{\piref}[\hat r_\theta]=-\beta\,\KL(\piref\|\pit)\le0$. So "implicit rewards going negative" on reference-like data is not a bug, it is arithmetic. And the argmax of $\hat r$ need not be the policy's most likely response: a rare response the policy boosted a lot relative to the reference gets a huge implicit reward while still being improbable.
TRL and most trainers log rewards/chosen and rewards/rejected, which are $\hat r_w$ and $\hat r_l$. It is normal for both to go negative while the margin grows. It is not automatically fine: a chosen reward that keeps falling means the chosen log-prob is falling, and probability mass is going somewhere you are not measuring. Always log logps/chosen and sample generations.
§3Likelihood displacement: where does the probability go?
DPO only asks the chosen response to beat the rejected one by a margin. It is perfectly happy if both get less likely, and in practice they usually do.
The phenomenon was noticed early by practitioners (log-probs of chosen responses falling during DPO) and has since been analysed carefully. Pal et al. (2024, "Smaug") show theoretically that standard DPO can reduce the likelihood of the preferred response, especially when the two responses have a small edit distance. Feng et al. (2024) analyse the gradient field and find DPO decreases the probability of dispreferred data faster than it increases that of preferred data. Rafailov et al. (2024, "From $r$ to $Q^*$") argue that when DPO starts from an SFT model, the implicit rewards of both chosen and rejected should fall: the expected implicit reward under the reference's own samples is $-\beta\KL(\piref\|\pit)$, which is zero at the start and strictly negative once the policy has moved, and preference data the SFT model was trained to fit looks like reference samples. Razin et al. (2024) name the effect likelihood displacement and show it can be harmful: training a model to prefer "No" over "Never" can sharply raise the probability of "Yes", and in their experiments DPO on refusal data drove Llama-3-8B-Instruct's refusal rate from 74.4% to 33.4%.
The first-order story
Let $g_w=\nabla_\theta\log\pit(y_w|x)$ and $g_l=\nabla_\theta\log\pit(y_l|x)$. One gradient step on one pair moves $\theta$ by $\eta\,c\,(g_w-g_l)$ with $c=\beta\,\sigma(\hat r_l-\hat r_w)>0$. To first order, the change in the chosen log-prob is
This is negative whenever $\langle g_w,g_l\rangle>\|g_w\|^2$: when the two responses look alike to the model (their gradients are aligned) and the rejected one has the larger gradient norm. And any third response $y'$ changes by $\eta c\,\langle g_{y'},\,g_w-g_l\rangle$: the mass goes to whatever response is best aligned with the difference direction, which can be a response that appears in no pair at all. Razin et al. make this precise with a centered hidden-embedding similarity (CHES) score between chosen and rejected, and show that filtering out high-CHES pairs mitigates the unintended unalignment.
In a purely tabular softmax (one free logit per response), the gradient of $\log\pi(y_w)-\log\pi(y_l)$ with respect to the logits is $e_w-e_l$: the normalizer terms cancel, the chosen logit goes up, the rejected goes down, and no other logit moves. The chosen probability can only rise. Displacement is a representation phenomenon: it appears because real responses share parameters, so pushing two similar responses apart drags along everything nearby. That is why the trainer below uses a log-linear policy with shared features.
Probability is a waterbed: press down on one spot and the water rises somewhere else. DPO presses down on the rejected response and only asks that the chosen be higher than the rejected. If the chosen sits right next to the rejected on the bed, pressing one presses both, and the water rises in a corner nobody was looking at. Where it breaks: on a real waterbed the water goes everywhere; in a network it goes along the specific direction $g_w-g_l$ in representation space, which is why the displaced mass can land on a semantically specific response ("Yes" instead of "No") rather than spreading out.
Fixes, and what each one actually does
- DPO-Positive (DPOP) (Pal et al., 2024) adds a hinge inside the sigmoid that penalizes the chosen log-ratio for going below zero: $-\log\sigma\big(\beta(h-\lambda\max(0,\log\frac{\piref(y_w|x)}{\pit(y_w|x)}))\big)$. The paper used $\beta=0.3$ and $\lambda=50$ (chosen without a sweep).
- DPO + NLL adds a supervised term on the chosen response: $\mathcal L_{\text{DPO}}+\alpha\,\mathcal L_{\text{NLL}}(y_w)$. Pang et al. (2024, Iterative Reasoning Preference Optimization) report the NLL term as crucial for reasoning (Llama-2-70B-Chat on GSM8K from 55.6% to 81.6%); Llama 3's post-training recipe also adds a scaled NLL term (§8). The cost: the chosen responses become imitation targets, which is bad when they are not much better than what the policy already produces.
- Data filtering. Razin et al. drop pairs whose chosen and rejected are too similar in representation space (high CHES).
- Anchored objectives. APO (D'Oosterlinck et al., 2024) makes the direction explicit: APO-zero raises winners and lowers losers in absolute terms; APO-down lowers both, the loser more, for when the model is already better than the "winning" data.
- IPO does not fix displacement, but bounds it: once the margin reaches its target the gradient stops (try it in the widget).
Displacement is still active research. DPO-Shift (Yang et al., 2025) trades margin for chosen probability with a shift parameter; Jian et al. (2025) report that the displaced mass lands on out-of-distribution responses and that in one of their reasoning setups SimPO's accuracy dropped from 73.5% to 37.5%. A useful framing from Ren & Sutherland (2024): a negative gradient on a response the model already finds unlikely "squeezes" probability toward the model's current argmax, so running DPO for too long can make even the desired outputs less likely.
§4Overfitting: deterministic preferences, IPO and noisy labels
The logistic loss is never satisfied. On a pair that is always labelled the same way, DPO's optimum sends the margin to infinity, and the KL "regularizer" has nothing to say about it.
Azar et al. (2023) put this sharply. Suppose for some pair the true preference is deterministic: $p^*(y\succ y')=1$. Bradley–Terry can only represent probability one with an infinite reward gap, so the DPO solution has $\pi(y')=0$ whatever $\beta$ is. In their words, the KL regularization "becomes weaker and weaker the more deterministic the preferences". This is not only about truly deterministic preferences: with finite data, if a pair is observed once, the empirical preference is 0 or 1, and DPO fits it as if deterministic. In RLHF the same data trains a reward model that is itself regularized (early stopping, finite capacity, ensembling), and then the KL penalty on the policy's own samples bounds how far the policy goes; in DPO the empirical preference is consumed directly.
Tell a student once that "A is better than B" and DPO's student concludes that B is infinitely worse and must never be said again. IPO's student writes down "A is better than B by about this much" and stops there. Where it breaks: "about this much" is the same fixed margin for every pair, whether the preference was unanimous or a coin flip. IPO bounds the overconfidence; it does not know which pairs deserve confidence.
ΨPO and IPO
Azar et al. define a general objective, $\Psi$PO: maximize $\E_{x,\,y\sim\pi,\,y'\sim\mu}\big[\Psi\big(p^*(y\succ y'|x)\big)\big]-\tau\,\KL(\pi\|\piref)$ for a non-decreasing $\Psi$. With $\Psi(p)=\log\frac{p}{1-p}$ and Bradley–Terry preferences, this recovers the RLHF/DPO objective; the unboundedness of the logit near $p=1$ is the source of the problem. With $\Psi$ the identity, preferences enter bounded, and the sampled loss becomes a regression of the log-ratio margin onto a constant:
Two things to notice. The loss has a finite minimizer, $h^*=1/(2\tau)$, so pairs that already have that margin are pushed back. And, unlike DPO, its gradient is not self-normalizing: it is linear in the distance to the target. Libraries such as TRL expose IPO with $\beta$ in the role of $\tau$; the target margin is then $1/(2\beta)$, i.e. 5 nats at $\beta=0.1$.
Label noise: cDPO and robust DPO
If each label is flipped with probability $\varepsilon$, the right target for $p(y_w\succ y_l)$ is $1-\varepsilon$, not 1. Mitchell's note (2023) turns this into conservative DPO:
which is exactly binary cross-entropy with label smoothing. Its gradient vanishes when $\sigma(\beta h)=1-\varepsilon$, i.e. at $h^*=\frac1\beta\ln\frac{1-\varepsilon}{\varepsilon}$; as the note puts it, "For normal DPO, the gradient is never zero!" Robust DPO (Chowdhury et al., 2024) instead builds an unbiased estimator of the clean loss, $\big[(1-\varepsilon)\mathcal L(y_w,y_l)-\varepsilon\,\mathcal L(y_l,y_w)\big]/(1-2\varepsilon)$, and proves a sub-optimality bound that degrades as $1/(1-2\varepsilon)$. Note the minus sign: cDPO and rDPO are different losses, though both take $\varepsilon$ as a hyperparameter (TRL exposes $\varepsilon$ as label_smoothing for its robust loss).
Because the DPO loss never saturates, more epochs keep pushing margins up and moving the policy away from the reference. Zephyr's authors observed that overfitting after one DPO epoch (perfect training accuracy) did not hurt MT-Bench or AlpacaEval in their setting, and trained 3 epochs; Rafailov et al. (2024) find that direct alignment algorithms over-optimize much like RLHF does at higher KL budgets, often "before even a single epoch of the dataset is completed". Both can be true; the safe reading is that the training loss tells you nothing about when to stop. Track KL to the reference on held-out generations and an external judge.
§5Length: the easiest way to win a preference
Human and AI judges tend to prefer longer answers. DPO faithfully learns whatever predicts the label, and length predicts it.
Park et al. (2024, "Disentangling Length from Quality in Direct Preference Optimization") document that DPO models grow verbose and tie the effect to out-of-distribution bootstrapping: the implicit reward extrapolates "longer is better" to lengths the data never contained. Their fix, R-DPO, adds a length term to the Bradley–Terry logit,
derived from modelling the observed reward as $r=\beta\log\frac{\pi}{\piref}+\beta\log Z+\alpha|y|$: an explicit length term "explains away" the length-driven part of the preference, so the policy's log-ratio does not have to. They report up to 20% improvement in win rates when controlling for length.
The other popular answer is length normalization. Sequence log-probs are sums over tokens, so a long response has a large-magnitude $\log\pi$, and the DPO margin of a pair with very different lengths can be dominated by the length difference. SimPO (Meng et al., 2024) uses the average per-token log-prob as its implicit reward, $\frac{\beta}{|y|}\log\pit(y|x)$, with no reference model; Tülu 3 uses a length-normalized variant of DPO (§8). Normalization changes the geometry, not just the scale: it removes the incentive for the chosen response's sum of log-probs to be driven by its token count.
LLM judges share the bias. Dubois et al. (2024) built length-controlled AlpacaEval for exactly this reason: regressing out the length difference raised its Spearman correlation with Chatbot Arena from 0.94 to 0.98. A method that "wins" only on uncontrolled win rates has often learned length. Report mean response length next to any win rate.
§6Off-policy data and the DPO–RLHF gap
In the population limit DPO and RLHF have the same optimum. With finite data that was sampled from some other model, they do not, and the difference is mostly about which responses get any training signal at all.
The theory gap: what the loss leaves unconstrained
DPO's loss touches $\pit$ only on the responses in the dataset. Xu et al. (2024, "Is DPO Superior to PPO for LLM Alignment?") show that the set of policies minimizing the DPO loss is a strict superset of the set of PPO solutions: "$\Pi_{\text{PPO}}$ is a proper subset of $\Pi_{\text{DPO}}$". Any policy that matches the right log-ratio differences on the data, and does anything at all on responses outside the data, is a DPO optimum; DPO "might find biased solutions that exploit out-of-distribution responses". PPO, by contrast, samples from the policy, so a response that gains probability gets scored by the reward model and pays KL on the policy's own samples. Their empirical results are stark on code: on CodeContests with Code Llama 34B (10@1k on the test set), SFT reached 15.2%, DPO 0.0%, iterative DPO 3.2%, and PPO 22.4%.
Song et al. (2024) give the cleanest statement in terms of coverage: a global coverage condition (the data must cover everything any candidate policy might do) is necessary and sufficient for offline contrastive methods like DPO to converge, while a weaker partial coverage condition suffices for online RL methods. Their HyPO uses offline data for the preference loss and online samples for the KL term. Swamy et al. (2025, "All Roads Lead to Likelihood") ask why two-stage RLHF beats offline fine-tuning at all, given that a reward model cannot add information; their best-supported explanation is the generation–verification gap: a reward (verifier) is simpler to learn than a good policy, and RL then only has to search among policies optimal for that simple verifier.
Offline DPO learns to drive from a library of dashcam clips of other drivers, each labelled "this clip was better than that one". Online methods put you behind the wheel with an instructor who grades your driving. The footage is cheap and plentiful, but it never shows your own characteristic mistakes, so nothing ever corrects them. Where it breaks: if the footage comes from drivers very much like you (on-policy pairs from your own SFT model), the library is nearly as good as the lessons, at least for the first iteration.
Empirical evidence: sampling and negative gradients
- Tajwar et al. (2024) compare objectives across bandits, synthetic LLM tasks and real ones and find that on-policy sampling and a "negative gradient" (actively pushing down bad responses) both help; they unify them as mode-seeking objectives, which "relocate masses across bins more effectively" than maximum-likelihood style objectives.
- Tang et al. (2024) study the online/offline gap directly and find it is not explained by coverage or data quality alone: offline-trained policies become better pairwise classifiers but worse generators, and scaling the policy does not close the gap.
- Guo et al. (2024, OAIF): making DPO/IPO/SLiC online by labelling fresh policy samples with an LLM judge wins about 66% of human comparisons against the offline versions.
- Chen et al. (2024): most preference-tuned models reach ranking accuracy below 60% on held-out preference data, and DPO is "ill-suited to fix even mild ranking errors in the reference model". The implicit reward model you trained is weak even when the generations improve.
- Lanchantin et al. (2025), Meta: on Llama-3.1-8B-Instruct, semi-online DPO (re-syncing the generator every few steps), fully online DPO and GRPO perform similarly and all strongly beat offline DPO; online DPO gives a 56.6% increase in AlpacaEval LC win rate and 45.6% in Arena-Hard score over offline DPO.
The cleanest way to state the 2024–2025 consensus: most of the gap between DPO and RLHF is the data distribution, not the loss. Online DPO (sample from the current policy, label with a reward model or judge, take a DPO step) behaves much more like PPO/GRPO than like offline DPO. Conversely, Sun et al. (2025) show on-policy data is not uniformly better either (in their study it was about 3× as effective as static data for Llama-3 but only 0.4× as effective, i.e. worse, for Zephyr), and SimpleMix (Li et al., 2025) finds on-policy data helps more on math and code and off-policy more on open-ended tasks. "Which samples does the gradient see?" is the first question to ask about any preference method.
§7The family: one idea per variant
Almost every DPO variant changes one of four things: the link function, the reference, the pairing, or where the samples come from.
Tang et al. (2024, "Generalized Preference Optimization") make the first axis precise: write the offline loss as $\E\big[f\big(\beta\,h_\theta\big)\big]$ for a convex function $f$. Logistic $f(u)=-\log\sigma(u)$ gives DPO, squared $f(u)=(u-1)^2$ gives IPO (with $\beta=2\tau$; up to a constant factor), hinge $f(u)=\max(0,1-u)$ gives SLiC. Different $f$ imply different effective regularization; the "KL" in each is only enforced through the shape of $f$ on the data.
Changing the link: IPO, cDPO, robust DPO, χPO
Covered in §4. One more worth knowing: χPO (Huang et al., 2024) is a "one-line change" to DPO that replaces the log link with $\phi(z)=z+\log z$ applied to $\pi/\piref$ (clipped), which amounts to adding $\chi^2$-divergence regularization to the KL. The $\chi^2$ penalizes moving mass onto responses the reference rarely produces much more harshly than KL does, which the authors show gives guarantees against over-optimization under single-policy coverage.
Dropping the pairing: KTO
Ethayarajh et al. (2024) start from prospect theory: humans value outcomes relative to a reference point, concavely for gains and convexly for losses. KTO needs only a binary signal per response ("desirable" or "undesirable"), not pairs. With $r_\theta=\log\frac{\pit(y|x)}{\piref(y|x)}$ and a reference point $z_0=\KL(\pit\|\piref)$,
$z_0$ plays the role that the paired response plays in DPO (a baseline that makes the log-ratio meaningful). It is not backpropagated through and in practice is estimated from mismatched pairs in the batch, $\hat z_0=\max\big(0,\frac1m\sum\log\frac{\pit(y_j|x_i)}{\piref(y_j|x_i)}\big)$, which the authors call "a biased but convenient estimate". Because the value function is a sigmoid rather than a log-sigmoid, KTO's gradient vanishes for examples that are very wrong as well as very right: it is robust to outliers (and noisy labels) by construction, at the price of ignoring hard examples. The paper reports KTO matching or exceeding DPO from 1B to 30B parameters and matching DPO with up to 90% fewer desirable examples (reweighting with $\lambda_D,\lambda_U$; they recommend $\frac{\lambda_D n_D}{\lambda_U n_U}\in[1,\tfrac32]$). The practical appeal: thumbs-up/thumbs-down logs are far more abundant than curated pairs.
DPO grades every answer against one specific rival answer. KTO grades each answer against the class average ($z_0$): did this response move the policy further from the reference than typical? Where it breaks: the "class average" is a noisy, biased batch estimate of a KL, and if the batch is unrepresentative the reference point drifts.
Dropping the reference: ORPO and SimPO
ORPO (Hong et al., 2024) merges SFT and preference optimization into one stage with no reference model: $\mathcal L_{\text{ORPO}}=\mathcal L_{\text{SFT}}(y_w)+\lambda\,\mathcal L_{\text{OR}}$ with $\mathcal L_{\text{OR}}=-\log\sigma\Big(\log\frac{\text{odds}_\theta(y_w|x)}{\text{odds}_\theta(y_l|x)}\Big)$ and $\text{odds}=\frac{P}{1-P}$ (computed on length-normalized likelihoods). The SFT term anchors the chosen; the odds-ratio term pushes the rejected down. No reference means one model in memory and one training run instead of two.
SimPO (Meng et al., 2024) also drops the reference, normalizes by length and adds a target margin:
The argument is that the implicit reward should match the quantity that guides generation (average per-token log-likelihood), not a log-ratio to a reference that plays no role at inference. The authors recommend $\beta\in[2.0,2.5]$ and $\gamma\in[0.5,1.5]$ (with larger $\beta$, e.g. 10, better in some Llama-3-Instruct settings) and report gains over DPO of up to 6.4 points on AlpacaEval 2 and 7.5 on Arena-Hard. The caveat: with no reference, nothing in the loss ties the model to its starting point except the learning rate and the number of steps, so SimPO is more sensitive to both, and it inherits likelihood displacement (§3).
Changing the samples: RSO, iterative/online DPO, OAIF, self-rewarding
RSO (Liu et al., 2023) argues that estimating the optimal policy is best done with preference pairs sampled from (an estimate of) that optimal policy, not from the SFT model or from unrelated models. It trains a reward model, then uses statistical rejection sampling to draw responses approximately from $\pi^*\propto\piref e^{r/\beta}$ and builds pairs from those. Iterative / online DPO (Xiong et al., 2023; Dong et al., 2024, "RLHF Workflow") alternates: sample several responses per prompt from the current policy, rank them with a reward model, take best vs worst as a pair, run DPO, repeat. Xiong et al. give the theory for the KL-regularized contextual bandit in offline, online and hybrid settings. OAIF (Guo et al., 2024) uses an LLM judge as the online annotator, and shows you can steer behaviour (e.g. ask the judge for shorter answers, cutting average response length from about 120 to about 40) just by changing the judge's prompt. Self-Rewarding LMs (Yuan et al., 2024) make the policy its own judge (LLM-as-a-judge) inside iterative DPO, improving both the responses and the judging across iterations.
Leaving Bradley–Terry: Nash learning, SPPO, DNO
Bradley–Terry assumes preferences are transitive and come from a scalar reward. Human preferences are often intransitive. Nash learning from human feedback (Munos et al., 2023) learns a pairwise preference model $\mathcal P(y\succ y'|x)$ and seeks the policy that no other policy is preferred to: the Nash equilibrium of the symmetric game, solved with a mirror-descent algorithm (Nash-MD) with last-iterate convergence to the regularized equilibrium. SPPO (Wu et al., 2024) approximates the equilibrium by self-play: each iteration samples responses from the current policy, estimates each response's win rate against the policy with a preference model, and regresses the log-ratio toward that win rate. With a 0.4B PairRM judge and 60k UltraFeedback prompts, it reports a 28.53% length-controlled win rate against GPT-4-Turbo on AlpacaEval 2.0 for Mistral-7B-Instruct and 38.77% for Llama-3-8B-Instruct. DNO (Rosset et al., 2024) is a batched on-policy algorithm with a regression-style objective in the same spirit. A related line, general preference models (Zhang et al., 2024), embeds responses so that the preference model can represent cyclic preferences. Note the naming collision: Zhang et al.'s "General Preference Optimization" and Tang et al.'s "Generalized Preference Optimization" are different papers.
Reasoning: Step-DPO
A long chain of thought fails at one step. Pairing a whole correct solution with a whole incorrect one gives a weak signal (they share most tokens and differ for many reasons). Step-DPO (Lai et al., 2024) pairs a correct and an incorrect next step given a shared correct prefix, and applies DPO at that granularity. With 10K step-wise pairs and fewer than 500 training steps, it reports a nearly 3% gain on MATH for models over 70B, and Qwen2-72B-Instruct with Step-DPO reaches 70.8% on MATH and 94.0% on GSM8K. Self-generated (on-policy) steps worked better than human- or GPT-4-written ones, the same lesson as §6 in miniature. A free fact behind it: tokens in a shared prefix have identical log-ratios in the chosen and rejected sequences, so they cancel exactly in $h$; DPO's gradient always concentrates at and after the point where the two responses diverge.
DPO appeared in May 2023. By early 2024 it had become the default open-source alignment stage (Zephyr, Tülu 2, and many leaderboard models), largely because it ran on the same infrastructure as SFT. 2024 was the year of variants and of failure-mode analyses; 2025 was the year online methods (iterative DPO, GRPO and RLVR, covered in Chapter 06) took the lead in the recipes that could afford them.
The comparison table
| Method | Loss on (implicit) margin | Reference? | Pairs? | On/offline | Key hyperparameters | The one idea |
|---|---|---|---|---|---|---|
| DPO | $-\log\sigma(\beta h)$ | yes | yes | offline | $\beta$ (0.01–0.5), lr | Invert the KL optimum; $Z$ cancels in BT |
| IPO | $(h-\tfrac{1}{2\tau})^2$ | yes | yes | offline | $\tau$ (target margin $1/2\tau$) | Bounded $\Psi$: stop at a finite margin |
| cDPO | label-smoothed logistic | yes | yes | offline | $\beta$, $\varepsilon$ | Target $1-\varepsilon$, not 1 |
| rDPO | $\frac{(1-\varepsilon)\mathcal L(w,l)-\varepsilon\mathcal L(l,w)}{1-2\varepsilon}$ | yes | yes | offline | $\beta$, $\varepsilon$ | Unbiased loss under label flips |
| SLiC-HF / hinge | $\max(0,\delta-\log\pit(y_w)+\log\pit(y_l))-\lambda\log\pit(y_{\text{ref}})$ | no (SLiC-HF); yes in the log-ratio form $\max(0,1-\beta h)$ | yes | offline | margin $\delta$, $\lambda$ | Calibrate likelihoods with a hinge, anchor with SFT |
| KTO | $\lambda_y-\lambda_y\sigma(\pm\beta(r_\theta-z_0))$ | yes | no (binary labels) | offline | $\beta$, $\lambda_D,\lambda_U$ | Prospect theory; reference point $z_0$ |
| ORPO | $\mathcal L_{\text{SFT}}-\lambda\log\sigma(\log\text{odds ratio})$ | no | yes | offline | $\lambda$ | SFT + preference in one stage |
| SimPO | $-\log\sigma(\tfrac{\beta}{|y_w|}\log\pi_w-\tfrac{\beta}{|y_l|}\log\pi_l-\gamma)$ | no | yes | offline | $\beta$ (2–2.5), $\gamma$ (0.5–1.5), lr | Reward = avg log-prob; margin |
| R-DPO | DPO logit $+\alpha(|y_w|-|y_l|)$ | yes | yes | offline | $\beta$, $\alpha$ | Explain length away |
| DPO-Positive | DPO logit $-\beta\lambda\max(0,-\log\frac{\pit(y_w)}{\piref(y_w)})$ | yes | yes | offline | $\beta$, $\lambda$ (50) | Never let the chosen fall below ref |
| DPO+NLL / RPO | $\mathcal L_{\text{DPO}}+\alpha\,\text{NLL}(y_w)$ | yes | yes | either | $\beta$, $\alpha$ | Anchor the chosen with SFT |
| RSO | DPO or SLiC | yes | yes | sampled from $\approx\pi^*$ | RM, $\beta$, sample count | Sample pairs from the optimal policy |
| Online / iterative DPO | DPO | yes (often refreshed) | built on the fly | online | RM/judge, samples per prompt, sync interval | Put the sampling loop back |
| OAIF | DPO / IPO / SLiC | yes | built on the fly | online | judge prompt | LLM judge as online annotator |
| Self-rewarding | DPO | yes | built on the fly | iterative | judge rubric, iterations | The policy is its own judge |
| SPPO / NLHF / DNO | regress log-ratio to win rate (SPPO) | yes (previous iterate) | preference model | online | preference model, $\eta$ | Nash equilibrium, no BT |
| Step-DPO | DPO on steps | yes | step pairs | offline (self-generated) | $\beta$, step segmentation | Credit the first wrong step |
| APO | anchored sigmoid terms | yes | yes | offline | variant (zero/down) | Say which way each likelihood should move |
| χPO | DPO with link $z+\log z$ | yes | yes | offline | $\beta$, clip | $\chi^2$ pessimism vs over-optimization |
§8What open recipes actually do (2024–2026)
In 2024, DPO was the preference stage of almost every open recipe. By 2025–2026, the recipes that could afford it put online RL at the centre and kept DPO for narrower jobs.
The table summarizes what the technical reports say. Read the β column with care: β = 5 in Tülu 3 and Olmo 3 multiplies a per-token average log-ratio (length-normalized DPO), so it is not comparable with the β = 0.1 of standard DPO on summed log-probs.
| Model (report) | Preference stage | Details the report gives |
|---|---|---|
| Llama 3 (2024) | Six rounds of SFT → DPO | lr 1e-5, β = 0.1; formatting tokens (headers, termination) masked out of the loss "to stabilize DPO training"; NLL term with coefficient 0.2 on the chosen; preference data mostly from the best models of the previous round, so it "conforms better to the distribution of the policy model". PPO was explored, but "DPO required less compute for large-scale models and performed better, especially on instruction following benchmarks like IFEval". |
| Nemotron-4 340B (2024) | DPO, then three rounds of RPO | Observed both chosen and rejected likelihoods "drop consistently" under DPO and added a weighted SFT loss on the chosen; Reward-aware Preference Optimization regresses toward the reward gap of a reward model to avoid overfitting. |
| Qwen2 (2024) | Offline DPO, then online DPO | Online stage: sample several responses from the current policy, a reward model picks the most and least preferred, DPO on those pairs, every episode. |
| Qwen2.5 (2024) | Offline DPO, then online GRPO | About 150,000 offline pairs (built from execution and answer checks), lr 7e-7, one epoch; then GRPO against a reward model. |
| Tülu 3 (2024) | Length-normalized DPO, then RLVR (PPO) | β = 5, lr 5e-7 (8B) / 2e-7 (70B), batch 128, one epoch; a mix of off-policy pairs and pairs with one on-policy response from the Tülu SFT model ("including on-policy data improves aggregated downstream DPO performance"). In their ablation only length-normalized DPO beat the SFT checkpoint overall. Why DPO for preferences: PPO took "roughly 28 hours using two nodes" against "about 4 hours using a single node" for DPO. |
| OLMo 2 (2025) | Tülu 3 recipe | DPO with on-policy preference data, then RLVR (PPO for 7B/13B, GRPO for 1B/32B). |
| Qwen3 (2025) | Online RL only | Reasoning RL with GRPO on verifier-checked queries, then general RL with rule-based rewards and reward models. DPO does not appear in the report. |
| DeepSeek-V3 / R1 (2024–25) | Online RL only | GRPO with rule-based and model-based rewards; R1-Zero is pure RL from the base model. |
| Llama 4 (2025) | Light SFT → online RL → light DPO | "SFT and DPO can over-constrain the model, restricting exploration during the online RL stage and leading to suboptimal accuracy, particularly in reasoning, coding, and math"; DPO kept at the end "to handle corner cases related to model response quality". |
| SmolLM3 (2025) | Off-policy APO | Anchored Preference Optimization on Tülu 3 preferences plus synthetic pairs: Qwen3-32B outputs as chosen, Qwen3-0.6B outputs as rejected. |
| Kimi K2 (2025) | Online RL only | Verifiable rewards plus a self-critique rubric reward, in which the model's critic ranks sampled responses pairwise. |
| Olmo 3 (2025) | Delta-learning DPO, then RLVR (GRPO-based) | Chosen from Qwen3-32B, rejected from Qwen3-0.6B (thinking mode): "the quality of preference data depends primarily on the quality of the delta between chosen and rejected responses". Length-normalized, β = 5, one epoch; "early stopping is important"; "Delta learning provides a stronger initialization for subsequent RLVR than SFT alone". |
Why the frontier went back to sampling
- Reasoning made on-policy data non-negotiable. When the target behaviour is "solve problems the model currently fails", the useful training signal lives in the model's own attempts, and verifiers can score them for free. That is RLVR (Chapter 06). Offline pairs from other models carry other models' mistakes.
- The offline ceiling is real. §6's evidence (coverage theory, Tang et al.'s classifier-vs-generator gap, Xu et al.'s code results, Lanchantin et al.'s semi-online results) all points the same way. Nathan Lambert's RLHF book summarizes the comparisons: in these reports "DPO algorithms are a hair behind", yet direct alignment algorithms "are still used extensively in leading models due to their simplicity".
- The cost argument shrank. DPO's main advantage was running on SFT infrastructure. Once labs had fast inference engines inside the training loop and asynchronous RL systems (Chapter 07), the marginal cost of sampling fell, and Tülu 3's 7× wall-clock gap stopped being decisive for well-resourced teams.
- Offline stages can hurt later RL. Llama 4's remark that SFT and DPO "over-constrain the model" before online RL is the clearest public statement. Olmo 3 reports the opposite for its delta-learning DPO (a better RLVR initialization than SFT alone), which suggests the issue is how much the stage narrows the distribution, not the loss per se.
A cheap, stable chat-quality and style stage (Tülu 3, OLMo 2); a warm start before RLVR built from reliable strong-vs-weak deltas (Olmo 3, SmolLM3); a final polish after RL (Llama 4); a cheap stand-in for RL in research on open models (Anthropic's open-source replication of its auditing-game model organism trained Llama 3.3 70B "using only Direct Preference Optimization (DPO) on high/low reward completion pairs"); and the inner loss of online loops (Qwen2's online DPO, semi-online DPO).
§9Implementation details that decide whether it works
DPO is twenty lines of loss and a hundred ways to compute the wrong log-probability.
Sequence log-probs with masking
$\log\pit(y|x)=\sum_{t}\log\pit(y_t|x,y_{\lt t})$, summed over completion tokens only. The prompt, padding, and (in multi-turn data) earlier turns are masked out. Llama 3's report adds a further mask: special formatting tokens (header and termination tokens) are masked out of both chosen and rejected responses, because tokens common to both sides create "a conflicting learning objective" and, in their experience, led to behaviours such as tail repetition or abruptly generating termination tokens (§8).
import torch, torch.nn.functional as F
def sequence_logps(model, input_ids, attention_mask, completion_mask):
"""Sum of log p(token) over completion tokens. completion_mask is 1 on response tokens."""
logits = model(input_ids=input_ids, attention_mask=attention_mask).logits
logits = logits[:, :-1].float() # position t predicts token t+1
targets = input_ids[:, 1:]
mask = completion_mask[:, 1:].float()
logp = torch.gather(F.log_softmax(logits, dim=-1), 2, targets.unsqueeze(-1)).squeeze(-1)
return (logp * mask).sum(-1), mask.sum(-1) # (sum log-prob, number of tokens)
def preference_loss(pw, pl, rw, rl, beta=0.1, kind="dpo", eps=0.0, len_w=None, len_l=None, gamma=0.0):
"""pw/pl: policy log-probs of chosen/rejected; rw/rl: reference log-probs (cached is fine)."""
if kind == "simpo": # reference-free, length-normalized
u = beta * (pw / len_w - pl / len_l) - gamma
return -F.logsigmoid(u).mean()
h = (pw - rw) - (pl - rl) # log-ratio margin
if kind == "ipo":
return ((h - 1.0 / (2 * beta)) ** 2).mean()
# DPO, or cDPO when eps > 0 (label smoothing)
return (-(1 - eps) * F.logsigmoid(beta * h) - eps * F.logsigmoid(-beta * h)).mean()
# logging: implicit rewards (detached)
# rewards_chosen = beta * (pw - rw).detach(); rewards_rejected = beta * (pl - rl).detach()
At step 0, the policy equals the reference, so every margin is exactly 0 and the DPO loss is exactly $\ln 2\approx0.693$ (IPO: $1/(4\beta^2)$). If your first logged loss is not $0.693$, the policy and reference log-probs are being computed differently: dropout left on in one of them, different precision, different truncation, a chat template mismatch, or cached reference log-probs from a different tokenization. Fix that before anything else.
Reference log-prob caching and memory
- Cache the reference. The reference is frozen and the data is fixed, so its log-probs can be computed in one pass before training (TRL:
precompute_ref_log_probs). This removes the second model from GPU memory during training and is exact, provided tokenization, truncation and template are identical in both passes. - LoRA gives you the reference for free. With adapters, the reference is the base model with adapters disabled; trainers compute it by toggling the adapter off rather than holding a copy.
- Concatenate chosen and rejected into one forward pass (pad to a common length), as TRL does: one call instead of two, which matters most under FSDP/ZeRO where every forward pass re-gathers the sharded weights.
- Compute log-softmax in fp32. A summed log-prob over 1,000+ tokens in bf16 accumulates errors of the same order as the margins you are trying to learn.
- Know your library's conventions. In TRL (v1.16), sequence log-probs are sums over completion tokens; chosen and rejected are concatenated into one batch; the
ipoloss divides log-probs by completion length (so its target is in per-token units);sigmoid_normis the length-normalized DPO of Tülu 3; and the oldrpo_alphaargument is gone (since v0.29): DPO + NLL is nowloss_type=["sigmoid", "sft"]withloss_weights=[1.0, alpha]. Libraries move fast; read the loss code, not the blog post. - Truncation must be symmetric. Truncating the chosen more than the rejected changes $|y|$ and the sum; both sides of a pair should be cut by the same rule (truncate the prompt first).
Hyperparameters that published runs actually used
| Source | Loss | β | Learning rate | Other |
|---|---|---|---|---|
| DPO paper (Rafailov et al., 2023) | DPO | 0.1 (0.5 for TL;DR) | 1e-6, RMSprop, 150 warmup steps | batch 64 |
| Zephyr-7B (Tunstall et al., 2023) | DPO | 0.1 | 5e-7 peak, 10% warmup, linear | batch 32, 3 epochs (SFT lr was 2e-5) |
| Smaug (Pal et al., 2024) | DPO-Positive | 0.3 | — | λ = 50 |
| SimPO (Meng et al., 2024) | SimPO | 2.0–2.5 (up to 10) | tuned per model | γ = 0.5–1.5 |
| Llama 3 (2024) | DPO + 0.2·NLL | 0.1 | 1e-5 | formatting tokens masked; six rounds |
| Tülu 3 8B / 70B (2024) | length-normalized DPO | 5 (per-token units) | 5e-7 / 2e-7 | batch 128, 1 epoch, warmup 0.1 |
| Olmo 3 7B / 32B Think (2025) | length-normalized DPO | 5 (per-token units) | 8e-8 / 7e-8 | 1 epoch, early stopping |
| TRL defaults (v1.16) | loss_type=["sigmoid"] | 0.1 | 1e-6 | docs suggest ~1e-5 for LoRA |
Two rules of thumb fall out, both with exceptions. First, many open full-parameter recipes run DPO at learning rates one to two orders of magnitude below their SFT rate (Zephyr: 5e-7 vs 2e-5; Tülu 3: 5e-7 and 2e-7): the loss is a difference of large sums, and small parameter changes move it a lot. Llama 3 is the notable exception, using 1e-5 for DPO (the same rate as its SFT), so treat the learning rate as something to sweep, not copy. Second, $\beta$ and learning rate interact. With plain SGD the gradient scales with $\beta$ (§2), so lowering $\beta$ also slows training. With Adam-family optimizers, which normalize away a global gradient scale, that effect largely disappears and $\beta$ acts mainly through the weighting $\sigma(-\beta h)$ and the saturation margin; a run that "moves too little" at small $\beta$ is then more likely a data or learning-rate issue than a $\beta$ issue.
What to monitor
rewards/accuracies(fraction of pairs with $\hat r_w>\hat r_l$) rises quickly toward 1 on train; on held-out pairs it plateaus far lower (Chen et al.'s sub-60% ranking accuracy is the sobering benchmark).rewards/marginsgrowing without bound on train means the margin is being pushed to infinity (§4).logps/chosenfalling steadily means displacement (§3). Pair it with sampled generations: where did the mass go?- Mean generation length and KL to the reference measured on samples from the policy, not on the dataset.
"DPO made the model worse: what do you check?" Go in order: step-zero loss = 0.693 (plumbing); logps/chosen trend (displacement); held-out vs train preference accuracy (overfitting); length of generations (length exploitation); the source of the pairs vs the policy's own samples (off-policy); and then, only then, hyperparameters.
§10Frontier & open problems
The open questions have shifted from "which loss?" to "which samples, which judge, and how far can you trust the result?".
- Loss vs data, settled-ish. The best evidence (Tajwar et al. 2024; Tang et al. 2024; Lanchantin et al. 2025) says sampling from the current policy matters more than the choice between a DPO-style and a policy-gradient loss. Semi-online DPO, re-syncing the generator every few to a hundred steps, is a practical middle ground that keeps most of the online benefit with simpler infrastructure. What is not settled is when off-policy data is enough: Sun et al. (2025) find on-policy data was about 3× as effective as static data for Llama-3 but less effective than static data for Zephyr, and SimpleMix (Li et al., 2025) finds the answer differs between verifiable and open-ended tasks.
- Displacement as a safety problem. Razin et al.'s refusal result reframes likelihood displacement from a curiosity to a risk: an innocuous-looking preference fine-tune can remove behaviours that were trained in earlier. Detecting it requires measuring where the mass went, not just whether the margin grew. Representation-aware data filtering (CHES) and anchored objectives are early answers.
- Over-optimization without an explicit reward. Direct alignment algorithms over-optimize much like RLHF (Rafailov et al., 2024), but there is no reward model to ensemble or regularize. Pessimistic objectives such as χPO change the divergence; whether that holds up at frontier scale is open.
- Beyond Bradley–Terry. Human preferences are noisy, context-dependent and sometimes intransitive. Nash-style methods (NLHF, SPPO, DNO) and general preference models drop the scalar-reward assumption; the open question is whether that matters at scale or is swamped by judge noise.
- What the preference signal really is. The delta-learning hypothesis (Geng et al., 2025) shows that pairs where both responses are weak can still teach a stronger model, as long as the chosen is reliably better than the rejected: the information is in the difference. That reframes DPO data curation around reliable deltas rather than high-quality "chosen" responses.
- Where DPO lives in 2026 pipelines. For reasoning and agentic behaviour, most published frontier-scale recipes rely on online RL with verifiable rewards and reward models (Chapter 06, Chapter 07). Direct preference losses survive as cheap stages for style and chat quality, as warm starts, and inside iterative loops.
No Anthropic publication we found says Claude is trained with DPO. The public descriptions are of the other branch of this chapter's divide: a preference model used as a reward for RL on the model's own samples. The Constitutional AI paper's RL phase samples pairs from the model, has a model judge which is better, trains a preference model on those AI preferences, and then trains "with RL using the preference model as the reward signal" (RLAIF). The character-training post describes a "character" variant of Constitutional AI in which "Claude then ranks its own responses" and a preference model is trained on the result. The Claude 3.7 Sonnet system card describes building pairwise preference data for preference-model training (prefer the least policy-violating response; if neither violates, the more helpful, less refusing one). System cards through Claude Opus 4.6 name RLHF and RL from AI feedback; later cards describe post-training aimed at behaviour that "aligns with the values described in Claude's constitution" without naming algorithms. Anthropic's alignment research does use DPO on open models, for example as the post-training method in its open-source replication of the auditing-game model organism on Llama 3.3 70B. Informed speculation: the published pipeline shape (preference models, AI feedback, RL on fresh samples) puts Anthropic's practice on the online side, with the strengths and costs §6 describes.
Why would a lab with a lot of compute still choose RL over DPO? The answer is about data, not loss: on-policy samples, a reward or preference model that generalizes to responses the policy actually produces, KL measured where the policy puts mass, and the generation–verification gap. The other half is knowing when DPO is still the right tool (§10).
§11Check yourself
Try each one before opening the answer. The "research" questions have no single right answer; the answers show one good line of reasoning.
Derive the DPO loss from the KL-regularized RLHF objective. core
For fixed $x$: $\E_\pi[r]-\beta\KL(\pi\|\piref)=-\beta\KL(\pi\|\pi^*)+\beta\log Z(x)$ with $\pi^*=\piref e^{r/\beta}/Z$, so $\pi^*$ is optimal. Invert: $r=\beta\log\frac{\pi^*}{\piref}+\beta\log Z(x)$. Bradley–Terry uses $r(x,y_w)-r(x,y_l)$, so $\beta\log Z(x)$ cancels. Parametrize $\pi^*$ by $\pit$ and maximize the preference likelihood: $\mathcal L=-\E\log\sigma\big(\beta\log\frac{\pit(y_w)}{\piref(y_w)}-\beta\log\frac{\pit(y_l)}{\piref(y_l)}\big)$. This rests on the equivalence-class theorem (every reward class has a representative of this form) and holds in the population limit.
Derive the DPO gradient. Why does it "focus on mistakes"? core
With $u=\hat r_w-\hat r_l$, $\nabla\mathcal L=-\sigma(-u)\nabla u=-\beta\,\sigma(\hat r_l-\hat r_w)\,(\nabla\log\pit(y_w)-\nabla\log\pit(y_l))$. The weight is near 1 for pairs the implicit reward misorders and decays like $e^{-\beta h}$ for correctly ordered ones. Without it (unlikelihood + likelihood) the DPO paper reports degeneration. Weight 0.1 at $h=\ln 9/\beta\approx22$ nats for $\beta=0.1$.
What is the DPO loss at step 0, and why is that a useful test? core
$\pit=\piref$, so every margin is 0 and the loss is $-\log\sigma(0)=\ln2\approx0.693$ (IPO: $1/(4\beta^2)$). Any other value means the policy and reference log-probs are computed inconsistently (dropout, precision, template, truncation, stale cache).
Why does the chosen log-probability often decrease during DPO? deep
First order: $\Delta\log\pit(y_w)\approx\eta c(\|g_w\|^2-\langle g_w,g_l\rangle)$, negative when chosen and rejected gradients are aligned and the rejected's is larger. Mass goes to responses aligned with $g_w-g_l$, possibly ones in no pair (Razin et al.: CHES; "No" vs "Never" raising "Yes"). Also, from "$r$ to $Q^*$": if the reference was SFT'd on the chosen data, implicit rewards must fall in expectation because the KL at convergence is positive. In a tabular softmax it cannot happen for a single pair, so it is a shared-representation effect. Fixes: DPOP, NLL term, CHES filtering, APO, early stopping.
Explain Azar et al.'s critique of DPO and what IPO changes. deep
Bradley–Terry maps preference probability 1 to an infinite reward gap, so for deterministic (or empirically deterministic: each pair seen once) preferences the DPO solution sets $\pi(y_l)=0$ regardless of $\beta$; the KL regularizer is ineffective. ΨPO with identity $\Psi$ gives IPO, a squared loss regressing the log-ratio margin to $1/(2\tau)$: finite target, pushes back past it. Limitation: same target for every pair, regardless of how confident the preference really was.
Is DPO's β the same knob as PPO's KL coefficient? deep
Same symbol, same population optimum, different enforcement. In PPO the KL is measured on the policy's own samples each step, so any drift the policy actually exhibits is paid for. In DPO, β only shapes a logistic loss on fixed data: it sets the implicit-reward scale and the margin at which the loss saturates. Nothing measures KL on the responses the model will generate, and deterministic labels make β irrelevant at the optimum (IPO's argument). So "DPO with β=0.1" and "PPO with β=0.1" can end at very different KLs.
Construct a minimal example where DPO's optimum is not RLHF's. research
Three responses, tabular policy, data only compares $y_1$ with $y_2$, with a non-deterministic empirical preference (say 80% for $y_1$) so the DPO optimum is finite. DPO constrains only $\log\frac{\pi(y_1)}{\piref(y_1)}-\log\frac{\pi(y_2)}{\piref(y_2)}$; $\pi(y_3)$ is free, so a policy putting 99% on unseen $y_3$ is a DPO optimum. RLHF fits a reward model that assigns $y_3$ some finite reward (by extrapolation), then the KL-regularized optimum is $\piref e^{r/\beta}/Z$, which keeps $y_3$ near its reference weight unless $r(y_3)$ is high. That is Xu et al.'s "$\Pi_{\text{PPO}}\subsetneq\Pi_{\text{DPO}}$" in miniature. Add that in a real network $y_3$'s fate is decided by representation geometry, which is how displacement picks specific responses.
Design an experiment that separates "the loss matters" from "on-policy data matters". research
A 2×2: data source {fixed offline pairs, fresh on-policy pairs labelled by the same judge} × objective {DPO, GRPO/PPO with that judge as reward}. Match number of judge calls, gradient steps, and final KL (report the reward–KL frontier, not single points). Add a sweep over the generator sync interval (offline = ∞, semi-online = 5–100 steps, online = 1) as Lanchantin et al. do. Evaluate with a judge different from the training judge, length-controlled, plus a verifiable task. Prediction from the literature: the data axis dominates. Controls: same prompts, same SFT start, 3+ seeds with confidence intervals.
You only have thumbs-up / thumbs-down logs. What do you train, and what can go wrong? core
KTO: per-example sigmoid value against a reference point $z_0$ (batch estimate of KL), with $\lambda_D,\lambda_U$ to balance classes ($\lambda_D n_D/\lambda_U n_U\in[1,1.5]$). Pitfalls: biased $z_0$ estimate with small or unrepresentative batches; logs are off-policy (generated by older models) and selection-biased (who clicks); ratings confound helpfulness with tone and length; sigmoid saturation means hard negatives get little gradient.
SimPO and ORPO drop the reference model. What does that cost you, and how do you guard against it? deep
The reference is the only term tying the solution to the starting model; without it, the anchor is implicit (learning rate, steps, ORPO's SFT term). Expect more sensitivity to learning rate and training length, and displacement can still happen (the chosen's average log-prob can fall while the margin grows). Guards: small lr and early stopping on a held-out judge, NLL/SFT term, monitor KL to the start checkpoint on samples, length-controlled evaluation. Upside: half the forward passes and memory, and a reward that matches the decoding criterion.
Why is a DPO model's implicit reward a weak reward model? deep
It is only defined up to a per-prompt shift, so it does not compare across prompts; it is trained with a generation-oriented objective whose optimum is unconstrained off the data; and in practice ranking accuracy on held-out preferences is low (Chen et al.: most preference-tuned models below 60%). Tang et al. even find the opposite trade-off: offline methods give better classifiers but worse generators. If you need a reward model, train one.
How would you use preference optimization for multi-step reasoning? research
Whole-solution pairs give diluted credit (shared prefixes cancel exactly in $h$, but the rest differs for many reasons). Options: Step-DPO (pairs of next steps after a shared correct prefix, self-generated); iterative RPO (on-policy correct vs incorrect solutions, DPO + NLL); or skip pairs and use RL with verifiable rewards (Chapter 06), which is where most 2025–2026 reasoning recipes went. A good answer names how you would detect reward hacking of the verifier and how you would keep entropy from collapsing.
Online DPO has plateaued. What do you try next? research
Diagnose first: is the judge saturated (pairs indistinguishable), hacked (length, style), or is sampling not diverse enough to produce informative pairs? Then: refresh the reference to the current policy (trust region on the last iterate), move from BT to a general preference model with self-play (SPPO/DNO style) if preferences look intransitive, improve pair selection (best-vs-worst of $k$, margin filters), mix in verifiable tasks (Lanchantin et al. find multi-tasking helps), or switch the objective to GRPO/PPO with the judge as reward and compare at matched KL.
In 2026, when would you still pick offline DPO? core
When you need a cheap, stable stage on SFT infrastructure: style and format adjustments, a warm start before online RL, distillation-like "delta" signals from a strong vs weak model (Olmo 3's delta learning), or small models where sampling infrastructure costs more than it buys. Not when the target behaviour depends on the model's own failure modes (reasoning, agentic tasks, safety edge cases), where on-policy data is the point.