NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Locally Optimized Product Quantization for Approximate Nearest Neighbor Search

Yannis Kalantidis, Yannis Avrithis

Abstract

Approximate Nearest Neighbor (ANN) search is critical for large-scale information retrieval. While Product Quantization (PQ) is a standard technique for compressing high-dimensional vectors, its global approach often fails to capture the complexity of multi-modal data distributions. This paper presents Locally Optimized Product Quantization (LOPQ), which partitions the data space and applies custom, optimized rotations to residuals within each local cell. This fine-grained adaptation significantly reduces quantization distortion, leading to state-of-the-art performance on billion-scale benchmarks.

Introduction

The challenge of searching through billions of high-dimensional vectors, such as SIFT or GIST descriptors, necessitates efficient data compression. Product Quantization (PQ) addresses this by decomposing vectors into subspaces and quantizing them. However, standard PQ and its variant, Optimized PQ (OPQ), rely on global transformations. Real-world data is frequently multi-modal, consisting of distinct clusters that a single global rotation cannot align perfectly to a rigid quantization grid. This misalignment results in high quantization error and reduced search recall.

The LOPQ Method

LOPQ moves beyond the "one size fits all" philosophy by leveraging the structure of an inverted index for local optimization. The process involves four key steps:

  1. Coarse Partitioning: The vector space is divided into $K$ Voronoi cells using a coarse quantizer (e.g., k-means).
  2. Residual Encoding: Instead of raw vectors, the algorithm encodes residuals—the difference between a point and its cell center.
  3. Local Optimization: For every cell, a unique optimal rotation and space decomposition are computed. LOPQ uses a parametric solution: assuming residuals within a cell are Gaussian, PCA is used for alignment, and variance is balanced across subspaces via eigenvalue allocation.
  4. Multi-LOPQ: For billion-scale datasets, the method is adapted for Inverted Multi-Indices, optimizing quantizers per subspace to maintain manageable memory overhead.
Comparison of quantization methods: (a) k-means, (b) PQ, (c) OPQ, and (d) LOPQ. LOPQ provides the best fit for local data clusters.

As shown in the comparison above, while global methods like OPQ attempt to align the entire dataset to a grid, LOPQ adapts the quantization grid to the specific orientation and shape of local data clusters.

Evaluation and Results

The authors evaluated LOPQ against several benchmarks, including SYNTH1M (synthetic multi-modal data), MNIST, SIFT1M, GIST1M, and the massive SIFT1B dataset.

Performance on Multi-modal Data

On the SYNTH1M dataset, designed specifically to test multi-modal distributions, LOPQ demonstrated a significant advantage. It outperformed global OPQ by approximately 30% in recall, validating the effectiveness of local parametric optimization.

Recall@R performance on the SYNTH1M dataset, showing LOPQ's superior performance on multi-modal distributions.

Billion-Scale Benchmarks

On the SIFT1B dataset, Multi-LOPQ established a new state-of-the-art. Using 128-bit codes, it improved Recall@1 by nearly 10% over previous leading methods. Furthermore, the system remains highly efficient, with query times under 8ms on billion-point indices.

Insights and Future Directions

The success of LOPQ stems from the observation that while global distributions are complex, local residuals within a Voronoi cell are typically unimodal and well-behaved, making Gaussian-based parametric optimization highly effective. The memory overhead for storing local rotations is constant relative to the number of points, making it a scalable solution for massive indices.

Future work may explore joint optimization of the coarse and local quantizers, which are currently trained independently. Additionally, investigating hierarchical local optimization or tree-based compression could further refine the precision of approximate nearest neighbor search.

Summary updated

BibTeX
@inproceedings{kalantidis2014locally,
  author = {Yannis Kalantidis and Yannis Avrithis},
  title = {{Locally Optimized Product Quantization for Approximate Nearest Neighbor Search}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2014},
  doi = {10.1109/cvpr.2014.298},
}
Figure