Distance Adaptive Beam Search for Provably Accurate Graph-Based Nearest Neighbor Search
Yousef Al-Jazzazi, Haya Diwan, Jinrui Gou, Cameron Musco, Christopher Musco, Torsten Suel
TL;DR
The paper tackles the theoretical-practical gap in graph-based ANN by introducing Adaptive Beam Search, a distance-based termination rule that replaces fixed beam width. By decoupling search order from the stopping criterion and parameterizing the termination with $\gamma$, the authors prove guarantees on navigable graphs and demonstrate substantial empirical gains over standard beam search across multiple datasets and graph constructions. Theoretical results show that on navigable graphs, the method yields provable approximate nearest neighbors, with exactness attainable at $\gamma=2$, while experiments report consistent reductions in distance computations (roughly 10–50%) for given recall. The work offers both a principled understanding of graph navigability in ANN and a practical, easily adoptable improvement for popular graph-based methods like HNSW, Vamana, and NSG.
Abstract
Nearest neighbor search is central in machine learning, information retrieval, and databases. For high-dimensional datasets, graph-based methods such as HNSW, DiskANN, and NSG have become popular thanks to their empirical accuracy and efficiency. These methods construct a directed graph over the dataset and perform beam search on the graph to find nodes close to a given query. While significant work has focused on practical refinements and theoretical understanding of graph-based methods, many questions remain. We propose a new distance-based termination condition for beam search to replace the commonly used condition based on beam width. We prove that, as long as the search graph is navigable, our resulting Adaptive Beam Search method is guaranteed to approximately solve the nearest-neighbor problem, establishing a connection between navigability and the performance of graph-based search. We also provide extensive experiments on our new termination condition for both navigable graphs and approximately navigable graphs used in practice, such as HNSW and Vamana graphs. We find that Adaptive Beam Search outperforms standard beam search over a range of recall values, data sets, graph constructions, and target number of nearest neighbors. It thus provides a simple and practical way to improve the performance of popular methods.
