Skip to main content
QUICK REVIEW

[论文解读] Fast Approximate Nearest Neighbor Search With The Navigating Spreading-out Graph

Cong Fu, Chao Xiang|arXiv (Cornell University)|Jul 1, 2017
Data Management and Algorithms被引用 25
一句话总结

本文提出了一种基于图的近似最近邻搜索(ANNS)索引——Naviating Spreading-out Graph(NSG),通过同时优化连通性、低出度、短搜索路径和紧凑的索引大小,实现了对数时间复杂度的搜索并具备高可扩展性。NSG在性能上超越了Faiss和HNSW等最先进方法,在1亿向量上以99%精度实现了相比串行搜索430倍的加速,并已在淘宝的百亿节点搜索引擎中实际部署,平均响应时间仅为5ms。

ABSTRACT

Approximate nearest neighbor search (ANNS) is a fundamental problem in databases and data mining. A scalable ANNS algorithm should be both memory-efficient and fast. Some early graph-based approaches have shown attractive theoretical guarantees on search time complexity, but they all suffer from the problem of high indexing time complexity. Recently, some graph-based methods have been proposed to reduce indexing complexity by approximating the traditional graphs; these methods have achieved revolutionary performance on million-scale datasets. Yet, they still can not scale to billion-node databases. In this paper, to further improve the search-efficiency and scalability of graph-based methods, we start by introducing four aspects: (1) ensuring the connectivity of the graph; (2) lowering the average out-degree of the graph for fast traversal; (3) shortening the search path; and (4) reducing the index size. Then, we propose a novel graph structure called Monotonic Relative Neighborhood Graph (MRNG) which guarantees very low search complexity (close to logarithmic time). To further lower the indexing complexity and make it practical for billion-node ANNS problems, we propose a novel graph structure named Navigating Spreading-out Graph (NSG) by approximating the MRNG. The NSG takes the four aspects into account simultaneously. Extensive experiments show that NSG outperforms all the existing algorithms significantly. In addition, NSG shows superior performance in the E-commercial search scenario of Taobao (Alibaba Group) and has been integrated into their search engine at billion-node scale.

研究动机与目标

  • 解决现有基于图的ANNS方法在百亿节点数据集上可扩展性和效率方面的局限性。
  • 设计一种图结构,确保快速、低复杂度的搜索,同时保持高准确率和低内存占用。
  • 在不牺牲搜索性能的前提下降低索引时间复杂度,使大规模数据集上的实际部署成为可能。
  • 为真实世界的ANNS工作负载设计一种理论基础扎实且实用的单调相对邻域图(MRNG)近似。

提出的方法

  • 提出单调相对邻域图(MRNG),一种理论图结构,通过确保向查询方向的单调路径推进,保证近似对数时间复杂度的搜索。
  • 引入Naviating Spreading-out Graph(NSG)作为MRNG的实用近似变体,平衡连通性、低出度、短路径和小索引大小。
  • 在NSG上采用贪心的、基于优先级的搜索算法,节点根据其与查询的接近程度被迭代扩展,通过固定候选池大小进行剪枝。
  • 采用两阶段索引策略:首先构建k-NN图,然后应用“扩散”机制重连边,以提升连通性和路径效率。
  • 通过将大规模数据集划分为子集,分别构建独立的NSG,并并行合并结果,实现分布式索引与搜索。
  • 采用受HNSW启发的分层多层结构,但通过边剪枝和扩散启发式策略,实现更快的索引速度和更低的出度。

实验结果

研究问题

  • RQ1基于图的ANNS方法是否能在保持对数时间复杂度的同时,实现对百亿节点数据集的可扩展性?
  • RQ2如何在不降低搜索性能或准确率的前提下,降低索引时间复杂度?
  • RQ3邻近图的哪些结构特性对实现快速且准确的最近邻搜索最为关键?
  • RQ4能否设计一种对理论最优图(MRNG)的实用近似,实现连通性、低出度和紧凑性的良好平衡?

主要发现

  • NSG在DEEP1B数据集的1亿向量子集上,以99%精度实现了相比串行CPU搜索430倍的加速,优于Faiss-GPU和Faiss-16core。
  • NSG-16core在625万个子集上使用16个并行NSG,索引耗时3.53小时,在分布式环境下对20亿向量实现平均响应时间低于5ms。
  • 在相同精度下,NSG在电商数据上的速度比IVFPQ基线快5至10倍,满足4500万向量的实时响应需求。
  • 与单体索引相比,分布式索引策略显著减少了总索引时间,因为构建16个NSG的复杂度低于在完整数据集上构建一个NSG。
  • NSG在高精度区域的表现优于HNSW,且避免了HNSW在大规模数据上遇到的内存溢出错误。
  • NSG已成功部署于淘宝生产搜索引擎,可高效处理百亿规模、高维向量,实现低延迟与高准确率。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。