liveBook · Manning

Product quantization

As explained in Building Reliable AI Systems

Product quantization compresses vectors by dividing them into subvectors and representing them with entries from learned codebooks.

Product quantization compresses vectors by splitting them into subvectors and representing them with entries from learned codebooks. Its compact representations reduce storage while retaining information for approximate similarity search. section 4.6.2

The benefit is most relevant when high-dimensional vectors and growing corpora make index memory a latency, storage, or cost bottleneck. Compression is not always necessary for small applications. section 4.6.2

Choose an index strategy around the workload:

  • Consider IVF-PQ when memory is constrained or documents are added frequently; favor HNSW when query latency is paramount and memory overhead is acceptable. Benchmark both on the target workload. section 4.5.2
  • Use compressed vectors for first-pass candidate retrieval, then rerank candidates with a cross-encoder when precision matters. section 4.6.2

How Building Reliable AI Systems covers it

How deep it goes
Explains codebook-based compact representations and approximate similarity, but does not detail the encoding procedure.
Examples
Illustrates memory pressure from millions of 768- or 1,536-dimensional vectors and compressed retrieval followed by cross-encoder reranking.
What you can do after
Apply quantization to existing vectors with FAISS or use compressed first-pass retrieval before cross-encoder reranking.
How it connects
Connects vector search with IVF, HNSW, scalar quantization, binary quantization, and cross-encoder reranking.

Also explained in

Compare how 3 books explain product quantization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Reliable AI Systems. The section links point to the parts of the book it draws on.