AI Infra
0%
Part III · Chapter 20

Direct Preference Optimization and Its Variants

AuthorChangkun Ou
Reading time~13 min

There is a recurring moment in an alignment pipeline. A team has a static file of preference pairs, a chosen response and a rejected one for each prompt, and it wants an aligned model out the other end. The textbook route is RLHF, and RLHF is resource-intensive. The direct-preference line asks whether that cost is necessary, collapses the apparatus into a single classification loss, then builds a family of variants on top of that loss. The controlled result is that none of the variants reliably beats the plain loss they all descend from.

A static file of preferences

RLHF, covered in Chapter 19, aligns a model in three stages: supervised fine-tuning, a reward model fit to human preferences, then a policy-gradient run with proximal policy optimization (PPO) (Schulman et al. 2017) that optimizes the policy against that reward under a Kullback-Leibler divergence (KL) constraint to the reference. The machinery is costly to run. PPO keeps four models in play at once, the policy, a frozen reference, the reward model, and a critic, and its result is sensitive to reward-model quality and to a handful of brittle hyperparameters. For the team with a static set of preference pairs, the question is whether all of that apparatus is necessary, or whether the preference signal can be optimized directly.

The reduction: a language model is an implicit reward model

The reduction rests on one fact about the RLHF objective. Maximizing reward under a KL penalty to a reference policy,

maxπθ  Ex,yπθ[r(x,y)]    βKL ⁣(πθ(x)πref(x)),\max_{\pi_\theta}\; \mathbb{E}_{x,\,y\sim\pi_\theta}\big[r(x,y)\big] \;-\; \beta\, \mathrm{KL}\!\left(\pi_\theta(\cdot\mid x)\,\|\,\pi_{\text{ref}}(\cdot\mid x)\right),

has a closed-form optimal policy, meaning the single best policy this objective implies can be written as a formula rather than found by search: it is the reference reweighted by the exponentiated reward, π(yx)πref(yx)exp(r(x,y)/β)\pi^*(y\mid x) \propto \pi_{\text{ref}}(y\mid x)\exp(r(x,y)/\beta). Rafailov et al. invert this (Rafailov et al. 2023). Solving for the reward in terms of the optimal policy expresses rr as a log-ratio, so the reward that any policy implies is

rθ(x,y)  =  βlogπθ(yx)πref(yx)  +  βlogZ(x).r_\theta(x,y) \;=\; \beta\,\log\frac{\pi_\theta(y\mid x)}{\pi_{\text{ref}}(y\mid x)} \;+\; \beta\log Z(x).

Here Z(x)Z(x) is the partition term, the normalizing sum over every response the model could produce that turns the reweighted reference back into a probability; it is intractable because that sum runs over all possible sequences, far too many to compute. Substitute that implicit reward into the Bradley-Terry model of pairwise preference and Z(x)Z(x) cancels between the chosen response ywy_w and the rejected yly_l. What remains is a supervised loss on preference pairs,

LDPO=E(x,yw,yl)logσ ⁣(βlogπθ(ywx)πref(ywx)βlogπθ(ylx)πref(ylx)).\mathcal{L}_{\text{DPO}} = -\,\mathbb{E}_{(x,y_w,y_l)}\,\log \sigma\!\left( \beta\log\frac{\pi_\theta(y_w\mid x)}{\pi_{\text{ref}}(y_w\mid x)} - \beta\log\frac{\pi_\theta(y_l\mid x)}{\pi_{\text{ref}}(y_l\mid x)}\right).

Maximize reward under a KL penalty that keeps the policy close to a frozen reference.
This objective has one optimal policy: the reference reweighted by exp(r/β), so π* ∝ π_ref · exp(r/β).
Inverting that relation solves for the reward, writing it as β times the log-ratio of policy to reference, plus a term β log Z(x).
Put this implicit reward into the Bradley-Terry model of which response is preferred.
The β log Z(x) term is the same for both responses, so it cancels between the chosen and the rejected one, leaving a log-σ on the gap between their log-ratios.
The RLHF machinery of a reward model, a critic, and a PPO loop is gone, and what remains is one loss.
Figure 20.1. The reduction is six algebraic steps from the RLHF objective to a single classification loss. Step through each line, or let it play.

The reward model and the RL loop are gone. The policy is trained to assign higher implicit reward to the preferred response, where implicit reward is the log-ratio of the policy to a frozen reference, how much more likely the tuned model makes this answer than the frozen starting model does. The title of the paper states the point: the language model is an implicit reward model. Figure 20.2 shows the machinery that this substitution deletes.

cluster_rlhf RLHF (PPO) cluster_dpo DPO pref1 Preference pairs rm Reward model fit to preferences pref1->rm ppo PPO loop rm->ppo aligned1 Aligned policy ppo->aligned1 pol1 Policy pol1->ppo ref1 Frozen reference ref1->ppo crit Critic crit->ppo pref2 Preference pairs aligned1->pref2 implicit reward Z(x) cancels loss Log-sigmoid loss on implicit reward gap pref2->loss aligned2 Aligned policy loss->aligned2 pol2 Policy pol2->loss ref2 Frozen reference ref2->loss
Figure 20.2. RLHF runs a reward model and a PPO loop over four models; DPO substitutes the implicit reward into the Bradley-Terry model, the partition term cancels, and what remains is one classification loss over preference pairs. After Rafailov et al. (2023).

