Abstract
Quantization methods have been introduced to perform large scale approximate nearest search tasks. Residual Vector Quantization (RVQ) is one of the effective quantization methods. RVQ uses a multi-stage codebook learning scheme to lower the quantization error stage by stage. However, there are two major limitations for RVQ when applied to on high-dimensional approximate nearest neighbor search:
- The performance gain diminishes quickly with added stages.
- Encoding a vector with RVQ is actually NP-hard. In this paper, we propose an improved residual vector quantization (IRVQ) method, our IRVQ learns codebook with a hybrid method of subspace clustering and warm-started k-means on each stage to prevent performance gain from dropping, and uses a multi-path encoding scheme to encode a vector with lower distortion. Experimental results on the benchmark datasets show that our method gives substantially improves RVQ and delivers better performance compared to the state-of-the-art.
Introduction
In the era of big data, finding the nearest neighbor to a query—such as identifying similar images in a database of billions—is a computationally intensive task. Quantization has emerged as a key solution, compressing high-dimensional vectors into short binary codes to facilitate fast similarity searches.
Residual Vector Quantization (RVQ) is a prominent multi-stage method that quantizes a vector, calculates the residual error, and subsequently quantizes that error in the next stage. Despite its popularity, RVQ suffers from two critical limitations. First, it experiences diminishing returns; as more stages are added, residuals become increasingly random, leading to low information entropy in later codebooks. Second, optimal encoding across all stages is an NP-hard problem, often forcing implementations to rely on suboptimal greedy approaches.
Improved Residual Vector Quantization (IRVQ)
To address these challenges, we propose Improved Residual Vector Quantization (IRVQ), which introduces two primary innovations: Improved Codebook Learning (ICL) and Multi-path Vector Encoding (MVE).
Improved Codebook Learning (ICL)
Rather than employing a standard "cold start" k-means clustering on high-dimensional residuals, ICL uses a hybrid approach. It performs PCA on the residuals and runs k-means in a low-dimensional subspace. Dimensions are then iteratively added, using previous centroids to "warm-start" the next round of clustering. This strategy ensures that codebooks maintain high information entropy even in deep stages, preventing the performance plateau typical of standard RVQ.
Multi-path Vector Encoding (MVE)
To overcome the suboptimality of greedy encoding, MVE implements a beam search strategy. Instead of selecting only the single best codeword at each stage, the algorithm maintains a list of the top $L$ candidates. This allows for the exploration of a broader combination space, significantly reducing total quantization distortion.
Experimental Results
We evaluated IRVQ on two benchmark datasets: SIFT-1M (128-dimensional local descriptors) and GIST-1M (960-dimensional global descriptors). Our results demonstrate that IRVQ consistently outperforms standard RVQ, Product Quantization (PQ), and Additive Quantization (AQ).
Performance Gains
On the 64-bit SIFT-1M dataset, IRVQ achieved a recall@4 of 58.31%, a 16% relative improvement over standard RVQ (50.35%). The advantages were even more pronounced in higher dimensions; on the GIST-1M dataset, IRVQ improved accuracy by 52.7% relative to RVQ. Furthermore, IRVQ outperformed AQ by 17.7% on recall@1 for 64-bit SIFT encoding.
Entropy and Redundancy Analysis
Visualization of mutual information between codebooks reveals that IRVQ achieves near-optimal encoding. While standard RVQ exhibits significant redundancy between stages, IRVQ codebooks share almost no redundant information, similar to the theoretical independence assumed by PQ but achieved through a more flexible additive structure.
Conclusion
IRVQ revitalizes multi-stage vector quantization by addressing the fundamental entropy and encoding bottlenecks of RVQ. While the multi-path encoding adds some computational complexity and the method requires a small additional memory overhead for error terms, the substantial gains in search accuracy—particularly in high-dimensional spaces—make it a powerful tool for large-scale approximate nearest neighbor search. Future work may explore applying this hybrid clustering approach to other quantization frameworks.
Summary updated