Back to Feed
Training & Fine-Tuning

Direct Preference Optimization for Language Models

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

Listen to the summary

Uses a voice available on your device

Audio options
On this page

Key Takeaways

  • Standard reinforcement learning from human feedback involves complex pipelines with supervised fine-tuning, reward modeling, and reinforcement learning optimization like PPO.
  • Direct Preference Optimization bypasses explicit reward modeling and reinforcement learning by directly optimizing the language model policy using a binary cross-entropy loss function.
  • Direct Preference Optimization exceeds PPO-based reinforcement learning from human feedback in controlling sentiment generation.
  • Direct Preference Optimization achieves a 61 percent win rate at a temperature of 0.0 on TL;DR summarization using GPT-4 evaluation, exceeding PPO's 57 percent win rate at its optimal sampling temperature of 0.0.
  • In human evaluations comparing Direct Preference Optimization and PPO on summarization, Direct Preference Optimization samples at temperature 0.25 were preferred 58 percent of the times over PPO samples at temperature 0.

Summary & Methodology Analysis

The paper addresses the complexity and instability of the standard reinforcement learning from human feedback pipeline, which is typically used for fine-tuning large language models to align with human preferences. Standard reinforcement learning from human feedback requires a three-step process consisting of supervised fine-tuning of a pre-trained language model, preference sampling and reward learning by fitting a reward model to human preferences, and reinforcement learning optimization such as PPO to maximize the learned reward under a KL-divergence constraint. This traditional pipeline can be complex and unstable in practice.

To solve this, the authors introduce Direct Preference Optimization. The novel contribution involves sampling completions and collecting human preferences to construct an offline preference dataset, and directly optimizing the language model policy using a simple binary cross-entropy loss function derived via a change-of-variables reparameterization of the reward function in closed form. This approach entirely bypasses explicit reward modeling and reinforcement learning. The evaluation uses models and datasets including GPT-2-large, GPT-J, Pythia-2.8B, the IMDb dataset, the Reddit TL;DR summarization dataset, the Anthropic Helpful and Harmless dialogue dataset, and the CNN/DailyMail dataset.

Despite the strong results, the paper outlines several limitations that require future work. Specifically, future work is needed to study how Direct Preference Optimization policies generalize out of distribution compared with learning from an explicit reward function. Additionally, future work needs to explore how reward over-optimization manifests in the direct preference optimization setting. While models up to 6B parameters were evaluated, exploring the scaling of Direct Preference Optimization to state-of-the-art models orders of magnitude larger is also left for future work.

Interactive System Flowchart

Click diagram to expand and zoom

Cross-Examination & FAQs

A deeper dive clarifying mechanics, constraints, and baseline evaluations.

Q1. What problem does the paper address?

The paper addresses the complexity and instability of the standard reinforcement learning from human feedback pipeline for fine-tuning large language models to align with human preferences.

Q2. What is the main alternative method introduced in the paper?

The paper introduces Direct Preference Optimization, which bypasses explicit reward modeling and reinforcement learning.

Q3. How does Direct Preference Optimization perform compared to the standard pipeline?

Direct Preference Optimization exceeds PPO-based reinforcement learning from human feedback in controlling sentiment generation, achieves higher win rates on summarization, and is preferred in human evaluations.

Q4. What are the steps of standard reinforcement learning from human feedback?

Standard reinforcement learning from human feedback consists of supervised fine-tuning of a pre-trained language model, preference sampling and reward learning by fitting a reward model to human preferences, and reinforcement learning optimization such as PPO to maximize the learned reward under a KL-divergence constraint.

Q5. What are the steps of Direct Preference Optimization?

Direct Preference Optimization involves sampling completions and collecting human preferences to construct an offline preference dataset, and directly optimizing the language model policy using a simple binary cross-entropy loss function derived via a change-of-variables reparameterization of the reward function in closed form.

Q6. What models and datasets were evaluated in the research?

The paper evaluated GPT-2-large, GPT-J, Pythia-2.8B, the IMDb dataset, the Reddit TL;DR summarization dataset, the Anthropic Helpful and Harmless dialogue dataset, and the CNN/DailyMail dataset.

Q7. What specific win rates were achieved on TL;DR summarization using GPT-4 evaluation?

Direct Preference Optimization achieves a 61 percent win rate at a temperature of 0.0, exceeding PPO's 57 percent win rate at its optimal sampling temperature of 0.0.

Q8. What were the results of human evaluations comparing Direct Preference Optimization and PPO on summarization?

Direct Preference Optimization samples at temperature 0.25 were preferred 58 percent of the times over PPO samples at temperature 0.

Q9. What future work or limitations are discussed in the paper?

Future work is needed to study how Direct Preference Optimization policies generalize out of distribution, how reward over-optimization manifests in the direct preference optimization setting, and how the method scales to state-of-the-art models orders of magnitude larger than the evaluated models up to 6B parameters.