Reproduce “Direct Preference Optimization: Your Language Model is Secretly a Reward Model” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, Chelsea Finn

DPO trains language models directly on preferred and dispreferred responses, using probabilities relative to a fixed reference policy as an implicit reward. Under a Bradley–Terry preference model, its classification loss targets the same KL-regularized objective as RLHF without a separate reward model or reinforcement-learning loop. On Reddit TL;DR summaries, DPO achieved approximately 61% versus PPO’s 57% GPT-4 win rate under reported conditions.

Key insights

  • The optimal policy for a KL-constrained reward maximization objective can be expressed in closed form, directly relating the policy, a reference policy, and the reward function.
  • By reparameterizing the reward function, the problem of learning from human preferences can be recast as a simple binary cross-entropy loss that directly optimizes the language model policy.
  • This direct optimization method reveals that the language model implicitly acts as a reward model, effectively bypassing the need for explicit reward modeling and complex reinforcement learning steps like PPO.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.