Direct Preference Optimization (DPO) is a post-training method that fine-tunes a language model directly on pairs of preferred and dispreferred responses, using a simple classification loss instead of a separate reward model and a reinforcement learning loop. Rafailov and colleagues at Stanford University introduced it in a paper first posted to arXiv in May 2023.
DPO optimizes the same objective as standard reinforcement learning from human feedback (RLHF): maximize reward while a KL-divergence constraint keeps the model close to a reference model. A change of variables expresses that reward through the policy itself, so the language model also serves as an implicit reward model. In the original experiments, with models of up to 6B parameters, DPO matched or beat PPO-based RLHF on sentiment control, summarization and single-turn dialogue.
Direct Preference Optimization (DPO) at a Glance
| Also called | DPO; an offline, reward-free preference optimization method |
|---|---|
| What it does | Widens the gap between the log-likelihoods of chosen and rejected responses, measured relative to a reference model |
| Where it's used in model development | The preference stage of post-training, usually after supervised fine-tuning (SFT); open recipes such as Tulu 3 and hosted fine-tuning APIs |
| The human role | People (or AI judges) decide which of two responses to a prompt is better, which sets the chosen and rejected response in every training example |
| Limits | Learns only from a fixed preference dataset; comparative studies report PPO outperforming it on some tasks |
How Direct Preference Optimization Works
Direct Preference Optimization works by turning each human comparison into a binary classification example that the model being trained learns to score correctly.
The training data
Each DPO example contains a prompt, a chosen completion and a rejected completion. In the classic setup, the SFT model generates two answers to a prompt and human labelers mark which one they prefer. The framework assumes a Bradley-Terry model of how those preferences arise.
The loss
For both responses, DPO computes the log-probability ratio between the policy being trained and the reference model, typically the SFT model. The loss is the negative log-sigmoid of beta times the difference between those two ratios. A per-example weight in the update prevents the model degeneration the authors saw with a naive probability-ratio objective. Hugging Face's TRL documentation adds that, in practice, the margin usually grows because the rejected response's likelihood falls, not because the chosen response's likelihood rises.
The beta parameter
Beta controls how far the trained model may move from the reference policy. OpenAI's fine-tuning API, a platform OpenAI says it is winding down, exposes it as a number between 0 and 2: higher values are more conservative, lower values follow the new preferences more aggressively.
What teams monitor
TRL logs the implicit reward for chosen and rejected completions, the margin between them, and reward accuracy: the share of pairs where the chosen completion's implicit reward is higher.
Where DPO Is Used in Model Development
DPO is used in the preference-tuning stage of post-training, usually after supervised fine-tuning (SFT).
- In place of reward modeling and RL. The RLHF pipeline the DPO paper reviews has three phases: SFT, preference sampling with reward learning, and RL optimization. DPO collapses the last two into one training stage.
- After SFT. OpenAI's guide recommends running SFT on a subset of preferred responses first, then starting DPO from that fine-tuned model.
- In open recipes. Tulu 3, a fully open family of post-trained models built on Llama 3.1 base models, trains with SFT, DPO and reinforcement learning with verifiable rewards (RLVR).
- Beyond plain text chat. TRL's DPOTrainer supports conversational data, tool-calling examples and vision-language models.
- Through variants. TRL exposes alternative losses, including IPO, a robust loss for noisy preferences and a length-normalized loss from the SimPO authors.
Limits of DPO and the Human Role
A key limit of DPO is that it learns from a fixed, offline batch of preference pairs, so its results depend on the quality of those pairs.
Data quality comes first
In a NeurIPS 2024 study, Ivison and colleagues found that better preference data produced the largest improvements, ahead of the choice of learning algorithm. High-quality preference data improved instruction following and truthfulness by up to 8%.
PPO can outperform it
The same study found PPO outperforms DPO by up to 2.5% in math and 1.2% in general domains. Xu and colleagues (ICML 2024) argued DPO may have fundamental limitations and reported that PPO surpassed other alignment methods in all their testbeds, from dialogue to code generation.
Modeling assumptions and artifacts
- The SimPO authors address a length bias in the original sigmoid loss by normalizing by the number of non-mask tokens.
- TRL's robust DPO loss uses label smoothing to model the probability that a preference label is flipped.
Where people fit
DPO has no standalone reward model to inspect: its implicit reward is fit to the preference data, so the pairs are where the target behavior is defined. That puts the human work upstream: a written rubric for what "better" means, raters calibrated on it, a process for resolving disagreements, and audits for artifacts such as length bias.
DPO vs. RLHF with PPO
DPO and PPO-based RLHF optimize the same KL-constrained reward objective, but DPO does it without an explicit reward model or reinforcement learning.
| Aspect | DPO | RLHF with PPO |
|---|---|---|
| Reward model | Implicit: the policy represents the reward | Trained separately on preference data |
| Training loop | Classification loss; no sampling from the model during fine-tuning | Samples from the policy in the loop and optimizes with RL |
| Prompts | Fixed, labeled preference pairs | Can add unlabeled prompts for policy training |
| Compute | Described by its authors as computationally lightweight | Trains multiple models, with significant computational cost |
| Reported results | Matched or beat PPO on the original paper's tasks | Outperformed DPO in later comparative studies |
Direct Preference Optimization (DPO) at Hugo
Hugo builds and manages dedicated preference alignment and post-training teams that write reference responses, rank model outputs and audit reasoning and safety for SFT, RLHF, RLAIF and DPO pipelines. Raters work from a rubric written with the client, pass a calibration set before production and have their agreement tracked per criterion, with re-calibration against gold examples during the program. The team organizes, validates and formats preference comparisons for the client's DPO, PPO and GRPO pipelines. For how DPO fits alongside other methods, see LLM post-training explained: SFT, RLHF, RLAIF, DPO and GRPO.
Related Terms
- Large Language Model (LLM)
- Process Reward Model (PRM)
- AI Model Training
- Data Annotation
- AI Red Teaming
- Generative AI (GenAI)
- Vision-Language Model (VLM)
- Supervised Fine-Tuning (SFT)
- Reinforcement Learning from Human Feedback (RLHF)
- Preference Data
- Reinforcement Learning from AI Feedback (RLAIF)
- Group Relative Policy Optimization (GRPO)
Direct Preference Optimization (DPO) FAQs
What is direct preference optimization in simple terms?
Direct preference optimization is a way to fine-tune a language model on examples where one response to a prompt is marked better than another. The model learns to favor the chosen response over the rejected one. DPO does this with a classification-style loss, so it needs no separate reward model and no reinforcement learning loop. A reference model, usually the SFT model, anchors training so the model does not drift too far from its starting behavior. Teams considering DPO should first check that their preference pairs reflect a written, consistent definition of what makes a response better.
How is DPO different from RLHF?
DPO and RLHF target the same goal, maximizing a reward learned from human preferences while staying close to a reference model, but DPO skips the separate reward model and the reinforcement learning step. Classic RLHF trains a reward model on comparisons, then optimizes the policy against it with an algorithm such as PPO, sampling from the model during training. DPO reparameterizes the reward so the policy itself acts as an implicit reward model and trains with a binary cross-entropy objective. Both methods learn from the same kind of data, human preferences over pairs of responses, so one well-built preference dataset can feed either.
What data does DPO need?
DPO needs a preference dataset: for each prompt, one chosen response and one rejected response. Hugging Face's TRL library accepts both standard and conversational formats, with an explicit prompt recommended, and also supports tool-calling and image-based examples. OpenAI's fine-tuning API uses JSONL lines with an input, a preferred output and a non-preferred output. Rankings of more than two answers can be handled with Plackett-Luce models, according to the original paper. Before training, audit the pairs for systematic artifacts, such as the longer answer always being chosen, because the model will learn those patterns too.
Is DPO better than PPO?
DPO is not consistently better than PPO; the answer depends on the task, the data and how well PPO is tuned. The original DPO paper found DPO matched or beat PPO-based RLHF on sentiment control, summarization and single-turn dialogue. Later work disagreed: Ivison and colleagues found PPO outperformed DPO by up to 2.5% in math and 1.2% in general domains, and Xu and colleagues reported PPO surpassing other methods in all their testbeds. The same NeurIPS 2024 study found preference data quality mattered more than the algorithm. Fix the data before switching algorithms.
What are the main alternatives to DPO?
The main alternatives to DPO are PPO-based RLHF and a family of DPO-style losses that change what the model optimizes. IPO, from Azar and colleagues, works directly with pairwise preferences and swaps DPO's logit transform for an identity transform, which its authors argue avoids overfitting. KTO learns from a binary signal of whether a single output is desirable and matched or exceeded preference-based methods at scales from 1B to 30B parameters. SimPO drops the reference model and uses average log probability as the reward, outperforming DPO by up to 6.4 points on AlpacaEval 2 in its authors' tests. KTO is worth considering when labels are thumbs-up or thumbs-down rather than paired comparisons.
Is DPO cheaper than RLHF?
DPO is generally cheaper to compute than PPO-based RLHF, according to its authors, because it trains with a classification loss and needs no sampling from the model during fine-tuning. The DPO authors describe RLHF as training multiple language models and sampling in the loop, which incurs significant computational cost. SimPO goes further by removing the reference model, which its authors say makes it more compute and memory efficient. TRL also supports training PEFT adapters rather than the entire model. Compute is only part of the budget, though: DPO still needs a judged chosen and rejected response for every training example.
Does fine-tuning a model with DPO make you a provider under the EU AI Act?
Fine-tuning a general-purpose AI model, with DPO or any other method, can make a downstream entity the provider of a new model under the EU AI Act, but not automatically. The European Commission's AI Office Q&A says not every modification makes the modifier a provider. Its indicative criterion is training compute for the modification greater than a third of the original model's training compute. Where obligations apply, they are limited to the modification, for example by adding information on it to the existing technical documentation. The Q&A is not an official Commission position, so confirm your own status with counsel.
Sources
- Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, Chelsea Finn. Direct Preference Optimization: Your Language Model is Secretly a Reward Model. Updated July 29, 2024. Accessed November 10, 2026.
- Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, Chelsea Finn. Direct Preference Optimization:Your Language Model is Secretly a Reward Model. Updated July 29, 2024. Accessed November 10, 2026.
- Hugging Face. DPO Trainer. Accessed November 10, 2026.
- Shusheng Xu, Wei Fu, Jiaxuan Gao, Wenjie Ye, Weilin Liu, Zhiyu Mei, Guangju Wang, Chao Yu, Yi Wu. Is DPO Superior to PPO for LLM Alignment? A Comprehensive Study. ICML 2024. Updated October 10, 2024. Accessed November 10, 2026.
- Hamish Ivison, Yizhong Wang, Jiacheng Liu, Zeqiu Wu, Valentina Pyatkin, Nathan Lambert, Noah A. Smith, Yejin Choi, Hannaneh Hajishirzi. Unpacking DPO and PPO: Disentangling Best Practices for Learning from Preference Feedback. NeurIPS 2024. Updated October 7, 2024. Accessed November 10, 2026.
- Mohammad Gheshlaghi Azar, Mark Rowland, Bilal Piot, Daniel Guo, Daniele Calandriello, Michal Valko, Rémi Munos. A General Theoretical Paradigm to Understand Learning from Human Preferences. Updated November 22, 2023. Accessed November 10, 2026.
- Kawin Ethayarajh, Winnie Xu, Niklas Muennighoff, Dan Jurafsky, Douwe Kiela. KTO: Model Alignment as Prospect Theoretic Optimization. ICML 2024. Updated September 8, 2026. Accessed November 10, 2026.
- Yu Meng, Mengzhou Xia, Danqi Chen. SimPO: Simple Preference Optimization with a Reference-Free Reward. NeurIPS 2024. Updated November 1, 2024. Accessed November 10, 2026.
- Nathan Lambert et al. Tulu 3: Pushing Frontiers in Open Language Model Post-Training. Updated April 14, 2025. Accessed November 10, 2026.
- OpenAI. Direct preference optimization. Accessed November 10, 2026.
- European Commission, AI Office. General-Purpose AI Models in the AI Act, Questions & Answers. Accessed November 10, 2026.




