[论文解读] ParlayANN: Scalable and Deterministic Parallel Graph-Based Approximate Nearest Neighbor Search Algorithms
ParlayANN 提供了一种可扩展、确定性且无锁的并行实现,支持四种最先进图-based 近似最近邻搜索(ANNS)算法,可在十亿规模数据集上实现高吞吐量、高召回率的搜索。通过消除串行瓶颈和锁机制,它在各种工作负载下实现了卓越的并行可扩展性与确定性输出,显著优于现有非图和图-based 方法——尤其在分布外查询(out-of-distribution queries)上表现更优。
Approximate nearest-neighbor search (ANNS) algorithms are a key part of the modern deep learning stack due to enabling efficient similarity search over high-dimensional vector space representations (i.e., embeddings) of data. Among various ANNS algorithms, graph-based algorithms are known to achieve the best throughput-recall tradeoffs. Despite the large scale of modern ANNS datasets, existing parallel graph based implementations suffer from significant challenges to scale to large datasets due to heavy use of locks and other sequential bottlenecks, which 1) prevents them from efficiently scaling to a large number of processors, and 2) results in nondeterminism that is undesirable in certain applications. In this paper, we introduce ParlayANN, a library of deterministic and parallel graph-based approximate nearest neighbor search algorithms, along with a set of useful tools for developing such algorithms. In this library, we develop novel parallel implementations for four state-of-the-art graph-based ANNS algorithms that scale to billion-scale datasets. Our algorithms are deterministic and achieve high scalability across a diverse set of challenging datasets. In addition to the new algorithmic ideas, we also conduct a detailed experimental study of our new algorithms as well as two existing non-graph approaches. Our experimental results both validate the effectiveness of our new techniques, and lead to a comprehensive comparison among ANNS algorithms on large scale datasets with a list of interesting findings.
研究动机与目标
- 解决图-based ANNS 算法缺乏可扩展、确定性并行实现的问题,使其能高效利用大规模多核系统。
- 克服现有实现的可扩展性限制,这些实现依赖于每顶点锁机制,在超过数十个线程后性能显著下降。
- 在 ANNS 中实现确定性行为,以支持需要可重现性的使用场景,如向量数据库、崩溃恢复和数据复制。
- 在十亿规模数据集上对图-based 和非图-based ANNS 算法进行全面评估,以识别并行执行下的性能与召回率权衡。
- 提供一个全新的开源库(ParlayANN),包含可重用工具与并行算法实现,以支持未来大规模向量搜索研究与部署。
提出的方法
- 基于 ParlayLib 并行编程框架,为四种 SOTA 图-based ANNS 方法(HNSW、HCNNG、LSH-Graph 和 GDSR)设计无锁并行算法。
- 采用共享内存、工作窃取执行模型,以最小化竞争并避免使用锁,从而在数百个核心上实现高可扩展性。
- 采用确定性图构建与搜索策略,其中顶点处理顺序由全局优先队列固定,确保多次运行结果完全一致。
- 实现混合索引策略,结合图遍历与高效内存访问模式,减少虚假共享并改善负载均衡。
- 利用 ParlayLib 运行时系统表达图构建与查询处理中的细粒度并行性,同时保证正确性与确定性。
- 集成算法优化技术,如早期终止、缓存友好的数据布局以及并行优先队列操作,以提升大规模数据集上的性能。

实验结果
研究问题
- RQ1无锁、确定性并行实现的图-based ANNS 算法是否能在十亿规模数据集上实现对数百个核心的高效可扩展性?
- RQ2在分布外查询下,图-based ANNS 算法与非图-based 方法(如 IVF、LSH)在召回率与吞吐量方面有何对比?
- RQ3在高核心数的共享内存并行环境下,最先进 ANNS 算法的性能与可扩展性特征如何?
- RQ4确定性图-based ANNS 是否能同时实现高召回率与高吞吐量,尤其在包含 OOD 查询的真实场景中?
- RQ5图构建与搜索中的算法选择如何影响大规模向量搜索中的并行可扩展性与确定性?
主要发现
- ParlayANN 在超过 50 个线程时仍能实现显著加速——与之相比,现有基于锁的实现通常在数十个线程后即达到饱和,表明其在大规模数据集上具有更优的可扩展性。
- 该库在多次运行中均能产生确定性输出,解决了生产系统中对可重现性与一致性的关键问题。
- 较少为人知的 HCNNG 算法在分布外查询上的召回率优于 HNSW 及其他方法,挑战了关于算法主导地位的既有假设。
- ParlayANN 中的图-based 方法在召回率上始终优于 IVF 和基于 LSH 的方法,尤其在 OOD 查询上,后者的性能严重下降。
- 即使考虑主内存限制,ParlayANN 的吞吐量仍超过基于磁盘的系统(如 SPANN 和 DiskANN)在内存工作负载下的表现。
- 基准测试表明,现有公开的 ANNS 实现常在非代表性条件下报告结果(如小规模数据集、串行执行),限制了其在真实场景中的适用性。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。