DPO (Direct Preference Optimization)

Definition

Direct Preference Optimization (Rafailov et al., 2023; arXiv:2305.18290, “Your Language Model is Secretly a Reward Model”) collapses the entire back half of RLHFreward-model training plus the PPO loop — into a single supervised classification loss on preference pairs. The load-bearing fact: the KL-regularized RLHF objective has a closed-form optimal policy, so the reward is a reparameterization of the policy itself. DPO changes variables from “reward space” to “policy space” before fitting, turning preference learning into maximum likelihood — no RL, no RM, no sampling loop.

Key math

The KL-regularized objective has the exact optimum (a Boltzmann tilt of the reference, = temperature):

Invert to read the reward off the policy: . Substitute into Bradley–Terry : the intractable is response-independent, so it cancels exactly (same prompt ). Parameterize and take the NLL:

The implicit reward is — DPO is literally the same Bradley–Terry loss as RM training, with the scalar head replaced by the -scaled log-ratio. Gradient: raise , lower , weighted by — large exactly when the pair is currently mis-ordered. is the KL leash as the sigmoid-logit scale (typical , default ).

Why it matters

DPO deletes three of RLHF’s four models (RM, critic, and the sampling loop), giving cheap, stable, accessible alignment on the pairs you already collected. But it trades problems: it is offline / off-policy (never sees on-policy samples → distribution shift, the defining limitation), suffers likelihood displacement (both and can fall — Razin et al. 2024, arXiv:2410.08847), overfits near-deterministic preferences, and is sensitive to /SFT coverage. Monitor absolute chosen-likelihood, not just the margin. The frontier default is iterative/online DPO — resample fresh on-policy pairs each round — which closes most of the gap to PPO. See preference-optimization for the variant family (IPO/KTO/ORPO/SimPO/CPO).

Taught in

See also