SPANN: Highly-efficient Billion-scale Approximate Nearest Neighbor Search

Qi Chen, Bing Zhao, Haidong Wang, Mingqin Li, Chuanjie Liu +3 more
11/5/2021
cs.DBcs.AIcs.CV

Official code: microsoft/SPTAG (5,024 stars, C++, MIT, last commit 2026-11-20).

Abstract

The in-memory algorithms for approximate nearest neighbor search (ANNS) have achieved great success for fast high-recall search, but are extremely expensive when handling very large scale database. Thus, there is an increasing request for the hybrid ANNS solutions with small memory and inexpensive solid-state drive (SSD).

Show full abstract

In this paper, we present a simple but efficient memory-disk hybrid indexing and search system, named SPANN, that follows the inverted index methodology. It stores the centroid points of the posting lists in the memory and the large posting lists in the disk. We guarantee both disk-access efficiency (low latency) and high recall by effectively reducing the disk-access number and retrieving high-quality posting lists. In the index-building stage, we adopt a hierarchical balanced clustering algorithm to balance the length of posting lists and augment the posting list by adding the points in the closure of the corresponding clusters. In the search stage, we use a query-aware scheme to dynamically prune the access of unnecessary posting lists. Experiment results demonstrate that SPANN is 2$\times$ faster than the state-of-the-art ANNS solution DiskANN to reach the same recall quality $90\%$ with same memory cost in three billion-scale datasets. It can reach $90\%$ recall@1 and recall@10 in just around one millisecond with only 32GB memory cost. Code is available at: {\footnotesize\color{blue}{\url{https://github.com/microsoft/SPTAG}}}.

View on arXivView PDF

Code Implementations(1)

microsoft/SPTAGOfficial100%
MIT

A distributed approximate nearest neighborhood search (ANN) library which provides a high quality vector index build, search and distributed online serving toolkits for large scale vector search scenario.

5,024625C++, PythonSep 12, 20181 weeks agoMIT
approximate-nearest-neighbor-searchdistributed-servingfresh-updateneighborhood-graphspace-partition-tree+1 more

Similar Papers

Cite this paper

@article{chen2021spann,
  title  = {SPANN: Highly-efficient Billion-scale Approximate Nearest Neighbor Search},
  author = {Qi Chen and Bing Zhao and Haidong Wang and Mingqin Li and Chuanjie Liu and Zengzhong Li and Mao Yang and Jingdong Wang},
  year   = {2021},
  eprint = {2111.08566},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.08566}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2111.08566.svg)](https://codeofpaper.com/paper/2111.08566)

Discussion