[KongchangAI]
· 2 min read· 1,144 words

Training Coding Agents: Data Quality Matters More Than Difficulty

Training Coding Agents: Data Quality Matters More Than Difficulty

Audit finds widespread reward label errors in SWE-Gym tasks; corrected training significantly improves policies.

A systematic audit of SWE-Gym found that hidden tests in many coding agent training tasks have incorrect reward labels. Among tasks never solved by the 9B base model, 74% have false negatives—tests incorrectly rejecting correct fixes; among occasionally solved tasks, this proportion is only 20%. After fixing or removing these erroneous tasks, policies trained on audited data outperformed those trained on original data by 2.4 and 2.7 percentage points on SWE-bench Verified and Pro, respectively; simply discarding unsolved tasks brought no such gain. The study also found that about a quarter of patches passing tests are false positives, but capturing some false positives with new tests did not significantly change held-out scores. The team released SWE-Gym-Verified with 1,087 audited tasks and the complete audit process, emphasizing that reward label correctness, not just pass rate, is the core of data quality.

Training coding agents with reinforcement learning often uses hidden tests as reward signals, but task sets typically only verify whether the reference fix passes, ignoring the correctness of the tests themselves. A systematic audit of SWE-Gym found that a large number of tasks have incorrect reward labels, and correcting these errors significantly improves policy performance.

SWE-Gym Data Audit Study

Reward Label Errors: High False Negative Rate in Unsolved Tasks

The research team audited SWE-Gym using two LLM families, counting only errors that were reproduced by execution. Results show that among tasks never solved by the 9B base model, 74% have false negatives where tests reject correct fixes; among tasks the model occasionally solves, this proportion is only 20%. This means "unsolved" often equates to "label error" rather than the task being inherently too difficult.

This finding challenges the common practice of filtering training data by pass rate. Pass rate only indicates whether a task produces a reward, not whether the reward is correct. A task may never be correctly solved due to test defects, and thus be misjudged as a high-difficulty sample.

False Negative in this context refers to tests incorrectly rejecting a correct code fix—i.e., the patch actually fixes the problem, but the test suite judges it as failed. Such errors are extremely harmful in reinforcement learning: the agent receives no reward even when making a correct fix, preventing the policy from learning from correct behavior and potentially pushing it away from the correct solution. False negatives typically stem from imperfect tests, such as insufficient test coverage, overly strict assertions, or dependence on specific implementation details. In the audit, false negatives were confirmed through execution reproduction, meaning researchers actually ran the reference fix and observed test results, thereby distinguishing "the task is inherently too difficult" from "the test is flawed." A high false negative rate indicates that many tasks are misjudged as high-difficulty when in fact the reward signal is wrong.

Fix and Remove: Audited Data Trains Better Policies

The researchers fixed or removed erroneous tasks, and policies trained on the retained audited tasks performed better. Under the same data scale and matched difficulty, models trained on audited data outperformed those trained on original data by 2.4 and 2.7 percentage points on held-out tasks from SWE-bench Verified and SWE-bench Pro, respectively.

In contrast, simply discarding never-solved tasks did not bring similar gains. This indicates the key is correcting reward labels, not crude filtering. The audit process ensures that tests for each retained task can correctly distinguish fixed from unfixed.

False Positives: A Considerable Proportion of Wrong Patches Pass Tests

The study also found that about a quarter of patches that pass tests are false positives—wrong patches that nonetheless pass. Even when new tests captured a quarter of these, there was no detectable change in held-out set scores. This suggests that the negative impact of false positives on policy training may not be as direct as that of false negatives, but it remains an important dimension of data quality.

This result implies that improving test coverage may not immediately translate into policy performance gains; the correctness of reward signals needs to be examined from multiple angles.

False Positive refers to incorrect or incomplete patches that pass the test suite. Opposite to false negatives, false positives provide erroneous positive rewards to the agent, encouraging it to learn repair patterns that superficially pass but are actually wrong. Common causes include incomplete test coverage, weak assertions, or tests that only check partial behavior. In reinforcement learning, false positives may cause the policy to converge to "test-taking" behavior—generating patches specifically targeting test loopholes rather than truly solving the problem. Although this study found that capturing some false positives with new tests did not significantly change held-out set scores, false positives remain an important dimension of data quality, especially in scenarios with low test coverage where they may accumulate into systematic bias.

SWE-Gym-Verified: Reproducible Audited Data and Process

To facilitate follow-up research, the team released SWE-Gym-Verified, containing 1,087 audited tasks, execution evidence for each judgment, the training set, and the complete audit process. This resource allows the community to reproduce audit results and develop more reliable training data on this basis.

The study emphasizes that reward labels themselves must be checked, rather than relying solely on pass rates. For teams building coding agent training sets, this means investing resources to verify test correctness; otherwise, training signals may be wasted on high-difficulty samples, or even systematic bias introduced.

SWE-Gym is a large-scale training environment for software engineering agents, containing issues collected from real code repositories and corresponding test cases, commonly used for reinforcement learning based on hidden tests. Its tasks typically consist of "problem description + codebase snapshot + test suite," and the agent must generate a patch that passes the tests. However, original SWE-Gym tasks only verify whether the reference fix passes, without auditing the correctness of the tests themselves. SWE-Gym-Verified is a version that has undergone systematic auditing on this basis: for each task, the reference fix is executed and test results recorded, false negatives and false positives are marked, and erroneous tasks are then fixed or removed. This dataset contains 1,087 audited tasks and execution evidence, enabling the community to reproduce the audit process and train more reliable agents.

Implications for Coding Agent Training

The core of data quality lies in the correctness of reward labels. Whether a task is valuable depends not only on whether it can produce a reward, but more importantly on whether the reward accurately reflects the correctness of the fix. Although auditing is costly, it brings significant policy improvements.

In the future, training data construction for coding agents should incorporate label verification and publicly release audit evidence to enhance reproducibility. The release of SWE-Gym-Verified provides infrastructure for this direction and reminds researchers: before pursuing larger-scale data, first ensure that the reward signal for each task is trustworthy.

One-line Summary

Audit finds widespread reward label errors in SWE-Gym tasks; corrected training significantly improves policies.

Paragraph Summary

A systematic audit of SWE-Gym found that hidden tests in many coding agent training tasks have incorrect reward labels. Among tasks never solved by the 9B base model, 74% have false negatives—tests incorrectly rejecting correct fixes; among occasionally solved tasks, this proportion is only 20%. After fixing or removing these erroneous tasks, policies trained on audited data outperformed those trained on original data by 2.4 and 2.7 percentage points on SWE-bench Verified and Pro, respectively; simply discarding unsolved tasks brought no such gain. The study also found that about a quarter of patches passing tests are false positives, but capturing some false positives with new tests did not significantly change held-out scores. The team released SWE-Gym-Verified with 1,087 audited tasks and the complete audit process, emphasizing that reward label correctness, not just pass rate, is the core of data quality.

#SWE-Gym#coding agents#reinforcement learning#reward labels#false negatives#data quality#SWE-bench
Share:

Related articles