Custom AI models for the enterprise · New York · LondonSecurityResearchContact sales
Finetune the World
Glossary

DPO (Direct Preference Optimization): definition, math and practical numbers

DPO fine-tunes a language model directly on pairs of preferred and rejected responses, optimizing the RLHF objective without a reward model or reinforcement learning.

Definition#

Direct Preference Optimization (Rafailov et al. 2023) trains on triples : a prompt, a preferred response and a rejected one. Its loss is a logistic loss on the difference of log-probability ratios against a frozen reference model:

It follows from the KL-regularized RLHF objective: the optimal policy satisfies , and under the Bradley–Terry preference model the intractable cancels. Full derivation: DPO from first principles.

The β caveat#

nominally sets how far the policy may move from the reference. In our tabular simulation with 256 preference pairs, the realized KL varied only from 1.48 to 1.83 across a twentyfold range of β. Monitor divergence directly.

Bring us one task. We’ll show you what a specialist model can do.

A 45-minute briefing with a senior research engineer. You leave with a feasibility read, a data plan and a fixed quote, whether or not you hire us.

Book a briefing →