Direct Preference Optimization with an Offset

Afra Amini, Tim Vieira, Ryan Cotterell
2/16/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: rycolab/odpo (21 stars, Apache-2.0, last commit 2025-02-17).

Abstract

Direct preference optimization (DPO) is a successful fine-tuning strategy for aligning large language models with human preferences without the need to train a reward model or employ reinforcement learning. DPO, as originally formulated, relies on binary preference data and fine-tunes a language model to increase the likelihood of a preferred response over a dispreferred response. However, not all preference pairs are equal. Sometimes, the preferred response is only slightly better than the dispreferred one. In other cases, the preference is much stronger. For instance, if a response contains harmful or toxic content, the annotator will have a strong preference for that response. In this paper, we propose a generalization of DPO, termed DPO with an offset (ODPO), that does not treat every preference pair equally during fine-tuning. Intuitively, ODPO requires the difference between the likelihood of the preferred and dispreferred response to be greater than an offset value. The offset is determined based on the extent to which one response is preferred over another. Our experiments on various tasks suggest that ODPO significantly outperforms DPO in aligning language models, especially when the number of preference pairs is limited.

View on arXivView PDF

Code Implementations(1)

rycolab/odpoCommunity100%
Apache-2.0

This repository contains code for the paper Direct Preference Optimization with an Offset (ODPO).

212PythonMar 24, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{amini2024direct,
  title  = {Direct Preference Optimization with an Offset},
  author = {Afra Amini and Tim Vieira and Ryan Cotterell},
  year   = {2024},
  eprint = {2402.10571},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.10571v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.10571.svg)](https://codeofpaper.com/paper/2402.10571)

Discussion