Product quantization
Product quantization is a vector-compression technique that partitions vectors into subvectors and represents each subvector with a code from a corresponding codebook.
AI-Powered Search
Product quantization is a vector-compression technique that partitions an embedding into subvectors and replaces each subvector with the identifier of a nearby centroid.
- How it is used
- Improves large-scale vector-search efficiency by compressing embeddings and reducing indexed storage and approximate-search cost.
- How deep it goes
- Traces PQ from subvector clustering and codebooks through query-time lookup tables, then demonstrates FAISS indexing and benchmarks.
- Examples
- Uses FAISS IndexPQ code, 16 subvectors, 8-bit settings, and benchmark listings comparing latency, index size, recall, and reranked recall.
- What you can do after
- Apply it via FAISS to build, persist, benchmark, and rerank a compressed embedding index.
Natural Language Processing in Action, Second Edition
Product quantization is a vector-compression technique that splits a vector into subvectors and quantizes each subvector separately.
- How it is used
- Deploys product quantization to compress embeddings and accelerate semantic-search indexing and nearest-neighbor queries.
- How deep it goes
- Explains subvector splitting and clustering, but defers package-level implementation details and pipeline configuration.
- Examples
- Uses NumPy integer conversion, document vectors, IVFPQ, and HNSW plus PQ as concrete illustrations.
- What you can do after
- Build it into semantic-search indexes while balancing compression, latency, throughput, and resource constraints.
Read how Natural Language Processing in Action, Second Edition explains product quantization →
Building Reliable AI Systems
Product quantization compresses vectors by dividing them into subvectors and representing them with entries from learned codebooks.
- How it is used
- Reduces vector-index memory to support faster, more scalable search as a corpus grows.
- 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.
Read how Building Reliable AI Systems explains product quantization →
Related concepts
- clusteringuses · Clustering is the technique of grouping data items according to similarity or shared characteristics.
- quantizationkind of · Quantization maps numerical values to a finite set of discrete representations, often using reduced precision to lower model storage or computation requirements.
- FAISSimplemented by · FAISS is an open-source software library for efficient similarity search and clustering of dense vectors.
- vector compressionkind of · Vector compression reduces the storage required for numerical vector representations, typically by encoding them with fewer or lower-precision values while retaining useful information.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


