hacktrace: behavior-supervised detection of reward hacking during code generation
cs.AI
Submitted: 2026-10-02
Updated: 2026-10-02
Code: https://github.com/XXXX/HackTrace
License: http://creativecommons.org/licenses/by/4.0/
The gist: A coding agent can earn a passing grade by fixing its code, or by deleting the test that exposes the bug.
Terminology
Abstract
A coding agent can earn a passing grade by fixing its code, or by deleting the test that exposes the bug. Detecting such reward hacking requires recognizing attempted shortcuts, including those that fail. We release 173,561 annotated multi-turn coding trajectories from Qwen3-8B and show that supervising shortcut behavior independently of exploit success substantially improves detection. We introduce HACKTRACE, a behavior-supervised monitor that reads the internal states the agent already computes while generating code. Reusing these states enables monitoring before a turn is complete, without additional language-model tokens or passes. Combining this evidence with static features of the final files achieves a mean per-problem AUC of 0.997 with 8 ms of monitoring overhead, improving both accuracy and latency over monitors that run the model again on an honesty question and answer. The same generation states also provide an inexpensive monitoring signal for reinforcement learning. With strong GRPO penalties, HACKTRACE reduces the cheating share of passing solutions from 82-91% to 1-5%, while retaining honest, correct solutions and maintaining high detection accuracy as the policy evolves. Our results show that both the supervision target and the source of monitoring evidence matter for turning accurate detection into a useful training signal.
Sources
- Understanding intermediate layers using linear classifier probes
- Concrete Problems in AI Safety
- Monitoring Reasoning Models for Misbehavior and the Risks of Promoting Obfuscation
- Eliciting Latent Predictions from Transformers with the Tuned Lens
- Discovering Latent Knowledge in Language Models Without Supervision
- Sycophancy to Subterfuge: Investigating Reward-Tampering in Large Language Models
- EvilGenie: A Reward Hacking Benchmark
- RL-Obfuscation: Can Language Models Learn to Evade Latent-Space Monitors?
- Verbalizable Representations Form a Global Workspace in Language Models
- The Impact of Off-Policy Training Data on Probe Generalisation
- Building Production-Ready Probes For Gemini
- Natural Emergent Misalignment from Reward Hacking in Production RL
- The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasets
- The Effects of Reward Misspecification: Mapping and Mitigating Misaligned Models
- Drop the Act: Probe-Filtered RL for Faithful Chain-of-Thought Reasoning
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- The Obfuscation Atlas: Mapping Where Honesty Emerges in RLVR with Deception Probes
- School of Reward Hacks: Hacking harmless tasks generalizes to misaligned behavior in LLMs
- Monitoring Emergent Reward Hacking During Generation via Internal Activations
- Representation Engineering: A Top-Down Approach to AI Transparency
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems