Full text not available for this paper
SWE-Growth: Teacher-Guided Adaptive Self-Play for Software Engineering Agents
Summary (Overview)
- Novel framework: SWE-Growth introduces a teacher-guided adaptive self-play framework for training software engineering agents, using task-level gaps between a frozen Teacher and the current Student to coordinate supervised fine-tuning (SFT), reinforcement learning (GRPO), and task generation.
- Key insight: Most self-play generated tasks (79.4%) provide zero group-relative learning signal under binary repair rewards; however, a frozen Teacher can identify learning opportunities within "silent" all-fail groups by providing verified repair demonstrations.
- Curriculum design: Tasks with all-fail Student outcomes but reliable Teacher success (≥2/4 attempts) provide SFT demonstrations; after SFT, refreshed Student rollouts identify mixed-outcome tasks with positive Teacher–Student gaps for GRPO.
- Results: Starting from 101 seed issues, SWE-Growth improves Qwen3-Coder-30B-A3B-Instruct from 27.7% to 31.7% on SWE-bench Pro and from 11.0% to 17.2% on held-out TerminalBench 2.1 by Round 2, exceeding Student-only self-play by 2.6 and 4.1 percentage points respectively.
- Key finding: A weak Teacher (with lower aggregate performance than the Student) can still provide valuable task-level guidance, and the trained Student can solve tasks that neither the initial Student nor the Teacher solves.
Introduction and Theoretical Foundation
Background
Large language model (LLM)-based software engineering agents solve repository-level issues by exploring codebases, editing source code, and checking changes through execution. Training typically relies on prepared tasks, executable repository environments, and successful repair examples. As agents improve, some tasks become too easy while others remain beyond current capability, motivating adaptive task selection.
Motivation: From Task Generation to Learning Signals
The paper identifies a critical bottleneck in self-play for software engineering: generating tasks does not ensure useful learning signals. Under binary repair rewards, tasks where all sampled attempts succeed or fail provide zero group-relative advantages (a concept from Shao et al., 2024).
Diagnostic analysis (with G=4 repair attempts per task, 63 complete Student groups across Go, Python, TypeScript, and JavaScript):
| Student-only GRPO (N=63) | Teacher on all-fail (N=47) | Selected subset |
|---|---|---|
| All-fail: 47 (74.6%) | All-pass: 3 (4.8%) | Mixed: 13 (20.6%) |
| Silent: 50 (79.4%) | T≥1/4: 17 (36.2%) | T≥2/4: 9 (19.1%) |
| — | — | 0/4→mixed: 3/5 (60.0%) |
A group is "silent" when its four Student rollouts receive identical rewards (zero group-relative advantage). T≥k/4 means the Teacher succeeds in at least k of four attempts.
Key observations:
- Only 20.6% of Student groups contain both successes and failures (usable for GRPO)
- The frozen Teacher succeeds on 36.2% of all-fail tasks, providing verified repair demonstrations
- After SFT on Teacher demonstrations, 60% of previously all-fail tasks yield mixed Student outcomes
This motivates using task-level Teacher–current Student gaps to guide curriculum selection.
Methodology
Problem Formulation
Let denote a clean repository task (repository revision, task context, and designated tests). An Injector policy proposes a bug patch , producing a synthetic repair task . A Student Fixer interacts with the modified repository and submits a repair patch . A frozen Teacher Fixer attempts the same task under a matched interaction budget.
Learning to Inject Repository Bugs
The Injector generates injection patches:
Only injections passing execution validation enter the repair curriculum.
EVT Validation of Injected Bugs
Three sequential checks validate injections:
- Executability : clean repository and test harness run successfully
- Validity : injection patch applies and satisfies edit constraints
- Target regression : target tests change from passing to failing
A task is retained only when , non-target tests remain passing, and the patch satisfies non-catastrophic-edit constraints.
Repair Evaluation and Curriculum Routing
For each validated task , the Student performs independent repair rollouts ( by default). A candidate patch receives reward:
where , , are binary indicators for successful patch application, target-test restoration, and non-target-test preservation.
For agent at round , the estimated success rate is:
The Teacher–Student capability gap is defined as:
Curriculum Pools
SFT pool (Student-zero tasks with reliable Teacher successes):
With , this requires at least one Teacher success in two of four attempts.
GRPO pool (mixed Student outcomes with positive gap):
Training Objectives
SFT objective with mixed demonstrations and replay examples:
GRPO objective with clipping and KL penalty:
where denotes valid action-token positions across retained decision records of rollout .
Injector Feedback
A valid injection earns reward if its task enters the SFT or GRPO pool:
where indicates SFT or GRPO eligibility, and is 1.0 for non-executable/catastrophic injections, 0.4 for evaluable but invalid patches, and zero for valid edits without target regression.
Two-Stage Asynchronous Execution
The Injector generates bugs while the Student and Teacher evaluate previously generated tasks asynchronously. Complete Student-zero and mixed-outcome groups enter the Teacher queue for evaluation, and Teacher results determine task eligibility for SFT and GRPO.
Empirical Validation / Results
Main Results (SWE-bench Pro and TerminalBench 2.1)
| Model / Method | Round | SWE-bench Pro Resolve rate (%) ↑ | TerminalBench 2.1 Success rate (%) ↑ |
|---|---|---|---|
| Backbone and baselines without self-play | |||
| Qwen3-Coder-30B-A3B-Instruct | – | 27.7 ± 1.3 | 11.0 ± 1.7 |
| Qwen3.6-35B-A3B (Teacher reference) | – | 38.5 ± 1.9 | 42.1 ± 2.4 |
| SWE-MeM SFT+RL | – | 31.1 ± 1.1 | – |
| Teacher Distillation † | – | 30.8 ± 0.9 | 9.8 ± 2.2 |
| Student-only self-play | |||
| Self-Play SWE-RL † | 0 | 28.2 ± 1.1 | 11.8 ± 1.7 |
| 1 | 28.6 ± 1.3 | 12.7 ± 1.6 | |
| 2 | 29.1 ± 1.3 | 13.1 ± 2.1 | |
| Teacher-guided self-play | |||
| Self-Play SWE-RL + Teacher † | 0 | 28.4 ± 1.4 | 13.1 ± 1.7 |
| 1 | 29.2 ± 1.1 | 14.0 ± 1.3 | |
| 2 | 29.9 ± 1.4 | 14.7 ± 1.9 | |
| SWE-Growth (Ours) | 0 | 28.5 ± 1.3 | 13.8 ± 2.2 |
| 1 | 30.2 ± 1.1 | 16.0 ± 1.9 | |
| 2 | 31.7 ± 1.1 ∗ | 17.2 ± 2.2 ∗ |
Notes: ∗ denotes significant improvement over Round-2 Self-Play SWE-RL + Teacher (paired t-test, p < 0.05). † Our implementation.
Learning Beyond Teacher Coverage
With a strong Teacher (Qwen3.6-35B-A3B), the Round-1 Student solves 20 tasks that neither the initial Student nor the Teacher solves (on 688 common tasks). Language-wise, gains exceed losses in all four languages (Go, Python, TypeScript, JavaScript).
With a weak Teacher (Qwen3.5-9B, which solves 192/731 tasks vs. 199 for the initial Student), the trained Student solves 208 tasks, exceeding both the initial Student (195) and the Teacher (192), including 25 tasks missed by both original models.
Ablation Results
| Round | Method | SWE-bench Pro (%) ↑ | Terminal-Bench (%) ↑ | CCR (%) ↑ | CMR (%) ↓ |
|---|---|---|---|---|---|
| Round 1 | SWE-Growth | 30.2 ± 1.1 | 16.0 ± 1.9 | 100.0 | 0.0 |
| vs. SFT only | 29.1 ± 0.9 | 11.3 ± 1.1 | — | — | |
| vs. GRPO only | 28.5 ± 1.3 | 12.0 ± 1.3 | 100.0 | 0.0 | |
| vs. No refresh | 28.7 ± 1.3 | 11.3 ± 0.9 | 58.1 | 15.1 | |
| vs. Fixed-pair gap | 28.2 ± 0.8 | 11.0 ± 1.1 | 29.4 | 42.4 | |
| Round 2 | SWE-Growth | 31.7 ± 1.1 | 17.2 ± 2.2 | 100.0 | 0.0 |
| vs. SFT only | 30.4 ± 1.6 | 13.7 ± 1.9 | — | — | |
| vs. GRPO only | 31.4 ± 1.3 | 16.5 ± 1.5 | 100.0 | 0.0 | |
| vs. No refresh | 31.0 ± 1.1 | 16.0 ± 1.3 | 78.5 | 9.5 | |
| vs. Fixed-pair gap | 30.8 ± 1.6 | 15.4 ± 2.1 | 44.3 | 44.9 |
Curriculum metrics:
where is the common candidate pool satisfying and .
Key ablation findings:
- SFT and GRPO are complementary: SFT-only performs better in Round 1 on SWE-bench Pro; GRPO-only approaches full method by Round 2
- Refreshing task selection matters: "No refresh" (stale selections with fresh rollouts) misses newly eligible tasks (CCR drops to 58.1% in Round 1)
- Fixed-pair gap fails: Using a gap between two frozen models (Qwen3.6 vs. Qwen3.5) instead of Teacher–current Student gap yields poor alignment (CCR 29.4%, CMR 42.4%)
Scaling Analysis
| Source Tasks | SWE-bench Pro (best round) | TerminalBench (best round) |
|---|---|---|
| 101 | 32.0% | 17.5% |
| 400 | 32.6% | 17.7% |
| 1000 | 33.3% | 16.1% |
Larger source-task pools support higher in-domain scores over more rounds, but cross-domain gains are not monotonic (1000 tasks yields lower TerminalBench than 400 tasks).
Theoretical and Practical Implications
Theoretical Contributions
-
Task-level Teacher–Student gaps as curriculum signals: The paper demonstrates that gaps between a frozen Teacher and evolving Student provide a principled way to allocate supervision, targeting tasks where the Teacher demonstrates verified local strengths the Student has yet to acquire.
-
Silent groups are learnable: The key theoretical insight is that all-fail groups (which provide zero group-relative advantage for GRPO) can still offer learning opportunities when a Teacher provides verified repairs, transforming them into useful SFT demonstrations.
-
Complementarity of SFT and GRPO: The staged SFT→GRPO pipeline leverages Teacher demonstrations to bootstrap Student capabilities, then uses refreshed Student rollouts to identify tasks where the Student can now generate its own success/failure comparisons for reinforcement learning.
-
Weak Teacher effectiveness: A Teacher with lower aggregate performance can still provide valuable task-level guidance, suggesting that task-level complementarity matters more than aggregate superiority.
Practical Implications
-
Data efficiency: SWE-Growth achieves 31.7% on SWE-bench Pro from only 101 seed tasks, outperforming SWE-MeM SFT+RL (31.1%) which uses thousands of source training problems.
-
Cross-domain generalization: The method improves TerminalBench 2.1 performance from 11.0% to 17.2% without training on TerminalBench tasks, while Teacher Distillation actually degrades cross-domain performance (11.0% → 9.8%).
-
Curriculum design principles: Refreshing task selection against the evolving Student is critical—stale selections miss newly eligible tasks, and fixed model-pair gaps do not reliably track the current Student's needs.
Conclusion
SWE-Growth introduces a teacher-guided adaptive self-play framework that uses task-level Teacher–Student gaps to coordinate SFT, GRPO, and task generation. Starting from 101 seed issues, it achieves 31.7% on SWE-bench Pro and 17.2% on TerminalBench 2.1, outperforming Teacher-augmented self-play by 1.8 and 2.5 percentage points respectively. Results with a weaker Teacher highlight the value of task-level complementarity over aggregate capability.
Limitations and Future Directions
- Teacher configurations: Limited set of Teacher configurations studied; effects of Teacher capability and demonstration format warrant further study
- Gap estimation noise: Empirical gaps estimated from few rollouts ( or ) are sensitive to sampling variability; incorporating uncertainty into task selection is future work
- Selection bias: Selecting tasks based on frozen Teacher success may exclude tasks learnable through other supervision forms
- Domain generalization: Evaluation covers repository-level code repair and terminal-based tasks; generalization to other domains remains to be established
- Safety considerations: Automated bug injection could be misused; agent-generated code requires human review before deployment
Related papers
- Inside the Loop: A Mechanistic Study of Looped Transformers on Permutation Traversal
Looped transformers solve sequential algorithmic tasks untied models of equal effective depth cannot, by executing one algorithm step per iteration without intermediate supervision.
- InfuseLoop: Cross-Trajectory Latent Injection for Scalable Parallel Looped Transformers
InfuseLoop injects cross-trajectory latent states into parallel looped transformers, eliminating training spikes and enabling quality gains at 8 loops with minimal overhead.
- Do Halting Heads Really Save Compute in Looped Language Models?
Halting heads in looped language models save far less compute than reported because mixture-trained heads rarely stop tokens and batching overhead eliminates most remaining gains.