advanced practice · coding problem
IVF nprobe vs recall
100k vectors, 1000 centroids, nprobe=1 recalls 70%, nprobe=8 recalls 92%. Latency 2ms→9ms. Pick nprobe for prod if SLA is 5ms and recall target 85%.
The mechanism
IVF partitions the space into Voronoi cells via k-means. A query is matched to its nearest cells (nprobe of them) and only those vectors are scanned — trading recall for a big speedup.
Expected evidence
nprobe=8 exceeds recall but misses SLA; try nprobe=4 and measure curve.
Try this drill in the practice workspace →
Hints when you need them
- More cells scanned → higher recall, higher latency.
Watch for these mistakes
- Setting nprobe=1 and wondering why recall is poor
- Too few or too many centroids for the dataset size