Back to AI Research

AI Research

ExecCritic: Learn to Test, Test to Improve for Codi... | AI Research

Key Takeaways

  • ExecCritic: Learn to Test, Test to Improve for Coding Agents Coding agents often struggle to fix bugs in large software repositories because they lack a reli...
  • Execution feedback can guide coding agents toward correct repository repairs, but only when the tests capture the behavior requested by the issue.
  • Agent-generated tests can encode incomplete or incorrect behavioral targets; when the same trajectory writes both the patch and the test, their errors can agree and create false confidence.
  • We introduce ExecCritic, combining a test--verify--revise scaffold with a role-specific reinforcement learning recipe for training agents within it.
  • Both roles use Qwen-3.5-35B-A3B as the backbone and are trained separately.
Paper AbstractExpand

Execution feedback can guide coding agents toward correct repository repairs, but only when the tests capture the behavior requested by the issue. Agent-generated tests can encode incomplete or incorrect behavioral targets; when the same trajectory writes both the patch and the test, their errors can agree and create false confidence. We introduce ExecCritic, combining a test--verify--revise scaffold with a role-specific reinforcement learning recipe for training agents within it. The scaffold separates test construction from source-code repair: a Test agent independently generates repository-native tests, a fail-closed harness qualifies and freezes them, and a Repair agent revises source code from their execution feedback without changing the tests. Both roles use Qwen-3.5-35B-A3B as the backbone and are trained separately. In Learn to Test, the Test agent learns to produce behaviorally valid tests that distinguish correct from incorrect patches. In Test to Improve, the Repair agent learns both direct task resolution and feedback-guided revision. On SWE-bench Verified, test quality determines whether feedback helps: holding the base Repair agent fixed, tests from the base Test agent reduce resolved rate from a no-test baseline of 61.2% to 57.3%, whereas tests from GPT-5.6-sol raise it to 65.3%. Role-specific post-training raises the Qwen Test agent's Base-to-Gold success from 22.2% to 62.2%; composing the two post-trained Qwen agents reaches 72.6%, an 11.4-point gain over the original no-test baseline without stronger-model or Oracle feedback at evaluation time. Code is publicly available at this https URL .

ExecCritic: Learn to Test, Test to Improve for Coding Agents
Coding agents often struggle to fix bugs in large software repositories because they lack a reliable way to verify their work. When an agent is responsible for both writing a patch and creating the test to validate it, it may inadvertently create a "false confidence" loop: the patch and the test might share the same misunderstanding of the bug, causing the code to pass a flawed test while failing to actually resolve the issue. ExecCritic addresses this by decoupling the testing process from the repair process, using specialized agents trained to generate high-quality, independent tests and perform feedback-guided code revisions. To see openai in practice, Gemini's now Generates Files! walks through a concrete example.

A Two-Stage Scaffold for Repair

The core of ExecCritic is a "test–verify–revise" framework that separates responsibilities. First, a dedicated Test agent explores the repository to generate a "test bundle"—a set of repository-native tests, execution commands, and behavioral contracts. A fail-closed harness then qualifies these tests, ensuring they fail on the buggy code and pass on the correct version. Once qualified, the test is "frozen," meaning the Repair agent cannot modify it. The Repair agent then attempts to fix the source code, receiving execution feedback from the fixed test. This structure prevents the Repair agent from "cheating" by weakening the test to make its own flawed code pass.

Role-Specific Training

ExecCritic uses a reinforcement learning recipe to train the Test and Repair agents separately, ensuring each develops the specific skills required for its role. The Test agent is trained to produce tests that are behaviorally valid and capable of distinguishing between correct and incorrect patches. Meanwhile, the Repair agent is trained to handle both the initial task of writing a patch and the iterative process of revising that patch based on the feedback provided by the fixed test. By training these roles independently, the system ensures that the feedback provided to the Repair agent is both reliable and diagnostic. The ai agents story also surfaces in OpenAI Unveils GPT-Red an Automated Model..., adding another angle.

Performance Gains

Experiments on the SWE-bench Verified benchmark demonstrate that the quality of generated tests is critical to an agent's success. When using lower-quality tests, an agent’s performance can actually decrease compared to a baseline with no tests at all. However, by using the trained ExecCritic agents, the system achieved a 72.6% resolution rate. This represents an 11.4-point improvement over the original no-test baseline. These results highlight that simply adding execution feedback is not enough; the system must be specifically trained to construct meaningful behavioral targets that accurately reflect the requirements of the issue.

Key Considerations

While ExecCritic significantly improves performance, it is important to note that the system's effectiveness relies on the harness's ability to qualify tests. The harness ensures that tests are executable and fail on the buggy repository, but it does not guarantee that a test is perfectly aligned with the underlying issue. Furthermore, the system is designed to operate without relying on stronger models or external "Oracle" feedback during the evaluation phase, proving that agents can learn to self-correct through structured, independent verification. The ai agents story also surfaces in Alibaba Releases Page Agent to Control..., adding another angle. as detailed in the full paper on Arxiv

Comments (0)

No comments yet

Be the first to share your thoughts!