Four edits to one loss

Once the loss exists, every later method is an edit to it. Each variant removes one assumption or one piece of machinery the previous line of the loss carried. Figure 20.3 lays out which piece each one changes.

dpo DPO log-sigmoid on log-ratio reward, paired data, frozen reference ipo IPO bounded squared loss regress reward gap to a fixed target dpo->ipo bound the objective kto KTO unpaired good/bad labels prospect-theory utility dpo->kto drop paired data orpo ORPO odds-ratio penalty added to SFT no reference model dpo->orpo merge into SFT, drop reference simpo SimPO reference-free reward length-normalized target margin dpo->simpo drop reference, normalize length
Figure 20.3. Each variant edits one part of the DPO loss. IPO bounds the objective; KTO drops the paired-data requirement; ORPO folds alignment into SFT and removes the reference; SimPO removes the reference and normalizes by length.

Where the log-sigmoid is unbounded, identity preference optimization (IPO) bounds the objective with a squared target for the reward gap. Azar et al. target a weakness in the derivation (Azar et al. 2023): the Bradley-Terry substitution assumes preferences are well modeled as a deterministic ordering, and with finite, near-deterministic data the log-sigmoid loss can drive the policy to push the implicit reward gap to infinity, overfitting the preference set. IPO replaces the log-sigmoid with a bounded squared objective that regresses the implicit reward gap toward a fixed target, so the optimum stays finite even when preferences are clean. Figure 20.4 contrasts the two loss shapes.

2026-06-22T14:10:27.906422 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/
Figure 20.4. Schematic illustration of the bounded IPO objective versus the unbounded DPO log-sigmoid loss as a function of the implicit reward gap, after Azar et al. (2023). The log-sigmoid keeps decreasing as the gap grows, so its optimum pushes the gap toward infinity; the squared loss has a minimum at a fixed target, so its optimum stays finite.

Run a few gradient steps on a single reward gap under each loss and watch the DPO gap climb without bound while the IPO gap settles at its target.

import numpy as np
import matplotlib.pyplot as plt

def sigmoid(z): return 1.0 / (1.0 + np.exp(-z))

beta, lr, target, steps = 1.0, 0.5, 5.0, 60
gd, gi = [0.0], [0.0]
for t in range(steps):
    # DPO gradient on the gap never reaches zero, so the gap keeps growing
    gd.append(gd[-1] + lr * beta * sigmoid(-beta * gd[-1]))
    # IPO regresses the gap to a fixed target, so it settles there
    gi.append(gi[-1] - lr * 2.0 * beta * (beta * gi[-1] - target))
print(f"DPO gap after {steps} steps: {gd[-1]:.2f} and still rising")
print(f"IPO gap converges to target: {gi[-1]:.2f}")
plt.plot(gd, label="DPO log-sigmoid"); plt.plot(gi, label="IPO bounded")
plt.axhline(target, ls="--", c="gray"); plt.xlabel("step"); plt.ylabel("implicit reward gap")
plt.legend(); plt.show()

Kahneman-Tversky optimization (KTO) drops the paired-data requirement. direct preference optimization (DPO) needs a chosen and a rejected response for the same prompt; KTO learns from unpaired binary good or bad labels by scoring each response against a reference point with a prospect-theory utility (Ethayarajh et al. 2024), the same human-value-of-gains-and-losses shape Kahneman and Tversky used. This trades the paired-data constraint for a utility model, which matters because thumbs-up and thumbs-down logs are far more abundant than curated pairs.

odds-ratio preference optimization (ORPO) merges alignment with SFT through an odds-ratio penalty. Instead of a separate alignment stage with a reference model, Hong et al. add an odds-ratio penalty to the SFT cross-entropy (Hong et al. 2024) (the SFT stage itself is Chapter 17), so one pass both teaches the format and down-weights the rejected response. It carries no reference model at all.

simple preference optimization (SimPO) goes reference-free, normalizing the reward by length. Meng et al. drop the reference policy from the implicit reward (Meng et al. 2024), using the average log-probability of a sequence as the reward, and add a target margin between chosen and rejected. The length normalization is the deliberate part: DPO's log-ratio reward correlates with sequence length, which lets a policy raise its score by getting wordier, and dividing by length removes that lever. Figure 20.5 shows the reward against response length under both rewards.

2026-06-22T14:10:28.271606 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/
Figure 20.5. Schematic illustration of how SimPO's length normalization flattens the implicit reward against response length, after Meng et al. (2024). The DPO log-ratio reward sums per-token terms and so grows with length, which a policy can exploit by getting wordier; the length-normalized SimPO reward is the per-token average and stays flat.

Controlled comparison

