Revisiting the Index Construction of Proximity Graph-Based Approximate Nearest Neighbor Search

Shuo Yang, Jiadong Xie, Yingfan Liu, Jeffrey Xu Yu, Xiyue Gao, Qianru Wang, Yanguo Peng, Jiangtao Cui · DOI

Introduction

In the landscape of high-dimensional vector search, Proximity Graphs (PGs) such as HNSW and NSG have become the gold standard for achieving high speed and accuracy. However, as datasets scale, these methods face a "superlinear" challenge: the time required to construct the index grows disproportionately faster than the data itself. While traditionally acceptable for static datasets, the rise of Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) demands frequent index updates as embedding models are tuned.

This paper introduces a novel "refinement-before-search" framework that addresses this bottleneck, achieving up to 5.6x faster index construction without compromising the state-of-the-art search accuracy required for modern AI applications.

The Bottleneck: Candidate Neighbor set Acquisition

The authors identify that the primary construction bottleneck lies in $k$-CNA (Candidate Neighbor set Acquisition)—the iterative process of identifying potential neighbors for every point before finalizing the graph's edges. Traditional methods often sacrifice search quality to save time during this phase. Furthermore, HNSW’s incremental insertion strategy was found to naturally limit the recall of its candidate neighbor sets to approximately 0.5 during construction, creating an inherent quality ceiling.

To overcome these limitations, the authors propose a paradigm shift from the traditional "search-then-refine" approach to a "refinement-before-search" framework.

Comparison of index construction frameworks: (a) RNG-based, (b) NSWG-based, and (c) the proposed framework.

As shown in Figure 1, the proposed framework introduces several key innovations:

  1. $\alpha$-Pruning: Standard Relative Neighborhood Graph (RNG) pruning is often too aggressive for $k$-ANN, discarding edges vital for finding top-$k$ neighbors. The authors introduce $\alpha$-pruning, which uses an angle threshold ($\alpha$) to maintain a sparse yet highly searchable graph.
  2. Iterative Refinement (IterNSG): Instead of a single massive search on a dense graph, the framework builds a sparse graph via $\alpha$-pruning, performs targeted searches to improve neighbor quality, and repeats the process. A "quality examination" step using random sampling determines when the index reaches sufficient quality to stop.
  3. Global HNSW Construction: Moving away from node-by-node incremental insertion, this paper proposes building HNSW layer-by-layer. By treating each layer as a complete RNG and applying the optimized framework, they shatter the 0.5 recall ceiling inherent in standard HNSW.

Computational Optimizations

The framework is further enhanced by two technical optimizations: P2K (Proximity Graph to KNNG) and K2P (KNNG to Proximity Graph). These utilize boolean flags to skip redundant distance and angle calculations across iterations, significantly reducing the computational overhead of the refinement cycles.

Performance and Scalability

The proposed framework, implemented as FastNSG and FastHNSW, was evaluated across six large-scale public datasets, including Sift, Gist, and Crawl.

Building time breakdown for original (Ori) vs. Fast versions of NSG and HNSW on the Gist1M dataset.

As illustrated in Figure 6, the "Fast" variants significantly reduce the time spent in the Search and Connect phases. Key results include:

  • Significant Speedups: FastNSG achieved a 5.6x speedup on the Msong dataset and 3.2x on Crawl. FastHNSW achieved a 4.6x speedup on Gist1M.
  • Maintained Accuracy: Unlike other accelerated methods that trade off quality, these methods maintained or improved Queries Per Second (QPS) at high recall levels (0.95–0.99).
  • Superior Scalability: Tests on the Sift50M dataset demonstrated that the speedup gap between the proposed framework and original methods widens as dataset size increases, proving its efficiency for massive data scales.

Conclusion

By rethinking the order of operations in graph construction and introducing $\alpha$-pruning, this research provides a path toward more agile vector search infrastructure. While the framework significantly optimizes the search and refinement phases, the authors note that the initial $k$-Nearest Neighbor Graph (KNNG) construction remains a fixed cost. Future work will focus on integrating more efficient KNNG initialization and developing smarter node selection strategies for the upper layers of hierarchical graphs.

Summary updated

BibTeX
@article{yang2025revisiting,
  author = {Shuo Yang and Jiadong Xie and Yingfan Liu and Jeffrey Xu Yu and Xiyue Gao and Qianru Wang and Yanguo Peng and Jiangtao Cui},
  title = {{Revisiting the Index Construction of Proximity Graph-Based Approximate Nearest Neighbor Search}},
  journal = {Proc. VLDB Endow.},
  year = {2025},
  doi = {10.14778/3725688.3725709},
}
Figure