# DPO (2023)

> RLHF without the reinforcement learning, as one simple loss on pairs of preferred and rejected answers.

Page: https://mralbu.github.io/ai-datasets/p/dpo

## Key facts

- Title: Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Authors: Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, Chelsea Finn
- Venue: NeurIPS 2023
- Category: LLMs
- Paper: https://www.alphaxiv.org/abs/2305.18290

## Why it matters

PPO-based RLHF needs several models in memory and is notoriously hard to tune. DPO made preference tuning something any lab could do on a modest budget, and most open models since have been aligned with it or one of its many variants.

## The idea

The RLHF objective has a closed-form optimal policy, which means the reward can be written in terms of the model itself. Substituting it gives a classification-style loss on preference pairs: raise the likelihood of the chosen answer relative to the rejected one, compared with a frozen reference model. No reward model, no sampling during training.

## The result

Matched or beat PPO-based RLHF on sentiment control with IMDb reviews, summarization, and single-turn dialogue on Anthropic's HH data, while being much simpler and more stable to train.

## The data

- [Anthropic HH-RLHF (2022)](https://mralbu.github.io/ai-datasets/d/hh-rlhf.md): 170k pairs of assistant replies to the same conversation, and which one a person preferred.
- [IMDB Large Movie Review (2011)](https://mralbu.github.io/ai-datasets/d/imdb.md): 50,000 movie reviews from IMDb, labeled positive or negative.

## Builds on

- [InstructGPT (2022)](https://mralbu.github.io/ai-datasets/p/instructgpt.md)

## Part of

- [Aligning language models](https://mralbu.github.io/ai-datasets/t/llm-alignment.md) (step 4 of 4)
