SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localization
Shravan Chaudhari, Rahul Thomas Jacob, Mononito Goswami, Jiajun Cao, Shihab Rashid, Christian Bock
TL;DR
<3-5 sentence high-level summary>: The paper tackles the challenge of locating semantically relevant code functions within large repositories, where purely semantic retrieval can miss important spatial context. It introduces SpIDER, a graph-aware dense retrieval framework that augments semantic ranking with BFS-based neighborhood exploration over code graphs, guided by LLMs for selective neighbor filtering. Empirical results across Python, Java, JavaScript, and TypeScript demonstrate consistent gains in Recall@K and Acc@K over dense baselines and sparse methods, and the authors provide a new SpIDER-Bench multi-language dataset. The work shows that leveraging code structure and local neighborhoods yields more accurate function-level localization, enabling more reliable automated software engineering workflows and patch generation.
Abstract
Retrieving code units (e.g., files, classes, functions) that are semantically relevant to a given user query, bug report, or feature request from large codebases is a fundamental challenge for LLM-based coding agents. Agentic approaches typically employ sparse retrieval methods like BM25 or dense embedding strategies to identify relevant units. While embedding-based approaches can outperform BM25 by large margins, they often lack exploration of the codebase and underutilize its underlying graph structure. To address this, we propose SpIDER (Spatially Informed Dense Embedding Retrieval), an enhanced dense retrieval approach that incorporates LLM-based reasoning over auxiliary context obtained through graph-based exploration of the codebase. Empirical results show that SpIDER consistently improves dense retrieval performance across several programming languages.
