# Direct Preference Optimization (DPO)

- **Canonical URL:** https://getaimath.com/dictionary/direct-preference-optimization-dpo/
- **Topics:** [Model Training & Optimization](https://getaimath.com/dictionary/category/model-training-and-optimization/)
- **Last updated:** 2026-11-25

## What is Direct Preference Optimization (DPO)?

**In one sentence:** DPO is a simpler way to do preference tuning that trains directly on "better vs worse" answer pairs, without a separate reward model.

RLHF needs to train a reward model and then run reinforcement learning, which is complicated. DPO skips those steps and uses a clever formula to push the model toward preferred answers and away from rejected ones, all in one training process.

![How an AI Goes to School: 3 Steps from Bookworm to Assistant — Simple 3-step cartoon showing an AI 1. Reading the whole library (Pre-training) to become a Bookworm, 2. Practicing polite Q&A with a teacher (Fine-tuning), and 3. Getting thumbs-up and thumbs-down feedback from humans (RLHF).](https://getaimath.com/diagrams/model-training-and-optimization.png)
*Napkin Diagram (Model Training & Optimization): First the model reads the internet to learn facts; next it practices answering questions; finally humans coach its manners.*

## What is an example of Direct Preference Optimization (DPO)?

Given a prompt with a "chosen" polite answer and a "rejected" rude one, DPO increases the chance of the polite one.

## Why does Direct Preference Optimization (DPO) matter?

DPO made preference tuning cheaper and easier, so many open models use it.

## Direct Preference Optimization (DPO) vs. Reinforcement Learning from Human Feedback (RLHF)

Both align models to human preferences using 'chosen vs. rejected' answer pairs, but RLHF trains a separate reward model plus RL loop while DPO optimizes the language model directly.

| Dimension | Direct Preference Optimization (DPO) | [Reinforcement Learning from Human Feedback (RLHF)](https://getaimath.com/dictionary/reinforcement-learning-from-human-feedback-rlhf/) |
| --- | --- | --- |
| Separate reward model? | No, folded directly into the loss math | Yes, trained first then used with PPO/GRPO |
| Engineering complexity | Simpler, stable supervised-style loop | High (multiple models in memory at once) |
| Strength | Fast, cheap offline preference tuning | Can explore new high-reward behaviors online |

## Related Concepts

- [Reinforcement Learning from Human Feedback (RLHF)](https://getaimath.com/dictionary/reinforcement-learning-from-human-feedback-rlhf/): RLHF is a way to improve a chatbot by having people rate its answers and then training it to give the kinds of answers people prefer.
- [Proximal Policy Optimization (PPO)](https://getaimath.com/dictionary/proximal-policy-optimization-ppo/): PPO is a reinforcement learning method that improves a model in small, careful steps so it does not change too much at once.
- [Preference Tuning](https://getaimath.com/dictionary/preference-tuning/): Preference tuning trains a model to give answers that people prefer, using comparisons between better and worse responses.
- [Knowledge Distillation](https://getaimath.com/dictionary/knowledge-distillation/): Knowledge distillation trains a small "student" model to copy the behavior of a big "teacher" model.
- [Instruction Tuning](https://getaimath.com/dictionary/instruction-tuning/): Instruction tuning is fine-tuning a model on many examples of instructions and correct responses, so it learns to follow directions.
- [Model Compression](https://getaimath.com/dictionary/model-compression/): Model compression is any technique that makes an AI model smaller or faster while keeping most of its quality.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/direct-preference-optimization-dpo/)
