Abstract
Software engineering (SWE) agents require the ability to navigate complex, fragile runtime environments and reason across large, interdependent codebases. A significant bottleneck in training these agents is the scarcity of high-quality, executable test cases to verify code patches. We present SWE-Dev, an open-source SWE agent that achieves state-of-the-art performance by scaling both training data and inference compute. By utilizing a novel LLM-based pipeline to automatically generate executable test cases, we developed a high-quality training dataset that enables our 32B parameter model to achieve a 36.6% resolve rate on SWE-bench-Verified, outperforming GPT-4o.
Introduction
While Large Language Models (LLMs) have demonstrated proficiency in generating standalone code snippets, real-world software engineering presents a more complex challenge. Agents must interact with toolchains, manage environment dependencies, and provide solutions that are not just syntactically correct but functionally valid within a specific system.
The primary obstacle to training effective SWE agents is the lack of reliable reward signals. Most open-source datasets, such as those derived from GitHub pull requests, often lack the accompanying test environments necessary to prove a patch actually fixes a bug. Without verification, training agents via reinforcement learning (RL) or trial-and-error remains difficult. SWE-Dev addresses this by introducing a scalable method for automated test case generation and demonstrating the impact of scaling interaction budgets during inference.
Methodology
1. Automated Test Case Generation Pipeline
To overcome the failure rates of end-to-end LLM test generation, we implemented a phased approach that uses structured reasoning as an anchor:
- Extraction: Repository information and the "golden" PR patch are extracted.
- Structured Specification: An LLM generates a high-level scenario using Gherkin syntax (Given/When/Then). This forces the model to reason about the logic before writing code.
- Translation: A code-specific LLM translates the Gherkin description into a functional Python test case.
- Refinement: An optional revision step utilizes traceback errors to fix tests that fail incorrectly.
2. Post-Training Optimization
We generated thousands of agent trajectories using DeepSeek-V3 and explored various optimization strategies. Surprisingly, Rejection Sampling Fine-Tuning (RFT) consistently outperformed offline RL methods like KTO and OREO. We hypothesize that offline RL struggles in this domain because on-policy negative examples introduce excessive noise, whereas RFT focuses on high-quality positive trajectories that drive more stable policy optimization.
3. Inference Scaling (Iteration Scaling)
Rather than relying solely on independent restarts (the standard pass@k metric), we scaled compute by increasing the interaction budget within a single task run. By allowing the agent more turns (e.g., increasing the limit from 30 to 75 rounds), the model is given the opportunity to iteratively test, fail, and self-correct. This approach more closely mirrors the workflow of human developers.
Experimental Results
Training and Evaluation
Our training data was derived from 240k PyPI packages, filtered to 38k high-quality instances across 4.4k repositories. This pipeline successfully synthesized 4,630 executable fail-to-pass test cases. Evaluation was conducted on SWE-bench-Verified, a rigorous subset of 500 real-world GitHub issues curated by OpenAI.
Performance Benchmarks
- State-of-the-Art Results: SWE-Dev-32B (based on Qwen2.5-Coder) achieved a 36.6% resolve rate on SWE-bench-Verified. This exceeds the performance of GPT-4o (33.2%) and matches larger open-source models like SWE-Syninfer-72B, despite having less than half the parameters.
- Efficiency at Scale: The SWE-Dev-7B model achieved a 23.4% resolve rate, demonstrating that the training pipeline is highly effective even for smaller model architectures.
- Impact of Iteration: Increasing the interaction budget from 30 to 75 rounds improved the 32B model’s resolve rate from 34.0% to 36.6%, confirming that "letting the agent cook" leads to higher success rates through self-correction.
Discussion and Key Insights
Scaling Laws in SWE
Our findings suggest that agent performance scales near-linearly with the logarithm of training data size. Notably, larger models (32B) appear to extract richer inductive biases from the data, showing a sharper improvement curve than 7B models as the dataset grows.
The Importance of Phased Reasoning
Merging test description and code generation into a single prompt often results in irrelevant tests. The use of Gherkin-style specifications acts as a reasoning anchor, significantly boosting the validity and relevance of the generated tests.
Limitations and Future Work
While iteration scaling is effective, it eventually hits diminishing returns. The jump from 30 to 45 rounds is significantly more impactful than the jump from 45 to 75. Future research should focus on adaptive iteration strategies that dynamically allocate compute based on the perceived complexity of the task. Additionally, while offline RL showed limited gains, we believe online RL—where agents interact with dynamic environments during the training phase—represents the next major frontier for SWE agent development.
Summary updated