Offline Regularised Reinforcement Learning for Large Language Models Alignment

Pierre Harvey Richemond, Yunhao Tang, Daniel Guo, Daniele Calandriello, Mohammad Gheshlaghi Azar, Rafael Rafailov, Bernardo Ávila Pires, Eugene Tarassov, Lucas Spangher, Will Ellsworth, Aliaksei Severyn, Jonathan Mallinson, Lior Shani, Gil Shamir, Rishabh Joshi, Tianqi Liu, Rémi Munos, Bilal PiotarXiv 2024

Abstract

The dominant framework for alignment of large language models (LLM), whether through reinforcement learning from human feedback or direct preference optimisation, is to learn from preference data. This involves building datasets where each element is a quadruplet composed of a prompt, two independent responses (completions of the prompt) and a human preference between the two independent responses, yielding a preferred and a dis-preferred response. Such data is typically scarce and expensive to collect. On the other hand, single-trajectory datasets where each element is a triplet composed of a prompt, a response and a human feedback is naturally more abundant. Consequently, in this work, we propose DRO, or Direct Reward Optimisation, as a framework and associated algorithms that do not require pairwise preferences. DRO uses a simple mean-squared objective that can be implemented in various ways. We validate our findings empirically, using T5 encoder-decoder language models, and show DRO's performance over selected baselines such as Kahneman-Tversky Optimization (KTO). Thus, we confirm that DRO is a simple and empirically compelling method for single-trajectory policy optimisation.

Introduction

Aligning Large Language Models (LLMs) with human values typically relies on Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimisation (DPO). These methods require pairwise preference data—quadruplets consisting of a prompt, two responses, and a human ranking. However, such data is expensive and scarce. In contrast, "single-trajectory" data (prompt, response, and a single feedback score like a thumbs-up) is naturally abundant in real-world logs but mathematically challenging to optimize without introducing bias.

Direct Reward Optimisation (DRO)

We introduce Direct Reward Optimisation (DRO), specifically the DRO-V variant, to address the limitations of single-trajectory alignment. Unlike DPO, which cancels out the partition function through pairwise comparison, DRO-V explicitly models it using a parameterized value function ($V$).

Technical Framework

  • MSE Objective: DRO transforms the KL-regularized policy optimization problem into a simple mean-squared error (MSE) loss.
  • Value Function Integration: By learning a prompt-specific value function, DRO-V ensures the policy update remains mathematically sound in the absence of a second comparison response. Standard methods like KTO often assume a constant partition function, but DRO-V proves that prompt-specific modeling is critical.
  • Offline Learning: The framework operates on static datasets, eliminating the need for expensive on-policy sampling during training.
  • Regularisation: The authors show that in the off-policy setting, an $\ell_2$ penalty on log-policy ratios is the natural extension of standard KL-regularization.

Experimental Results

We evaluated DRO-V using T5-Large (770M) and T5-XL (3B) models on the UltraFeedback dataset. Performance was measured via side-by-side win rates judged by PaLM 2.

Side-by-side win rates for the T5-Large model, comparing DRO-V against SFT and KTO baselines.

As shown in the results for the T5-Large model, DRO-V significantly outperforms the Supervised Fine-Tuning (SFT) baseline with a 78.9% win rate and exceeds the performance of Kahneman-Tversky Optimization (KTO) with a 63.4% win rate. Similar trends were observed for the T5-XL model, where DRO-V achieved an 81.5% win rate against SFT and a 57.5% win rate against KTO.

Robustness and Hyperparameter Sensitivity

A key advantage of DRO-V is its stability. The authors found that the model is remarkably robust to variations in the learning rate for the value function, suggesting it is easier to tune than traditional RLHF.

Win rate vs SFT across different learning rate values for the DRO-V objective, demonstrating stability across orders of magnitude.

The empirical data suggests that DRO-V maintains high performance even when the learning rate for the value function is varied by an order of magnitude. Furthermore, the study revealed that maintaining separate networks for the policy and value functions is superior to parameter sharing, which is often standard in other RL contexts.

Conclusion

DRO-V provides a simple, theoretically grounded, and empirically superior method for LLM alignment using single-trajectory feedback. By explicitly modeling the value function, it overcomes the biases inherent in previous single-response methods. Future work will explore scaling to larger models and extending the framework to online settings.

Summary updated

BibTeX
@misc{richemond2024offline,
  author = {Pierre Harvey Richemond and Yunhao Tang and Daniel Guo and Daniele Calandriello and Mohammad Gheshlaghi Azar and Rafael Rafailov and Bernardo Ávila Pires and Eugene Tarassov and Lucas Spangher and Will Ellsworth and Aliaksei Severyn and Jonathan Mallinson and Lior Shani and Gil Shamir and Rishabh Joshi and Tianqi Liu and Rémi Munos and Bilal Piot},
  title = {{Offline Regularised Reinforcement Learning for Large Language Models Alignment}},
  year = {2024},
  eprint = {2405.19107},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.19107},
}
Figure