Lune

SIGMOD2020Top-tier venue

Improving Approximate Nearest Neighbor Search through Learned Adaptive Early Termination

Conglong Li, Minjia Zhang, David G. Andersen, Yuxiong He

Abstract

In applications ranging from image search to recommendation systems, the problem of identifying a set of "similar" real-valued vectors to a query vector plays a critical role. However, retrieving these vectors and computing the corresponding similarity scores from a large database is computationally challenging. Approximate nearest neighbor (ANN) search relaxes the guarantee of exactness for efficiency by vector compression and/or by only searching a subset of database vectors for each query. Searching a larger subset increases both accuracy and latency. State-of-the-art ANN approaches use fixed configurations that apply the same termination condition (the size of subset to search) for all queries, which leads to undesirably high latency when trying to achieve the last few percents of accuracy. We find that due to the index structures and the vector distributions, the number of database vectors that must be searched to find the ground-truth nearest neighbor varies widely among queries. Critically, we further identify that the intermediate search result after a certain amount of search is an important runtime feature that indicates how much more search should be performed. To achieve a better tradeoff between latency and accuracy, we propose a novel approach that adaptively determines search termination conditions for individual queries. To do so, we build and train gradient boosting decision tree models to learn and predict when to stop searching for a certain query. These models enable us to achieve the same accuracy with less total amount of search compared to the fixed configurations. We apply the learned adaptive early termination to state-of-the-art ANN approaches, and evaluate the end-to-end performance on three million to billion-scale datasets. Compared with fixed configurations, our approach consistently improves the average end-to-end latency by up to 7.1 times faster under the same high accuracy targets. Our approach is open source at github.com/efficient/faiss-learned-termination.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

54 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search cites High-Dimensional Approximate Nearest Neighbor Search: with Reliable and Efficient Distance Comparison Operations
  • RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search cites A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor Search
  • RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search cites HVS: Hierarchical Graph Structure Based on Voronoi Diagrams for Solving Approximate Nearest Neighbor Search
  • RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor Search cites Efficient Approximate Nearest Neighbor Search in Multi-dimensional Databases
  • High-Dimensional Approximate Nearest Neighbor Search: with Reliable and Efficient Distance Comparison Operations cites A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor Search
  • High-Dimensional Approximate Nearest Neighbor Search: with Reliable and Efficient Distance Comparison Operations cites HVS: Hierarchical Graph Structure Based on Voronoi Diagrams for Solving Approximate Nearest Neighbor Search
  • Efficient Approximate Nearest Neighbor Search in Multi-dimensional Databases cites A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor Search
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers54

  1. A Comprehensive Survey and Experimental Comparison of Graph-Based Approximate Nearest Neighbor SearchMengzhao Wang, Xiaoliang Xu, Qiang Yue, Yuxiang WangVLDB 2021 · 354 citations
  2. RaBitQ: Quantizing High-Dimensional Vectors with a Theoretical Error Bound for Approximate Nearest Neighbor SearchJianyang Gao, Cheng LongSIGMOD 2024 · 83 citations
  3. Efficient Approximate Nearest Neighbor Search in Multi-dimensional DatabasesYun Peng, Byron Choi, Tsz Nam Chan, Jianye Yang et al.SIGMOD 2023 · 74 citations
  4. High-Dimensional Approximate Nearest Neighbor Search: with Reliable and Efficient Distance Comparison OperationsJianyang Gao, Cheng LongSIGMOD 2023 · 73 citations
  5. HVS: Hierarchical Graph Structure Based on Voronoi Diagrams for Solving Approximate Nearest Neighbor SearchKejing Lu, Mineichi Kudo, Chuan Xiao, Yoshiharu IshikawaVLDB 2022 · 70 citations

Related papers

  1. Recall-Aware Early Termination in Approximate Nearest Neighbor SearchShuang Hao, Xinxin Li, Wei ZhangKDD 2026
  2. E2E: Efficient Filtered AKNN Search via Adaptive TerminationWenxuan Xia, Mingyu Yang, Wentao Li, Wei WangKDD 2026 · 1 citation
  3. ANNA: Specialized Architecture for Approximate Nearest Neighbor SearchYejin Lee, Hyunji Choi, Sunhong Min, Hyunseung Lee et al.HPCA 2022 · 37 citations
  4. ANSMET: Approximate Nearest Neighbor Search with Near-Memory Processing and Hybrid Early TerminationYiwei Li, Yuxin Jin, Boyu Tian, Huanchen Zhang et al.ISCA 2025 · 10 citations
  5. JUNO: Optimizing High-Dimensional Approximate Nearest Neighbour Search with Sparsity-Aware Algorithm and Ray-Tracing Core MappingZihan Liu, Wentao Ni, Jingwen Leng, Yu Feng et al.ASPLOS 2024 · 21 citations
Dusk over the sea between two cliffs drawn in fine vertical lines