Contrastive Policy Gradient: Aligning LLMs on sequence-level scores in a supervised-friendly fashion

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Flet-Berliac, Yannis, Grinsztajn, Nathan, Strub, Florian, Wu, Bill, Choi, Eugene, Cremer, Chris, Ahmadian, Arash, Chandak, Yash, Azar, Mohammad Gheshlaghi, Pietquin, Olivier, Geist, Matthieu
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866912190095687680
author Flet-Berliac, Yannis
Grinsztajn, Nathan
Strub, Florian
Wu, Bill
Choi, Eugene
Cremer, Chris
Ahmadian, Arash
Chandak, Yash
Azar, Mohammad Gheshlaghi
Pietquin, Olivier
Geist, Matthieu
author_facet Flet-Berliac, Yannis
Grinsztajn, Nathan
Strub, Florian
Wu, Bill
Choi, Eugene
Cremer, Chris
Ahmadian, Arash
Chandak, Yash
Azar, Mohammad Gheshlaghi
Pietquin, Olivier
Geist, Matthieu
contents Reinforcement Learning (RL) has been used to finetune Large Language Models (LLMs) using a reward model trained from preference data, to better align with human judgment. The recently introduced direct alignment methods, which are often simpler, more stable, and computationally lighter, can more directly achieve this. However, these approaches cannot optimize arbitrary rewards, and the preference-based ones are not the only rewards of interest for LLMs (eg., unit tests for code generation or textual entailment for summarization, among others). RL-finetuning is usually done with a variation of policy gradient, which calls for on-policy or near-on-policy samples, requiring costly generations. We introduce Contrastive Policy Gradient, or CoPG, a simple and mathematically principled new RL algorithm that can estimate the optimal policy even from off-policy data. It can be seen as an off-policy policy gradient approach that does not rely on important sampling techniques and highlights the importance of using (the right) state baseline. We show this approach to generalize the direct alignment method IPO (identity preference optimization) and classic policy gradient. We experiment with the proposed CoPG on a toy bandit problem to illustrate its properties, as well as for finetuning LLMs on a summarization task, using a learned reward function considered as ground truth for the purpose of the experiments.
format Preprint
id arxiv_https___arxiv_org_abs_2406_19185
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Contrastive Policy Gradient: Aligning LLMs on sequence-level scores in a supervised-friendly fashion
Flet-Berliac, Yannis
Grinsztajn, Nathan
Strub, Florian
Wu, Bill
Choi, Eugene
Cremer, Chris
Ahmadian, Arash
Chandak, Yash
Azar, Mohammad Gheshlaghi
Pietquin, Olivier
Geist, Matthieu
Machine Learning
Reinforcement Learning (RL) has been used to finetune Large Language Models (LLMs) using a reward model trained from preference data, to better align with human judgment. The recently introduced direct alignment methods, which are often simpler, more stable, and computationally lighter, can more directly achieve this. However, these approaches cannot optimize arbitrary rewards, and the preference-based ones are not the only rewards of interest for LLMs (eg., unit tests for code generation or textual entailment for summarization, among others). RL-finetuning is usually done with a variation of policy gradient, which calls for on-policy or near-on-policy samples, requiring costly generations. We introduce Contrastive Policy Gradient, or CoPG, a simple and mathematically principled new RL algorithm that can estimate the optimal policy even from off-policy data. It can be seen as an off-policy policy gradient approach that does not rely on important sampling techniques and highlights the importance of using (the right) state baseline. We show this approach to generalize the direct alignment method IPO (identity preference optimization) and classic policy gradient. We experiment with the proposed CoPG on a toy bandit problem to illustrate its properties, as well as for finetuning LLMs on a summarization task, using a learned reward function considered as ground truth for the purpose of the experiments.
title Contrastive Policy Gradient: Aligning LLMs on sequence-level scores in a supervised-friendly fashion
topic Machine Learning
url https://arxiv.org/abs/2406.19185