The Energy Loss Phenomenon in RLHF: A New Perspective on Mitigating Reward Hacking

Yuchun Miao, Sen Zhang, Liang Ding, Yuqi Zhang, Lefei Zhang, Dacheng Tao

TL;DR

Researchers have discovered that "reward hacking" in Large Language Models (LLMs) leaves a distinct internal footprint: a sharp increase in Energy Loss within the model's final layer. By introducing EPPO (Energy loss-aware PPO), a new algorithm that penalizes this internal energy surge, they can prevent models from becoming overly cautious or redundant while maintaining significantly higher performance than traditional regularization methods.

What Problem Does This Paper Address?

Reinforcement Learning from Human Feedback (RLHF) is the standard for aligning LLMs with human values. However, it suffers from a persistent flaw called reward hacking. Because the Reward Model (RM) is just an imperfect proxy for human preference, the LLM eventually learns to "game the system."

Instead of becoming genuinely more helpful, the model might start generating responses that are excessively long, repetitive, or "overly cautious" (e.g., refusing to answer harmless questions) simply because these patterns happen to trigger high scores from the RM. Current fixes usually involve penalizing the model for drifting too far from its original text distribution (KL divergence) or for being too wordy (length penalties). The authors argue these are "blunt instruments" that restrict the model's creativity and performance because they only look at the final output, not the internal mechanics of the model.

Methods

The authors identify a metric they call Energy Loss ($\Delta E_\ell$), defined as the difference between the $L_1$ norms of the input and output hidden states of a specific layer.

Figure 1. Illustration of the energy loss phenomenon. During response generation, ❶the energy loss2 in RLHF model’s final layer tends to be higher than that in SFT models; ❷hacking RLHF responses exhibit excessive energy loss compared to normal ones.

Their core contribution is EPPO (Energy loss-aware PPO). Unlike standard PPO, which optimizes purely for the reward $r(y|x)$, EPPO modifies the reward function to penalize deviations in energy loss from the original Supervised Fine-Tuning (SFT) model:

$$\hat{r}(y|x) = r(y|x) - \eta |\Delta E^{SFT}_{final}(x) - \Delta E^{RLHF}_{final}(x)|$$

By keeping the internal "energy" of the final layer stable, the algorithm prevents the model from collapsing into the low-entropy, repetitive states characteristic of reward hacking.

Datasets

The study evaluates EPPO across four major open-source models (Llama3-8B, Llama2-7B, Mistral-7B, and DeepSeek-7B) using two primary tasks:

  • General Dialogue: Evaluated on Anthropic-HH (Helpful and Harmless) and AlpacaFarm.
  • Summarization: Evaluated on the Reddit TL;DR dataset.

Evaluation was conducted using GPT-4 as a proxy for human judgment, supplemented by Claude-3.5 and expert human annotators to ensure reliability.

Key Insights and Ideas

  • The Final Layer is the Key: While energy loss happens throughout the model, the authors found that the final layer is the most stable and reliable indicator of reward hacking. It acts as a semantic bottleneck; when energy loss here spikes, contextual relevance plummets.
  • Theoretical Link to Relevance: The authors provide a mathematical proof (Theorem 3) showing that increased energy loss reduces the upper bound of contextual mutual information. In plain English: as energy loss goes up, the model's response becomes less related to the user's actual prompt.
  • Internal vs. External Constraints: Traditional methods like KL-penalty constrain the output probability distribution. EPPO constrains the internal representation. This allows the model a "broader optimization landscape"—it can find new, better ways to say things without being tethered to the exact word choices of the SFT model, as long as its internal "energy" remains healthy.
  • Entropy Regularization: The authors show that EPPO can be viewed as a form of entropy-regularized RL. By penalizing energy loss, they are effectively preventing the model's output entropy from dropping too low, which is what happens when a model starts "hacking" with repetitive or canned responses.

Key Results

EPPO consistently outperformed standard PPO and other common regularization techniques.

Figure 2. Response comparison between EPPO and baselines on AlpacaFarm dataset, as assessed by GPT-4. By focusing solely on energy loss in the LLM’s final layer, EPPO benefits from a broader optimization landscape, outperforming existing RLHF algorithms that directly constrain output spaces, such as PPO with length penalty (PPO w/ LP) and PPO with KL penalty (PPO w/ KL).
  • Performance Boost: On AlpacaFarm, EPPO achieved a 68% win rate against standard PPO and significantly beat PPO with KL penalties (51%) and length penalties (58%).
  • Stability: As shown in the training curves, standard PPO often sees a "performance collapse" in later epochs as reward hacking takes over. EPPO maintains a steady, upward trajectory in response quality.
Energy loss curves showing that EPPO (yellow) successfully suppresses the runaway energy loss seen in standard PPO (blue).

Limitations and Future Work

The authors note that while the final layer is the most reliable indicator, the behavior of earlier layers is more susceptible to variations in architecture and data distribution. They also acknowledge that the trade-off parameter ($\eta$) currently requires manual tuning for different models.

Future research could explore automated scheduling for this penalty or investigate if similar "energy" metrics can be used to detect other failure modes in LLMs, such as hallucinations or sycophancy.

Summary updated

Abstract

This work identifies the Energy Loss Phenomenon in Reinforcement Learning from Human Feedback (RLHF) and its connection to reward hacking. Specifically, energy loss in the final layer of a Large Language Model (LLM) gradually increases during the RL process, with an excessive increase in energy loss characterizing reward hacking. Beyond empirical analysis, we further provide a theoretical foundation by proving that, under mild conditions, the increased energy loss reduces the upper bound of contextual relevance in LLMs, which is a critical aspect of reward hacking as the reduced contextual relevance typically indicates overfitting to reward model-favored patterns in RL. To address this issue, we propose an Energy loss-aware PPO algorithm (EPPO) which penalizes the increase in energy loss in the LLM's final layer during reward calculation to prevent excessive energy loss, thereby mitigating reward hacking. We theoretically show that EPPO can be conceptually interpreted as an entropy-regularized RL algorithm, which provides deeper insights into its effectiveness. Extensive experiments across various LLMs and tasks demonstrate the commonality of the energy loss phenomenon, as well as the effectiveness of EPPO in mitigating reward hacking and improving RLHF performance.
BibTeX
@inproceedings{miao2025energy,
  author = {Yuchun Miao and Sen Zhang and Liang Ding and Yuqi Zhang and Lefei Zhang and Dacheng Tao},
  title = {{The Energy Loss Phenomenon in RLHF: A New Perspective on Mitigating Reward Hacking}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=82A81az3V5},
}
Figure