Secrets of RLHF in Large Language Models Part II: Reward Modeling

Binghai Wang, Rui Zheng, Lu Chen, Yan Liu, Shihan Dou, Caishuang Huang, Wei Shen, Senjie Jin, Enyu Zhou, Chenyu Shi, Songyang Gao, Nuo Xu, Yuhao Zhou, Xiaoran Fan, Zhiheng Xi, Jun Zhao, Xiao Wang, Tao Ji, Hang Yan, Lixing Shen, Zhan Chen, Tao Gui, Qi Zhang, Xipeng Qiu, Xuanjing Huang, Zuxuan Wu, Yu-Gang JiangarXiv 2024 · DOI

Abstract

Reinforcement Learning from Human Feedback (RLHF) has become the standard for aligning Large Language Models (LLMs) with human preferences. However, the Reward Model (RM)—the "brain" of the RLHF process—is often a bottleneck due to noisy human annotations and poor generalization under distribution shifts. This paper presents a systematic approach to enhancing RM robustness. By employing an ensemble-based preference strength measurement, the authors introduce label flipping for denoising, adaptive margins for better separation, and MetaRM for maintaining accuracy across iterative training rounds.

Introduction

While much research focuses on the optimization algorithms of RLHF, such as PPO, the quality of the Reward Model is equally critical. An RM acts as a proxy for human judgment, but it faces two primary challenges. First, human feedback is inherently noisy; annotators often disagree, leading to ambiguous or incorrect preference pairs. Second, as the policy model evolves during RLHF, it generates out-of-distribution (OOD) samples that the initial RM may fail to evaluate correctly, often leading to "reward hacking." This report details methods to overcome these hurdles, ensuring RMs remain reliable proxies throughout the alignment process.

Quantifying Preference Strength

To address data noise, the authors propose a multi-model voting mechanism. By training an ensemble of 10 reward models, they calculate the mean and standard deviation of preference scores for each data pair. This allows for a quantitative assessment of "preference strength."

Distribution of mean and standard deviation of preference scores across an ensemble of reward models.

As shown in the distributions above, most data pairs exhibit a moderate mean preference difference with a relatively low standard deviation, indicating general model agreement. However, the tails of these distributions represent critical edge cases: ambiguous pairs where the mean difference is near zero, and potentially noisy pairs where the standard deviation is high.

Data-Centric Innovations: Denoising and Smoothing

Using these metrics, the authors implement several data-centric strategies:

  • Label Flipping: For pairs where the ensemble strongly contradicts the human label (the bottom 20% of preference strength), the authors flip the label. This assumes the human annotator was likely in error, effectively denoising the training set.
  • Label Smoothing: For pairs with very high preference strength, label smoothing is applied to prevent the model from overfitting to superficial patterns or "easy" features.
  • Adaptive Margin: The loss function is modified to include a margin that scales with the measured preference strength, forcing the model to distinguish more clearly between responses with high-confidence differences.

The "U-Shaped" Agreement Curve

A key insight from this work is the "U-shaped" agreement curve. By analyzing model consistency across different data percentiles, the authors found that reward models tend to disagree in specific patterns.

Relationship between data percentiles, preference metrics, and model consistency. The U-shaped standard deviation curve (left, blue) highlights disagreement on ambiguous and strong preference data.

As illustrated in the left plot of the figure above, the standard deviation of preference differences (blue line) is higher at both ends of the data spectrum. Disagreement occurs at the low end due to "ambiguous" or "incorrect" labels and at the high end because models often overfit to non-robust features in "strong" preference examples. The right plot confirms that consistency generally increases with the magnitude of the preference difference, but the variance at the extremes necessitates the proposed denoising and smoothing techniques.

Algorithmic Enhancements for Robustness

Beyond data cleaning, the authors introduce algorithmic improvements:

  • Contrastive Learning: By incorporating unsupervised contrastive losses (e.g., SimCSE), the model learns to create distinct feature representations for "chosen" versus "rejected" responses. This reduces feature overlap and improves the model's discriminative power, especially for similar-looking responses.
  • MetaRM: To combat distribution shift during iterative RLHF, MetaRM utilizes a meta-learning framework. It treats the evolving policy distribution as a series of tasks, optimizing the RM to maintain its ranking ability even as the LLM's outputs change.

Key Results and Conclusion

The proposed methods yielded significant improvements across multiple benchmarks, including Anthropic HH-RLHF and OpenAI Summarization. Notably, "flipping" labels for noisy data proved more effective than simply discarding it, suggesting that the underlying signal remains valuable if correctly interpreted. Furthermore, MetaRM enabled stable performance across 3 to 4 rounds of iterative RLHF, preventing the typical performance plateaus.

While these results are promising for 7B parameter models, future work will explore scaling these "secrets" to larger 70B+ models and addressing potential biases introduced by using GPT-4 as an automated judge. Overall, this work provides a robust blueprint for building the next generation of reward models in the RLHF pipeline.

Citation: Wang, B., Zheng, R., et al. (2024). Secrets of RLHF in Large Language Models Part II: Reward Modeling. arXiv:2401.06080v2.

Summary updated

BibTeX
@misc{wang2024secrets,
  author = {Binghai Wang and Rui Zheng and Lu Chen and Yan Liu and Shihan Dou and Caishuang Huang and Wei Shen and Senjie Jin and Enyu Zhou and Chenyu Shi and Songyang Gao and Nuo Xu and Yuhao Zhou and Xiaoran Fan and Zhiheng Xi and Jun Zhao and Xiao Wang and Tao Ji and Hang Yan and Lixing Shen and Zhan Chen and Tao Gui and Qi Zhang and Xipeng Qiu and Xuanjing Huang and Zuxuan Wu and Yu-Gang Jiang},
  title = {{Secrets of RLHF in Large Language Models Part II: Reward Modeling}},
  year = {2024},
  eprint = {2401.06080},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.06080},
}
Figure