TL;DR
When an AI bug-finder points to the exact file where a bug lives, standard benchmarks declare victory—even if the model just guessed based on a convenient filename rather than actually reading the code. By systematically scrambling filenames while keeping the code intact, researchers reveal that many AI localizers lean heavily on naming shortcuts, frequently miss the actual broken function inside the file, and don't automatically guarantee a working software patch.
What Problem Does This Paper Address?
Imagine a user reports that "login fails after a token refresh," and an AI bug localizer ranks auth/login.py as its top suspect. Benchmarks award this a "file-level hit" (Recall@1). Finding the right file in a massive codebase is genuinely helpful, but celebrating at the file level hides three critical realities:
- The "Why": Did the model understand the broken token-validation logic inside the file, or did it just match the words
authandloginin the file path? - The "Where": Real-world files contain dozens of functions. Knowing the file doesn't tell an automated repair agent which function to edit.
- The "Fix": Does pinpointing that location actually lead to a patch that passes tests?
Because benchmarks reward any shortcut that surfaces the right file, models that rely on brittle naming conventions can look identical on leaderboards to models that genuinely analyze source code.
Methods
To pry apart filename matching from code comprehension, the authors trace bug localization across three distinct checkpoints: file ranking, function selection, and executed code repair.
- Counterfactual Path Interventions: Using a fixed pool of top-100 candidate files (retrieved via BM25) and 50-line code previews, the authors hold the bug report, model weights, and code previews constant while altering only the displayed file paths:
- PathAlias: Replaces paths with plausible, readable names from unrelated repositories (e.g.,
plots/scale.py). - PathSwap: Replaces paths with opaque, structure-preserving IDs (e.g.,
d_f4e8/m_008e.py). - Path Exchange & Git Renames: Swaps the paths of the true buggy file and a single distractor to create a head-to-head conflict, or reverts files to outdated names from Git history.
- Codeaware Training: To test if path reliance can be curbed, they train LoRA-adapted Qwen2.5 rerankers where half the training examples have shuffled file paths, forcing the model to look at code previews.
- Interactive & Downstream Tracing: Beyond 50-line previews, they give full-file search/read tools to interactive agents under opaque file handles. Finally, they test downstream function-level scorers and run automated repair models under two interfaces: handing the fixer the entire file versus restricting it to edit only a single supplied function.
Datasets
The paper introduces no new standalone benchmarks, instead applying counterfactual perturbations to established software engineering datasets:
- SWE-bench Lite (300 issues; primary evaluation with zero training overlap) and SWE-bench Verified (500 issues; used strictly as a sensitivity check due to training overlap).
- GREPO (4,046 training groups; 1,704 Python test issues used for function-transfer and historical Git rename studies).
- Auxiliary generalization checks reference BeetleBox, Bench4BL, and BEIR-SciFact.
Key Insights and Ideas
- Standard benchmarks hide code blindness: Two models—one trained with code previews and one trained without any code at all—achieve nearly identical scores on original file paths. Only when filenames are anonymized do we see that the code-blind model collapses while the code-visible model falls back on reading source lines.
- Names beat code in a head-to-head fight: Even when a standard reranker can see the code preview, swapping the buggy file's path onto a random distractor tricks the model into picking the distractor nearly two-thirds of the time.
- Tool access isn't a silver bullet: Giving an agent tools to search and open complete files doesn't guarantee robustness. Pipelines that filter directory trees first collapse completely when filenames turn opaque, whereas strong reasoning models that lean on iterative code search stay rock-steady.
- The editing interface dictates the value of localization: Pinpointing the exact broken function is make-or-break when a repair model is only allowed to edit that single function. However, if the fixer is handed the whole file and allowed to look around, upstream function-selection errors matter much less.
Key Results
File ranking accuracy drops sharply when original paths are replaced with readable aliases or opaque IDs.
- Path Sensitivity: On 259 date-filtered SWE-bench Lite issues, an unaugmented Qwen2.5-14B reranker drops from 62.2% Recall@1 on original paths to 41.4% under PathAlias and 45.9% under PathSwap. Swapping a gold path onto a random distractor hijacks the top prediction 63.4% of the time (dropping to 1.1% with
Codeawaretraining). - Hidden Code Use: On single-snapshot Lite, Qwen2.5-14B trained with and without 50-line code previews score 57.0% vs. 55.7% on normal paths, but diverge to 39.7% vs. 0.3% under PathSwap.
- Full-File Agents: On 193 Lite issues under opaque handles, tree-filtering pipeline Agentless (GPT-4o) plunges from 135/193 hits to 0/193 (-69.9 pp), and tool-using GPT-4.1-mini drops by 25.9 pp. Meanwhile, Moatless drops just 6.2 pp, and
gpt-6.1-solholds completely steady at 188/193 in both conditions. - Function & Repair Bottlenecks: Across four Qwen2.5 pipelines on GREPO, only 45.0% of file hits yield the right top-ranked function under name-and-summary scoring—even though the target function is available in the candidate pool over 90% of the time. Switching to a listwise scorer (
gpt-6.1-sol) jumps function Hit@1 by ~36 pp. In single-function repair, correct function localization boosts test-passing patches by ~24–25 pp (e.g., 23/90 vs. 1/176 for Qwen3-14B), whereas whole-file repair shows an uncertain +14.0 pp difference whose 95% CI crosses zero ([-1.2, 29.7]).
Limitations and Future Work
The authors are admirably transparent about the boundaries of their experiments:
- Alias vs. Opaque Ordering: Under exact base-commit checkouts, confidence intervals between PathAlias and PathSwap span zero, leaving it unresolved whether misleading readable names hurt more than gibberish IDs.
- Cross-System Comparisons: The active repository-navigation tests compare distinct models and architectures rather than toggling tools on and off within the exact same model. Furthermore, SweRank's native function-body pipeline was reproduced on normal paths (78.8% Acc@1) but not stress-tested under PathSwap.
- Observational Repair: The executed repair cohorts rely on archived, pre-correction function rankings rather than randomized, end-to-end causal interventions.
Moving forward, the authors urge benchmark designers to pair standard file-level recall with path-perturbation stress tests, report function localization alongside its specific scoring interface, and evaluate repair models with enough baseline "headroom" to meaningfully reflect localization gains.
Summary updated