The boundary miss — one lonely point
A cell boundary is a hard wall: a true neighbor a hair across it can be closer to the query than points inside the query's own cell, yet stay invisible at low nprobe purely because of which side of the line it fell on — nearness in space is not membership in a probed cell.
IVF's speedup comes with a signature failure, and now we've named it: the boundary miss, where a hard cell wall hides an obviously-close neighbor. nprobe patches it but every extra cell you probe is latency back on the bill. That raises a sharper question: is there a way to navigate toward the query's true neighbors directly, instead of carving the space into rigid cells with brittle walls?
Scene 05
The boundary miss — one lonely point
- Watch
- Try it
- Predict
- Capture
Freeze the frame from the last scene and zoom in on the wall. The query 'Now Playing' sits beside a cell boundary; 'Lonely Synth' (#14, the red point) sits just across it, in the next cell over. Measure honestly and #14 is the query's true #4-closest song. Yet at nprobe=1 — scanning only the query's own cell — IVF skips #14 entirely and fills its slot with 'Study Beats' (#13), which is farther from the query but happens to live INSIDE the scanned cell. The red point is closer and still lost. Notice it: the miss is caused by the line, not by the distance.
Highlighted lines are the ones running in the diagram right now.
def build(vectors, nlist):centroids = kmeans(vectors, k=nlist) # the wallsmembers = {c: [] for c in centroids}for v in vectors:c = nearest_centroid(v, centroids) # Voronoi cellmembers[c].append(v)return centroids, members
def search(q, k, nprobe):cells = nearest_centroids(q, nprobe)candidates = []for c in cells: # ONLY probed cellscandidates += members[c] # un-probed cells invisiblecandidates.sort(key=lambda p: dist(q, p))return candidates[:k] # nearness off-cell ignored
Where this sits in Build a vector database (Pinecone / Weaviate / pgvector style)
Scene 05 of 15, in the First index act — Flat baseline, IVF cells, and the boundary miss that bites every junior.. A cell wall is hard: a true neighbor a hair across it is invisible at low nprobe, even though it's closer than points you do return. Proximity in space ≠ membership in a probed cell.
Up next. Cells are rigid and their walls cause misses. What if, instead of dividing space, we connected each vector to its nearest neighbors with links — so that searching becomes hopping from point to point, always stepping closer to the query, with no hard boundary to fall on the wrong side of?
All 15 scenes in Build a vector database (Pinecone / Weaviate / pgvector style) · Every curriculum