TL;DR
Large language models (LLMs) can be "tricked" by reward models into producing undesirable outputs due to imperfections in the reward model, especially when dealing with novel prompts. This paper introduces Bayesian reward models, which quantify uncertainty in their predictions, to mitigate this "reward hacking" and improve LLM alignment.
What Problem Does This Paper Address?
Aligning LLMs with human preferences is crucial for safety and helpfulness. A common approach involves training a "reward model" on human preferences and then using it to either select the best response from a set of generated options (Best-of-n sampling) or to fine-tune the LLM itself (RLHF). However, these reward models are trained on finite data and can have blind spots. This leads to "reward overoptimization" or "reward hacking," where the LLM learns to exploit flaws in the reward model to achieve high scores, even if the generated response isn't genuinely preferred by humans. This is particularly problematic when the LLM encounters prompts or generates responses that are "out-of-distribution" (OOD) compared to its training data. The paper illustrates this with an example where a proxy reward model gives a high score to a repetitive, nonsensical response, while a "gold standard" human preference model rates it poorly.
Methods
The core contribution is the use of Bayesian reward models to address reward overoptimization. Specifically, the authors leverage Laplace-LoRA (Yang et al., 2024a), a method that applies Laplace approximation to Low-Rank Adaptation (LoRA) weights. LoRA is a parameter-efficient fine-tuning technique that injects trainable low-rank matrices into pre-trained models. By applying Laplace approximation to these LoRA weights, the authors obtain a Bayesian posterior distribution over the reward model's predictions. This distribution provides an epistemic uncertainty estimate – essentially, a measure of how confident the model is in its prediction.
The paper then proposes two ways to incorporate this uncertainty into the reward signal:
- Standard Deviation-Based Penalty: The predicted reward is reduced by a factor proportional to the standard deviation of the uncertainty estimate.
- Variance-Based Penalty: The predicted reward is reduced by a factor proportional to the variance of the uncertainty estimate.
These penalties aim to "punish" responses for which the reward model is uncertain, thereby discouraging the LLM from exploiting potential reward model flaws. The approach is applied post-hoc to an already trained standard reward model. The authors also show how this can be combined with reward ensembles, where multiple reward models are trained and their predictions are aggregated.
Datasets
The paper uses the AlpacaFarm dataset for training and evaluation. Specifically:
- The "sft" split of AlpacaFarm is used for supervised fine-tuning of the LLM policy.
- The AlpacaFarm human preference dataset is used to train an "oracle gold reward model."
- This gold reward model then provides synthetic labels to train smaller proxy reward models.
- A subset of 1000 prompts from the AlpacaFarm instructions validation dataset is used for policy optimization (BoN sampling).
Key Insights and Ideas
- Uncertainty is Key to Robustness: The paper strongly suggests that quantifying uncertainty in reward models is a direct path to mitigating reward overoptimization. When the reward model is unsure, it's a signal that the LLM might be entering dangerous territory.
- Laplace-LoRA as a Practical Tool: Applying Bayesian inference (specifically Laplace approximation) to efficient fine-tuning methods like LoRA makes uncertainty estimation more scalable and practical for LLMs.
- Penalizing Uncertainty Works: Both variance and standard deviation penalties effectively reduce reward hacking, with variance-based penalties showing a slight edge in some scenarios.
- Ensembles Benefit from Uncertainty: Combining Bayesian uncertainty estimation with reward ensembles further enhances robustness, suggesting a synergistic effect.
Key Results
The authors evaluated their approach using Best-of-n (BoN) sampling.
- Mitigation of Overoptimization: Their Bayesian reward models, particularly with uncertainty penalties, significantly reduced reward overoptimization compared to standard (MAP) reward models. This was evidenced by the gold reward scores remaining higher and not declining at large KL divergences (indicating more sampling).
- Variance vs. Standard Deviation Penalty: Both penalty types were effective, with variance-based penalties showing slightly better performance, especially at lower KL divergences.
- Ensemble Improvements: Integrating Laplace-LoRA with reward ensembles (LA Ens) further improved performance over standard ensembles (Ens).
- Robustness to Penalty Strength: While larger penalties (higher k values) generally improved robustness, they also found that very large penalties could degrade performance, especially for the standard deviation-based penalty. Variance-based penalties were found to be more robust.
Limitations and Future Work
- Computational Cost: While Laplace-LoRA is more efficient than full Bayesian methods, it still adds computational overhead compared to standard reward models.
- Hyperparameter Sensitivity: The effectiveness of the uncertainty penalty depends on the choice of the hyperparameter
k. The paper explores different values but acknowledges this as a tuning parameter. - Future Work: The paper suggests that this approach holds promise for RLHF as well, not just BoN sampling. They also hint at exploring other Bayesian approximation techniques and further investigating the interplay between uncertainty penalties and ensemble methods.
Summary updated