Introduction
State-of-the-art software engineering (SWE) agents have traditionally relied on training data mined from real-world repositories like GitHub. While historical pull requests and issue reports provide valuable context, this approach suffers from data scarcity in niche domains and a narrow focus on bug-fixing tasks. To address these limitations, this paper introduces SWE-Playground, a fully automated pipeline designed to generate high-quality, synthetic software engineering environments. By training on "dense" synthetic trajectories, coding agents can achieve greater versatility and data efficiency than those trained on much larger, real-world datasets.
The Problem: Data Bottlenecks in SWE Agent Training
Current training paradigms for coding agents face two primary challenges:
- Limited Flexibility: Training is constrained by existing codebases. Generating high-quality data for rare or complex scenarios—such as specific architectural patterns or edge-case algorithmic implementations—is difficult when relying solely on public repositories.
- Narrow Task Focus: Most benchmarks and training sets prioritize issue resolution (bug fixing). However, professional software engineering encompasses a broader range of skills, including system design, library development from scratch, and the creation of comprehensive test suites. Agents trained exclusively on bug-fixing often fail to generalize to these "day-to-day" development activities.
Methods: The SWE-Playground Pipeline
The core contribution of this work is the SWE-Playground pipeline, a hierarchical framework that "hallucinates" complete engineering projects to create rich training data.
The pipeline consists of six distinct stages:
- Project Proposal: An LLM generates a project concept (e.g., a filesystem simulator) based on prompts requiring high algorithmic density and minimal external dependencies.
- Task Decomposition: Projects are broken down into modular phases and individual tasks, each roughly the size of a single pull request.
- Repository Scaffolding: An agent initializes the directory structure, configuration files (e.g.,
pyproject.toml), and function stubs containingNotImplementedError. - Unit Test Generation: Before implementation, a dedicated agent writes a comprehensive test suite. This establishes a verifiable reward signal for the subsequent coding phase.
- Functionality Implementation: The agent implements the required logic. The previously generated tests are used to verify the solution, creating a high-quality, iterative training trajectory.
- Capability-Specific Adaptation: The pipeline can be modified to create specific scenarios, such as injecting bugs into working code to simulate "issue resolution" tasks.
Key Insights: Density and Versatility
The authors identify several critical factors that contribute to the success of synthetic training:
- Learning Density: A key finding is that 704 synthetic trajectories from SWE-Playground outperformed 3,300 trajectories from the R2E-Gym baseline. These synthetic samples contain 2-3x more tool calls and lines of code edited per sample, providing a "higher learning density."
- The "Scratch-Build" Advantage: Training agents to build libraries from a blank slate (de novo development) inherently teaches them how to identify and fix bugs. In contrast, agents trained only on bug-fixing showed performance degradation when tasked with feature development.
- Iterative Self-Verification: The loop between test generation and implementation forces agents to iterate through failures, creating rich "trial-and-error" data that is highly effective for reinforcement learning or model distillation.
- Execution-Based Learning: SWE-Playground trajectories feature a significantly higher proportion of bash execution (41.7%) compared to baselines (~27%), suggesting that agents learn a more robust, execution-based methodology rather than simple token prediction.
Experimental Results
The effectiveness of the synthetic training approach was evaluated across several benchmarks, including SWE-bench Verified (bug fixing), SWT-Bench (test generation), and Commit-0 (building libraries from scratch).
The results demonstrate the superior versatility of the SWE-Play-7B model:
- Benchmark Performance: The model achieved top-tier results on four out of five evaluation metrics. Notably, on the SWT-Bench Resolved Rate, it achieved 3.26%, whereas the larger SWE-smith-7B baseline failed to solve any instances (0.00%).
- Data Efficiency: Despite using a dataset nearly five times smaller than R2E-Gym, the SWE-Playground model reached comparable or superior performance on SWE-bench Verified.
- Generalization: The model showed a +23.14% improvement in coverage delta on SWT-Bench compared to the base Qwen2.5-Coder-7B model, indicating that synthetic training effectively translates to improved testing capabilities.
Conclusion and Future Work
SWE-Playground demonstrates that high-quality synthetic data can overcome the limitations of real-world datasets for training coding agents. By focusing on learning density and a broad spectrum of engineering tasks, the pipeline produces more versatile and efficient models. Future work will explore using these synthetic environments for Reinforcement Learning, allowing agents to self-improve through autonomous exploration without the need for human-written solutions.
Summary updated