papers / dpo2023
Next task →
Research Papers/Post-training and alignment/Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Post-training and alignment · #3 · seminal

Direct Preference Optimization: Your Language Model is Secretly a Reward Model

Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning, Stefano Ermon, Chelsea Finn · 2023 · NeurIPS
reproduction difficulty: mediumAlignmentNLPOptimization

1. Research problem

RLHF for language models requires training a separate reward model and running an unstable online RL loop with repeated sampling.

2. Motivation

The authors wanted to optimize the same preference-based objective directly with a simple supervised loss.

3. Previous approaches

InstructGPT-style RLHF used reward models plus PPO; earlier preference-learning methods optimized policies through RL rather than exploiting a closed-form reparameterization.

4. Core contribution

Derived a change of variables showing the optimal policy under a KL-constrained reward objective can be expressed in terms of the policy itself, yielding a binary classification loss on preference pairs called DPO.

5. Mathematical formulation

Loss = -log sigma(beta*(log pi(y_w|x)/pi_ref(y_w|x) - log pi(y_l|x)/pi_ref(y_l|x))), using preferred and dispreferred responses without an explicit reward model.

6. Methodology

Derive the implicit reward from the optimal-policy equation, prove equivalence to the RLHF objective, and validate on preference datasets.

7. Architecture

Standard decoder-only policy plus a frozen reference model; no value network or reward model.

8. Experimental setup

Sentiment generation, summarization, and dialogue tasks with human or synthetic preference data.

9. Datasets

IMDb sentiment completions, Reddit/TL;DR summarization preferences, Anthropic HH dialogue data.

10. Results

Matched or exceeded PPO-based RLHF on several tasks while being substantially simpler and more stable to train.

11. Limitations

Offline preference data can be distribution-shifted from the learned policy; sensitive to beta and reference model; may overfit fixed pairs.

12. Critical analysis

Elegant theoretical simplification of RLHF that lowered the engineering barrier to preference alignment, though it inherits offline RL limitations.

13. Implementation tasks

  • 1.Implement the DPO loss and compare gradients with a two-stage reward-model plus PPO setup on a small dataset.
  • 2.Ablate beta and reference-model choice on a preference benchmark.
  • 3.Curate a small synthetic preference dataset and fine-tune a small language model with DPO.

14. Follow-up work

  • 1.Training language models to follow instructions with human feedback (Ouyang et al., 2022)
  • 2.Identity-Preference Optimization (IPO) and other offline preference objectives

15. Open research questions

  • 1.Does DPO's implicit reward generalize as well as an explicit reward model under distribution shift?
  • 2.How should online preference data be incorporated into DPO?
16. Reproduce it. Record the hypothesis, configuration, dataset, metrics and discrepancies in the Experiment Tracker. A reproduction is not complete until you have run the experiments, performed at least one ablation and documented the differences from the reported numbers.