arXiv:2604.15484cs.IR2026-04

用混合检索提升大模型记忆效率,本地存储且效果媲美大模型。

vstash: Local-First Hybrid Retrieval with Adaptive Fusion for LLM Agents

  • 结合向量与关键词检索,通过自适应加权融合提升召回精度。
  • 在5个数据集上最高提升21.4%的NDCG@10,33M小模型逼近110M大模型性能。
  • 开源本地化系统,支持实时诊断与版本管理,适合部署型应用。

我们提出vstash,一种以本地存储为核心的文档记忆系统,通过倒数排名融合(RRF)结合向量相似性搜索与全文关键词匹配,并引入每查询自适应IDF加权。所有数据存于单一SQLite文件中,使用sqlite-vec实现近似最近邻搜索,FTS5实现关键词匹配。主要贡献:(1) 利用混合检索差异进行自监督嵌入优化,在SciFact、NFCorpus和FiQA共753个BEIR查询中,74.5%产生前10位结果分歧(各数据集分歧率63.4%/73.4%/86.7%),基于76K分歧三元组微调BGE-small(33M参数)后,5个BEIR数据集平均提升最多达19.5%(表6);在3个数据集上,该33M模型表现达到或超过110M的ColBERTv2及未训练的BGE-base;在FiQA和ArguAna上略逊于ColBERTv2。(2) 自适应RRF加权使所有5个数据集的NDCG@10提升,最高达21.4%(ArguAna),在SciFact上达0.7263。(3)后融合评分尝试(频率+衰减、历史增强召回、交叉编码重排序)均未提升效果。(4) 构建生产级基础架构,含完整性校验、模式版本控制、排序诊断及基于距离的相关性信号,经50,425条相关性标注查询验证。50K片段下中位搜索延迟为20.9毫秒,性能稳定。微调模型已发布至HuggingFace:`Stffens/bge-small-rrf-v2`。代码、数据与实验全部开源。

原文摘要 · Abstract (English)

We present **vstash**, a local-first document memory system that combines vector similarity search with full-text keyword matching via Reciprocal Rank Fusion (RRF) and adaptive per-query IDF weighting. All data resides in a single SQLite file using sqlite-vec for approximate nearest neighbor search and FTS5 for keyword matching. We make four primary contributions. **(1)** Self-supervised embedding refinement via hybrid retrieval disagreement: across 753 BEIR queries on SciFact, NFCorpus, and FiQA, 74.5% produce top-10 disagreement between vector-heavy (vec=0.95, fts=0.05) and FTS-heavy (vec=0.05, fts=0.95) search (per-dataset rates 63.4% / 73.4% / 86.7%, Section 5.2), providing a free training signal without human labels. Fine-tuning BGE-small (33M params) with MultipleNegativesRankingLoss on 76K disagreement triples improves NDCG@10 on all 5 BEIR datasets (up to +19.5% on NFCorpus vs. BGE-small base RRF, Table 6). On 3 of 5 datasets, under different preprocessing, the tuned 33M-parameter pipeline matches or exceeds published ColBERTv2 results (110M params) and an untrained BGE-base (110M); on FiQA and ArguAna it underperforms ColBERTv2 (Section 5.5). **(2)** Adaptive RRF with per-query IDF weighting improves NDCG@10 on all 5 BEIR datasets versus fixed weights (up to +21.4% on ArguAna), achieving 0.7263 on SciFact with BGE-small. **(3)** A negative result on post-RRF scoring: frequency+decay, history-augmented recall, and cross-encoder reranking all failed to improve NDCG. **(4)** A production-grade substrate with integrity checking, schema versioning, ranking diagnostics, and a distance-based relevance signal validated on 50,425 relevance-judged queries across the 5 BEIR datasets. Search latency remains 20.9 ms median at 50K chunks with stable NDCG. The fine-tuned model is published as `Stffens/bge-small-rrf-v2` on HuggingFace. All code, data, and experiments are open-source.

检索增强本地存储混合检索小模型优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。