No items found.

Benchmarking Reward Hack Detection in Code Environments via Contrastive Analysis

Darshan Deshpande, Anand Kannappan, Rebecca Qian

Darshan Deshpande, Anand Kannappan, Rebecca Qian

“Alluvial Fan”, Taklimakan Desert, China
03

Abstract

Recent advances in reinforcement learning for code generation have made robust environments essential to prevent reward hacking. As LLMs increasingly serve as evaluators in code-based RL, their ability to detect reward hacking remains understudied. In this paper, we propose a novel taxonomy of reward exploits spanning across 54 categories and introduce TRACE (Testing Reward Anomalies in Code Environments), a synthetically curated and human-verified benchmark containing 517 testing trajectories. Unlike prior work that evaluates reward hack detection in isolated classification scenarios, we contrast these evaluations with a more realistic, contrastive anomaly detection setup on TRACE. Our experiments reveal that models capture reward hacks more effectively in contrastive settings than in isolated classification settings, with GPT-5.2 with highest reasoning mode achieving the best detection rate at 63%, up from 45% in isolated settings on TRACE. Building on this insight, we demonstrate that state-of-the-art models struggle significantly more with semantically contextualized reward hacks compared to syntactically contextualized ones. We further conduct qualitative analyses of model behaviors, as well as ablation studies showing that the ratio of benign to hacked trajectories and analysis cluster sizes substantially impact detection performance. We release the benchmark and evaluation harness to enable the community to expand TRACE and evaluate their models.

03

Runs

Cite this
TextBibTeXCopy
Darshan Deshpande, Anand Kannappan, Rebecca Qian. Benchmarking Reward Hack Detection in Code Environments via Contrastive Analysis. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 24515–24536, 2026.
@InProceedings{pmlr-v306-deshpande26a, title = {Benchmarking Reward Hack Detection in Code Environments via Contrastive Analysis}, author = {Deshpande, Darshan Girish and Kannappan, Anand and Qian, Rebecca}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {24515--24536}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/deshpande26a/deshpande26a.pdf}, url = {https://proceedings.mlr.press/v306/deshpande26a.html}, abstract = {Recent advances in reinforcement learning for code generation have made robust environments essential to prevent reward hacking. As LLMs increasingly serve as evaluators in code-based RL, their ability to detect reward hacking remains understudied. In this paper, we propose a novel taxonomy of reward exploits spanning across 54 categories and introduce TRACE (Testing Reward Anomalies in Code Environments), a synthetically curated and human-verified benchmark containing 517 testing trajectories. Unlike prior work that evaluates reward hack detection in isolated classification scenarios, we contrast these evaluations with a more realistic, contrastive anomaly detection setup on TRACE. Our experiments reveal that models capture reward hacks more effectively in contrastive settings than in isolated classification settings, with GPT-5.2 with highest reasoning mode achieving the best detection rate at 63%, up from 45% in isolated settings on TRACE. Building on this insight, we demonstrate that state-of-the-art models struggle significantly more with semantically contextualized reward hacks compared to syntactically contextualized ones. We further conduct qualitative analyses of model behaviors, as well as ablation studies showing that the ratio of benign to hacked trajectories and analysis cluster sizes substantially impact detection performance. We release the benchmark and evaluation harness to enable the community to expand TRACE and evaluate their models.} }
ICML 2026
January 27, 2026
ICML 2026
Main
Main conference
Poster
trace
More research
All research →
“Serene Expressions”, off the Louisiana coast“Serene Expressions”, off the Louisiana coast
NeurIPS 2026
meta

HalluWorld: A Controlled Benchmark for Hallucination via Reference World Models

May 19, 2026
NeurIPS 2026
Main
halluworld
NeurIPS 2026
“Meighen Island”, Canadian Arctic“Meighen Island”, Canadian Arctic
ICML 2026
meta

Position: We Need A Unified Definition of Hallucination (It’s The World Model, Stupid!)

December 25, 2025
ICML 2026
Main
unified-hallucination-framework
ICML 2026
“Capillaries”, Meta River, Colombia–Venezuela border“Capillaries”, Meta River, Colombia–Venezuela border
meta

TRAIL: Trace Reasoning and Agentic Issue Localization

May 13, 2025
arXiv 2505.08638
trail
From the blog
All posts →
No items found.