Zarc:在十亿级向量上实现秒级精确最近邻搜索
Zarc: Exact Nearest Neighbors over a Billion Vectors in Seconds
Zarc 通过仅在 GPU 内存中保留半精度证明的短行、从主机内存取回少量完整向量,在四块 H100 GPU 上 1.1 秒完成十亿向量的 1 万次精确查询,而穷举搜索需五分钟。该系统支持欧氏距离、余弦、内积及带过滤查询,并在更新下保持精确。在 11 个开源 LLM 上,其精确 top-10 注意力键检索比穷举搜索快 2.2 至 13.1 倍。
arXiv:2611.29252v1 Announce Type: cross Abstract: Exact k-nearest-neighbor vector search lies on the critical path of machine learning systems, from sparse attention in the latest large language models (LLMs) to long-context memories and training-data deduplication. Exhaustive GPU search scans the whole dataset for every query, while approximate indexes return inexact neighbors. Recent methods skip almost every vector with a cheap half-precision proof that it lies too far away, but only on one GPU that holds the whole dataset. Our insight is to keep only the short rows of these proofs in GPU memory and to fetch the few remaining full vectors from host memory. Our system, Zarc, answers Euclidean, cosine, inner-product, and filtered queries exactly under updates. On four H100 GPUs, it answers 10,000 exact queries over one billion vectors in 1.1 seconds instead of five minutes. On eleven open LLMs, it retrieves the exact top-10 attention keys 2.2x to 13.1x faster than exhaustive search. In sparse attention over one million tokens, it runs 3.1x faster than bf16 selection with FlashInfer, which misses the exact top-64 for most queries.
来源:arXiv (AI + Vision + Imaging) · arxiv.org