Inference-Time Reward Hacking in Large Language Models

Hadi Khalaf, C. M. Verdun, Alexander X. Oesterling, Himabindu Lakkaraju, Flávio du Pin Calmon
6/1/2025
rlhf-rlvr-dpo

No confident code implementation found for this paper.

Abstract

A common paradigm to improve the performance of large language models is optimizing for a reward model. Reward models assign a numerical score to an LLM's output that indicates, for example, how likely it is to align with user preferences or safety goals.

Show full abstract

However, reward models are never perfect. They inevitably function as proxies for complex desiderata such as correctness, helpfulness, and safety. By overoptimizing for a misspecified reward, we can subvert intended alignment goals and reduce overall performance, a phenomenon commonly referred to as reward hacking. In this work, we characterize reward hacking in inference-time alignment and demonstrate when and how we can mitigate it by hedging on the proxy reward. We study this phenomenon under Best-of-$n$ (BoN) and Soft Best-of-$n$ (SBoN), and we introduce Best-of-Poisson (BoP) that provides an efficient, near-exact approximation of the optimal reward-KL divergence policy at inference time. We show that the characteristic pattern of hacking as observed in practice (where the true reward first increases before declining) is an inevitable property of a broad class of inference-time mechanisms, including BoN and BoP. To counter this effect, we introduce HedgeTune, an efficient algorithm to find the optimal inference-time parameter. We demonstrate that hedging mitigates reward hacking and achieves superior reward-distortion tradeoffs on math, reasoning, and human-preference setups.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{khalaf2025inferencetime,
  title  = {Inference-Time Reward Hacking in Large Language Models},
  author = {Hadi Khalaf and C. M. Verdun and Alexander X. Oesterling and Himabindu Lakkaraju and Flávio du Pin Calmon},
  year   = {2025},
  eprint = {2506.19248},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2506.19248},
  url    = {https://doi.org/10.48550/arXiv.2506.19248},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.19248.svg)](https://codeofpaper.com/paper/2506.19248)

Discussion