Evaluation lab · San Francisco · London · Zürich
Reinforced Labs Request a briefing
Glossary

DPO (Direct Preference Optimization)

Also called: DPO, Direct Preference Optimization, direct preference optimisation

DPO trains a language model directly on preference pairs with a classification-style loss, skipping the separate reward model and RL loop of RLHF.

Direct Preference Optimization (DPO) is a post-training method that fits a language model to preference pairs with a single supervised loss, without training a separate reward model or running reinforcement learning. It solves the same KL-regularised objective as RLHF, in closed form.

Where the loss comes from

The KL-regularised RLHF objective has a known optimal policy, . Rearranging gives the reward implied by any policy: . Substituting that into the Bradley-Terry likelihood, the constant cancels and leaves

where and are the chosen and rejected responses, is the model being trained, is a frozen copy of the starting model and controls how far the model may move. Intuitively, DPO raises the likelihood of the chosen response relative to the reference and lowers that of the rejected one, weighted most on pairs it currently gets wrong.

Worked example

Take . The policy gives the chosen response log-probability against under the reference (log-ratio ) and the rejected response against (log-ratio ). The margin is , so the loss is . As the margin grows the loss falls towards zero.

DPO vs RLHF

  • Simpler: two models in memory (policy and reference), no sampling during training, no value network.
  • Offline: it learns only from fixed pairs, so it cannot discover and correct its own new failure modes the way on-policy RL can. Iterated or online variants regenerate pairs from the current model.
  • Still exploitable: the implicit reward can overfit, for example by lowering the probability of both responses or drifting towards longer outputs.

Why it matters

DPO made preference tuning cheap enough for small teams, and it is now a common default for safety and style tuning. For evaluation, the lesson is that a lower DPO loss is not the same as a better model: it measures fit to the preference set, so held-out behavioural evals and refusal-calibration checks still decide whether the tuned model is safe to ship.

Sources

  1. Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, Chelsea Finn. Direct Preference Optimization: Your Language Model is Secretly a Reward Model, 2023. arxiv.org

Know the number before you ship.

A 45-minute working session with an evaluation engineer. Bring one use case; leave with a threat model, a draft eval plan with sample sizes, and an honest read on where you stand.