From Fragments to Paths: Task-Level Context Recovery for Large Industrial Codebases
The paper introduces DeepDiscovery, a two-stage "Location–Inference" framework that effectively recovers task-relevant context from large industrial codebases by moving beyond local fragments, thereby significantly improving file retrieval and coding agent performance on complex software engineering tasks.
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 a master detective trying to solve a complex case in a massive, chaotic city (the Large Industrial Codebase). The city has millions of buildings, secret tunnels, hidden wiring, and constantly changing street signs. Your job is to find the specific clues needed to solve a crime (the Task, like fixing a bug or adding a feature).
The problem is that most current detective tools (existing AI methods) are like flashlights that only shine on the immediate street corner. They might find a few relevant documents, but they miss the crucial connections: the hidden wiring between buildings, the owner's manual for a specific machine, or the test logs from three blocks away. Without seeing the whole picture, the detective gets stuck.
This paper introduces a new detective tool called DEEPDISCOVERY. Instead of just shining a light on random spots, it uses a smart, two-step strategy to reconstruct the entire "path" the detective needs to walk to solve the case.
Here is how it works, using simple analogies:
1. The Two-Step Strategy: "Find the Anchor, Then Trace the Path"
Most tools try to search the whole city at once, which is slow and confusing. DEEPDISCOVERY works in two stages:
Stage 1: The Anchor (Location)
Imagine you are looking for a specific person in a stadium. Instead of scanning every seat, you first look for the "high-confidence" entry points: the team logos, the specific section numbers, or the VIP passes mentioned in the ticket.- In the paper: The system quickly scans the code to find a few "anchors" (key files like a main configuration file or a specific service entry point). It uses clues like file names, folder structures, and coding patterns to guess where the action is, without reading every single line of code yet.
Stage 2: The Path (Inference)
Once the anchors are found, the detective doesn't just stop there. They start walking the "implementation path."- In the paper: The system expands outward from those anchors. It looks for explicit links (like a door connecting two rooms) and implicit links (like a secret tunnel or a phone call between two people that isn't written in the building blueprints). It follows these connections to find configuration files, tests, and related code that the task actually needs.
2. The "Smart Budget" (Metadata-First)
Imagine you are packing a backpack for a hiking trip, but you only have room for a few items.
- Old way: You stuff the whole library into the bag, hoping you find the right map. It's heavy and slow.
- DEEPDISCOVERY way: You first look at the spine of the book (the metadata/summary). If the spine tells you the book is about "cooking," you leave it on the shelf. You only open the book and read the pages (load the full text) if the spine suggests it's critical to your hike.
- In the paper: The system reads the "summary" of files first. It only loads the full, heavy text of a file if it's absolutely necessary for the task. This saves time and money (computing power).
3. Why It Matters: The "Freshness" Problem
Many existing tools rely on pre-made maps (offline indexes) of the city. But in a fast-growing city, the maps become outdated the moment a new building is constructed.
- The Paper's Claim: DEEPDISCOVERY doesn't wait for a new map to be drawn. It explores the city right now, in real-time. This means it works perfectly even when the code is changing every minute, which is common in big companies.
4. The Results: Solving More Cases
The authors tested this new detective tool in three ways:
- The Test Drive (Method Level): They gave it 27 medium-sized puzzles. DEEPDISCOVERY found the complete set of necessary clues 92.6% of the time, beating all other tools. It did this without needing to pre-build any maps, making it faster and cheaper.
- The Real World (Industrial Systems): They plugged it into six different real-world AI coding assistants used by a large company. In almost every case, the assistants became much better at finding the full set of files needed to fix a problem. The improvement was huge for big, complex projects (up to a 9.2% increase in success).
- The Final Exam (End-to-End): They tested it on SWE-bench Verified, a famous benchmark for software engineering tasks.
- The Result: A system using DEEPDISCOVERY solved 78.6% of the tasks.
- The Comparison: The same system without DEEPDISCOVERY only solved 70.4%.
- The Takeaway: By understanding the code better, the AI solved 41 more tasks out of 500.
Summary
Think of DEEPDISCOVERY as a detective who doesn't just read the nearest page of a manual but understands how the whole machine works. It finds the starting point, follows the hidden wires and connections, and only reads the heavy instructions when absolutely necessary.
The paper claims that by doing this, AI coding assistants can stop missing crucial pieces of the puzzle and start solving complex software engineering problems much more reliably, especially in huge, fast-changing codebases.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.