TL;DR
Training software engineering (SWE) agents requires high-quality, executable data, but naively building environments for thousands of repositories is prohibitively expensive. SWE-Next solves this by introducing "repo-quarter profiles" that reuse environment images across temporally close commits, reducing storage requirements from tens of terabytes to just 639 GB. Combined with strict execution-grounded filtering, SWE-Next automatically extracts thousands of high-signal training tasks from real GitHub pull requests, boosting downstream agent performance without requiring massive compute infrastructure.
What Problem Does This Paper Address?
Large Language Model (LLM)-based agents are increasingly capable of handling complex, multi-step software engineering tasks. To train these agents effectively via Supervised Fine-Tuning (SFT), researchers need realistic, execution-grounded trajectories—step-by-step logs of an agent interacting with a real codebase, running tests, and fixing bugs.
However, scaling this data collection faces two major bottlenecks:
- Data Quality: Only a tiny fraction of real-world repository changes provide clean, verifiable task instances where a bug is cleanly fixed without causing regressions.
- Systems Cost: Naively building a unique Docker container for every single commit pair to isolate dependencies quickly leads to massive storage overhead (tens of terabytes) and slow build times, making large-scale data collection impractical for most research labs.
Methods
SWE-Next introduces a dual-pronged approach addressing both data filtering and systems efficiency:
- Execution-Grounded Commit Filtering: The framework automatically mines real merged pull requests (PRs) from GitHub. It runs the repository's test suite on both the base commit (before the PR) and the merged commit (after the PR). It retains only those pairs classified as
NEWCOMMITBETTER—meaning the merged commit fixes at least one previously failing test and introduces zero regressions. - Repo-Quarter Profiles: Instead of building a heavy Docker image for every single commit, SWE-Next groups commits by repository and calendar quarter (e.g.,
repo_2022Q2). It builds a single shared environment image containing system packages, the Python interpreter, and cached virtual environments for that quarter. - Runtime Isolation & Copy-on-Start: To keep tasks separate and reproducible, the source code is not baked into the Docker image. Instead, the commit-specific repository snapshot is mounted as read-only at runtime and copied into a writable workspace (
copy-on-start), ensuring agent edits don't leak across runs.
Datasets
- Seed Data: 3,971 real Python repositories mined from GitHub (with no overlap with the standard SWE-Bench evaluation set), encompassing 102,582 candidate commit pairs.
- SWE-Next Dataset: After strict filtering, the framework produced 2,308 self-verifying instances spanning 311 repositories, alongside 3.7k successful expert trajectories generated using Claude 4.5 Sonnet and GPT-5-mini.
- Evaluation Benchmarks: The downstream models were evaluated on SWE-Bench Verified and SWE-Bench Lite to measure real-world issue resolution performance.
Key Insights and Ideas
- Data Quality > Trajectory Volume: Traditional approaches focus on generating massive volumes of trajectories. SWE-Next demonstrates that higher-signal, execution-grounded filtering combined with strict submission gating (forcing the agent to produce a non-empty diff and run tests before submitting) yields better downstream performance even with fewer training trajectories.
- Dependencies Evolve Slowly: The core insight behind "repo-quarter profiles" is that while code changes constantly, a project's underlying dependencies change slowly. Capitalizing on this allows for massive amortization of environment build and storage costs.
- Infrastructure is No Longer the Bottleneck: Failure analysis showed that only 2.4% of failed trajectories were due to environment or harness issues. The vast majority (75.7%) failed due to patch quality (the agent modified the right area but missed an edge case), showing that the environment setup is highly stable.
Key Results
- Massive Efficiency Gains: SWE-Next processed over 102k commit pairs across nearly 4,000 repositories in just 30 hours, requiring only 639 GB of environment storage. Without environment reuse, this run would have estimated to require over 30 TB.
- Superior Downstream Performance: Models fine-tuned on SWE-Next trajectories consistently outperformed baselines. For instance, a Qwen2.5-Coder 14B model fine-tuned on SWE-Next achieved 30.0% pass@1 on SWE-Bench Verified, outperforming R2E-Gym (26.8%) and even beating a much larger SWE-Gym 32B model (20.6%).
Limitations and Future Work
- Language Constraint: The current implementation of SWE-Next is strictly focused on Python repositories. Extending the pipeline to support other programming languages with different build systems and test runners remains future work.
- Trajectory Scale: Due to budget and compute constraints, the authors did not scale trajectory generation to its maximum potential, leaving larger-scale trajectory collection as an open area for exploration.
Summary updated