arXiv:2503.01713cs.LGcs.AI2025-03被引 18

SAGE通过语义分块与动态选块,提升RAG问答精准度与效率。

SAGE: A Framework of Precise Retrieval for RAG

  • 用语义模型分块,让文本段落更契合问题意图。
  • 动态选块算法根据相关性下降速度,精准选出最相关段落。
  • 让大模型自检上下文是否充足,避免冗余或缺失,适合追求高精度的场景。

检索增强生成(RAG)在特定语料库的问答任务中表现优异,但仍存在大量失败案例。这些失败不仅源于大语言模型(LLM)的局限,更主要来自检索到不准确信息:一是现有RAG方法分割语料时忽略语义,导致问题与片段关联性差;二是检索数量与相关性之间存在权衡——少则遗漏关键信息,多则引入无关内容。本文提出SAGE框架以解决上述问题:首先训练语义分块模型,将语料划分为语义完整的段落;其次设计基于相关性下降速度的动态选块算法,仅保留最相关的段落;最后让LLM评估检索内容是否过多或不足,并自动调整上下文量。实验表明,SAGE在问答质量上平均优于基线61.25%;通过减少噪声内容,平均降低49.41%的推理令牌消耗,显著提升成本效率。本工作为提升RAG性能提供了有效路径。

原文摘要 · Abstract (English)

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.

RAG语义分块上下文优化高效推理

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