Abstract
Aligning Large Language Models (LLMs) with human preferences often relies on reward models that serve as proxies for human judgment. However, aggressive optimization against these proxies can lead to "reward hacking," where models exploit flaws in the reward function to achieve high scores at the expense of actual quality. This paper investigates strategies to mitigate this phenomenon during Best-of-N (BoN) sampling. We introduce Stochastic Regularized BoN (SRBoN), providing a theoretical framework that connects regularization to robust optimization. Furthermore, we propose Sentence Length Regularized BoN (RBoNL), a simple yet effective method to counteract length bias. Our evaluations on standard benchmarks show that these regularized sampling techniques improve robustness and alignment quality.
Introduction
Reinforcement Learning from Human Feedback (RLHF) is the standard for LLM alignment but is computationally intensive. Best-of-N (BoN) sampling offers a more efficient alternative: generating $N$ candidate responses and selecting the one with the highest score from a Reward Model (RM). Despite its popularity, BoN is susceptible to reward hacking as $N$ increases. Previous attempts to address this used heuristic regularization (RBoN), but a rigorous theoretical understanding of its effectiveness was lacking. This work bridges that gap by framing regularized sampling within control theory and robust optimization.
Methodology
The authors categorize and compare several sampling strategies, ranging from simple random sampling to complex regularized methods. These methods differ in their use of reward functions and similarity functions to guide the selection process.
Stochastic Regularized BoN (SRBoN)
SRBoN relaxes the deterministic selection of the "best" response. Instead, it samples from a distribution regularized by terms such as KL divergence or Wasserstein distance. The authors prove that this stochastic approach is mathematically equivalent to Robust Optimization. In this framework, regularization acts as a safeguard against potential perturbations or errors in the reward model, ensuring the selected output remains high-quality even if the proxy reward is imperfect.
Sentence Length Regularized BoN (RBoNL)
A common failure mode in reward models is "length bias," where longer (or sometimes overly concise) responses are unfairly favored. RBoNL addresses this by penalizing the reward based on the inverse of the sentence length. This heuristic is formally derived by considering the Total Variation (TV) distance between the output distribution and a target length-aware distribution.
Experimental Setup
The proposed methods were evaluated on two primary benchmarks:
- AlpacaFarm: A simulated environment for instruction-following.
- Anthropic’s hh-rlhf: A dataset focused on helpfulness and harmlessness.
The experiments utilized Mistral 7B SFT $\beta$ as the base model. Performance was measured using various proxy reward models (e.g., OASST, SHP), with Eurus-RM-7B serving as the "gold" reference reward to evaluate true alignment.
Key Insights
Regularization as an Adversary
A central finding is that regularization functions as an adversarial perturbation. By forcing the selection process to be conservative, it ensures that the chosen response is robust to inaccuracies in the reward model. This provides a theoretical justification for why regularized decoding succeeds empirically.
The Efficacy of Simple Heuristics
Despite the mathematical sophistication of SRBoN, the simpler RBoNL often yielded the best results. This suggests that a significant portion of reward hacking in current models is driven by basic biases, such as sentence length, which can be effectively mitigated with targeted penalties.
Results and Discussion
The evaluation demonstrated the clear benefits of regularized sampling:
- RBoNL Performance: In AlpacaFarm and helpfulness tasks, RBoNL consistently outperformed standard BoN, achieving win rates as high as 52.7%.
- Robustness: SRBoN proved particularly effective when the correlation between the proxy and gold reward models was low, confirming its utility in scenarios with unreliable reward signals.
- Baseline Comparison: Unregularized random sampling performed poorly, with win rates dropping to 3% in some instances, underscoring the necessity of an informed selection process.
Conclusion
This research provides both theoretical and practical advancements in LLM alignment. By framing regularized BoN sampling as robust optimization, the authors offer a principled way to understand and prevent reward hacking. While RBoNL offers a highly effective and simple solution for current length biases, SRBoN provides a robust framework for more general alignment challenges. Future work will focus on reducing the inference overhead of BoN sampling and automating the selection of regularization hyperparameters.
Summary updated