TRANSMISSION // 2611.30207v1

When coding-agent tests reward the wrong fixes

Source published

An audit of SWE-Gym finds that hidden tests can reject valid fixes or accept faulty ones—and that checking the tests may matter more than filtering hard tasks.

AI-generated conceptual illustration for When coding-agent tests reward the wrong fixes
AI-generated conceptual illustration; not documentary evidence.

Reinforcement learning teaches coding agents through rewards for passing hidden tests. But what if those tests reward the wrong thing? A study auditing SWE-Gym suggests that test quality—not just task difficulty—can shape what agents learn.

In reinforcement learning, a coding agent tries to solve a software task, and hidden tests determine whether it receives a reward. Those tests are often treated as labels for correct and incorrect fixes. But a test can be wrong in either direction: it may reject a fix that meets the task’s requirements, or accept a patch that leaves a bug elsewhere. A new preprint asks whether checking these reward labels can improve training data for coding agents.

The researchers studied SWE-Gym, a collection of software tasks drawn from open-source repositories. Each task pairs a repository and an issue with tests associated with the fix. The usual screening checks that the reference fix passes and the original code fails. That shows a reward is attainable, the authors argue, but not that every valid fix will earn it—or that every rewarded fix is valid.

The team audited tasks using two large-language-model families, Claude and GPT. The models examined individual test assertions for possible false negatives: cases where a correct patch would fail. A suspicion counted only when the researchers produced and ran an alternative patch that followed the task description but was rejected by the test. For false positives, they looked at patches that passed and counted one as wrong only when model judgments were supported by an executed counterexample showing a regression.

The audit found that false negatives were concentrated among tasks the 9-billion-parameter base model never solved. In the study’s original training pool, 74% of never-solved tasks were judged to have tests that rejected correct fixes, compared with 20% of tasks the model solved sometimes. Across the audited tasks whose assertions were judged, 55% received a false-negative verdict. The authors also found that about a quarter of the passing patches they examined were false positives under their conservative definition; many other patches could not be confidently classified.

These patterns matter because a task’s failure to earn reward does not explain why it failed. A task may be genuinely difficult—or its tests may demand details the issue never specified, such as exact warning wording. The researchers found that simply dropping tasks the base model never solved did not remove many of the flawed tasks that still influenced training. In the GRPO training method they used, tasks contribute to learning when samples receive different rewards. Some flawed, sometimes-solved tasks therefore remained active in training, potentially favoring patches that matched unstated test expectations.

To test whether an audit made a practical difference, the researchers trained a 9B model on equal-sized sets of 512 tasks, matched for difficulty. The audited set was assembled by repairing or removing problematic tasks. Across three training runs, models trained on this set scored 2.4 percentage points higher on held-out SWE-bench Verified tasks and 2.7 points higher on SWE-bench Pro than models trained on the original set. Simply replacing never-solved tasks with sometimes-solved ones did not produce a comparable gain. This comparison suggests that filtering by solve rate alone is not a substitute for checking what the tests reward.

The team also added tests designed to catch some wrong patches that had passed. These tests caught about a quarter of the identified false positives in the relevant sample. Training on the strengthened tests did not produce a detectable change in held-out scores. That result does not establish that the policies were equivalent: the study had only three runs per set, and its authors say the held-out scores could not show whether agents produced fewer wrong patches that passed.

The work has important limits. It examines one task source, one base model, one agent setup and one reinforcement-learning recipe, with an 80-step training budget and three random seeds. The audit’s judgments were made by language models, although suspected errors had to be reproduced in execution and two authors independently checked a sample. Human reviewers did not inspect every task. The false-positive count was limited to regressions that could be demonstrated with a counterexample, while the held-out benchmarks may also contain flawed tests.

The authors release SWE-Gym-Verified, a set of 1,087 audited tasks, along with verdicts, execution evidence, training sets and the audit pipeline. The paper is a preprint, so its findings have not necessarily been peer reviewed. Its results do not show that auditing will improve every coding-agent training system, but they highlight a basic measurement problem: a high pass rate says that tests are being passed, not that the reward is correct.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • When Coding Tests Reward the Wrong Fix

    Supporting evidence: Both studies report that software tests can provide misleading RL rewards, but they examine different errors and populations: Zhang et al. audit SWE-Gym task tests for tests rejecting correct fixes and patches passing despite regressions, while Rajan measures test-passing patches that differ from gold fixes in SWE-bench Verified and training trajectories. Together they support the bounded point that execution-based checks can expose reward-label errors; their rates are not directly comparable because the datasets, error definitions, and audit procedures differ.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.30207v1 — Original paper

      Excerpt reference: static/papers/2611.30207v1.md:13-93
      Basis: Paper text
      Source SHA-256: b5323d72773a4f4c025a202c6d24f6dd78cc301e6a49cb240cc92883e4905e64

    • 2611.30207v1 — Original paper

      Excerpt reference: static/papers/2611.30207v1.md:344-490
      Basis: Paper text
      Source SHA-256: b5323d72773a4f4c025a202c6d24f6dd78cc301e6a49cb240cc92883e4905e64

    • 2606.16062v2 — Original paper

      Excerpt reference: static/papers/2606.16062v2.md:13-71
      Basis: Paper text
      Source SHA-256: 9d29831a309e2f5193b03086a4c52f3ec0cf4ac33eba6bff299df59e4399b90d

    • 2606.16062v2 — Original paper

      Excerpt reference: static/papers/2606.16062v2.md:246-292
      Basis: Paper text
      Source SHA-256: 9d29831a309e2f5193b03086a4c52f3ec0cf4ac33eba6bff299df59e4399b90d

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.