Fill in the IVF nlist rule of thumb.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
nlist ~ sqrt(N). Larger makes centroid comparison dominate per query work; smaller forces each partition to be large and slow to scan.
Imagine sorting a million books into boxes. Too few boxes means each box is huge and you waste time digging through one. Too many boxes means you spend forever picking which box to look in. The sweet spot is when the number of boxes is about the same as the number of books per box, which math says is roughly sqrt(N).
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Derive the optimum from T(nlist) = nlist + nprobe * N / nlist. Discuss the 4*sqrt(N) refinement, k-means training cost at scale, and why nprobe (not nlist) is the recall knob.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Setting nlist proportional to N (linear growth) or treating it as a recall knob; the recall knob is nprobe, and nlist is a structural balance.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.