[论文解读] SPANN: Highly-efficient Billion-scale Approximate Nearest Neighbor Search
SPANN 提出了一种基于内存-磁盘混合的近似最近邻搜索系统,仅将聚类中心点存储在内存中,将大型倒排列表存储在磁盘上,通过层次聚类和查询感知剪枝技术实现低延迟和高召回率。在仅使用 32GB 内存的情况下,SPANN 在十亿规模数据集上以 90% 召回率的条件下,搜索速度比 DiskANN 快 2 倍,对召回率@1 和召回率@10 的响应时间低于 1 毫秒。
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). 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$\ imes$ 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}}}.
研究动机与目标
- 解决十亿规模向量数据集在内存中进行近似最近邻搜索(ANNS)时的高内存开销问题。
- 开发一种混合 ANNS 系统,仅使用极少内存和廉价 SSD 支持大规模向量搜索。
- 通过最小化磁盘 I/O 和提升倒排列表质量,实现低查询延迟和高召回率。
- 通过工作负载均衡实现高效分布式部署,避免热点问题并确保可扩展性。
- 与现有基于磁盘的 ANNS 解决方案(如 DiskANN 和 HM-ANN)相比,展示出更优的性能和可扩展性。
提出的方法
- 使用分层平衡聚类对向量进行划分,并均衡倒排列表长度,提升负载分布并减少磁盘访问。
- 通过在聚类闭包中包含点来增强倒排列表,提升搜索质量,同时不增加内存成本。
- 仅将聚类中心点存储在内存中,将完整的倒排列表存储在磁盘上,从而在保持高召回率的同时最小化内存占用。
- 在搜索过程中应用查询感知的动态剪枝技术,减少需访问磁盘的倒排列表数量,从而限制 I/O 和 CPU 成本。
- 采用最优装箱算法,根据数据大小和历史查询访问模式在机器间均衡分配,防止分布式环境中的热点问题。
- 采用分布式架构,每台机器存储索引的一个分区,查询仅被路由到最相关的机器,基于查询感知剪枝策略。
实验结果
研究问题
- RQ1基于简单倒排索引的方法是否能在极低内存占用下实现十亿规模近似最近邻搜索的最先进性能?
- RQ2在内存-磁盘混合 ANNS 系统中,如何在保持高召回率的同时最小化磁盘 I/O?
- RQ3有哪些技术能有效提升倒排列表质量,同时不增加内存成本?
- RQ4查询感知的动态剪枝是否能显著减少每次搜索涉及的机器数量,从而提升延迟和可扩展性?
- RQ5在分布式 ANNS 系统中,如何在机器间均衡工作负载,避免热点并确保线性可扩展性?
主要发现
- 在三个十亿规模数据集上,SPANN 在 90% 召回率下搜索速度比 DiskANN 快 2 倍,且内存预算相同。
- SPANN 仅使用 32GB 内存,即可在约 1 毫秒内达到召回率@1 和召回率@10 的 90%,相比基线内存成本降低 90%。
- 通过多约束聚类和查询感知剪枝,每次查询平均调用的机器数从随机分区的 32 台减少至 6.3 台,I/O 和 CPU 成本节省 80.3%。
- SPANN 在分布式环境中表现出强大的可扩展性,查询访问和数据大小在各台机器间分布均匀,支持资源增加时的线性扩展。
- 在倒排列表扩展中使用闭包分配显著提升了搜索质量,从而在不增加内存占用的前提下提高了召回率。
- SPANN 已成功部署于 Microsoft Bing,支持数百亿次向量搜索,验证了其在真实场景中的高效性和鲁棒性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。