What Is Product Quantization for Vector Search?

Product Quantization for Vector Search Explainer

Product quantization, or PQ, compresses high-dimensional vectors for faster and more memory-efficient similarity search. It splits each vector into smaller subvectors and replaces each subvector with the nearest entry from a learned codebook.

The stored vector becomes a compact sequence of codebook indices. For a query, the system precomputes distances to codewords and combines table lookups to estimate the distance to many compressed vectors quickly.

PQ is useful when millions or billions of full-precision vectors would exceed memory. It often works with an inverted index or a reranking step that applies exact distances to a short candidate list.

Compression changes distances and can reorder neighbors. More subspaces or larger codebooks improve fidelity but use more storage and computation. Evaluation should measure recall, memory, training data, encoding time, and reranked quality.

Product quantization compresses a vector into short codebook references so large collections can be searched with less memory.

Key terms include product quantization, subvector, codebook, centroid, compact code, lookup table, distance estimate, recall and reranking.

Each subvector is represented by the index of a nearby codeword.

Precomputed lookup tables estimate query distances without reconstructing every full vector.

Shorter codes save memory but introduce distance error.

Exact reranking of top candidates can recover quality where it matters most.

Explore more "Explainers"

Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.