Additive Quantization for Extreme Vector Compression

Artem Babenko, Victor S. Lempitsky

Abstract

In the era of big data, high-dimensional vector storage and retrieval are critical challenges. This paper introduces Additive Quantization (AQ), a novel compression scheme that represents vectors as a sum of codewords from multiple codebooks. By moving beyond the "subspace independence" assumption of Product Quantization, AQ achieves significantly lower approximation errors and higher search accuracy while maintaining the fast lookup-table speeds required for large-scale retrieval.

The Problem: The Subspace Independence Assumption

Modern computer vision tasks often involve millions or billions of high-dimensional vectors (e.g., SIFT, GIST, or Fisher Vectors). Storing these in raw form is memory-prohibitive. The goal is "extreme compression"—squeezing a 128-dimensional vector into just 8 or 16 bytes—while still enabling efficient Approximate Nearest Neighbor (ANN) searches.

For years, Product Quantization (PQ) was the standard. PQ works by splitting a vector into $M$ disjoint subspaces (chunks) and quantizing each chunk independently. However, PQ relies on a heavy assumption: that these subspaces are statistically independent. If data has correlations across those arbitrary boundaries, PQ loses information.

Methods: From Concatenation to Summation

The core innovation of Additive Quantization (AQ) is representing a vector $x$ as the sum of $M$ codewords: $$x \approx \sum_{m=1}^M c^m(i_m)$$

Unlike PQ, where each codeword only covers a small slice of the dimensions, every AQ codeword is a full $D$-dimensional vector. This allows the codebooks to work together to "cancel out" errors from one another, capturing complex global correlations that PQ and even Optimized PQ (OPQ) miss.

Comparison of Product Quantization (PQ) and Additive Quantization (AQ) architectures.

Key Technical Innovations:

  1. Fast Computation (ADC): AQ preserves the "Asymmetric Distance Computation" (ADC) trick. By precomputing lookup tables for the query vector against all codebooks, calculating a distance remains a simple matter of $M$ lookups and $M$ additions.
  2. Beam Search Encoding: Finding the optimal set of codewords is a hard optimization problem (a fully connected MRF). The authors adapted a Beam Search algorithm to find high-quality solutions efficiently.
  3. The Norm Trick: To keep Euclidean distance calculations fast, the squared norm of the compressed vector is quantized into a single extra "length byte," adding negligible overhead.
  4. Hybrid Approach (APQ): For longer code lengths, Additive Product Quantization splits the vector into a few large chunks (PQ-style) and then applies AQ to each chunk to balance accuracy and encoding complexity.

Key Results

The authors evaluated AQ on standard benchmarks including SIFT-1M, GIST-1M, and VLAD-500K.

Across all datasets, AQ/APQ consistently produced lower mean approximation errors than PQ and OPQ for the same bit budget. In ANN tasks, AQ demonstrated a clear advantage in Recall@T. For example, on the SIFT-1M dataset at 8 bytes, AQ-8 achieved significantly higher recall than PQ-8 and OPQ-8.

Recall@T performance on SIFT-1M dataset for various quantization methods across different bit budgets.

Furthermore, when testing on downstream tasks like image classification (PASCAL VOC 2007) using compressed Fisher Vectors, APQ-compressed data resulted in a higher Mean Average Precision (mAP) than OPQ, proving that better approximation quality translates directly to better task performance.

Conclusion

Additive Quantization represents a significant step forward in vector compression. While it introduces higher encoding complexity due to the Beam Search requirement, the gains in retrieval accuracy and approximation error make it a powerful tool for large-scale vector databases. Future work may focus on faster encoding algorithms to make AQ viable for real-time streaming applications.

Summary updated

BibTeX
@inproceedings{babenko2014additive,
  author = {Artem Babenko and Victor S. Lempitsky},
  title = {{Additive Quantization for Extreme Vector Compression}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2014},
  doi = {10.1109/cvpr.2014.124},
}
Figure