hacktrace: behavior-supervised detection of reward hacking during code generation

Hao Jiang, Xin Li, Annan Wang, Yichi Zhang, Weisi Lin
10/2/2026
cs.AI

No confident code implementation found for this paper.

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.

Show full abstract

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.

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{jiang2026hacktrace,
  title  = {hacktrace: behavior-supervised detection of reward hacking during code generation},
  author = {Hao Jiang and Xin Li and Annan Wang and Yichi Zhang and Weisi Lin},
  year   = {2026},
  eprint = {2610.03055},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.03055v1}
}

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

Discussion