Key Moments

How SWE-bench Was Built | Stanford CS329Z Guest Lecture with Carlos Jimenez, Alex Wettig & John Yang

Stanford OnlineStanford Online
Education6 min read83 min video
Nov 30, 2026|6,015 views|42|1
Save to Pod
TL;DR

SWE-bench transformed coding agent evaluations by using GitHub issues and pull requests, but initial models only achieved a 2% success rate, highlighting the immense difficulty of real-world coding tasks.

Key Insights

1

SWE-bench was built using naturally occurring pairs of GitHub issues and pull requests, leveraging readily available, structured data from the open-source ecosystem.

2

Initial models evaluated on SWE-bench achieved a success rate of only 1.96%, underscoring the significant challenge of real-world coding tasks for AI agents.

3

Building SWE-bench involved substantial infrastructure work, including fetching and organizing vast amounts of GitHub data and setting up complex execution environments for testing.

4

The development of SWE-bench was driven by the limitations of existing benchmarks, which were often superficial or artificial, and the desire to evaluate AI's capabilities with long context windows.

5

Despite initial low scores, the creators remained confident due to the natural problem formulation of SWE-bench and the potential for deterministic environments like terminals to improve AI performance.

6

The evolution from SWE-bench to SWE-agent and SWE-smith reflects a progression from creating a benchmark to developing more robust frameworks and tools for training and evaluating AI coding agents.

The limitations of early coding benchmarks

Before SWE-bench, the landscape of AI coding evaluation was dominated by relatively simple, often artificial tasks like few-shot code completion or simple bug fixes, exemplified by benchmarks like HumanEval. While these provided some insight, they failed to capture the complexity of real-world software development. The emergence of models with significantly larger context windows (e.g., 32k to 100k tokens) prompted a search for more challenging and realistic evaluation scenarios. Early explorations into long-context models often focused on artificial 'needle in a haystack' problems, which didn't fully represent the practical applications of coding agents. The prevailing sentiment was that while LLMs were improving, their ability to handle large codebases or complex, multi-step coding tasks remained largely unaddressed by existing benchmarks.

Leveraging GitHub issues for naturalistic evaluation

The core innovation of SWE-bench was its use of GitHub issues and pull requests as the foundation for its benchmark. This approach was chosen because these naturally occurring pairs represent a structured, real-world problem-solution format. An issue describes a bug or a feature request, and a pull request provides the code changes intended to resolve it. This format offered a rich, abundant, and readily available dataset that was far more realistic than synthetic tasks. The creators recognized that this ecosystem provided a 'natural' source for training and evaluation data, requiring only a conceptual leap to harness it. Unlike previous benchmarks that relied on curated, often simplified problems, SWE-bench aimed to test AI agents on actual software development challenges extracted directly from open-source projects.

The immense challenge of early SWE-bench performance

When SWE-bench was first launched, the performance of state-of-the-art models was surprisingly low. The best-performing model achieved a success rate of just 1.96%. This starkly contrasted with much simpler tasks like MMLU, where models scored 40-50%. The creators, however, viewed this low score not as a sign of futility, but as an indicator of the benchmark's rigor and its potential to drive meaningful progress. They believed that the natural, complex nature of the problems, combined with the potential for deterministic execution environments, would allow models to improve over time. This initial result fueled their confidence that SWE-bench was a valuable tool for pushing the boundaries of AI coding capabilities, rather than a measure of current AI limitations.

Building the infrastructure: the 'muck' of SWE-bench

The development of SWE-bench was not just a conceptual exercise; it involved significant engineering and infrastructure challenges. The process required collecting thousands of GitHub issues and their associated pull requests, storing vast code repositories, and setting up robust execution environments capable of running and testing code changes. This often involved dealing with complex dependency management, legacy code, and non-deterministic issues within the environments themselves. The creators described this phase as 'mucking through the mud,' highlighting the tedious, hands-on work of debugging installations, resolving environment conflicts, and ensuring test reproducibility. This effort was crucial because, unlike current benchmarks that might leverage sophisticated AI agents to automate environment setup, the SWE-bench team had to perform much of this manually.

Concerns about data contamination and memorization

A significant concern during the development of SWE-bench was the potential for models to have already seen and memorized solutions to these issues during their training. Since SWE-bench utilizes publicly available GitHub data, there was a risk that models could simply 'recall' the correct code changes without genuine problem-solving ability. However, empirical results quickly showed that this was not the case. Models performed poorly, indicating that the task's complexity and the specific way the data was structured and presented acted as a genuine test. This addressed concerns about data contamination and demonstrated that SWE-bench was indeed measuring emergent coding capabilities rather than simple memorization.

