Back to articles

When Coding-Agent Training Tests Get the Answer Wrong

3 min read

In reinforcement learning for coding agents, tests often determine the reward: a patch that passes earns credit, while one that fails does not. But a test suite running successfully is not the same as a test suite correctly distinguishing good code from bad. A systematic study of SWE-Gym examines that gap, asking whether the tasks used to train coding agents carry reliable reward labels.

What the audit found

The researchers reviewed SWE-Gym with two LLM families. They used an execution-based standard: a suspected issue counted only when they could reproduce it by running the code. Among tasks that a 9B base model never solved, 74% had at least one test that rejected a correct fix—a false negative. The equivalent share was 20% for tasks the model solved sometimes. In other words, an agent’s repeated failure to earn reward may reflect a faulty test label, not just an especially hard task.

The team repaired or removed problematic tasks and compared training data under controlled conditions. With dataset size held equal and task difficulty matched, models trained on the audited tasks scored 2.4 points higher on held-out SWE-bench Verified tasks and 2.7 points higher on SWE-bench Pro than models trained on the original tasks. Simply dropping tasks the 9B model never solved did not produce the same gains. The distinction matters: filtering for apparent difficulty is not equivalent to checking whether the reward itself is correct.

The audit also identified the opposite failure: false positives, where an incorrect patch passes. These made up about a quarter of all passing patches. New tests caught about a quarter of those false positives, but the researchers did not detect a corresponding change in held-out scores. That finding does not show that false positives are harmless; it cautions against assuming that catching more of them will automatically improve benchmark performance.

Why it matters

For reinforcement learning, tests are part of the training signal as well as a way to evaluate a finished agent. A mistaken label can teach an agent that a valid repair is a failure, or that a flawed patch is acceptable. A pass rate tells us whether a task produces reward; it does not establish that the reward is deserved. Data curation therefore needs to examine test correctness, not just task counts, difficulty, or solve rates.

The researchers release SWE-Gym-Verified, comprising 1,087 audited tasks, verdicts accompanied by execution evidence, training sets, and the full audit pipeline. This makes it possible for others to inspect and reproduce the judgments rather than treating data quality as an unverified claim. The results are specific to the studied task collection, models, and benchmarks, so they should not be read as a guarantee of the same gains across all coding-agent training.

Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles