实测对比HNSW与扁平索引在稠密检索中的性能,给出选型建议。
Operational Advice for Dense and Sparse Retrievers: HNSW, Flat, or Inverted Indexes?
- 用Lucene在BEIR数据集上实测不同索引的优劣
- HNSW索引查询快但建索引慢,扁平索引相反
- 适合需要快速原型或小规模数据的开发者参考
当前稠密检索实践者面临众多选择。除了嵌入模型外,最近邻向量搜索的实现方式也至关重要。尽管最佳实践推荐使用HNSW索引,但对较小语料库和快速原型设计而言,采用暴力搜索的扁平向量索引同样是可行方案。本文基于开源Lucene搜索库,在BEIR数据集上提供了关于HNSW与扁平索引(包括量化变体)的实验结果,从索引时间、查询评估性能和检索质量三个维度阐明其权衡关系。此外还对比了稠密与稀疏检索器的表现,为当今搜索从业者理解稠密与稀疏检索器的设计空间提供指导。据我们所知,这是首个在此方面基于实证实验提供操作建议的研究。
原文摘要 · Abstract (English)
Practitioners working on dense retrieval today face a bewildering number of choices. Beyond selecting the embedding model, another consequential choice is the actual implementation of nearest-neighbor vector search. While best practices recommend HNSW indexes, flat vector indexes with brute-force search represent another viable option, particularly for smaller corpora and for rapid prototyping. In this paper, we provide experimental results on the BEIR dataset using the open-source Lucene search library that explicate the tradeoffs between HNSW and flat indexes (including quantized variants) from the perspectives of indexing time, query evaluation performance, and retrieval quality. With additional comparisons between dense and sparse retrievers, our results provide guidance for today's search practitioner in understanding the design space of dense and sparse retrievers. To our knowledge, we are the first to provide operational advice supported by empirical experiments in this regard.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。