The SWE-Bench Illusion: When State-of-the-Art LLMs Remember Instead of Reason

Shanchao Liang, Spandan Garg, Roshanak Zilouchian Moghaddam · DOI

Introduction

The integration of Large Language Models (LLMs) into software engineering workflows has necessitated robust evaluation frameworks. SWE-Bench has emerged as a primary benchmark, tasking models with resolving real-world GitHub issues. However, a critical concern persists: are these models genuinely reasoning through complex software bugs, or are they merely recalling solutions encountered during their extensive training on public repositories? This paper investigates the "memorization illusion," suggesting that current state-of-the-art (SOTA) performance may be heavily inflated by data contamination.

Methodology: Context-Constrained Diagnostic Tasks

To isolate reasoning from retrieval, the authors developed three diagnostic tasks designed to restrict the model's access to the codebase context. By stripping away the repository structure, any success in these tasks serves as a "smoking gun" for memorization.

Diagnostic tasks mapping bug fixing subtasks to context-constrained evaluations.
  1. File-Path Identification: Models are provided only with an issue description and repository name. Without access to the file tree, they must predict the exact buggy file path. Success here strongly suggests the model remembers the specific issue from its training data.
  2. Function Reproduction: Given an issue and a file where the buggy function has been completely deleted, the model must reconstruct the code without function signatures or documentation.
  3. Prefix Completion: This task measures verbatim reproduction by asking the model to complete code immediately preceding a known bug fix, providing direct evidence of training data internalization.

Experimental Setup and Datasets

The study evaluated ten leading models, including OpenAI's o3 and the Claude 3.5/4 families, across a diverse set of benchmarks. These included the standard SWE-Bench Verified and Full SWE-Bench, as well as newly curated datasets designed to test generalization:

  • SWE-Bench Extra: Tasks created after the original benchmark cutoff.
  • Outside-Repo Tasks: Issues from popular repositories (e.g., Pandas, PyTorch) not included in the original SWE-Bench.
  • RefactorBench and SWE-Bench C#: Benchmarks testing multi-file logic and cross-language generalization.

Results and Analysis

The evaluation revealed a significant performance decay as models moved from legacy benchmark data to "fresh" or "outside" tasks.

Cross-benchmark evaluation showing performance decay on fresh and outside-repo tasks.

Suspicious Accuracy and Performance Drop

The most striking finding was the high accuracy on context-free tasks. OpenAI’s o3 achieved a 76% success rate in identifying buggy file paths without any repository access. However, this accuracy dropped to below 53% for repositories not included in the original SWE-Bench, despite those repositories having similar popularity and documentation quality. This "graduated decay" suggests that models are specifically overfit to the most prominent benchmark problems.

Verbatim Recitation

In the function reproduction task, models exhibited significantly higher 5-gram overlap (consecutive sequences of 5 tokens) on SWE-Bench tasks compared to outside tasks. For instance, Claude 4 Opus demonstrated verbatim generation for 31.6% of test instances in prefix completion tests. This indicates that models are often reciting "canonical" solutions from memory rather than synthesizing new code. Interestingly, higher-capacity models showed more memorization, suggesting that as models scale, they become more effective at internalizing training data rather than necessarily improving general reasoning.

Conclusion

The findings suggest that SOTA performance on software engineering benchmarks is partially an illusion driven by memorization. To move toward true engineering intelligence, the community must adopt "freshness-controlled" benchmarks and contamination-resistant metrics. Evaluating models on data generated strictly after their training cutoffs is essential to ensure that we are measuring generalizable reasoning rather than sophisticated retrieval.

Summary updated

BibTeX
@inproceedings{liang2026swe,
  author = {Shanchao Liang and Spandan Garg and Roshanak Zilouchian Moghaddam},
  title = {{The SWE-Bench Illusion: When State-of-the-Art LLMs Remember Instead of Reason}},
  booktitle = {SEIP@ICSE},
  year = {2026},
  doi = {10.1145/3786583.3786882},
}
Figure