arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.01713cs.LGcs.AIcs.DBcs.IR
收藏

SAGE:一种面向 RAG 的精确检索框架

SAGE: A Framework of Precise Retrieval for RAG

Department of Computer Science Tsinghua University(计算机科学系清华大学)

Jintao Zhang, Guoliang Li, Jinyang Su

AI总结:

针对 RAG 因无语义切分和上下文数量权衡导致的检索失准问题,本文提出 SAGE 框架,结合语义切分、动态块选择与 LLM 反馈调整,显著提升问答质量和成本效率。

摘要:

检索增强生成(Retrieval-augmented generation,RAG)已经在特定语料库内执行问答(QA)任务方面展现出显著能力。尽管如此,RAG 在问答中仍存在大量失败案例。这些失败并不能仅仅归因于大型语言模型(LLM)的局限;相反,它们主要源于为 LLM 检索到了不准确的信息,而这又由两项限制造成:(1)当前 RAG 方法在切分语料库时没有考虑语义,导致问题与片段之间的相关性受损,因而难以找到相关上下文。(2)在检索较少上下文时遗漏必要上下文,与检索较多上下文时获得不相关上下文之间存在权衡。在本文中,我们提出一个 RAG 框架(SAGE),以克服这些限制。首先,为解决未考虑语义的切分问题,我们建议训练一个语义切分模型。该模型经过训练,可将语料库切分为语义完整的块。其次,为确保只检索最相关的块,同时忽略不相关的块,我们设计了一种块选择算法,根据相关性分数的下降速度动态选择块,从而得到更相关的选择。第三,为进一步确保所检索块的精确性,我们建议让 LLM 评估检索到的块是过多还是不足,然后据此调整上下文数量。实验表明,SAGE 在问答质量上平均优于基线 61.25%。此外,通过避免检索噪声上下文,SAGE 降低了 LLM 推理中消耗的 token 成本,并实现平均 49.41% 的成本效率提升。此外,我们的工作为改进 RAG 提供了有价值的见解。

英文摘要:

Retrieval-augmented generation (RAG) has demonstrated significant proficiency in conducting question-answering (QA) tasks within a specified corpus. Nonetheless, numerous failure instances of RAG in QA still exist. These failures are not solely attributable to the limitations of Large Language Models (LLMs); instead, they predominantly arise from the retrieval of inaccurate information for LLMs due to two limitations: (1) Current RAG methods segment the corpus without considering semantics, making it difficult to find relevant context due to impaired correlation between questions and the segments. (2) There is a trade-off between missing essential context with fewer context retrieved and getting irrelevant context with more context retrieved. In this paper, we introduce a RAG framework (SAGE), to overcome these limitations. First, to address the segmentation issue without considering semantics, we propose to train a semantic segmentation model. This model is trained to segment the corpus into semantically complete chunks. Second, to ensure that only the most relevant chunks are retrieved while the irrelevant ones are ignored, we design a chunk selection algorithm to dynamically select chunks based on the decreasing speed of the relevance score, leading to a more relevant selection. Third, to further ensure the precision of the retrieved chunks, we propose letting LLMs assess whether retrieved chunks are excessive or lacking and then adjust the amount of context accordingly. Experiments show that SAGE outperforms baselines by 61.25% in the quality of QA on average. Moreover, by avoiding retrieving noisy context, SAGE lowers the cost of the tokens consumed in LLM inference and achieves a 49.41% enhancement in cost efficiency on average. Additionally, our work offers valuable insights for boosting RAG.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