AIWiki
Malaysia
Back to all articles
AI FoundationsDPORLHFalignment

Direct Preference Optimization

3 min readUpdated November 2026
Direct Preference Optimization
Type
Model alignment / fine-tuning method
Introduced
2023
Developed by
Stanford University
Paper
arXiv:2305.18290
Replaces
Reward model plus PPO stage of RLHF
Related
RLHF, Reward modeling, KTO, SimPO, IPO
Direct Preference Optimization (DPO) is a training objective that aligns a language model with human preferences without training a separate reward model or running a reinforcement-learning loop. Given pairs of outputs that people preferred over one another, it updates the model directly with a binary cross-entropy loss, and is widely used as a lighter alternative to the reinforcement learning from human feedback (RLHF) pipeline.[1]

Background

The standard RLHF recipe has three stages: supervised fine-tuning on demonstrations, training a reward model on human preference judgments, and then optimising the policy against that reward with an algorithm such as PPO while penalising drift from the original model. The middle and third stages are unstable and resource-intensive: reward models can be gamed, and online sampling during reinforcement learning is expensive.[1][2]

The 2023 DPO paper showed that, under the standard KL-constrained reward maximisation formulation, the optimal policy can be written as an explicit function of the reward. Inverting that relationship lets the reward term be eliminated entirely: the objective becomes a logistic loss over the model's log-probability ratio between a preferred response and a rejected response, with a coefficient controlling how far the model may move from its reference checkpoint.[1]

Key Concepts

  • Preference pairs. Training data consists of prompts with a chosen and a rejected completion, typically gathered from human annotators or from AI feedback pipelines.
  • Implicit reward. The reward is not a separate network; it is read off from the policy's own log-probabilities, which is why no reward-model training step is needed.
  • KL-style regularisation. The temperature-like coefficient keeps the tuned model near the reference model, trading alignment strength against degeneration into repetitive or overconfident outputs.
  • Static, offline data. DPO trains on a fixed dataset rather than sampling from the live model, which makes it stable and cheap but means the data must already cover the behaviours being encouraged.
  • A family of variants. Later methods adjust the same machinery: IPO targets overfitting to deterministic preferences, KTO needs only per-response labels of desirable or undesirable rather than pairs, and SimPO drops the reference model and uses length-normalised scores.[3][4]

Applications

DPO and its variants are standard practice for turning a base checkpoint into an assistant-style model: instruction tuning, tone and style control, refusal behaviour, and safety steering are all commonly trained this way. It is also used for multimodal and speech models, and as a quick alignment pass on domain-specific fine-tunes where a full RLHF stack would be disproportionate.[1][3]

>See Also

๐Ÿ‡ฒ๐Ÿ‡พMalaysian Context

๐Ÿ‡ฒ๐Ÿ‡พ Relevance to Malaysia: DPO lowers the cost of adapting a model to local requirements, which matters for teams building on Malaysian language models such as ILMU and MallAM. A few thousand carefully curated preference pairs in Bahasa Melayu โ€” covering register, cultural references and appropriate refusals โ€” are within reach of a small local team with modest GPU resources, whereas a full reinforcement-learning pipeline generally is not. Preference data should be documented and reproducible where NAIO and MDEC responsible-AI guidance expects model behaviour to be traceable, and because preference pairs are often real user or employee text, they fall within the Personal Data Protection Act when they contain personal data.

References

  1. โ†‘Rafailov, R. et al. Direct Preference Optimization: Your Language Model is Secretly a Reward Model. NeurIPS 2023; arXiv:2305.18290. https://arxiv.org/abs/2305.18290
  2. โ†‘Ouyang, L. et al. Training language models to follow instructions with human feedback. arXiv:2203.02155. https://arxiv.org/abs/2203.02155
  3. โ†‘Ethayarajh, K. et al. KTO: Model Alignment as Prospect Theoretic Optimization. arXiv:2402.01306. https://arxiv.org/abs/2402.01306
  4. โ†‘Meng, Y. et al. SimPO: Simple Preference Optimization with a Reference-Free Reward. arXiv:2405.14734. https://arxiv.org/abs/2405.14734