MonaVec: 一种面向边缘和离线AI系统的免训练嵌入式向量搜索内核
MonaVec: A Training-Free Embedded Vector Search Kernel for Edge and Offline AI Systems
AI总结:
提出MonaVec,一种无需训练、数据无关的嵌入式向量搜索内核,通过随机哈达玛变换和预计算Lloyd-Max量化实现4位压缩,在边缘和离线场景下提供确定性结果,支持单文件部署。
摘要:
我们提出MonaVec,一种确定性的嵌入式向量搜索内核,适用于边缘和离线AI场景——即服务器基础设施、网络连接和训练数据均不可用的环境。现有的向量搜索系统假设存在持久化服务器、千兆字节RAM或对语料库进行训练;而MonaVec则针对SQLite的部署模式:一个文件、一次函数调用、随处运行。其量化核心默认免训练且数据无关:随机哈达玛变换(RHDH)将任意输入分布调整至N(0,1),因此预计算的Lloyd-Max表可将数据量化至4位(缩小8倍),无需学习码本或数据遍历。索引持久化为单个.mvec文件,其中嵌入的ChaCha20旋转种子使得结果在不同架构间可重现,并在同一构建内字节一致——这是并行构建图库无法提供的确定性保证。在语义嵌入(AG News,45K x 1024维BGE-M3,余弦相似度)上,MonaVec 4位BruteForce在27 MB内达到0.960 Recall@10,在召回率上领先float32 FAISS-IVF和8位usearch,同时以峰值吞吐量换取字节一致的确定性。单次全局标准化(fit())将相同的数据无关流程扩展到对幅度敏感的L2数据,可选的IvfFlat和HNSW后端将其扩展到百万向量语料库。MonaVec使用纯Rust实现,并带有Python绑定和运行时SIMD调度(AVX-512/AVX2/NEON/scalar)。它面向设备端RAG、离线代理和嵌入式检索——即SQLite在关系数据领域占据的细分市场:一个文件、一次调用、随处运行。
英文摘要:
We present MonaVec, a deterministic, embedded vector-search kernel for edge and offline AI -- settings where server infrastructure, network connectivity, and training data are all unavailable. Existing vector-search systems assume a persistent server, gigabytes of RAM, or a training pass over the corpus; MonaVec instead targets the deployment profile of SQLite: one file, one function call, runs anywhere. Its quantization core is training-free by default and data-oblivious: a Randomized Hadamard Transform (RHDH) conditions any input distribution toward N(0,1), so precomputed Lloyd-Max tables quantize to 4 bits (8x smaller) with no learned codebook and no data pass. The index persists as a single .mvec file whose embedded ChaCha20 rotation seed makes results reproducible across architectures and byte-identical within a build -- a determinism guarantee that parallel-build graph libraries cannot offer. On semantic embeddings (AG News, 45K x 1024-dim BGE-M3, cosine), MonaVec 4-bit BruteForce reaches 0.960 Recall@10 in 27 MB -- leading float32 FAISS-IVF and 8-bit usearch on recall -- while trading peak throughput for byte-identical determinism. A single-pass global standardization (fit()) extends the same data-oblivious pipeline to magnitude-sensitive L2 data, and optional IvfFlat and HNSW backends carry it to million-vector corpora. MonaVec is implemented in pure Rust with Python bindings and runtime SIMD dispatch (AVX-512/AVX2/NEON/scalar). It targets on-device RAG, offline agents, and embedded retrieval -- the niche SQLite occupies for relational data: one file, one call, runs anywhere.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。