Introduction
Reinforcement Learning from Human Feedback (RLHF) is the standard for aligning Large Language Models (LLMs). However, it typically relies on "sparse rewards"—a single scalar score assigned at the end of a sequence. This creates a significant credit assignment problem: the model receives feedback on the whole response but doesn't know which specific tokens were beneficial or detrimental. While reward shaping can turn sparse rewards into dense, per-token signals, manual annotation is expensive and simple heuristics often fail to align with model logic.
The Proposed Framework
This paper introduces a novel framework that uses explainability methods to "densify" rewards and employs Bayesian Optimization (BO) to find the optimal balance of these signals.
The approach involves three key steps:
- Explainability-based Attribution: The system uses additive feature attribution methods—specifically SHAP and LIME—to decompose the final reward model score into the marginal contribution of each individual token.
- Bilevel Optimization with BO: Since explainability estimates can be noisy, the authors treat the weighting of these signals (SHAP, LIME, and Attention) as a black-box optimization problem. Bayesian Optimization is used in an "outer loop" to sample weights, while the "inner loop" performs standard PPO training.
- Policy Invariance Proof: The authors provide a theoretical proof showing that because these methods are additive, they function as "potential-based reward shaping." This ensures that the optimal policy found with dense rewards is identical to the one that would be found with the original sparse reward, only reached more efficiently.
Experimental Results
The framework was evaluated on the HH-RLHF and Ultrafeedback datasets using Llama-based models. Performance was measured via win rates on AlpacaEval-2 and MTBench.
Key Insights
- Performance Gains: On the Ultrafeedback task, the BO-SHAP-LIME combination achieved a win rate of 64.82% on AlpacaEval, significantly outperforming the sparse reward baseline (57.64%).
- Training Stability: One of the most striking findings is that dense rewards drastically reduce PPO Value Head Loss. By providing feedback at every token, the model's internal critic predicts long-term value more accurately, leading to smoother training.
- Generalization vs. Hacking: Explainable dense rewards helped the model generalize better to open benchmarks rather than just over-optimizing for the reward model's quirks, a common issue known as "reward hacking."
Conclusion and Future Work
This work demonstrates that "post-hoc" explainability tools can be effectively repurposed as "ante-hoc" training signals. By densifying rewards through an optimized combination of attribution methods, RLHF becomes more stable and produces better-aligned models. Future research may explore dynamic weighting, where the importance of different attribution sources changes based on context or token embeddings.
Summary updated