Inference-Time Reward Hacking in Large Language Models

Hadi Khalaf, Claudio Mayrink Verdun, Alex Oesterling, Himabindu Lakkaraju, Flavio Calmon

Abstract

Reward hacking occurs when Large Language Models (LLMs) over-optimize for imperfect proxy rewards, leading to a "winner's curse" where true performance eventually collapses. This paper formalizes this phenomenon and introduces Best-of-Poisson (BoP) and HedgeTune. BoP provides a computationally efficient approximation of the theoretically optimal tilted distribution, while HedgeTune calibrates inference-time parameters using a small set of verifiable data. Empirical results across reasoning and preference tasks demonstrate that these methods effectively identify the hacking threshold and maintain higher performance than standard Best-of-n sampling.

The Challenge of Reward Hacking

To align Large Language Models (LLMs) with human values and complex objectives, researchers typically employ reward models—proxy functions designed to score the quality of model outputs. A widely used inference-time technique is Best-of-n (BoN) sampling: the model generates $n$ candidate responses, which are then ranked by the reward model to select the highest-scoring output.

However, reward models are inherently imperfect proxies. As optimization pressure increases (i.e., as $n$ grows), the model eventually begins to exploit the flaws and biases of the proxy reward rather than improving in true quality. This phenomenon, known as reward hacking, manifests as a "winner's curse": while the proxy reward continues to rise, the true underlying quality of the output peaks and then sharply declines.

The "winner's curse" in action: as optimization pressure (KL divergence) increases, the true reward peaks and then collapses. HedgeTune successfully identifies this "hacking threshold."

Formalizing the Winner's Curse

The authors provide a mathematical characterization of reward hacking, proving it is an inevitable consequence for a broad class of selection mechanisms. They demonstrate that the true reward function is typically unimodal when plotted against optimization strength. This means there is a definitive "sweet spot" for alignment, beyond which further optimization becomes counterproductive.

Proposed Solutions: BoP and HedgeTune

To address this, the paper introduces two primary innovations:

  1. Best-of-Poisson (BoP): Theoretically, the optimal balance between reward maximization and model drift is achieved by an "exponentially tilted" distribution. Since direct sampling from this distribution is computationally intractable for LLMs, the authors propose BoP. By drawing the number of samples $n$ from a Poisson distribution, BoP serves as a near-exact, efficient approximation of the optimal policy.
  2. HedgeTune: This calibration algorithm is designed to find the optimal operating point. By using a small "gold" dataset where true rewards are verifiable (such as math problems with ground-truth answers), HedgeTune identifies the specific inference-time parameters—such as the optimal $n$ for BoN or temperature for Soft Best-of-n (SBoN)—that maximize true performance before hacking occurs.

Empirical Evaluation

The authors evaluated these methods across several challenging benchmarks, including MMLU Pro, MATH, and GPQA for verifiable reasoning, as well as AlpacaFarm for human preferences.

HedgeTune successfully recovers the best operating point for BoN and BoP across various benchmarks, preventing the performance drop-off seen in standard over-optimization.

As shown in the results, HedgeTune consistently identifies the peak of the true reward curve. For instance, on the GPQA dataset, standard BoN performance begins to degrade after $n=12$. HedgeTune correctly identifies this threshold, preventing the model from falling into the hacking region. Furthermore, combining Soft Best-of-n (SBoN) with HedgeTune often yields a superior reward-distortion curve, maintaining higher accuracy even as more samples are drawn compared to the "hard" selection of standard BoN.

Conclusion

Inference-time hedging offers a powerful, zero-retraining-cost method for improving LLM alignment. Unlike RLHF or DPO, which require expensive fine-tuning, BoP and HedgeTune allow existing models to be tuned for specific tasks simply by adjusting sampling and scoring strategies. While HedgeTune currently relies on verifiable "gold" data for calibration, future work may extend these techniques to more subjective domains using advanced "LLM-as-a-judge" frameworks.

Summary updated

BibTeX
@inproceedings{khalaf2025inference,
  author = {Hadi Khalaf and Claudio Mayrink Verdun and Alex Oesterling and Himabindu Lakkaraju and Flavio Calmon},
  title = {{Inference-Time Reward Hacking in Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=hSX7Dd8dxy},
}
Figure