NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering

John Yang, Carlos E Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik R Narasimhan, Ofir Press

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.

Comparison of interaction paradigms: Humans utilize UIs (like VS Code), while LM Agents utilize ACIs (like SWE-agent's toolset).

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.

The SWE-agent system loop, where LM-friendly commands and environment feedback facilitate autonomous software engineering.

Key components of the SWE-agent ACI include:

  1. Summarized Search & Navigation: Standard tools like grep can return thousands of lines. The ACI provides custom commands like search_dir that 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.
  2. The File Viewer: Rather than reading entire files, agents interact with code through a 100-line "window" equipped with line numbers. Commands like scroll and goto allow the agent to navigate large files efficiently.
  3. Linter-Guarded Editing: The edit command 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.
  4. 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

BibTeX
@inproceedings{yang2024swe,
  author = {John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
  title = {{SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=mXpq6ut8J3},
}
Figure