liveBook · Manning

Product quantization

Also called pq

Product quantization is a vector-compression technique that partitions vectors into subvectors and represents each subvector with a code from a corresponding codebook.

How 4 Manning books explain it

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.

Read how AI-Powered Search explains product quantization →

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

Related concepts

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.