Transformers and LLMs · 2023

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 →
  1. 1Preference accuracyScore chosen versus rejected pairs.Score a reward model by pairwise preference accuracyEasy
  2. 2DPO lossThe loss from policy and reference log-probabilities.Compute the DPO loss from log-probabilitiesMediumPro
  3. 3DPO from logitsCompute sequence log-probs from raw logits first.Compute the DPO loss directly from policy and reference logitsHardPro
  4. 4DPO gradientSee which pairs get the biggest push.Compute the DPO gradient weights by handHardPro

Beyond the paper

Follow-up ideas that build on this paper. Each blurb names the follow-up work.

  1. 5Conservative DPOExtension: label smoothing for noisy preferences.Add label smoothing to the DPO loss (conservative DPO)Easy

More transformers and llms papers