Detecting and Suppressing Reward Hacking with Gradient Fingerprints

Songtao Wang, Quang Hieu Pham, Fangcong Yin, Xinpeng Wang, Jocelyn Qiaochu Chen +2 more
4/17/2026
cs.LGcs.CL

Official code: songtao-x/reward_hack (5 stars, last commit 2026-06-03).

Abstract

Reinforcement learning with verifiable rewards (RLVR) typically optimizes for outcome rewards without imposing constraints on intermediate reasoning. This leaves training susceptible to reward hacking, where models exploit loopholes (e.g., spurious patterns in training data) in the reward function to achieve high scores without solving the intended task. These reward-hacking behaviors are often implicit, as the intermediate chain-of-thought (CoT) may appear plausible on the surface, limiting the effectiveness of purely text-based monitoring. We propose Gradient Fingerprint (GRIFT), a method for detecting reward hacking using models' internal computations. Given a prompt and a model-generated CoT, GRIFT computes gradients of the CoT conditioned on the prompt and compresses them into a compact representation, which is then used to assess whether the CoT reflects reward hacking behavior. Across verifiable reasoning benchmarks spanning math, code, and logical reasoning, GRIFT substantially outperforms strong baselines, including CoT Monitor and TRACE, achieving over 25% relative improvement in detecting reward hacking behavior. Moreover, integrating GRIFT into the rejection fine-tuning pipeline for reasoning tasks reduces reward hacking and improves performance on the true task objective. Our results highlight a promising direction of leveraging gradient level representations for assessing the quality of CoT reasoning traces. Our code is available at: https://github.com/songtao-x/reward_hack.

View on arXivView PDF

Code Implementations(1)

51Shell, PythonJan 17, 20264 months ago

Similar Papers

Cite this paper

@article{wang2026detecting,
  title  = {Detecting and Suppressing Reward Hacking with Gradient Fingerprints},
  author = {Songtao Wang and Quang Hieu Pham and Fangcong Yin and Xinpeng Wang and Jocelyn Qiaochu Chen and Greg Durrett and Xi Ye},
  year   = {2026},
  eprint = {2604.16242},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.16242v1}
}

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/2604.16242.svg)](https://codeofpaper.com/paper/2604.16242)

Discussion