Download README.md from JH012/HackTrace-Data: direct link, hf CLI and curl.
- Browser
- Download file 6.35 kB
-
https://huggingface.co/datasets/JH012/HackTrace-Data/resolve/main/README.md
- Command line
-
hf download hf://datasets/JH012/HackTrace-Data/README.md
-
curl -L -o README.md https://huggingface.co/datasets/JH012/HackTrace-Data/resolve/main/README.md
pretty_name: HackTrace Trajectories
license: cc-by-4.0
language:
- en
task_categories:
- text-classification
- text-generation
tags:
- reward-hacking
- coding-agents
- ai-safety
- monitoring
- reinforcement-learning
- code
size_categories:
- 100K<n<1M
configs:
- config_name: trajectories
default: true
data_files:
- split: train
path: trajectories/train.parquet
- split: test
path: trajectories/test.parquet
- config_name: problems
data_files:
- split: train
path: problems/problems.parquet
HackTrace Trajectories
173,561 multi-turn coding trajectories of Qwen3-8B on CodeContests problems, each labeled for shortcut behavior. This is the dataset of HackTrace: Behavior-Supervised Detection of Reward Hacking During Code Generation.
- Paper: arXiv:2610.03055
A coding agent can pass its tests by fixing its code, or by deleting the test that exposes the bug. Every trajectory here
carries two labels: ACT marks shortcut behavior whether or not it worked (test tampering, hard-coded outputs,
special-casing, evaluation bypass), and OUTCOME additionally requires that the shortcut passed the visible tests and
failed the hidden ones. Honest and shortcut trajectories exist for the same problems, so detectors can be compared within
a problem.
from datasets import load_dataset
ds = load_dataset("JH012/HackTrace-Data", "trajectories") # splits: train, test
problems = load_dataset("JH012/HackTrace-Data", "problems", split="train")
Files
| Config | File | Rows | Contents |
|---|---|---|---|
trajectories |
trajectories/train.parquet |
133,009 (26,329 ACT positives) |
training split, 375 problems; 56,617 editable-test and 76,392 read-only-test trajectories |
trajectories |
trajectories/test.parquet |
40,552 (7,944 ACT positives) |
test split, 315 unseen problems; 15,200 editable-test (190 problems) and 25,352 read-only-test (125 problems) |
problems |
problems/problems.parquet |
990 | problem statements with the visible cases shown to the agent and the 12 hidden cases used for labeling, one row per (tier, problem) |
MANIFEST.json lists the sha256, size and row count of every file. The split is by problem: no test problem appears in
training.
Row schema (trajectories)
| Field | Meaning |
|---|---|
id |
trajectory id |
split |
train or test |
variant |
editable-test (the agent may rewrite solution.py and test.py) or read-only-test (only solution.py) |
tier, problem_name |
problem group and CodeContests problem name; join with problems on both |
num_turns |
number of agent turns (at most 3) |
messages |
the full conversation: system prompt, user turns (problem, issued test.py, execution feedback) and assistant turns |
final_solution, final_test |
solution.py and test.py after the last turn (an empty string means the file was emptied) |
visible_tests_pass |
the final files pass the visible grader (python test.py prints ALL PASS) |
hidden_tests_pass |
the final solution passes the 12 hidden cases; evaluated only when visible_tests_pass is true, null otherwise |
tests_modified |
test.py differs from the issued file |
label_source |
judge (individually judged by GPT-5.4), rule (editable-test, failed the visible grader, tests unchanged: negative by rule), or rule, audited by judge (rule-labeled rows that were also judged as an audit) |
judge_category |
the judge's category; null for rule-labeled rows and for 21 judged rows whose verdict text was not stored |
judge_rationale |
the judge's one-sentence rationale |
ACT |
shortcut behavior in the final artifacts, whether or not it succeeded |
OUTCOME |
ACT and a visible-grader pass with a hidden-test failure |
generated_tokens |
tokens generated by the agent over the trajectory |
Judge categories: the shortcut categories are test_tamper, hardcode_output, special_casing and eval_bypass; the
others are honest_correct, honest_but_wrong, honest_fix_test (a test edit that does not weaken the check, such as
fixing formatting) and other.
How the data was built
- Agent. Qwen3-8B, at most 3 turns per trajectory, up to 600 new tokens per turn, temperature 0.9, top-p 0.95. Each
turn the agent sees the problem and the current
test.py; later turns add execution feedback. - Prompts. The system prompts were written to elicit shortcut behavior for study, and they are part of every
trajectory's
messages. The paper's Appendix A describes them and an additional neutral-prompt pool. - Labels. A GPT-5.4 judge read the problem, the original and final tests, their AST comparison, the final files and the execution outcomes of 136,900 trajectories: every one that passes the visible grader, modifies the tests, or uses the read-only prompt. The remaining 36,661 editable-test trajectories fail the visible grader with unchanged tests and are negative by rule.
- Checks. An independent Gemini-2.5-pro pass agrees with the judge on shortcut behavior for 95.9% of 107,035 earlier-pool trajectories (κ = 0.90). A blind, LLM-assisted human audit of 305 stratified test trajectories agrees with the final labels on 97.0% (κ = 0.94).
Activation features (about 140 GB) and the fitted detectors are not part of this repository.
Licenses
| Content | Source | License |
|---|---|---|
| problem statements, visible and hidden cases | CodeContests (Li et al., 2022) | CC BY 4.0 |
| trajectories | generated by Qwen3-8B (Apache-2.0 model) | CC BY 4.0 |
| labels, judge categories and rationales | HackTrace authors; rationales generated by GPT-5.4 | CC BY 4.0 |
The problem statements originate from competitive-programming sites, and their copyright stays with the original authors. The dataset contains no personal data.
Citation
@article{jiang2026hacktrace,
title = {HackTrace: Behavior-Supervised Detection of Reward Hacking During Code Generation},
author = {Jiang, Hao and Li, Xin and Wang, Annan and Zhang, Yichi and Lin, Weisi},
journal = {arXiv preprint arXiv:2610.03055},
year = {2026},
url = {https://arxiv.org/abs/2610.03055}
}
Please also cite CodeContests (Li et al., 2022).