[Paper Review] Link and code: Fast indexing with graphs and compact regression codes
This paper proposes Link and Code (L&C), a graph-based approximate nearest neighbor search method that combines optimized product quantization (OPQ) for compact vector encoding with quantized regression from graph neighbors to improve accuracy under strict memory constraints. By leveraging hierarchical navigable small world (HNSW) graphs and learning regression codes from local neighborhoods, L&C achieves state-of-the-art accuracy on billion-scale datasets like Deep1B and BIGANN, outperforming prior methods at 64–128 bytes per vector with faster search times.
Similarity search approaches based on graph walks have recently attained outstanding speed-accuracy trade-offs, taking aside the memory requirements. In this paper, we revisit these approaches by considering, additionally, the memory constraint required to index billions of images on a single server. This leads us to propose a method based both on graph traversal and compact representations. We encode the indexed vectors using quantization and exploit the graph structure to refine the similarity estimation. In essence, our method takes the best of these two worlds: the search strategy is based on nested graphs, thereby providing high precision with a relatively small set of comparisons. At the same time it offers a significant memory compression. As a result, our approach outperforms the state of the art on operating points considering 64-128 bytes per vector, as demonstrated by our results on two billion-scale public benchmarks.
Motivation & Objective
- To address the scalability-accuracy trade-off in large-scale similarity search by combining memory-efficient compact codes with high-precision graph traversal.
- To enable indexing of one billion vectors on a single server while maintaining high search accuracy.
- To improve distance estimation accuracy in compact representations by exploiting graph connectivity through quantized regression from neighbors.
- To demonstrate that graph-based candidate generation outperforms inverted list-based methods in high-accuracy regimes with larger code sizes.
Proposed method
- The method uses optimized product quantization (OPQ) to compress database vectors into 8–32 bytes per vector, reducing memory footprint.
- It builds a hierarchical navigable small world (HNSW) graph to enable fast, high-selectivity graph traversal during search.
- Each vector is refined using a quantized regression model that predicts the original vector from its k nearest neighbors in the graph, using a learned codebook of regression coefficients.
- Regression coefficients are learned via alternate optimization to minimize reconstruction error between original and reconstructed vectors.
- The method stores only a few bytes per vector for the regression weights, enabling minimal memory overhead.
- The approach is integrated into the Faiss library and evaluated on Deep1B and BIGANN benchmarks with 1B vectors.
Experimental results
Research questions
- RQ1Can graph-based search strategies be effectively combined with compact vector representations to scale to one billion vectors on a single server?
- RQ2Does using a coarse centroid as the initial approximation outperform using the nearest neighbor in a compact codebook?
- RQ3Can quantized regression from graph neighbors significantly improve similarity estimation accuracy with minimal memory cost?
- RQ4How does the selectivity of HNSW compare to inverted list-based methods like IMI in high-accuracy regimes with larger code sizes?
- RQ5Can the combination of compact codes and graph refinement achieve state-of-the-art performance on billion-scale benchmarks?
Key findings
- On the Deep1B benchmark, L&C achieves 66.7% recall@1 at 3.50ms per query with 108 bytes per vector, outperforming Polysemous codes (45.6% recall@1) and other methods in accuracy and speed.
- L&C is 2.5× faster than IMI to reach 50% recall@1 on Deep1B with 96 bytes per vector, demonstrating superior efficiency-accuracy trade-off.
- The refinement step via quantized regression improves accuracy significantly, even with only a few extra bytes per vector.
- HNSW-based candidate generation shows much higher selectivity than IMI, especially for larger code sizes (e.g., 128 bytes), favoring graph-based methods in high-accuracy regimes.
- The method scales to one billion vectors on a single server, a capability not achieved by prior graph-based methods like HNSW that require full vector storage.
- L&C achieves state-of-the-art performance on both Deep1B and BIGANN, setting new benchmarks in the high-accuracy regime with practical memory usage.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.