← Latest papers
💻 computer science

SWE-QA: Can Language Models Answer Repository-level Code Questions?

This paper introduces SWE-QA, a repository-level code question answering benchmark derived from 77,100 GitHub issues that addresses the limitations of existing snippet-based datasets by evaluating LLMs on complex, multi-file reasoning tasks through a curated set of 576 questions and an associated agentic framework.

Original authors: Weihan Peng, Yuling Shi, Yuhang Wang, Xinyun Zhang, Beijun Shen, Xiaodong Gu

Published 2026-04-28
📖 4 min read☕ Coffee break read

Original authors: Weihan Peng, Yuling Shi, Yuhang Wang, Xinyun Zhang, Beijun Shen, Xiaodong Gu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to understand how a massive, 10-story library works.

The Problem: The "Snippet" Trap
Until now, most tests for AI "code brains" have been like showing them a single, isolated page from a book and asking, "What does this sentence mean?" While the AI might get that right, real-world software isn't single pages. It's the whole library. To answer a question like, "Why does the front door lock automatically when the sun sets?" you need to walk through the basement, check the wiring in the attic, and read the blueprints in the manager's office. You have to connect dots across many different files.

Previous AI tests failed because they didn't force the AI to do this "library walk." They only tested if the AI could read a single page.

The Solution: SWE-QA (The Library Tour)
The authors of this paper built a new test called SWE-QA. Think of it as a rigorous "library tour" exam for AI.

  • The Source Material: They didn't just make up questions. They went into 15 real, popular software "libraries" (GitHub repositories) and looked at 77,000 real questions that human developers actually asked each other.
  • The Taxonomy (The Map): They organized these questions into a map. They asked: Are we asking What is this? Why was it built this way? Where is the code hiding? or How does it work?
  • The Construction: They created 720 high-quality questions. To answer them, an AI can't just guess. It has to:
    1. Find the right file (like finding the right shelf).
    2. Read the code in that file.
    3. Jump to a different file to see how they connect (multi-hop reasoning).
    4. Synthesize an answer that explains the whole system.

The Experiment: Testing the AI Librarians
The researchers took six of the smartest AI models available (like GPT-5.1, Gemini, and others) and gave them this "library tour" exam. They tested them in three different ways:

  1. The "Memorizer" (Direct Prompting): They just asked the AI the question without giving it the library books.
    • Result: The AI failed miserably. It was like asking someone to describe a library they've never visited.
  2. The "Index Finder" (RAG): They gave the AI a tool to search for relevant pages before answering.
    • Result: Much better! The AI could find the right pages, but sometimes it missed the connections between them.
  3. The "Detective Agent" (Agent Frameworks): They gave the AI a "detective kit" (tools like OpenHands) that let it think, search, read, search again, and connect the dots on its own.
    • Result: This was the winner. The AI that acted like a detective, actively exploring the codebase, got the highest scores (around 70 out of 100).

The Findings: What the AI Can and Can't Do

  • The Good News: AI is getting really good at explaining why things are built a certain way (Design Rationale) or how a specific feature works, especially if the explanation is written clearly in the code comments.
  • The Bad News: The AI still struggles with "Where" questions (finding exactly where a specific variable is defined across 10 files) and complex "What" questions that require tracing a long chain of dependencies. It's like the AI can understand the story of the library, but it sometimes gets lost trying to find the specific key to the back door.
  • The Cost: The "Detective" approach works best, but it's expensive. It uses 100 times more computing power (tokens) than just guessing. It's the difference between a quick glance and a full forensic investigation.

The Conclusion
This paper introduces a new, harder, and more realistic test for AI. It shows that while AI is promising for understanding software, it still needs help to navigate the complex, interconnected nature of real-world code. The best results come from AI agents that can actively "walk" through the code files rather than just reading a single snippet.

In short: We built a harder test to see if AI can really understand a whole software project, not just a tiny piece of it. The AI is getting better, but it still needs a good map and a detective's mindset to solve the hardest puzzles.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →