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

检索增强生成中令牌级协调的理论

A Theory for Token-Level Harmonization in Retrieval-Augmented Generation

Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学)

Shicheng Xu, Liang Pang, Huawei Shen, Xueqi Cheng

AI总结:

本文提出首个RAG理论,通过分布融合量化益处与损害,并基于此提出令牌级协作方法Tok-RAG,无需训练即可预测RAG效果,实验验证其有效性。

摘要:

检索增强生成(RAG)利用检索到的文本来增强大型语言模型(LLMs)。研究表明,虽然RAG提供了有价值的外部信息(益处),但带有噪声或不正确的检索文本也可能误导LLMs(损害)。尽管许多现有方法试图保留益处并避免损害,但它们缺乏对RAG的理论解释。RAG在下一令牌预测中的益处和损害仍然是一个黑盒,无法以可解释的方式进行量化或比较,因此现有方法是数据驱动的,需要额外的效用评估器或事后处理。本文迈出了提供理论以解释和权衡RAG中益处与损害的第一步。首先,我们将RAG建模为LLM知识分布与检索文本分布之间的融合。然后,我们通过这种融合中的分布差异,形式化了RAG在下一令牌预测中外部知识价值(益处)与其误导LLMs的潜在风险(损害)之间的权衡。最后,我们证明了RAG对令牌的实际效果,即益处与损害的比较,可以在无需任何训练或访问检索效用的条件下进行预测。基于我们的理论,我们提出了一种实用的新方法Tok-RAG,该方法在令牌级别实现纯LLM与RAG之间的协作生成,以保留益处并避免损害。使用OPT、LLaMA-2和Mistral等LLMs在真实世界任务中的实验证明了我们方法的有效性,并支持我们的理论发现。

英文摘要:

Retrieval-augmented generation (RAG) utilizes retrieved texts to enhance large language models (LLMs). Studies show that while RAG provides valuable external information (benefit), it may also mislead LLMs (detriment) with noisy or incorrect retrieved texts. Although many existing methods attempt to preserve benefit and avoid detriment, they lack a theoretical explanation for RAG. The benefit and detriment in the next token prediction of RAG remain a black box that cannot be quantified or compared in an explainable manner, so existing methods are data-driven, need additional utility evaluators or post-hoc. This paper takes the first step towards providing a theory to explain and trade off the benefit and detriment in RAG. First, we model RAG as the fusion between distribution of LLMs knowledge and distribution of retrieved texts. Then, we formalize the trade-off between the value of external knowledge (benefit) and its potential risk of misleading LLMs (detriment) in next token prediction of RAG by distribution difference in this fusion. Finally, we prove that the actual effect of RAG on the token, which is the comparison between benefit and detriment, can be predicted without any training or accessing the utility of retrieval. Based on our theory, we propose a practical novel method, Tok-RAG, which achieves collaborative generation between the pure LLM and RAG at token level to preserve benefit and avoid detriment. Experiments in real-world tasks using LLMs such as OPT, LLaMA-2, and Mistral show the effectiveness of our method and support our theoretical findings.

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

↑