IVF (inverted file) clusters vectors with k-means into cells; at query time only the nprobe nearest cells are scanned. More probes give higher recall and higher latency; recall drops for vectors near cell boundaries.
Product quantization splits each vector into m sub-vectors and replaces each with the ID of its nearest entry in a small learned codebook (256 entries fit in one byte), compressing a 768-dimension float32 vector (3,072 bytes) to, for example, 96 bytes.
IVF-PQ therefore scales to hundreds of millions or billions of vectors: a billion 768-dimension float32 vectors need about 3 TB raw, versus roughly 100 GB of PQ codes, at some cost in recall (often recovered by reranking with original vectors).
Loading…