用可微分数据奖励优化RAG系统,让各模块更协同地利用外部知识。
RAG-DDR: Optimizing Retrieval-Augmented Generation Using Differentiable Data Rewards
- 设计可微分数据奖励机制,端到端训练RAG各模块以对齐数据偏好。
- 在多任务测试中显著优于传统指令微调,小模型提升更明显。
- 增强生成模块提取关键信息能力,缓解模型记忆与外部知识冲突。
检索增强生成(RAG)通过从外部资源检索知识,有效缓解大语言模型(LLM)的幻觉问题。现有方法采用指令微调(SFT)优化LLM以适应RAG系统,使其能处理多样任务,但易过拟合训练信号,并忽略不同RAG模块间的数据偏好差异。本文提出可微分数据奖励(DDR)方法,通过滚动回放策略收集奖励,使各模块在端到端训练中对齐数据偏好:代理采样潜在响应作为扰动,评估其对整个RAG系统的影响,并优化自身输出以提升系统整体表现。实验表明,DDR在多个知识密集型任务中显著优于SFT,尤其在参数量较小的模型上优势更明显。此外,DDR显著增强了模块间的数据偏好对齐能力,使生成模块更有效地从文档中提取关键信息,并缓解参数化记忆与外部知识间的冲突。代码已开源:https://github.com/OpenMatch/RAG-DDR。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) has proven its effectiveness in mitigating hallucinations in Large Language Models (LLMs) by retrieving knowledge from external resources. To adapt LLMs for the RAG systems, current approaches use instruction tuning to optimize LLMs, improving their ability to utilize retrieved knowledge. This supervised fine-tuning (SFT) approach focuses on equipping LLMs to handle diverse RAG tasks using different instructions. However, it trains RAG modules to overfit training signals and overlooks the varying data preferences among agents within the RAG system. In this paper, we propose a Differentiable Data Rewards (DDR) method, which end-to-end trains RAG systems by aligning data preferences between different RAG modules. DDR works by collecting the rewards to optimize each agent in the RAG system with the rollout method, which prompts agents to sample some potential responses as perturbations, evaluates the impact of these perturbations on the whole RAG system, and subsequently optimizes the agent to produce outputs that improve the performance of the RAG system. Our experiments on various knowledge-intensive tasks demonstrate that DDR significantly outperforms the SFT method, particularly for LLMs with smaller-scale parameters that depend more on the retrieved knowledge. Additionally, DDR exhibits a stronger capability to align the data preference between RAG modules. The DDR method makes the generation module more effective in extracting key information from documents and mitigating conflicts between parametric memory and external knowledge. All codes are available at https://github.com/OpenMatch/RAG-DDR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。