Introduction
While Large Language Models (LLMs) have demonstrated remarkable proficiency in generating isolated code snippets, the broader discipline of software engineering remains a challenge for autonomous systems. Real-world engineering requires navigating vast codebases, localizing bugs across disparate files, executing tests, and iteratively refining solutions based on environment feedback.
A primary bottleneck in current autonomous agents is the interface through which they interact with the computer. Most systems rely on standard Linux shells designed for human operators. However, these interfaces are often suboptimal for LLMs; they can be excessively "noisy," flooding the model's context window with irrelevant data, or too "silent," failing to provide actionable feedback when an operation fails. SWE-agent addresses this by introducing the Agent-Computer Interface (ACI), a specialized environment designed to align with the unique strengths and constraints of language models.
The Agent-Computer Interface (ACI)
SWE-agent operates by wrapping a standard computer environment in an ACI that provides high-level, LM-friendly abstractions. This approach mirrors how human developers use Integrated Development Environments (IDEs) to manage complexity.
Key components of the SWE-agent ACI include:
- Summarized Search & Navigation: Standard tools like
grepcan return thousands of lines. The ACI provides custom commands likesearch_dirthat cap results at 50 entries, prompting the agent to refine its query if the output is too broad. This preserves the model's context window for relevant information. - The File Viewer: Rather than reading entire files, agents interact with code through a 100-line "window" equipped with line numbers. Commands like
scrollandgotoallow the agent to navigate large files efficiently. - Linter-Guarded Editing: The
editcommand allows for precise line-range replacements. Critically, every edit is immediately followed by a linter check. If the agent introduces a syntax error, the ACI blocks the change and provides the error message, allowing the agent to self-correct before the environment state becomes unrecoverable. - Context Management: The system automatically collapses historical observations into single-line summaries, ensuring that the most recent and relevant feedback remains prioritized in the model's immediate view.
Experimental Evaluation
The researchers evaluated SWE-agent on SWE-bench, a rigorous benchmark consisting of 2,294 real-world GitHub issues from popular Python repositories such as scikit-learn and django. They also utilized SWE-bench Lite (a 300-instance subset) for ablation studies and HumanEvalFix for multi-language debugging.
Key Results
SWE-agent established a new state-of-the-art for autonomous software engineering agents:
- SWE-bench: Resolved 12.47% of tasks using GPT-4 Turbo, a significant improvement over previous non-interactive RAG-based systems which solved only 3.8%.
- SWE-bench Lite: Resolved 18.0% of tasks.
- HumanEvalFix: Achieved an 87.7% pass@1 rate.
- Model Agnosticism: The ACI proved effective across different models; when paired with Claude 3 Opus, the system still resolved 10.5% of SWE-bench tasks.
Insights and Discussion
The study highlights several critical principles for agent design. First, signal-to-noise ratio is paramount; every irrelevant character in a shell output is a token that consumes the model's reasoning capacity. Second, guardrails such as integrated linters are essential to prevent "cascading failures," where an agent spends its entire budget trying to fix a broken environment rather than the original bug.
Furthermore, the data suggests that success is fast, while failure is slow. Successful agents typically identify a fix within 12 turns (median cost of $1.21). If a solution is not reached by turn 20, the agent is likely stuck in a loop, suggesting that simply increasing the computational budget or "time" does not linearly improve success rates.
Conclusion and Future Work
While SWE-agent represents a major leap forward, 87.5% of real-world issues remain unsolved. Analysis shows that over half of these failures are due to logic errors—where the agent uses the tools correctly but fails to understand the required fix. Future research will focus on expanding the ACI to support more languages, integrating advanced tools like web browsing, and exploring automated ACI design, where agents can optimize their own interfaces to better suit their reasoning patterns.
Summary updated