Averaging log-likelihoods in direct alignment

Nathan Grinsztajn, Yannis Flet-Berliac, Mohammad Gheshlaghi Azar, Florian Strub, Bill Wu +6 more
6/27/2024
cs.LG

No confident code implementation found for this paper.

Abstract

To better align Large Language Models (LLMs) with human judgment, Reinforcement Learning from Human Feedback (RLHF) learns a reward model and then optimizes it using regularized RL. Recently, direct alignment methods were introduced to learn such a fine-tuned model directly from a preference dataset without computing a proxy reward function. These methods are built upon contrastive losses involving the log-likelihood of (dis)preferred completions according to the trained model. However, completions have various lengths, and the log-likelihood is not length-invariant. On the other side, the cross-entropy loss used in supervised training is length-invariant, as batches are typically averaged token-wise. To reconcile these approaches, we introduce a principled approach for making direct alignment length-invariant. Formally, we introduce a new averaging operator, to be composed with the optimality operator giving the best policy for the underlying RL problem. It translates into averaging the log-likelihood within the loss. We empirically study the effect of such averaging, observing a trade-off between the length of generations and their scores.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{grinsztajn2024averaging,
  title  = {Averaging log-likelihoods in direct alignment},
  author = {Nathan Grinsztajn and Yannis Flet-Berliac and Mohammad Gheshlaghi Azar and Florian Strub and Bill Wu and Eugene Choi and Chris Cremer and Arash Ahmadian and Yash Chandak and Olivier Pietquin and Matthieu Geist},
  year   = {2024},
  eprint = {2406.19188},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.19188v1}
}

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/2406.19188.svg)](https://codeofpaper.com/paper/2406.19188)

Discussion