ModelRefs / Inverted File Index (IVF) — AI Glossary
Inverted File Index (IVF) — AI Glossary
A vector indexing method partitioning the vector space into Voronoi cells, searching only the nearest cells at query time.
Overview
IVF (Faiss IVFFlat, IVF-PQ) quantizes the dataset into k centroids, assigns each vector to its nearest centroid, and at query time searches only the nprobe nearest cells. IVF+PQ (Product Quantization) adds compression for memory efficiency. Scales to billions of vectors; dominant approach in Faiss and many production vector stores.
Reference details
| Topic | rag |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
How it works
- Centroids are learned by running k-means over a sample of the corpus, and that sample has to be large relative to the cell count or the partition is fitted to noise.
- A common rule of thumb is tens of vectors per centroid in the training sample, so a partition into many cells needs a correspondingly larger sample rather than a fixed one.
- Each vector is then assigned to its nearest centroid and stored in that cell's posting list, which is the inverted file the method is named for.
- At query time the query is compared against the centroids first — a cheap scan over a small set — and only the posting lists of the nearest cells are searched.
- Real data does not partition evenly, so cells end up holding very different numbers of vectors, and the fraction of cells probed is therefore not the fraction of vectors examined.
- That imbalance is why latency varies between queries on the same index and why the probe count has to be tuned against measured recall rather than against the proportion of cells it appears to cover.
Example: You are choosing how much of the data to ignore
Partition a corpus into 1,024 cells and probe the 8 nearest at query time and you have searched 8 / 1024 ≈ 0.8% of the data. That is the entire speedup, and also the entire risk: a true nearest neighbour sitting just across a cell boundary, in a cell you did not probe, is simply never considered. Nothing errors — the answer is assembled from slightly worse neighbours. Raising the probe count raises recall and latency together, roughly in step, so the parameter is a dial between them that has to be set by measuring recall against exact search on your own queries.
Commonly confused with
IVF partitions the space and searches a subset of partitions; graph indexes navigate a proximity graph instead. They fail differently — partition boundaries cause the misses here, whereas graph indexes miss when the walk gets stuck. Product quantization is orthogonal to both: it compresses the vectors, and is commonly combined with IVF to cut memory at a further cost in precision.
When to use it
Reach for it when:
- Very large corpora where memory matters and some recall loss is acceptable
- Batch or offline search where the probe count can be raised without hurting a user
- Combined with compression, when the raw vectors would not fit in memory
Reach for something else when:
- Without training the partition on a representative sample of your actual data
- Frequently updated corpora, where the learned partition drifts from the data
- Correctness-critical retrieval, unless recall has been measured and is acceptable
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Inverted File Index (IVF) — AI Glossary.
Frequently asked questions
What is Inverted File Index (IVF)?
A vector indexing method partitioning the vector space into Voronoi cells, searching only the nearest cells at query time.
What concepts are related to Inverted File Index (IVF)?
Closely related concepts include ann, product quantization, faiss.