TL;DR
Modern AI coding agents usually hunt for bugs by staring at a static snapshot of a codebase, ignoring the rich institutional memory hidden in its commit history. By distilling historical pull requests into clean, structured "traceability records," a new framework called TACO acts like a veteran developer pointing agents straight to the right files. It boosts localization accuracy by over 11–13 percentage points while cutting token costs by roughly 30%.
What Problem Does This Paper Address?
Before an engineer or an AI agent can fix a bug, they have to find where the relevant code lives—a task known as code localization. Today's large repositories are far too massive to stuff into an LLM's context window all at once. Instead, state-of-the-art "agentic" frameworks iteratively search, navigate, and read files much like a human newcomer would.
The catch? These agents almost exclusively look at two things: the bug report and the current snapshot of the code. They suffer from what the authors call a traceability gap. Often, the terminology in a user's bug report (the symptoms) looks nothing like the internal abstractions in the code (the implementation).
For example, if a user reports a documentation rendering bug involving :param: fields, a snapshot-only agent naturally greps for words like param and docstring, chasing red herrings down the wrong rabbit hole. In reality, the fix lives in an abstract class called DocFieldTransformer. How would anyone know that? Because a historical pull request (PR) fixed a similar rendering issue there months ago. Once code is merged, the reasoning, debates, and vocabulary that bridged the symptom to the code vanish from the snapshot—leaving agents in the dark.
Methods
Simply dumping raw git history into an agent's prompt doesn't work; historical PRs are noisy, full of dead-end discussions, and reference outdated line numbers. To make history useful, the authors built TACO (Traceability Augmented Code Localization), which splits the work into an offline preparation phase and an online search phase.
- Offline Knowledge Crystallization: Instead of indexing raw PR text, TACO uses an LLM to distill historical PRs into compact structured records containing high-value search keywords and architectural rationales (explaining why a function was changed). Crucially, TACO uses prompt auto-tuning: an LLM judge evaluates retrieval quality and iteratively refines the distillation prompt so the generated records are maximally retrievable for future issues. These records are stored in a dual-index database—a Horizontal Semantic Index (linking similar issues) and a Vertical Topology Graph (capturing structural code relationships).
- Online Synergistic Retrieval: When a new bug arrives, TACO runs a dual-track search—querying both semantic history and repository topology. An arbiter cross-validates and ranks the candidates. Finally, because codebases evolve—files get renamed, functions move—TACO applies temporal alignment to map historical pointers onto the current version of the repository before handing the hints over to the coding agent.
Datasets
TACO is evaluated on two standard, real-world software engineering benchmarks derived from popular Python GitHub repositories:
- SWE-bench Lite
- SWE-bench Verified (a human-validated subset of SWE-bench designed for reliable evaluation).
No new datasets are introduced, though TACO mines the historical pull requests natively preceding the benchmark snapshots within those repositories.
Key Insights and Ideas
- Raw history is a distraction, not a solution: In the authors' motivating Sphinx case study, giving an agent (
LocAgent) the raw text of a relevant historical PR still led to failure—the agent got distracted by surface-level chatter and took 14 steps to guess the wrong lines. Giving it TACO's distilled rationale got it to the exact target function in 4 steps. - History matters most when the trail goes cold: When analyzing tasks by "traceability length" (how many hops away the bug symptom is from the fix), standard agents plummet in accuracy as the semantic gap widens (
trace-2+andtrace-inf). TACO provides its most dramatic rescues precisely on these "disconnected" bugs where static code structure offers zero clues.
- Better hints mean cheaper agents: Localization isn't just an accuracy game; wandering around a repository burns tokens. Good historical context prevents aimless exploration.
Key Results
Plugged into five state-of-the-art agentic baselines (LocAgent, SWE-Agent, Moatless, OrcaLoca, and OpenHands), TACO delivers substantial across-the-board gains:
- Higher Accuracy: Exact-match top-1 localization accuracy (Acc@1) jumps by an average of 11.29, 13.20, and 12.87 percentage points at the file, module, and function levels, respectively. On weaker baselines like
OpenHandsandSWE-Agent, file- and function-level gains frequently exceed 20+ percentage points. - Lower Cost & Token Usage: Because agents stop wandering down blind alleys, TACO streamlines exploration for
LocAgentandSWE-Agent, cutting token consumption by an average of 29.2% and monetary API costs by 30.4%, all with minimal offline maintenance overhead.
Limitations and Future Work
Not discussed in the paper (within the provided pages; full limitation details reside in the unprovided concluding sections of the manuscript, though the reliance on repositories having an existing pull request history is inherent to the evolutionary approach).
Summary updated