A team's HNSW-based vector index gives fast, high-recall search, but as their corpus grows into the hundreds of millions of vectors, the index no longer fits in memory. They switch to an IVF+PQ index instead, which partitions vectors into clusters and additionally compresses each vector by splitting it into subvectors and replacing each subvector with the ID of its nearest centroid from a small codebook. Compared to storing full-precision vectors, what does this quantization step trade away, and why would a team accept that?
- Nothing is traded away; IVF+PQ produces exactly the same similarity ranking as an exhaustive full-precision search, just organized differently in memory
- Recall is reduced, because replacing each subvector with the ID of its nearest codebook centroid is a lossy approximation of the original values, so similarity computed from the compressed representation only approximates the true distance; a team accepts this because the memory footprint can shrink dramatically, often by roughly an order of magnitude or more, letting a large index fit in memory at all, while search remains far faster than an exhaustive scan
- Only the ability to add new vectors to the index after it is built is lost; existing search accuracy is completely unaffected by the quantization step
- Only the ability to filter search results by metadata is lost; the vector similarity ranking itself remains exactly as accurate as full-precision search
Why B? And why not the others?
Correct answer: B. Recall is reduced, because replacing each subvector with the ID of its nearest codebook centroid is a lossy approximation of the original values, so similarity computed from the compressed representation only approximates the true distance; a team accepts this because the memory footprint can shrink dramatically, often by roughly an order of magnitude or more, letting a large index fit in memory at all, while search remains far faster than an exhaustive scan
Product quantization replaces each subvector with the ID of its nearest centroid from a small codebook, and that centroid is only an approximation of the original subvector's actual values, so any similarity or distance computed from the compressed representation is itself an approximation of the true full-precision distance; documented benchmarks on this kind of index show recall dropping well below a full-precision flat index's near-perfect recall. A team accepts this because the compression can shrink an index's memory footprint by roughly an order of magnitude or more (letting a corpus that would not otherwise fit in memory fit at all) while combining an IVF partitioning stage with the quantized vectors also makes search dramatically faster than scanning everything exhaustively, since a query only has to compare against vectors in a handful of nearby partitions rather than the full corpus. This is a different mechanism from an HNSW index's own speed-versus-recall tradeoff, which comes from an approximate graph traversal that can skip a true nearest neighbor, not from lossily compressing the vectors' values themselves. The option claiming no tradeoff exists is wrong because quantization is lossy by construction. The option claiming only insertion ability is lost is wrong because the accuracy cost falls on search recall, not on whether new vectors can be added. The option claiming only metadata filtering is lost is wrong because metadata filtering is a separate concern from how the vectors themselves are compressed and searched.
Source: Pinecone (Faiss series), 'Product Quantization,' https://www.pinecone.io/learn/series/faiss/product-quantization/