Back to articles
Reinforcement Learning

FC-SWE Teaches Software Agents to Learn from Failed Patches

3 min read

Introduction

Repository-level software engineering is a long-horizon problem rather than a one-shot code-generation task. An agent must inspect a codebase, reason about the issue, edit files, invoke tools, and run tests. When a patch fails, the verifier often provides valuable clues about what went wrong. FC-SWE, proposed by an NVIDIA research team, makes that failure-and-recovery process part of reinforcement learning instead of treating each attempt as an isolated sample.

What changes in FC-SWE

A conventional GRPO setup generally samples several independent trajectories for the same issue, evaluates their patches, and compares terminal rewards. This can distinguish successful from unsuccessful outcomes, but it does not normally feed the failed patch or test output into a subsequent generation. FC-SWE organizes attempts into chains:

  • Failure-conditioned context: after verification failure, the repository is restored to its original task state. The next attempt receives the issue, the failed patch, and verifier feedback as context.
  • Trajectory-local rewards: each attempt keeps its own verification outcome. A successful recovery does not incorrectly assign credit to the earlier failed patch.
  • Active-set advantage estimation: the comparison group contains only the initial and recovery trajectories actually executed for that issue. Failed attempts remain visible, while attempts that were never triggered are not treated as observations.

This design addresses a structural difficulty in recovery training. Whether a later trajectory exists depends on the previous result, while its conditioning information depends on the previous execution. Resetting the repository also helps separate feedback-guided repair from continued editing of a potentially corrupted state.

Results and interpretation

The study evaluates Qwen3.5-4B with SWE-agent on all 500 SWE-bench Verified tasks under a verifier-assisted, multi-attempt protocol. FC-SWE reaches 41.7% Resolved@1 and 52.8% Resolved@2, compared with 38.9% and 48.5% for the GRPO baseline. Although training chains contain at most two attempts, the method reaches 70.7% Resolved@11 when given an eleven-attempt test-time budget.

The metric definition matters. Resolved@K measures cumulative success within up to K feedback-linked attempts. It is not independent-sampling Pass@K, and it should not be read as a standard single-attempt leaderboard score. The results therefore support a narrower conclusion: FC-SWE improves recovery under a verifier-assisted interaction protocol, rather than proving a universal improvement for every software engineering setting.

Why it matters

The main contribution is conceptual as much as numerical: a failed patch becomes a source of learning context rather than only a negative reward. This is particularly relevant for agent systems that face expensive tests, stateful repositories, and multi-turn tool use. Open questions include scaling recovery chains beyond two training attempts, controlling verifier cost, and maintaining stable learning when feedback is noisy or incomplete. The authors say the implementation is planned for a dedicated NVIDIA NeMo RL branch and is not yet available.

Source: Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles