Deriving the Gradient of the DPO Objective

This section provides the gradient derivation for the DPO objective. It also includes proofs for Lemma 1 and Lemma 2, which demonstrate that reward functions from the same equivalence class induce the same preference distribution and optimal policy.


This content originally appeared on HackerNoon and was authored by Writings, Papers and Blogs on Text Models

:::info Authors:

(1) Rafael Rafailo, Stanford University and Equal contribution; more junior authors listed earlier;

(2) Archit Sharma, Stanford University and Equal contribution; more junior authors listed earlier;

(3) Eric Mitchel, Stanford University and Equal contribution; more junior authors listed earlier;

(4) Stefano Ermon, CZ Biohub;

(5) Christopher D. Manning, Stanford University;

(6) Chelsea Finn, Stanford University.

:::

Abstract and 1. Introduction

2 Related Work

3 Preliminaries

4 Direct Preference Optimization

5 Theoretical Analysis of DPO

6 Experiments

7 Discussion, Acknowledgements, and References

Author Contributions

\ A Mathematical Derivations

A.1 Deriving the Optimum of the KL-Constrained Reward Maximization Objective

A.2 Deriving the DPO Objective Under the Bradley-Terry Model

A.3 Deriving the DPO Objective Under the Plackett-Luce Model

A.4 Deriving the Gradient of the DPO Objective and A.5 Proof of Lemma 1 and 2

A.6 Proof of Theorem 1

\ B DPO Implementation Details and Hyperparameters

\ C Further Details on the Experimental Set-Up and C.1 IMDb Sentiment Experiment and Baseline Details

C.2 GPT-4 prompts for computing summarization and dialogue win rates

C.3 Unlikelihood baseline

\ D Additional Empirical Results

D.1 Performance of Best of N baseline for Various N and D.2 Sample Responses and GPT-4 Judgments

D.3 Human study details

A.4 Deriving the Gradient of the DPO Objective

In this section we derive the gradient of the DPO objective:

\

\ We can rewrite the RHS of Equation 21 as

\

\ Using the properties of sigmoid function σ ′ (x) = σ(x)(1 − σ(x)) and σ(−x) = 1 − σ(x), we obtain the final gradient

\

A.5 Proof of Lemma 1 and 2

In this section, we will prove the two lemmas from Section 5.

\ Lemma 1 Restated. Under the Plackett-Luce preference framework, and in particular the Bradley-Terry framework, two reward functions from the same equivalence class induce the same preference distribution.

\

\ which completes the proof.

\ Lemma 2 Restated. Two reward functions from the same equivalence class induce the same optimal policy under the constrained RL problem.

\

\ which completes the proof.

\

:::info This paper is available on arxiv under CC BY-NC-ND 4.0 DEED license.

:::

\


This content originally appeared on HackerNoon and was authored by Writings, Papers and Blogs on Text Models


Print Share Comment Cite Upload Translate Updates
APA

Writings, Papers and Blogs on Text Models | Sciencx (2024-08-26T20:00:25+00:00) Deriving the Gradient of the DPO Objective. Retrieved from https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/

MLA
" » Deriving the Gradient of the DPO Objective." Writings, Papers and Blogs on Text Models | Sciencx - Monday August 26, 2024, https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/
HARVARD
Writings, Papers and Blogs on Text Models | Sciencx Monday August 26, 2024 » Deriving the Gradient of the DPO Objective., viewed ,<https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/>
VANCOUVER
Writings, Papers and Blogs on Text Models | Sciencx - » Deriving the Gradient of the DPO Objective. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/
CHICAGO
" » Deriving the Gradient of the DPO Objective." Writings, Papers and Blogs on Text Models | Sciencx - Accessed . https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/
IEEE
" » Deriving the Gradient of the DPO Objective." Writings, Papers and Blogs on Text Models | Sciencx [Online]. Available: https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/. [Accessed: ]
rf:citation
» Deriving the Gradient of the DPO Objective | Writings, Papers and Blogs on Text Models | Sciencx | https://www.scien.cx/2024/08/26/deriving-the-gradient-of-the-dpo-objective/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.