Approximate Nearest Neighbor Search (HNSW, IVF, LSH)
Algorithms and data structures for efficiently finding approximate nearest neighbors in high-dimensional vector spaces, trading a small amount of accuracy for orders-of-magnitude speedups over exact search.
Method
IVF need not compress vectors: IndexIVFFlat stores full vectors, whereas IVF-PQ adds quantization.
Applications
Dense retrieval and semantic search, recommendation (item-item or user-item), image and multimedia retrieval, RAG systems, deduplication, clustering initialization, any large-scale vector similarity task.
Advantages
Enables practical similarity search at billion scale; excellent speed-accuracy trade-offs; mature open-source and commercial implementations; foundational for modern vector databases.
Limitations
Approximation error; index construction cost and memory; parameter tuning (efConstruction, nprobe, etc.) affects recall/speed trade-off; dynamic updates can be costly for some indexes. IVF need not compress vectors: IndexIVFFlat stores full vectors, whereas IVF-PQ adds quantization.
Alternatives
Exact search (for small data), tree-based methods (KD-tree, Ball-tree — limited in high-d), quantization-only methods, learned indexes. Top Algorithms & Models — Part 2 (101–200) Research Compendium
Editorial clarification
IVF need not compress vectors: IndexIVFFlat stores full vectors, whereas IVF-PQ adds quantization.
Sources
Educational reference only, not professional advice.
All algorithms