AI GLOSSARY · AI CONCEPTS
Direct preference optimization (DPO)
Definition
Direct preference optimization (DPO) is a method for tuning a language model on pairs of answers with a preferred and a dispreferred response, using a simple classification-style loss instead of a separate reward model and reinforcement learning.
Also called: DPO, DPO training, direct preference optimisation.
In plain language
DPO trains a model from pairs labelled as preferred and dispreferred; people or another process can supply the labels. You collect many examples: one question, a better answer and a worse answer. Training then pushes the model toward the better kind and away from the worse kind, like a writing coach who only ever says 'this draft, not that one'. It skips the extra scoring program that RLHF builds, so the setup is simpler. The limits are the same as for any preference training: the preference labels can be mistaken or reflect the biases of the process that supplied them, and the preference data still has to be collected and checked. It does not make a model correct.
Technical definition
The DPO paper (arXiv 2305.18290, first submitted 29 May 2023) introduces a new parameterization of the reward model in RLHF that allows the optimal policy to be extracted in closed form, so the problem is solved with a simple classification loss, without sampling from the model during fine-tuning. Hugging Face's TRL documentation describes training on a preference dataset where each example has a prompt, a chosen and a rejected completion. The objective widens the margin between the log-likelihoods of preferred and dispreferred completions relative to a reference model, without an explicit reward model. The beta parameter sets regularization strength relative to the reference policy in the underlying KL-regularized objective; it is not a hard maximum on model movement.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Skill by Skill Almanac · Illustrative, not executed
llm-eval-test-sets 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- An eval dataset for an LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.
- Why it exercises the concept
- The catalogue has no training skills. What it does have is the check you need after any tuning: a graded test set that was not used for training, so you can see whether behaviour changed.
Skill by Skill Almanac · Illustrative, not executed
reproducibility-package-checklist 38/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A check of whether a project folder has what a stranger needs to rerun an analysis, including data provenance and licence, pinned software versions and random seeds.
- Why it exercises the concept
- A preference-tuning run depends on its data, library versions and seeds. The skill is written for research analyses, not model training, but the same missing pieces make a tuning run impossible to repeat.
Guide · Illustrative, not executed
What Is an LLM? The Facts Agent Users Need
- What you see
- The current guide contrasts the original Transformer decoder’s autoregressive generation with BERT’s masked pretraining, and distinguishes runtime context from learned parameters.
- Why it exercises the concept
- It supplies background on training objectives and runtime behavior, including worked objective examples. It is not a DPO training tutorial or evidence that a tuning run was executed.
How it shows up when you use agents
DPO happens before you meet the model. The DPO paper describes tuning a language model with preference pairs, and TRL, a Hugging Face library, includes a trainer for it. If you run a self-hosted model or pick an open model from a hub, its description may say it was tuned with DPO. That tells you how it was shaped, not how well it works on your task.
If you tune a model yourself, the quality of the chosen and rejected pairs decides most of the result. Pairs that differ in length or style rather than quality can teach the wrong lesson. Your own graded cases, kept apart from the training pairs, are a good way to see whether the tuning helped. Compare against the untouched model before you adopt the new one.
What breaks when DPO is misunderstood: treating it as a replacement for evaluation, or assuming it removes the need for human judgement. People still decide which answer is better, and the method does not say whether that judgement was good. See RLHF for the older recipe it simplifies and fine-tuning for the wider family.
Common confusions
- DPO versus RLHF. RLHF fits a reward model and then runs reinforcement learning. DPO uses preference pairs directly with a classification-style loss.
- DPO versus supervised fine-tuning. Supervised tuning learns from single example answers. DPO learns from pairs where one answer is preferred.
- DPO versus prompting. Prompting changes the input. DPO changes the model's weights.
- Myth. DPO needs no human preferences. It needs preference data, which people or another process must supply.
Related terms
Terms that mention Direct preference optimization (DPO)
2 terms mention this one
More in AI concepts
Sources
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model, arXiv (Rafailov et al.) (accessed 2026-11-24)
- DPO Trainer, Hugging Face (TRL documentation) (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft); OpenAI Codex (bounded factual repairs); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .
Change log (5)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : First version.
- : Verifier pass: Softened unsourced claims and removed the comparison alias.
- : Bounded source repairs: Allowed human or other preference-label provenance; described beta as regularization strength rather than hard movement bound; corrected guide scope and training coverage. Pending independent re-review.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.