Glossary

ConceptFine-Tuning & Adaptation

DPO (Direct Preference Optimization)

At a glance

Preference tuning without a separate reward model or RL loop, simpler than RLHF.

Who this is for
Engineers and technical readers learning the terms used in AI systems.
Topics
  • Fine-Tuning & Adaptation
  • Concept

In short

Direct preference optimization tunes a model on pairs of a preferred and a rejected answer with one classification-style loss against a frozen reference, without a separate reward model or a reinforcement-learning loop. Bigcircle recommends it for how answers read, such as tone, format and refusal style, and keeps facts like citations in retrieval and validation, because tuning improves how a citation is phrased whether or not the authority behind it exists.

Key facts

Definition

Direct Preference Optimization raises the likelihood of a chosen response over a rejected one, each measured against a frozen reference model, with the margin scaled by a beta that TRL defaults to 0.1.

How Bigcircle does it

  1. On its trademark drafting platform, a supervised fine-tune rather than DPO, Bigcircle found register drift was the only one of four failure modes tuning alone handled well, so citations come from a whitelisted index and validators.
  2. Bigcircle recommends validating any LLM judge that labels the pairs against a human expert first, because the judge's taste becomes the training target and a fluent wrong answer can win the pair.
  3. Bigcircle recommends KTO when the only signal is thumbs up or down on single answers, and reinforcement learning with a verifiable reward when a program can check the answer, because a preference loss cannot score correctness.

Comparison

PPO-based RLHF keeps a policy, a reference, a reward model and a value model in memory and samples new answers during training, while DPO keeps two models and makes one offline pass over a fixed set of pairs.

Key number

Ai2's Tulu 3 rated candidate answers with GPT-4o and trained DPO on 271,409 preference examples for its 8B model and 334,302 for its 70B model.

Direct preference optimization, DPO, is a way to tune a language model on pairs of answers to the same prompt, one preferred and one rejected, using a single loss that works like logistic regression. It reaches the goal of RLHF without RLHF's separate reward model and reinforcement-learning loop. Rafailov and colleagues showed in 2023 that the policy RLHF is looking for can be written directly in terms of the preference data, so the model can be moved toward it with ordinary gradient descent. Their paper's subtitle puts it as "Your Language Model is Secretly a Reward Model."

Chosen and rejected, optimized directly#

DPO uses the same raw data as RLHF: a prompt, a chosen response and a rejected one. The loss compares how much more likely the model being trained makes each response than a frozen reference model does, usually the supervised fine-tuned checkpoint you started from. That ratio acts as an implicit reward for each side. The loss pushes the chosen reward above the rejected one, passed through a sigmoid and scaled by a setting called beta, which defaults to 0.1 in Hugging Face's TRL library.

Walk one example through. The prompt asks for a summary of an incident report. The chosen answer is a tight five-line summary, and the rejected one buries the cause of the outage in paragraph four. Suppose the current model rates the chosen answer 0.3 above the reference in log-probability and the rejected one 0.5 above, so it has drifted toward the worse style. The margin is negative, and this pair produces a large update. Pairs the model already ranks correctly produce small ones, so training effort goes to the preferences the model currently gets wrong.

The frozen reference does the job the KL penalty does in RLHF: an anchor that lets the model absorb the preferences without drifting into odd text that wins on margin and reads badly.

Why it is simpler to run than RLHF#

Count the models. PPO-based RLHF keeps four in memory: the policy, a frozen reference, a reward model and a value model, and two of them carry optimizer state. DPO keeps two, the policy and the frozen reference, and the reference only runs inference. With LoRA adapters, TRL can use the base model with its adapters switched off as the reference, so one copy of the weights does both jobs.

The larger saving is in the loop. PPO samples fresh responses from the model at every step, scores them and estimates advantages, and it is sensitive to its settings. DPO never samples during training. It is one offline pass over a fixed dataset, about as reproducible as supervised fine-tuning, and two settings carry most of the outcome: beta and the learning rate, which TRL defaults to 1e-6. In the original paper DPO beat PPO-based RLHF at controlling the sentiment of generations, and matched or improved on it for summarization and single-turn dialogue.

