What is IVF (Inverted File Index)?

IVF (Inverted File Index) is an approximate nearest neighbour index that divides the vector space into many cells with k-means clustering, records each vector in its nearest centroid's list and scans only vectors in the few cells nearest the query.

Unlike Hierarchical Navigable Small World, which navigates a multi-layer neighbourhood graph and usually needs more memory, IVF clusters vectors and, combined with product quantisation, can hold very large indexes in little memory. The number of cells scanned sets the accuracy versus speed balance.

Topic
Embeddings, document processing and RAG

How IVF (Inverted File Index) works

  1. K-means runs on sample vectors to learn a set number of cluster centroids.
  2. Each vector joins its nearest centroid's inverted list, stored in full or compressed.
  3. At query time the nearest centroids are found and only their lists are scanned.
  4. Scanning more lists raises accuracy and lowers speed.

In more detail

Core parameters: balancing nlist and nprobe

IVF's behaviour is governed by two core parameters: nlist, the number of k-means clusters created at build time and usually chosen in proportion to the square root of the vector count and nprobe, the number of nearest clusters scanned per query. Raising nprobe increases recall at the cost of higher query latency, while setting nlist too high increases centroid-selection overhead.

IVF variants (IVF-Flat, IVF-SQ8, IVF-PQ) and refinement

IVF is a family of variants rather than a single format: IVF-Flat stores uncompressed vectors inside each inverted list for high recall, IVF-SQ8 applies 8-bit scalar quantisation for ~4x memory savings with minimal loss and IVF-PQ achieves much higher compression at the expense of quantisation error. In production, IVF-PQ is commonly paired with a refinement/reranking pass over the top-k candidates using full vectors on disk or CPU RAM.

Metadata filtering and newer quantisers

When enterprise RAG queries combine vector search with strict metadata filters (such as user permissions or date ranges), standard IVF probing can examine cells whose vectors are all filtered out, yielding too few results. Modern vector engines address this with adaptive/iterative probing, bitmap pre-filtering or inverted-list partitioning by tenant. Newer quantisers such as RaBitQ (2024) aim for higher recall per byte than classic PQ, while libraries such as NVIDIA cuVS accelerate IVF search on GPUs.

Commonly confused terms

TermHow it differs
Flat (brute-force) searchFlat (brute-force) search computes exact distances against every vector for 100% recall with O(N) query cost, whereas IVF narrows the search to only nprobe nearest clusters for sub-linear approximate search.
Product quantisationIVF is a coarse spatial partitioning structure that narrows down which subset of vectors to inspect, whereas Product Quantisation (PQ) is a vector compression encoding applied inside those lists (commonly paired as IVF-PQ) to shrink memory usage.

Why IVF (Inverted File Index) matters for on-premises AI

IVF searches millions or billions of embeddings without scanning all data; combined with product quantisation it cuts memory greatly and is common in in-house RAG systems to fit an index on one server or in GPU memory. The paper on a widely used vector search library frames index choice as a trade-off of speed, memory and accuracy. If the data distribution shifts, clusters can go stale and the index needs retraining; near neighbours on cluster borders can also be missed.

ON-PREMISES EXAMPLE

A telecom operator fits a very large vector index of customer service records on one server with IVF and product quantisation, tuning the number of cells scanned to hit its retrieval target on validation questions.

Common questions

How does IVF differ from HNSW?

HNSW navigates a graph and usually needs more memory. IVF clusters vectors and, with compression, uses less memory for large indexes.

How is accuracy improved in IVF?

By scanning more cells per query or choosing cluster count and compression settings to suit the data.

Sources

In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.