VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

How Lossy Works | Inverted File Indexing — When the Vector Space Is Divided Into Cells

Imagine dividing a huge vector space into neighbourhoods.

Each vector is assigned to a nearby centroid.

When a query arrives, the system searches only a few of those neighbourhoods.

That is the core idea behind an Inverted File index, usually shortened to IVF.

Quick Read

IVF is a partition-based approximate nearest-neighbour index. A coarse quantiser divides vectors into clusters around centroids. At query time, the nearest centroids are identified and only vectors in a selected number of corresponding cells are scanned.

One-sentence answer: IVF is lossy because it replaces exhaustive search with coarse spatial routing, preserving likely neighbourhoods while ignoring cells the first-stage centroid comparison judges too far away.

The Coarse Quantiser Is the First Gate

During index construction, the vector population is clustered.

Each vector is assigned to one centroid or cell.

The full geometry has now been simplified into a coarse partition.

The index remembers which vectors live under which centroid rather than treating every vector as equally reachable from every query.

Search Begins With the Centroids, Not the Database

A query is compared with the coarse centroids first.

Only the closest few cells are opened.

The vectors inside those cells are then compared more carefully.

The database becomes searchable because most cells remain closed.

nprobe Is the Main Recall–Latency Dial

Search one cell and latency can be very low.

Search many cells and recall improves because more of the nearby geometry is inspected.

Many IVF systems expose this choice through a parameter commonly called nprobe.

The more cells you probe, the closer the process moves toward exhaustive search.

Boundary Errors Are the Classic Failure

Suppose the true nearest neighbour sits just across a cluster boundary.

The query falls slightly closer to the centroid on the other side.

If only one cell is searched, the true neighbour is invisible despite being physically close in vector space.

The coarse partition creates artificial walls.

More Centroids Create Finer Cells

Use more centroids and each cell becomes smaller.

This can make local search more selective.

But the centroid table grows, training becomes more expensive, and probing strategy becomes more delicate.

Too few cells make each list large. Too many can make routing brittle.

Cluster Balance Matters

If one cell contains millions of vectors and another contains a few thousand, query cost becomes uneven.

A centroid partition optimised only for geometric distortion may still create operational imbalance.

Index quality therefore includes both geometry and workload distribution.

IVF Can Be Exact Inside the Chosen Cells

IVF-Flat keeps original vectors in the inverted lists and can compute exact distances inside the cells it probes.

The approximation arises from which cells were not searched.

This is an important distinction from Product Quantisation, where vector values themselves are compressed.

IVF owns coarse spatial routing. Quantisation owns representation precision.

IVF-PQ Adds a Second Loss Layer

In large-scale systems, IVF is often combined with compressed vector codes.

Now there are two approximations:

  • coarse routing decides which cells are searched;
  • compressed codes approximate distances inside those cells.

The two losses should be measured separately even when deployed together.

Adaptive Probing Is Becoming More Important

Some queries are easy: their nearest neighbours sit deep inside one obvious cluster.

Others are difficult: good neighbours are scattered across several cells.

Recent research explores adaptive IVF search that changes how many clusters are probed according to query difficulty, seeking high recall without paying the same cost for every query.

IVF and Clustering Are Related but Not the Same Owner

Clustering groups data to describe structure.

IVF uses coarse clusters operationally as search partitions.

The clusters are not the final answer. They are doors into the database.

IVF and Candidate Generation Also Stay Separate

Candidate Generation owns the whole first-stage retrieval problem.

IVF owns one partition-based mechanism for reducing the candidate universe.

This keeps the taxonomy clean and avoids cannibalising the umbrella article.

Education: Coarse Categories Help Until the Answer Lives Near a Boundary

A learner may classify a problem as “algebra” and search remembered algebra methods first.

That is efficient when the classification is correct.

It fails when the problem sits between algebra, geometry and modelling.

This is an analogy, not IVF mechanics. The shared lesson is that routing by coarse category saves work by making some regions temporarily invisible.

A CivDJ View: Inspect the Neighbour Across the Wall

Forward: does the IVF index meet latency and recall targets?

Backward: were missed neighbours located in unprobed cells?

Rotate: do misses concentrate near boundaries, in sparse regions or in unusually shaped clusters?

The coarse cell is a useful abstraction only while it does not become a false wall around the truth.

When IVF Is Exactly the Right Loss

Use it when vector collections are large, partition-based search maps well to the workload, memory efficiency matters, and recall can be calibrated by varying the number of probed cells.

When IVF Becomes Dangerous

  • Too few cells are probed.
  • True neighbours sit across cluster boundaries.
  • Clusters become badly imbalanced.
  • Centroids are stale after distribution shift.
  • IVF routing loss is confused with vector-quantisation loss.
  • Recall is never calibrated against exact search.

A Practical IVF Audit

  • Centroids: how many coarse cells exist?
  • Assignment: how balanced are the inverted lists?
  • Probe: how many cells are searched per query?
  • Boundary: where do exact neighbours live when recall fails?
  • Drift: are centroids still representative?
  • Compression: are vectors exact or additionally quantised?
  • Baseline: what recall is achieved against flat search?

Research Anchors

Current 2025–2026 ANN work continues to use IVF as a major partition-based index. Recent studies explicitly model query difficulty to adapt the number of clusters searched, while database documentation continues to expose the central IVF trade-off: fewer scanned cells improve speed while broader probing improves recall.

Continue Through eduKateSG

Continue with How Lossy Works | HNSW, How Lossy Works | Candidate Generation, and the companion article How Lossy Works | Graph Search Budgets.

Final Thought: Search Gets Cheap by Closing Most of the Doors

IVF works because only a few cells are opened.

Its intelligence lies in making sure the door left closed did not contain the neighbour the receiver needed.

Discover more from eduKate Singapore

Subscribe now to keep reading and get access to the full archive.

Continue reading