RLHF: three stages, four models resident1. supervisedfine-tune2. train rewardmodel on pairs3. PPO loop(sample, score, update)DPO: one stage, two models residentchosen / rejectedpreference pairsone classification-style loss on the policy(anchored to a frozen reference)

Where DPO fits, and where it does not#

DPO fits targets that are a matter of preference and that you can show as pairs: tone, format, verbosity, refusal style, or which of two support answers a reviewer would send. It is not only a small-team shortcut. Ai2's Tulu 3 rated candidate answers with GPT-4o and trained DPO on 271,409 preference examples for its 8B model and 334,302 for its 70B model, mixing in pairs sampled from its own model. Meta's Llama 3 paper reports trying on-policy PPO and choosing DPO because it needed less compute at that scale and did better, particularly on instruction following.

Preference tuning changes how an answer reads, and that is the limit to plan around. On the trademark drafting platform, which uses supervised fine-tuning rather than DPO, Bigcircle found that register drift was the only one of four failure modes that fine-tuning alone handled well. Tuning improved how a citation was phrased, which is the wrong thing to improve when the authority behind it might not exist, so citations come from a whitelisted retrieval index and validators instead. A preference loss carries the same risk more strongly, because a judge that prefers the more fluent answer rewards a confident wrong citation over a hesitant right one.

So check what the pairs reward before training on them. If an LLM judge labels the pairs, the judge's taste becomes the target, and it needs the same validation against a human expert as any other judge (see judge alignment). DPO is also offline: it learns from a fixed set rather than from its own new samples. Pairs written by an older or different model blunt the update, which is why Tulu 3 added on-policy pairs. For skills a program can check, such as maths or passing unit tests, RLVR with a method like GRPO is the better tool. A common modern order is supervised fine-tuning for instructions, DPO for preferences, RLVR for correctness.

ORPO and KTO#

Two variants cover the cases where plain DPO's requirements get in the way. ORPO, odds ratio preference optimization, drops the reference model and folds preference learning into the supervised fine-tuning stage, so one model and one training phase do the work. It gives up the anchor, so it overshoots more easily, and as of October 2026 TRL lists its ORPO trainer under experimental. KTO learns from unpaired signals, this answer was good and that one was bad, which matches what a product actually logs: thumbs up and thumbs down, rarely two answers to the same prompt. Its authors report it matching or beating pairwise methods at scales from 1B to 30B, and TRL ships it as a core trainer beside DPO.

Pick the method by the signal you have#

Use DPO when you have, or can generate and check, pairs of answers to the same prompt and the goal is how answers read. Use KTO when the only signal is a thumbs up or down on single answers. Use ORPO when memory allows only one model and you can accept less control over drift. If the property you want is correctness that a program can score, train against that check instead of a preference. Keep facts such as citations in retrieval and validation, where tuning cannot make a wrong one sound right.

Common questions about direct preference optimization

  • What is direct preference optimization?

    Direct preference optimization is a preference-tuning method that trains on a prompt, a chosen answer and a rejected answer, pushing the chosen one's likelihood up relative to a frozen reference model. Rafailov and colleagues introduced it in 2023 as a way to reach the RLHF objective without a reward model or reinforcement learning.

  • What is the difference between DPO and RLHF?

    PPO-based RLHF trains a reward model and then optimizes against it with reinforcement learning, sampling fresh answers at every step. DPO learns from the same preference pairs in one offline pass, which is why Meta's Llama 3 team chose it over PPO for needing less compute at scale.

  • When is DPO the wrong tool?

    A skill a program can check, such as maths or a unit test, fits reinforcement learning with a verifiable reward better. DPO also learns from a fixed set, so pairs written by an older or different model blunt the update, which is why Tulu 3 added pairs sampled from its own model.

Let's build something that ships.

Tell us what you're building. We'll tell you whether it needs a fixed-scope build, a prototype taken to production, or a programme we run, what's achievable, and where the real bottlenecks are.

Reply within 2h

We store your name, email, company, and message, and email a copy to hello@bigcircle.ai. Read the privacy page and the terms.