cs.LGAug 24, 2026

Safety Hacking in Constrained Best-of-NN Inference-time Scaling

Authors: Akifumi Wachi, Takumi Tanabe, Youhei Akimoto

Organizations: LY Corporation · University of Tsukuba · RIKEN AIP

Abstract

Inference-time pipelines often sample multiple outputs, filter them with a learned safety model, and return the proxy-feasible output with the highest learned reward. We show that this composition creates a two-stage failure: an imperfect safety proxy first contaminates the feasible set with unsafe outputs, and reward maximization can then amplify this residual contamination. We define safety hacking as selecting an output that passes the learned constraint but violates the true safety criterion. For constrained Best-of-NN sampling, we derive finite-NN bounds governed by the joint upper reward tails of safe and unsafe outputs within the proxy-feasible set. If unsafe-but-feasible outputs have the heavier tail, safety hacking becomes asymptotically certain as NN grows, even when false-positive mass and average safety- and reward-proxy errors are arbitrarily small. We also show that policies within a bounded χ2χ^2 divergence from the proxy-feasible reference distribution admit an NN-independent safety-hacking bound, and instantiate this general coverage-control principle with constrained pessimistic sampling. Coverage control limits amplification but cannot repair a contaminated feasible set: admitted unsafe outputs may still be favored, and regularized selection is not necessarily safer than constrained Best-of-NN for every reward proxy. Toy and language-model experiments characterize both contamination and its reward-tail amplification, which exposes an inherent difficulty in inference-time scaling with learned safety models.

Figures & tables

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Safe Inference-Time Alignment via Lagrangian Reward Augmentation

    Jul 2, 2026Yaswanth Chittepu, Ativ Joshi, Sohini Chintala +1LLM AlignmentLLM Safety Alignment

  2. From Curiosity to Caution: Mitigating Reward Hacking for Best-of-N with Pessimism

    Apr 6, 2026Zhuohao Yu, Zhiwei Steven Wu, Adam BlockReward HackingReward Over-Optimization