通过识别相似问题,提前获取答案,显著加快大模型检索速度。
HaS: Accelerating RAG through Homology-Aware Speculative Retrieval

- 基于查询间的语义相似性,预判可复用的检索结果。
- 在多个数据集上降低23.74%~36.99%的检索延迟,准确率仅降1%-2%。
- 适合需要快速响应的智能代理和多跳问答系统使用。
检索增强生成(RAG)通过引入外部文档扩展大语言模型的推理知识边界,但随着知识库增大,检索耗时显著增加。现有加速方法或因近似检索牺牲精度,或仅能复用完全相同的查询结果,提升有限。本文提出HaS——一种基于同源关系的推测性检索框架:在受限范围内进行低延迟推测检索,获取候选文档后,通过判断其与当前查询是否存在同源关系来验证有效性。该验证被建模为同源查询再识别任务:一旦发现当前查询是之前见过的同源查询,即判定草案可接受,从而跳过耗时的全库检索。得益于真实场景中同源查询的普遍性,HaS实现显著效率提升。大量实验表明,其在多个数据集上分别降低23.74%与36.99%的检索延迟,准确率仅下降1%-2%。作为即插即用方案,它还能显著加速现代智能体式RAG中的复杂多跳查询。代码已开源:https://github.com/ErrEqualsNil/HaS。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) expands the knowledge boundary of large language models (LLMs) at inference by retrieving external documents as context. However, retrieval becomes increasingly time-consuming as the knowledge databases grow in size. Existing acceleration strategies either compromise accuracy through approximate retrieval, or achieve marginal gains by reusing results of strictly identical queries. We propose HaS, a homology-aware speculative retrieval framework that performs low-latency speculative retrieval over restricted scopes to obtain candidate documents, followed by validating whether they contain the required knowledge. The validation, grounded in the homology relation between queries, is formulated as a homologous query re-identification task: once a previously observed query is identified as a homologous re-encounter of the incoming query, the draft is deemed acceptable, allowing the system to bypass slow full-database retrieval. Benefiting from the prevalence of homologous queries under real-world popularity patterns, HaS achieves substantial efficiency gains. Extensive experiments demonstrate that HaS reduces retrieval latency by 23.74% and 36.99% across datasets with only a 1-2% marginal accuracy drop. As a plug-and-play solution, HaS also significantly accelerates complex multi-hop queries in modern agentic RAG pipelines. Source code is available at: https://github.com/ErrEqualsNil/HaS.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。