TL;DR
This paper investigates whether Large Language Models (LLMs) can truly reason over entire codebases, a capability often assumed due to their increasing context windows. The study reveals a significant gap: while LLMs perform well in agentic workflows that break down tasks into smaller chunks, their direct long-context reasoning for complex bug fixing is still severely limited, with performance dropping sharply at 64k tokens.
What Problem Does This Paper Address?
The rapid expansion of context windows in LLMs has led to an expectation that these models can now directly process and understand entire code repositories. This is particularly relevant for software engineering tasks like automated bug fixing, where understanding the broader context of a codebase is crucial. However, it's unclear if LLMs can effectively leverage these long contexts for complex, multi-file reasoning, or if their apparent success in agentic workflows is merely a result of task decomposition into shorter, more manageable segments. This paper aims to bridge this gap by systematically evaluating LLMs' actual long-context reasoning capabilities in realistic bug-fixing scenarios.
Methods
The researchers employed a two-pronged approach:
- Agentic Workflow Evaluation: They first evaluated state-of-the-art LLMs (GPT-5-nano, Deepseek-R1-0528, Qwen3-32B) within an agentic framework called
mini-SWE-agent. This setup mimics how LLMs are often used in practice, breaking down a complex task into a series of smaller interactions. They analyzed the token usage of successful and failed trajectories to understand if these agentic workflows truly utilize long-context reasoning. - Direct Long-Context Evaluation: To isolate the direct reasoning capability, they created a specialized pipeline. This pipeline artificially inflated the context by injecting all necessary files for a given bug fix, ensuring perfect retrieval recall. This allowed them to test single-shot patch generation under genuinely long contexts (64k tokens) without the confounding factor of retrieval.
Datasets
The primary dataset used for evaluation was SWE-bench Verified. This is a curated subset of the SWE-bench benchmark, consisting of real GitHub issues paired with code repositories and human-validated patches. Each issue is verified to be reproducible, ensuring the problem description, tests, and environment reliably reproduce the bug. The authors also created a smaller dataset from SWE-bench Verified for their direct long-context evaluation, containing 100 samples with 100% recall of required files, specifically focusing on a 64k token context length.
Key Insights and Ideas
- Agentic Success ≠ Long-Context Reasoning: The study strongly suggests that strong performance in agentic coding workflows doesn't necessarily imply effective long-context reasoning. Instead, LLMs seem to succeed by decomposing complex problems into smaller, short-context steps.
- Token Usage Doesn't Tell the Whole Story: While failed trajectories in agentic workflows tend to consume more tokens, the average token count for successful runs remains well under 20k-30k. This indicates that current agentic benchmarks might not be pushing the limits of LLM context capacity.
- Direct Long-Context Reasoning is Fragile: When directly tested with long contexts (64k tokens) and perfect file retrieval, LLMs show a dramatic drop in performance, highlighting a significant gap between their nominal context window and their usable context capacity.
- SWE-bench is Better for Agents: The findings indicate that SWE-bench is more suitable as a benchmark for evaluating agentic workflows rather than direct long-context reasoning capabilities.
Key Results
- Agentic Workflows:
- GPT-5-nano achieved a 31% resolve rate on 100 samples in the
mini-SWE-agentharness.
- GPT-5-nano achieved a 31% resolve rate on 100 samples in the
- Deepseek-R1-0528 achieved a 30.3% resolve rate on 100 samples from SWE-bench Verified.
- Qwen3-32B achieved a 15.2% resolve rate on 100 samples from SWE-bench Verified.
- Token-level analysis showed successful agentic trajectories typically stayed under 20k-30k tokens.
- Direct Long-Context (64k tokens):
- Qwen3-Coder-30B-A3B achieved only a 7% resolve rate.
- GPT-5-nano solved none of the tasks (0% resolve rate).
- Qualitative Failures: Models exhibited systematic failure modes, including hallucinated diffs, incorrect file targets, and malformed patch headers.
Limitations and Future Work
The authors acknowledge that disentangling whether longer contexts lead to worse resolve rates due to confusion or because more challenging issues inherently require more context is a direction for future work. They also note that their direct long-context evaluation used a simplified approach to context injection (BM25 ranking and perfect recall) and that more sophisticated retrieval methods might yield different results.
The paper strongly suggests the need for:
- More long-context focused versions of benchmarks like SWE-bench.
- Targeted advances in LLM architectures and training that explicitly improve long-context reasoning capabilities, rather than assuming it will emerge implicitly from agentic interactions.
- Further research into understanding and mitigating the failure modes observed in direct long-context reasoning.
Summary updated