Exploring the impact of low-rank adaptation on the performance, efficiency, and regularization of RLHF

Simeng Sun, Dhawal Gupta, Mohit IyyerarXiv 2023 · DOI

Abstract

Reinforcement Learning from Human Feedback (RLHF) is a critical but resource-intensive stage in aligning large language models. This study investigates the use of Low-Rank Adaptation (LoRA) during the Proximal Policy Optimization (PPO) phase of RLHF. We demonstrate that LoRA-based PPO enables the alignment of a LLaMA-7B model using significantly fewer resources—just two A100 GPUs—while achieving performance comparable to or exceeding full fine-tuning. Furthermore, we find that LoRA acts as an implicit regularizer, reducing the need for explicit KL penalties and mitigating the "factuality tax" typically associated with the alignment process.

Introduction

The final stage of training modern large language models (LLMs) often involves Reinforcement Learning from Human Feedback (RLHF), specifically using Proximal Policy Optimization (PPO). However, PPO is computationally expensive, requiring the simultaneous loading of four model versions: the policy, the critic (value function), the reward model, and a frozen reference model. For a 7B parameter model, this typically necessitates a high-end multi-GPU node, creating a significant barrier for many research labs. Additionally, PPO often leads to "reward hacking" and a decline in factual accuracy as the model optimizes for stylistic preferences.

Methodology

To address these challenges, we implement LoRA-based PPO. By freezing the backbone LLM and training only small low-rank adapter matrices (0.2% of total parameters, or 16.7M), we significantly reduce memory overhead. Our implementation focuses on adapting the query, key, value, and output projections within the attention layers.

A key finding in our hyperparameter tuning was the importance of the LoRA scaling factor ($\alpha$); setting $\alpha=64$ was essential for achieving competitive performance. We also explored various divergence-based regularizers beyond the standard Kullback-Leibler (KL) penalty, including Jensen-Shannon (JS) divergence, Bregman divergence, and Squared Error.

Experimental Setup

We utilized the Alpaca-52K dataset, partitioned for Supervised Fine-Tuning (SFT), Reward Modeling, and PPO. Evaluation was conducted using the AlpacaFarm benchmark, measuring win rates against a text-davinci-003 baseline. Factuality was assessed using the FActScore benchmark, which quantifies the accuracy of atomic facts in generated biographies.

Results and Analysis

Our LoRA-based PPO approach achieved win rates between 47.5% and 49.8% against text-davinci-003, surpassing the standard AlpacaFarm full fine-tuning checkpoint (46.7%). Notably, using Jensen-Shannon divergence as a regularizer provided the best results, as shown in Figure 1.

Win rate against text-davinci-003 across different regularization methods and PPO steps.

Efficiency gains were substantial: the training process required only two A100 GPUs and was completed in approximately 10 hours, representing a 75% reduction in hardware requirements compared to full-model PPO.

Discussion: LoRA as an Implicit Regularizer

One of the most significant insights is that LoRA-PPO performs remarkably well even without an explicit KL penalty. We hypothesize that the structural constraints of LoRA—where the majority of the model's weights remain frozen—act as an implicit regularizer, preventing the model from drifting into low-quality or "gibberish" states.

Win rate vs. token-level KL divergence, illustrating the trade-off between alignment performance and model drift.

As illustrated in Figure 2, models without explicit regularization (green markers) maintain high win rates even as they drift further from the reference model (higher KL divergence) compared to those with KL penalties. This implicit regularization also helps preserve factuality. While full-model PPO often sees a sharp decline in factual accuracy (dropping to 34.5% in our tests), LoRA-PPO maintained a factuality score of 39.4%, nearly identical to the SFT baseline of 39.7%.

Conclusion and Limitations

LoRA-based PPO offers a path toward democratizing the alignment phase of LLM training by drastically reducing compute requirements while maintaining or improving performance and factuality. Future work should investigate whether these findings scale to larger models (e.g., 70B+) and more diverse datasets. Furthermore, the reduced need for a reference model in the LoRA setting suggests potential for even greater memory efficiency in future implementations.

Summary updated

BibTeX
@misc{sun2023exploring,
  author = {Simeng Sun and Dhawal Gupta and Mohit Iyyer},
  title = {{Exploring the impact of low-rank adaptation on the performance, efficiency, and regularization of RLHF}},
  year = {2023},
  eprint = {2309.09055},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.09055},
}
Figure