🤖 AI Summary
This work addresses the lack of theoretical correctness guarantees in Hierarchical Navigable Small World (HNSW) graph-based approximate nearest neighbor search, which relies on heuristic greedy strategies. The authors propose a novel two-stage “certify-and-correct” framework: first, a distribution-agnostic statistical certifier rapidly assesses result quality; if the result fails to meet a prescribed accuracy threshold, a precise recovery algorithm is triggered based on the graph spanner structure of HNSW. Innovatively treating HNSW as a geometric spanner, the method leverages extreme value theory to dynamically estimate its stretch factor, thereby introducing—for the first time—a provable accuracy guarantee for HNSW. Experiments demonstrate that this approach maintains query efficiency comparable to standard HNSW on benchmark datasets while ensuring correctness in the worst case, outperforming existing methods that aim to balance speed and precision.
📝 Abstract
Hierarchical Navigable Small World (HNSW) graphs serve as the industry standard due to their logarithmic complexity and strong empirical performance. However, HNSW relies on greedy graph traversal, a heuristic that provides no theoretical guarantees of correctness. In this paper, we propose a novel "Certify-then-Rectify" framework that bridges the gap between the speed of heuristic search and the rigor of exact retrieval. Rather than discarding HNSW, our approach first employs a distribution-free statistical certifier to dynamically evaluate the quality of a standard HNSW search with minimal overhead. If certification indicates that the retrieved neighbors are of low quality, the framework safely escalates to a rigorous exact recovery algorithm. To make this exact recovery computationally feasible, we reinterpret the HNSW graph as a geometric spanner and utilize Extreme Value Theory to stochastically estimate its maximum empirical stretch factor. This allows us to mathematically bound the maximum distance of true nearest neighbors. Extensive evaluations on benchmark datasets demonstrate that our tiered framework delivers the average-case speed of HNSW while ensuring the worst-case correctness of exact search and outperforming other applicable approaches.