Presented at EMNLP 2024, this research introduces a novel framework to enhance Reward Models (RMs) in the Reinforcement Learning from Human Feedback (RLHF) pipeline. By integrating unsupervised contrastive learning techniques, the authors improve the model's ability to distinguish between preferred and non-preferred responses, leading to more robust alignment in Large Language Models (LLMs).
Introduction
Reinforcement Learning from Human Feedback (RLHF) is the standard methodology for aligning LLMs with human values. The Reward Model (RM) acts as a proxy for human judgment, trained to predict preferences between pairs of responses. However, traditional RMs often suffer from superficial learning—relying on heuristics like response length—and sensitivity to noise in human labels. This paper addresses these limitations by forcing the RM to learn more robust feature representations through contrastive objectives.
Methodology: Contrastive Reward Modeling
The core innovation involves adding an unsupervised contrastive loss to the standard supervised ranking loss. This approach encourages the model to cluster similar high-quality representations and separate them from poor-quality ones in the latent space.
1. Data Augmentation and Pairing
To generate multiple "views" of the same data without additional human labeling, the researchers utilize Dropout-based augmentation. By passing the same input through the model twice with different dropout masks, the model generates two distinct internal representations. The study explores two pairing strategies:
- Single Representation Pairs: Contrasting individual response instances.
- Difference Representation Pairs: Contrasting the mathematical difference between a "chosen" and "rejected" response.
2. Training Objectives
The framework incorporates two primary contrastive algorithms:
- SimCSE (Instance-based): Maximizes similarity between different dropout views of the same response while minimizing similarity with other instances.
- SwAV (Cluster-based): Assigns instances to prototypical clusters, ensuring different views of the same response are consistently clustered.
The final training objective is defined as: $L_{total} = L_{RM} + \beta L_{Contrastive}$.
Latent Space Analysis
A key finding of the study is the significant improvement in feature separation. In standard reward models, the internal features of "chosen" and "rejected" responses often overlap, leading to ambiguous reward signals. The introduction of SimCSE creates a distinct separation in the latent space, allowing the model to act as a more decisive judge.
Experimental Results
The proposed methods were evaluated across several benchmarks, including Anthropic-HH, Reddit TL;DR, and out-of-distribution (OOD) sets like Stanford SHP.
Performance Benchmarks
The SimCSE-diff variant demonstrated superior performance on complex reasoning and conversation benchmarks. On MT-bench, it achieved an average score of 6.53, significantly outperforming the Vanilla PPO baseline of 5.82. Furthermore, the contrastive models showed enhanced stability during the PPO training phase, providing a smoother reward signal that prevented model collapse.
Generalization and Harmlessness
One of the most significant advantages was observed in OOD generalization. On the Stanford SHP dataset, contrastive models improved accuracy by up to 2.29% over the baseline. In harmlessness evaluations, SimCSE-based models successfully identified harmful content in 76% of cases when compared against standard Supervised Fine-Tuning (SFT) models.
Conclusion
By incorporating contrastive learning into the reward modeling stage, this research provides a path toward more reliable and stable LLM alignment. The resulting models are less prone to "gaming" superficial features and demonstrate a deeper understanding of human preference, particularly in challenging out-of-distribution scenarios. Future work will explore scaling these benefits to models beyond the 7B parameter range and investigating more advanced data augmentation techniques.
Summary updated