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.
Retrieval Augmented Generation, The Foundational Ideas
Product quantization compresses vectors by splitting them into subvectors and replacing each subvector with the index of its nearest entry in a learned codebook.
- How it is used
- Compresses dense-retrieval indexes so large-scale semantic search and RAG deployments fit available memory.
- How deep it goes
- Explains subvector codebooks, memory-quality trade-offs, and index composition, but stops short of implementation details for training PQ codebooks.
- Examples
- Uses FAISS-scale indexing, Wikipedia-scale RAG retrieval, and compressed indexes deployed beside a reader on one GPU.
- What you can do after
- Evaluate and configure compressed retrieval architectures by balancing index footprint, search strategy, latency, and retrieval quality.
Read how Retrieval Augmented Generation, The Foundational Ideas explains product quantization →
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 →
What to know first
- similarity searchSimilarity search is a retrieval technique that finds or ranks items by their similarity to a query, often by comparing feature or vector representations under a similarity or distance measure.
- approximate nearest neighbor searchApproximate nearest neighbor search efficiently finds items close to a query under a distance or similarity measure without guaranteeing the exact nearest items.
- recallRecall is the proportion of all relevant or actual positive items that a system successfully retrieves or correctly identifies.
- HNSWHNSW is a graph-based approximate nearest-neighbor indexing and search method that organizes data points in a hierarchy of navigable proximity graphs.
Related concepts
- clusteringuses · Clustering is the process of grouping data items so that items within a group are more similar to one another than to items in other groups.
- quantizationkind of · Model quantization represents model parameters or computations with reduced-precision numerical values, often to lower storage or computational requirements.
- Atlasused by · Atlas is a retrieval-augmented language model designed for knowledge-intensive natural-language tasks.
- compressionkind of · Compression is the encoding of data or information in a more compact representation to reduce its size while retaining content needed for recovery or use.
- FAISSimplemented by · FAISS is an open-source software library for efficient similarity search and clustering of dense vectors.
- ivfpqused by · IVFPQ is an approximate nearest-neighbor indexing technique that combines inverted-file partitioning with product quantization.
Questions about product quantization
What is 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.
Which Manning books explain product quantization?
Retrieval Augmented Generation, The Foundational Ideas, AI-Powered Search, Natural Language Processing in Action, Second Edition and Building Reliable AI Systems.
What should I know before learning product quantization?
Manning books that teach product quantization usually introduce similarity search, approximate nearest neighbor search, recall and HNSW first.
What is product quantization a kind of?
Product quantization is a kind of quantization. Model quantization represents model parameters or computations with reduced-precision numerical values, often to lower storage or computational requirements.
What is product quantization also called?
Product quantization is also called pq.
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.



