arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.00521cs.IR
收藏

WebANNS:在 Web 浏览器中快速高效的近似最近邻搜索

WebANNS: Fast and Efficient Approximate Nearest Neighbor Search in Web Browsers

Mugeng Liu, Siqi Zhong, Qi Yang, Yudong Han, Xuanzhe Liu, Yun Ma

AI总结:

针对浏览器中近似最近邻搜索面临的计算、存储与内存限制,本文提出WebANNS引擎,利用WebAssembly、惰性加载和启发式策略,实现查询延迟最高743.8倍提升并将内存占用降低39%,使浏览器内ANNS达到用户可接受的延迟。

摘要:

近似最近邻搜索(ANNS)已成为现代人工智能基础设施的关键组成部分,尤其是在检索增强生成(RAG)应用中。众多浏览器内 ANNS 引擎相继出现,以便与基于大语言模型(LLM)的主流 Web 应用无缝集成,同时应对隐私保护以及异构设备部署带来的挑战。然而,Web 浏览器为 ANNS 带来了独特的困难,包括计算能力受限、外部存储访问问题以及内存使用约束,而当前最先进(SOTA)的解决方案未能全面解决这些问题。我们提出 WebANNS,一种专为 Web 浏览器设计的新型 ANNS 引擎。WebANNS 利用 WebAssembly 克服计算瓶颈,设计了一种惰性加载策略来优化从外部存储的数据读取,并采用启发式方法降低内存占用。实验表明,WebANNS 速度快且内存高效,在第 99 百分位查询延迟上相比 SOTA 引擎实现了高达 743.8 倍的提升,同时将内存使用量最多降低了 39%。值得注意的是,WebANNS 将浏览器中的查询时间从 10 秒缩短到 10 毫秒量级,使得浏览器内 ANNS 在用户可接受的延迟下变得切实可行。

英文摘要:

Approximate nearest neighbor search (ANNS) has become vital to modern AI infrastructure, particularly in retrieval-augmented generation (RAG) applications. Numerous in-browser ANNS engines have emerged to seamlessly integrate with popular LLM-based web applications, while addressing privacy protection and challenges of heterogeneous device deployments. However, web browsers present unique challenges for ANNS, including computational limitations, external storage access issues, and memory utilization constraints, which state-of-the-art (SOTA) solutions fail to address comprehensively. We propose WebANNS, a novel ANNS engine specifically designed for web browsers. WebANNS leverages WebAssembly to overcome computational bottlenecks, designs a lazy loading strategy to optimize data retrieval from external storage, and applies a heuristic approach to reduce memory usage. Experiments show that WebANNS is fast and memory efficient, achieving up to $743.8\times$ improvement in 99th percentile query latency over the SOTA engine, while reducing memory usage by up to 39\%. Note that WebANNS decreases query time from 10 seconds to the 10-millisecond range in browsers, making in-browser ANNS practical with user-acceptable latency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