Read in sequence, the four edits look like a ladder of improvements, each variant fixing what the last one missed. A controlled comparison undercuts that reading.

What's contested

The variant family is usually presented as a ladder of improvements, but a controlled multi-scale study (arXiv:2603.19335) finds no variant reliably beats vanilla DPO once confounds are corrected for. When tuning budget, data, and model are held equal, the gaps between methods shrink into the noise, and the apparent ranking inverts across model scale: a variant that leads at one size trails at another. The practical reading is that reported wins for a new objective often reflect a better-tuned baseline-versus-variant comparison rather than a property of the loss, and that the choice among these methods should be driven by pipeline and data constraints rather than by a claimed accuracy edge.

If accuracy does not separate the variants, then something else has to decide between them, and that something is the shape of the pipeline and the data.

What actually decides the choice

With the accuracy edge gone, the real axes are the engineering ones the variants trade along. Four of them recur.

  • Reference model versus none. Keeping the frozen reference (DPO, IPO) anchors the policy and gives the KL constraint a meaning, at the cost of a second resident model and forward pass. Dropping it (ORPO, SimPO) halves the alignment-stage memory and simplifies the pipeline, but removes the explicit anchor that limits drift from the starting policy.
  • Paired versus unpaired data. DPO, IPO, ORPO, and SimPO all need a chosen and a rejected response per prompt. KTO accepts unpaired binary signals, which fits production feedback logs but substitutes a utility model for the pairwise comparison the others optimize.
  • Bounded versus unbounded objective. IPO's bounded regression resists the overfitting that DPO's log-sigmoid invites on clean, near-deterministic preferences. The price is a loss that no longer matches Bradley-Terry exactly and a target margin to set.
  • Two stages versus one. ORPO merges alignment into SFT, saving a stage and a reference model, at the cost of entangling format learning and preference learning so they can no longer be tuned or audited separately.

The first of these axes is not only a modeling choice. It is forced from below.

Constraint arrow

The memory budget of Chapter 10 reaches up and shapes the loss. DPO and IPO keep a frozen reference model resident alongside the policy and pay a second forward pass through it on every step. At large model size that doubled footprint is the cost that ORPO (no reference) and SimPO (reference-free) exist to remove. The reference-free design is not primarily an accuracy claim, it is a response to the systems cost of holding two models.

Running it

DPO is the smallest of the family to run: one loss, a frozen copy of the SFT model as the reference, and a static file of preference triples. The core is the log-ratio difference inside a log-sigmoid, computed from per-token log-probabilities of the chosen and rejected responses under the policy and the reference; see the loss derivation in DPO loss, Rafailov et al. (arXiv:2305.18290), Sec. 4 (Rafailov et al. 2023). The reference forward pass can be precomputed once because the reference never updates, which is the standard memory optimization.

The one hyperparameter that matters across the family is β\beta, the strength of the KL constraint that also scales the implicit reward. Too small and the policy drifts off the reference and degrades; too large and it barely moves. Because vanilla DPO is off-policy, trained on a fixed set rather than on samples from the live policy, its ceiling is the fixed data, and the common remedy is iterated or online DPO that regenerates pairs from the current model between rounds. That on-policy variant, and the broader RLHF apparatus it approaches, belong to Chapter 19.

Further reading

  • Rafailov et al., “Direct Preference Optimization: Your Language Model is Secretly a Reward Model” (DPO), 2023. arXiv:2305.18290
    DPO replaces RLHF's explicit reward model and RL loop with a simple binary cross-entropy loss, extracting the optimal policy directly from human preference data.
  • Azar et al., “A General Theoretical Paradigm to Understand Learning from Human Preferences” (IPO), 2023. arXiv:2310.12036
    This paper introduces ΨPO, a general preference optimization objective that unifies RLHF and DPO as special cases, and proposes IPO, which bypasses the Bradley-Terry assumption to avoid overfitting.
  • Ethayarajh et al., “KTO: Model Alignment as Prospect Theoretic Optimization,” 2024. arXiv:2402.01306
    KTO aligns LLMs using a Kahneman-Tversky prospect theory objective that learns from binary desirability signals instead of preference pairs, matching or exceeding DPO at scales from 1B to 30B parameters.
  • Hong et al., “ORPO: Monolithic Preference Optimization without Reference Model,” 2024. arXiv:2403.07691
    ORPO is a monolithic preference alignment algorithm that merges SFT and preference optimization into one step using an odds ratio penalty, eliminating the need for a reference model.
  • Meng et al., “SimPO: Simple Preference Optimization with a Reference-Free Reward,” 2024. arXiv:2405.14734
    SimPO replaces DPO's reference-model reward with a length-normalized average log probability and a target reward margin, eliminating the reference model while outperforming DPO by up to 7.5 points on Arena-Hard.
  • Schulman et al., “Proximal Policy Optimization Algorithms” (PPO), 2017. arXiv:1707.06347
    PPO introduces a clipped surrogate objective for policy gradient reinforcement learning that achieves TRPO-level reliability with simpler first-order optimization and better sample complexity.

Comments

Log in to comment