SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localization
This paper proposes SpIDER, a spatially informed dense embedding retrieval method that integrates LLM-based reasoning with graph-based codebase exploration to significantly improve software issue localization, validated by a new multi-language benchmark called SpIDER-Bench.
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
The Big Problem: Finding a Needle in a Digital Haystack
Imagine you are a detective trying to fix a broken machine (a software bug) inside a massive, multi-story library (a codebase). You have a description of the problem, but you don't know exactly which book (file), which chapter (class), or which specific paragraph (function) contains the error.
Currently, AI agents try to find the right paragraph by reading the words. They ask, "Which paragraph sounds most like my problem description?" This is like using a search engine that only looks for matching keywords. It's helpful, but often the AI picks the wrong paragraph because the words match, even though the location is wrong.
The Missing Piece: The Map
The authors realized that code isn't just a pile of words; it's a structure. Functions call other functions; files contain classes. It's like a family tree or a subway map.
- The Flaw: Current AI methods ignore the map. They just look at the words.
- The Reality: If a bug is in one room, the fix is often in the room right next door, or the room above it. The "neighborhood" matters.
The Solution: SpIDER
The authors created a new tool called SpIDER (Spatially Informed Dense Embedding Retrieval). Think of SpIDER as a detective who uses two tools at once:
- A Dictionary: To understand the meaning of the words (Semantic Similarity).
- A Map: To understand the layout of the building (Graph Structure).
How SpIDER Works (The Analogy)
Imagine you are looking for a specific recipe in a giant cookbook.
The First Guess (The "Top-K"):
First, SpIDER uses the "Dictionary" to find the 20 paragraphs that sound most like your request. Let's say it picks 20 paragraphs.The "Seed" Selection:
From those 20, it picks the top 5 best guesses. These are the "Seeds."The Neighborhood Search:
Instead of stopping there, SpIDER looks at the Map. It asks: "Who are the neighbors of these 5 seeds?"- In a code library, a "neighbor" might be a function that calls the seed function, or a function inside the same file.
- SpIDER walks a few steps away from the seeds (like walking 4 doors down a hallway) to see what's there.
The Smart Filter (The "LLM"):
Now, SpIDER has a list of the original 20 paragraphs plus the new neighbors it found. That's too many to read. So, it asks a super-smart AI (a Large Language Model) to act as a librarian.- The librarian looks at the new neighbors and asks: "Does this actually help fix the bug, or is it just nearby?"
- If the librarian says "Yes," SpIDER swaps out a weak guess from the original list for this strong new neighbor.
The Result: You still only get 20 results (the budget stays the same), but now your list includes the "nearby" paragraphs that the word-search missed.
Why This Matters (The Results)
The paper tested this method on a new benchmark called SpIDER-Bench, which includes code in Python, Java, JavaScript, and TypeScript. (Most previous tests only looked at Python).
- Better Accuracy: SpIDER consistently found the right code 13% more often than standard methods that only look at words.
- Cross-Language Magic: Even though the AI was mostly trained on Python, SpIDER helped it find bugs in Java and JavaScript just as well, because the "map" (structure) works the same way in all these languages.
- Real Impact: When they used SpIDER to help an AI agent actually fix the bugs, the agent succeeded in solving more problems. Better finding = better fixing.
The "Secret Sauce"
The paper argues that relying only on word-matching is like trying to find your friend in a city by only knowing their name. SpIDER adds the knowledge that "my friend usually hangs out near the coffee shop," allowing the AI to look in the right neighborhood even if the name match isn't perfect.
Summary
SpIDER is a smarter way for AI to find code bugs. It doesn't just read the words; it also looks at the neighborhood where the code lives. By combining word-matching with a map of the code's structure, it finds the right files and functions much more reliably, helping AI agents fix software faster and more accurately across different programming languages.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.