Abstract
Efficient Nearest Neighbor (NN) search in high-dimensional spaces is a foundation of many multimedia retrieval systems. A common approach is to rely on Product Quantization, which allows the storage of large vector databases in memory and efficient distance computations. Yet, implementations of nearest neighbor search with Product Quantization have their performance limited by the many memory accesses they perform. Following this observation, André et al. proposed Quick ADC with up to 6× faster implementations of PQ m×4 product quantizers (PQ) leveraging specific SIMD instructions. Quicker ADC is a generalization of Quick ADC not limited to PQ m×4 codes and supporting AVX-512, the latest revision of SIMD instruction set. In doing so, Quicker ADC faces the challenge of using efficiently 5,6 and 7-bit shuffles that do not align to computer bytes or words. To this end, we introduce (i) irregular product quantizers combining sub-quantizers of different granularity and (ii) split tables allowing lookup tables larger than registers. We evaluate Quicker ADC with multiple indexes including Inverted Multi-Indexes and IVF HNSW and show that it outperforms the reference optimized implementations (i.e., FAISS and polysemous codes) for numerous configurations. Finally, we release an open-source fork of FAISS enhanced with Quicker ADC.
Introduction
In modern multimedia retrieval, data is often represented as high-dimensional vectors. Searching through billions of these vectors requires efficient compression and distance estimation techniques. Product Quantization (PQ) has emerged as a standard, compressing vectors into short codes and enabling Asymmetric Distance Computation (ADC) via pre-computed lookup tables.
However, the primary performance bottleneck in standard ADC is not computational complexity but memory latency. Frequent, random memory accesses to lookup tables stall the CPU. While Quick ADC addressed this by using SIMD "shuffle" instructions to perform lookups within registers, it was restricted to 4-bit codes. Quicker ADC generalizes this approach to support 5, 6, and 8-bit quantization, leveraging the power of AVX-512.
Methodology
Irregular Product Quantizers
A significant challenge in using 5-bit or 6-bit codes is their lack of alignment with standard 8-bit or 16-bit hardware boundaries. This often leads to wasted memory or complex bit-shifting operations that negate SIMD benefits. Quicker ADC solves this by introducing "irregular" groupings. By combining sub-quantizers of different granularities—for instance, two 6-bit sub-quantizers and one 4-bit sub-quantizer—the system can perfectly fill a 16-bit word ($6+6+4=16$).
Split Tables
SIMD shuffle instructions are typically limited by the size of the register (e.g., 16 or 64 entries). Supporting standard 8-bit sub-quantizers, which require 256-entry lookup tables, necessitates a different approach. Quicker ADC utilizes "split tables," where a large lookup table is divided into multiple smaller segments. The system performs multiple parallel shuffles and then uses "blend" instructions to select the correct result based on the specific bits of the code.
Dynamic Distance Quantization
To further optimize performance, Quicker ADC quantizes the distances themselves into 8-bit or 16-bit integers rather than using 32-bit floats. A dynamic range ($d_{min}$ to $d_{max}$) is learned at query time from a small sample of the database. This ensures that the available bit-depth is focused on the most relevant (closest) neighbors, maintaining high precision where it matters most.
Experimental Evaluation
The performance of Quicker ADC was evaluated on several large-scale datasets:
- SIFT1M & SIFT1000M: 128-dimensional SIFT descriptors.
- Deep1M & Deep1B: Deep learning features of varying dimensions (96 and 256).
Tests were conducted across various indexing architectures, including Inverted File (IVF), Inverted Multi-Index (IMI), and HNSW graphs.
Results and Discussion
Quicker ADC demonstrates substantial performance gains over existing state-of-the-art implementations. In exhaustive search scenarios, it achieves approximately a 10x speedup over the standard FAISS implementation and a 2-3x speedup over polysemous codes.
Beyond raw speed, the dynamic quantization scheme ensures superior accuracy. Compared to other SIMD-based methods like Bolt, Quicker ADC provides significantly higher recall by minimizing rounding errors through its adaptive range estimation. On the SIFT1000M dataset, under a strict 0.25ms query latency constraint, Quicker ADC achieved a Recall@1 of 0.23-0.24, outperforming polysemous codes which managed 0.18-0.23.
Conclusion
Quicker ADC effectively unlocks the potential of AVX-512 for high-bit Product Quantization. By overcoming alignment issues with irregular quantizers and register size limitations with split tables, it provides a high-performance alternative for large-scale vector search. The project is available as an open-source fork of the FAISS library.
Summary updated