The evolution towards more complex tasks and agents

SWE-bench's success spurred further research and development, leading to extensions like SWE-bench Verified (for more rigorous verification) and SWE-bench Pro (for harder tasks). The creators also recognized the limitations of a purely static benchmark and the growing importance of AI agents. This led to the development of SWE-agent, a framework designed to allow AI agents to interact with the terminal environment and execute code, aiming to automate much of the manual setup and testing that was previously required. This progression from a static benchmark to interactive agents and more sophisticated training methodologies like SWE-smith signifies a maturing field focused on building AI systems capable of performing complex, multi-step software engineering tasks.

Measuring what matters: beyond simple code completion

The discussion also touched upon the future of AI evaluation. While SWE-bench addressed the challenge of real-world coding, the creators suggested that future benchmarks should explore areas like high levels of customization, personalization, and more subjective evaluations. The shift towards agents playing games like Pokémon or interacting in complex digital worlds highlights a move beyond purely code-centric tasks. The challenge lies in developing evaluation methodologies that can capture nuanced interactions, long-term planning, and adaptability in novel environments. The creators emphasized the importance of asking good questions and identifying what is truly worth measuring, acknowledging that the definition of a 'good' benchmark evolves as AI capabilities advance.

The human element in AI evaluation

A recurring theme was the indispensable role of human input and evaluation, even as AI capabilities grow. While AI agents can automate many aspects of benchmark creation and execution, human expertise remains the 'gold standard' for validation and defining what constitutes a successful outcome. The creators stressed the need for 'human signals'—whether from expert code reviews, user feedback, or subjective assessments of AI behavior. They suggested that future evaluation frameworks might need to incorporate more interactive, multi-turn processes that mimic human collaboration and problem-solving, acknowledging that the quest for truly intelligent AI requires understanding and integrating human judgment.

Common Questions

Before SWE-bench, LLM evaluations for programming tasks were often superficial, artificial, or focused on simpler problems like few-shot code completion or debugging, as seen in benchmarks like HumanEval. Long-context evaluations were emerging but were not yet robust.

Topics

Mentioned in this video

Software & Apps
Hugging Face Transformers

A library that was considered during the development of SWE-bench, contributing to the complex environment setup.

Cursor

A company where Alex Wettig worked after his PhD.

SWE-Bench Verified

An enhanced version of SWE-bench that addresses alignment issues.

Claude

A language model mentioned for its ability to play a game of Pokemon, showcasing diverse capabilities beyond standard coding tasks.

GPT-4

A large language model with a 32k token context window, which was considered long at the time SWE-bench was being developed.

Swee Smith

A project inspired by SWE-bench's task format, focusing on training data and agent execution.

Tau-bench

A benchmark that incorporates user feedback into the loop, representing a shift towards more interactive evaluation methods.

Terminal Bench

A benchmark that, unlike SWE-bench's initial approach, focuses on tasks within the terminal environment and emphasizes scientific domains.

SWE-agent

A project that followed SWE-bench, focusing on agent-based programming tasks and refining the evaluation process.

AWS

Amazon Web Services, mentioned as a domain where terminal environments are useful for tasks like software-driven biological experiments.

SymPy

A Python library discussed in the context of fine-tuning smaller models versus using a large, general-purpose model.

SWE-Bench

A benchmark for evaluating the ability of large language models to solve programming tasks, built upon GitHub issues and pull requests.

NumPy

A Python library that presented significant dependency and installation challenges during the development of SWE-bench environments.

Alan Marino

A benchmark mentioned as a potential testbed for exploring certain aspects of evaluation, though it may lack other desired features.

MMLU

A benchmark task that had a significantly higher performance score (40-50%) compared to the initial SWE-bench results (around 2%).

Instinct

A personal agent application that raises concerns about data privacy and user control.

SWE-Bench Pro

A version of SWE-bench designed to handle more difficult tasks.

Devon

An AI coding assistant launched by the company Cognition, which led to widespread adoption of SWE-bench.

HumanEval

A popular benchmark for code completion and correction tasks that was widely used before SWE-bench.

scikit-learn

A Python library where an early SWE-bench problem was identified.

LeetCode

A platform for competitive programming problems, representing a prior approach to evaluating models that SWE-bench aimed to surpass.

matplotlib

A Python library whose backend was unfamiliar to the SWE-bench creators, highlighting the diverse nature of the problems addressed.

InnerCode

A precursor to SWE-agent that involved directing language model outputs to a terminal.

More from Stanford Online

View all 204 summaries

Ask anything from this episode.

Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.

Get Started Free