Reward Shaping to Mitigate Reward Hacking in RLHF

Jiayi Fu, Xuandong Zhao, Chengyuan Yao, Heng Wang, Qi Han, Yanghua Xiao

Introduction

Reinforcement Learning from Human Feedback (RLHF) has become the standard for aligning Large Language Models (LLMs). However, this process is frequently undermined by reward hacking, where models exploit imperfections in the Reward Model (RM) to achieve high scores through degenerate behaviors—such as excessive verbosity or repetitive phrasing—rather than genuine quality improvements. This paper introduces Preference As Reward (PAR), a mathematically grounded reward-shaping technique designed to stabilize training and mitigate these vulnerabilities.

The PAR Framework

The standard RLHF pipeline uses Proximal Policy Optimization (PPO) to maximize rewards from a proxy RM. As optimization progresses, the model often enters "blind spots" where the RM provides inflated scores. To counter this, the authors propose two design principles: Boundedness (limiting the influence of outliers) and a specific Growth Profile (encouraging early learning while preventing late-stage over-optimization).

The proposed PAR method applies a sigmoid transformation to centered rewards: $$r_{RL} = \text{sigmoid}(r - r_{ref})$$ where $r_{ref}$ is the reward of a response from the reference model. This transformation ensures the RL signal represents the probability that a new response is superior to the baseline, directly aligning with the Bradley-Terry model used to train most RMs.

Key Results and Stability

The researchers evaluated PAR using Gemma2-2B on benchmarks including AlpacaEval 2.0 and MT-Bench. PAR demonstrated significant resistance to over-optimization. While "Vanilla" PPO runs often collapsed due to reward hacking, PAR maintained high performance even over extended training durations.

On AlpacaEval 2.0, PAR achieved a 70.8% win rate, significantly outperforming standard PPO and other baseline methods like Minmax. A critical factor in this success is the reduction of variance in the policy gradient. By bounding the rewards, PAR prevents the "critic" model from being overwhelmed by extreme values, leading to much smoother training dynamics.

Comparison of Critic Loss between Vanilla PPO and the PAR method, demonstrating the significantly higher stability and lower noise achieved through bounded reward shaping.

Conclusion

PAR offers a simple yet effective solution to the pervasive problem of reward hacking in RLHF. By grounding reward shaping in preference theory and ensuring mathematical boundedness, it provides a wider "early stopping" window and more robust alignment. While it may not raise the absolute ceiling of model capability, it drastically improves the reliability and efficiency of the fine-tuning process.

Summary updated

BibTeX
@inproceedings{fu2025reward,
  author = {Jiayi Fu and Xuandong Zhao and Chengyuan Yao and Heng Wang and Qi Han and Yanghua Xiao},
  title = {{Reward Shaping to Mitigate Reward Hacking in RLHF}},
  booktitle = {R2-FM @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=62A4d5Mokc},
}
Figure