Approximate vs Exact Nearest Neighbor (SOLVED)
Brute-force exact search thresholds, ANN recall trade-offs, and hybrid exact re-rank on shortlists.
TL;DR — Quick Answer
Use exact k-NN via brute force or optimized GEMM when vector count is small (typically under ~10k–50k depending on dimension and hardware) or when perfect recall is mandatory. Use ANN for larger corpora where slight recall loss is acceptable for orders-of-magnitude latency gains. A common pattern is ANN shortlist + exact re-rank on candidates.
The Interview Question
When should you use approximate nearest neighbor (ANN) search versus exact k-NN?
Deep Explanation
Exact k-NN
Sign in to unlock full answer
Get deep explanations, PDF export & all Vector Databases questions
- 21 more sections of deep explanation
- Real-world examples
- Common mistakes
- Interviewer expectations
- Follow-up questions
ANNExact Searchk-NNRecallFaissPinecone