Berk Bayri

Direct preference optimization

A way to train a language model on pairs of answers where people preferred one over the other, without first building a separate reward model or running reinforcement learning. It reaches the goal of RLHF with a simpler training step.

Direct preference optimization, usually shortened to DPO, starts from the same raw material as RLHF: a prompt, two candidate answers and a record of which one a person preferred. What changes is the route from that data to a better model.

After an initial round of supervised examples, classic RLHF adds two stages. First a reward model is trained to predict human preferences. Then the language model is tuned with reinforcement learning to score well against that reward model, while being held close to its original behavior. Both stages are expensive and the second is known for being unstable.

Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher Manning and Chelsea Finn showed in 2023 that this two-stage problem can be rewritten as a single training objective on the language model itself. The model is pushed to make the preferred answer more likely and the rejected one less likely, relative to a frozen copy of where it started. The paper's title makes the point: the language model is, in effect, its own reward model.

"Direct Preference Optimization: Your Language Model is Secretly a Reward Model"

arXiv · 2023-05-29

Why it matters outside the lab

Because DPO needs no separate reward model or reinforcement learning loop, preference tuning is within reach of smaller teams. A company adapting an open-weight model can collect examples of answers its reviewers accept and reject and tune on them with ordinary fine-tuning infrastructure, often combined with LoRA to keep the job small.

That makes the hard part visible. The method is only as good as the preference pairs. If reviewers favor answers that sound confident, the model learns confidence, not accuracy. If the pairs come from one team's habits, the model learns that team's habits. Simpler training does not make the judgment in the data any better, so the comparison set needs the same scrutiny as any other evaluation data, and the tuned model needs testing on cases the preference data never covered.

A common confusion

DPO is not a way to teach a model new facts. It shifts which of the answers the model could already give become more likely. Missing knowledge is a job for retrieval or further training on the source material, not for preference pairs.

Related terms