UC伯克利的天空计算实验室建造了LEANN,这是一个开源矢量指数,几乎不存储嵌入物。 LEANN 矢量索引在查询时重算嵌入,而不是保存到磁盘中。 Repo 基准测试显示一个6000万块的维基百科指数从201GB下降到6GB. 研究论文在MLSys 2026获得最佳研究论文奖。 因此,它带来语义搜索和RAG在个人数据之上,在笔记本电脑上。
TL;数据
- 尺寸:6 GB为60M块(repo);4 GB在报纸的76 GB维基百科设置中。 默认嵌入器:Contriever (110M params). 它是一种指数,而不是LLM,所以没有适用上下文长度。
电脑和工作站论文试制了一台装有32GB RAM的RTX 4090盒和一个M1 Ultra Mac. 只有CPU的 Linux 安装存在,没有发布 CPU 时空。
- 性能:与HNSW下游准确度相符,为90%,使用不到5%的原始数据存储。
- 最佳:25.5%NQ精度,与HNSW相同,使用4GB而不是188GB.
- 最糟的:热点QA检索需要44.80s的Mac,占管道总时间的50.1%。
什么是LEANN吗?
LEANN是一个低存储近似近邻(ANN)指数,建立在FAISS之上。 它针对一个问题:矢量指数往往大于其指数数据。 研究论文显示 a 76 GB本体需要173 GB的嵌入加上15 GB HNSW图。 超过翻倍的原始数据。
LEANN保持一个普鲁兹图,放下全向量,并按要求重建。 代码是麻省理工学院许可的,并安装有uv pip安装lein.
LEANN如何在不拖延搜索的情况下重新计算嵌入?
HNSW 这样的图形索引访问每个查询只访问一小组节点。 LEANN利用这一点。 它存储图表加上一个紧凑的产品量化表。 在查询时间,它只重置搜索路径上的节点。
3种技术保持这种实用性:
- 两级搜索:便宜的PQ距离将邻居排在首位。 只有顶级候选人才能得到准确的重评。
- 动态批量:将几个跳板的考生分组,例如一次64个,以便提高GPU的效率。
- 高度保护线:大多数节点保持边缘,而前2%的“枢纽”节点保持较多。
在缩写中,双层搜索给出平均1.4x加速。 将批量融资加入1.8x. 嵌入式重算仍占查询时空的约76%.
LEANN在基准测试上表现如何?.
研究团队对一个60M-passage RPJ-Wiki的数据存储器进行了NQ,TriviaQA,GPQA和HotpotQA的测试。 延迟度的测量值为90%召回@3. 以下所有数字均在研究论文中自报。
在NQ上,用一台RTX 4090上的Qwen3-4B,LEANN和HNSW都达到了下游精度的25.5%. LEANN使用4GB的存储。 HNSW使用188 GB. BM25得分18.3%,PQ压缩得分17.9%.
代价是搜索时间。 LEANN的检索在NQ上需要2.48 s,而HNSW则需要0.05 s. 世代大约需要20 s,所以端到端的耐性从20.95 s上升到23.34 s.
在RTX 4090上的数据集中,LEANN检索范围为1.12 s(GPQA)至7.12 s(HotpotQA). 由EdgeRAG启发的基于IVF的重算基线,可达200x慢。 LEANN比BM25改进了11.8%的精确匹配度。
GitHub Repo在个人数据上报告了类似的节省。 400K聊天信息从1.8GB缩小到64MB. 38K浏览器条目从130MB缩小到6.4MB.
LEANN 对其它矢量索引
储存、延迟和准确数字来自LEANN文件v2、表1和表2以及第7.2节(自报)。 许可证和设计行链接到每个项目自己的来源。
开发者在哪里可以使用 LEANN?
Repo飞船准备应用文件,Apple Mail,Chrome历史,WeChat,iMessage,以及ChatGPT或Claude出口。 MCP读者从Slack和Twitter书签中提取直播数据。 LEANN还作为语义搜索MCP服务器运行,用于Claude Code.
在30 SWE-Bench Pro任务上,团队报告来自Context Bench的24.2%的初始相关代码召回,而BM25的则有11.4%. agent也使用8.4%的代币。
HNSW是默认的后端,DiskANN用于更快的搜索。 世代与Ollama,Hugging Face,Anthropic或任何OpenAI兼容的API合作。 它支持Ubuntu,Arch,WSL,macOS和Windows. 一些应用,如Apple邮件搜索,只是macOS而已。
关键外卖
- LEANN存储一个已刷卡的图表,并在查询时重算嵌入。
- 60M块:201GB在repo 基准测试中降到6GB.
- 与HNSW精确度(在NQ上为25.5%)相符,恢复90%。
- 搜索成本秒:2.48s对0.05s 在NQ上的HNSW。
- 麻省理工学院许可和一份2026年最佳研究论文
检查一下纸张,GitHub Repo和PyPI包。 并加入我们的通讯。 等等你在电报里吗现在你也可以加入我们的电报。
需要和我们合作推广您的 GitHub Repo OR Hugging Face Page OR Product Release OR Webinar 等吗?联系我们
Asif Razzaq是Marktechpost AI Media Inc.的首席执行官。 作为一个有远见的企业家和工程师,阿西夫致力于利用人工智能的潜力促进社会福祉。 他最近的努力是人工智能媒体平台的发布,该平台以深入报道机器学习和深层学习新闻而著称,这些新闻在技术上既可靠又为广大观众所容易理解。 该平台每月有超过200万次观看,表明其受观众欢迎。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
UC Berkeley’s Sky Computing Lab built LEANN, an open-source vector index that stores almost no embeddings. The LEANN vector index recomputes embeddings at query time instead of saving them to disk. The repo benchmark shows a 60 million chunk Wikipedia index dropping from 201 GB to 6 GB. The research paper won the Best Research Paper award at MLSys 2026. So, it brings semantic search and RAG over personal data, on a laptop.
TL;DR
- Size: 6 GB for 60M chunks (repo); 4 GB in the paper’s 76 GB Wikipedia setup. Default embedder: Contriever (110M params). It is an index, not an LLM, so no context length applies.
- Runs on: laptops and workstations. The paper tested an RTX 4090 box with 32 GB RAM and an M1 Ultra Mac. A CPU-only Linux install exists, with no published CPU latency.
- Performance: matches HNSW downstream accuracy at 90% recall, using under 5% of raw-data storage.
- Best: 25.5% NQ accuracy, identical to HNSW, using 4 GB instead of 188 GB.
- Worst: HotpotQA retrieval takes 44.80 s on the Mac, 50.1% of total pipeline time.
What is LEANN?
LEANN is a low-storage approximate nearest neighbor (ANN) index built on top of FAISS. It targets one problem: vector indexes are often bigger than the data they index. The research paper shows a 76 GB corpus needs 173 GB of embeddings plus a 15 GB HNSW graph. That more than doubles the raw data.
LEANN keeps a pruned graph, drops the full vectors, and rebuilds them on demand. The code is MIT licensed and installs with uv pip install leann.
How does LEANN recompute embeddings without stalling search?
Graph indexes like HNSW visit only a small set of nodes per query. LEANN exploits that. It stores the graph plus a compact product quantization (PQ) table. At query time, it re-embeds only nodes on the search path.
3 techniques keep this practical:
- Two-level search: cheap PQ distances rank neighbors first. Only top candidates get exact recomputation.
- Dynamic batching: candidates from several hops are grouped, for example 64 at once, for GPU efficiency.
- High-degree preserving pruning: most nodes keep few edges, while the top 2% “hub” nodes keep more.
In ablations, two-level search gives an average 1.4x speedup. Adding batching raises it to 1.8x. Embedding recomputation still accounts for about 76% of query latency.
How does LEANN perform on benchmarks?
The research team tested NQ, TriviaQA, GPQA and HotpotQA against a 60M-passage RPJ-Wiki datastore. Latency is measured at 90% Recall@3. All figures below are self-reported in the research paper.
On NQ, with Qwen3-4B on an RTX 4090, LEANN and HNSW both reach 25.5% downstream accuracy. LEANN uses 4 GB of storage. HNSW uses 188 GB. BM25 scores 18.3%, and PQ compression scores 17.9%.
The cost is search time. LEANN retrieval takes 2.48 s on NQ, versus 0.05 s for HNSW. Generation takes about 20 s, so end-to-end latency rises from 20.95 s to 23.34 s.
Across datasets on the RTX 4090, LEANN retrieval ranges from 1.12 s (GPQA) to 7.12 s (HotpotQA). The IVF-based recomputation baseline, inspired by EdgeRAG, is up to 200x slower. LEANN improves exact match by up to 11.8% over BM25.
The GitHub repo reports similar savings on personal data. 400K chat messages shrink from 1.8 GB to 64 MB. 38K browser entries shrink from 130 MB to 6.4 MB.
LEANN vs other vector indexes
Storage, latency and accuracy figures come from the LEANN paper v2, Tables 1 and 2 and Section 7.2 (self-reported). License and design rows link to each project’s own source.
Where can developers use LEANN?
The repo ships ready apps for documents, Apple Mail, Chrome history, WeChat, iMessage, and ChatGPT or Claude exports. MCP readers pull live data from Slack and Twitter bookmarks. LEANN also runs as a semantic search MCP server for Claude Code.
On 30 SWE-Bench Pro tasks from ContextBench, the team reports 24.2% initial relevant-code recall versus 11.4% for BM25. The agent also used 8.4% fewer tokens.
HNSW is the default backend, with DiskANN for faster search. Generation works with Ollama, Hugging Face, Anthropic, or any OpenAI-compatible API. It supports Ubuntu, Arch, WSL, macOS and Windows. Some apps, like Apple Mail search, are macOS only.
Key Takeaways
- LEANN stores a pruned graph and recomputes embeddings at query time.
- 60M chunks: 201 GB down to 6 GB in the repo benchmark.
- Matches HNSW accuracy (25.5% on NQ) at 90% recall.
- Search costs seconds: 2.48 s vs 0.05 s for HNSW on NQ.
- MIT licensed and an MLSys 2026 Best Research Paper.
Check out the Paper, GitHub Repo and PyPI package. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.? Connect with us
Asif Razzaq is the CEO of Marktechpost AI Media Inc.. As a visionary entrepreneur and engineer, Asif is committed to harnessing the potential of Artificial Intelligence for social good. His most recent endeavor is the launch of an Artificial Intelligence Media Platform, Marktechpost, which stands out for its in-depth coverage of machine learning and deep learning news that is both technically sound and easily understandable by a wide audience. The platform boasts of over 2 million monthly views, illustrating its popularity among audiences.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.