Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, Chelsea Finn
NeurIPS 2023 · arXiv 2305.18290 · Read the paper ↗
Align a model to human preferences with a simple classification loss, no separate reward model or RL loop.
4 steps + 1 beyond the paper · 0 solved
Start: Preference accuracy →- 1Preference accuracyScore chosen versus rejected pairs.Score a reward model by pairwise preference accuracy
- 2DPO lossThe loss from policy and reference log-probabilities.Compute the DPO loss from log-probabilities
- 3DPO from logitsCompute sequence log-probs from raw logits first.Compute the DPO loss directly from policy and reference logits
- 4DPO gradientSee which pairs get the biggest push.Compute the DPO gradient weights by hand
Beyond the paper
Follow-up ideas that build on this paper. Each blurb names the follow-up work.
More transformers and llms papers
- Attention Is All You Need 2017
- LoRA: Low-Rank Adaptation of Large Language Models 2021
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 2022
- RoFormer: Enhanced Transformer with Rotary Position Embedding 2021
- Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity 2021
- Fast Inference from Transformers via Speculative Decoding 2022
- LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale 2022