arXiv:2505.23794cs.CLcs.AI2025-05EMNLP被引 15

让大模型通过强化学习学会分步推理与检索,提升问答准确率。

R3-RAG: Learning Step-by-Step Reasoning and Retrieval for LLMs via Reinforcement Learning

  • 用强化学习训练模型分步推理并检索外部知识
  • 在多个数据集上超越基线,正确率显著提升
  • 适合需要高精度推理的问答系统研究者

检索增强生成(RAG)通过整合外部知识提升大语言模型的事实准确性并缓解幻觉问题。然而,密集检索器因参数量远小于大模型且无法进行分步推理,常成为系统瓶颈。虽然基于提示的迭代式RAG试图解决此问题,但受限于人工设计的工作流。为此,我们提出R3-RAG,利用强化学习使大模型自主学习分步推理与检索,从而全面获取外部知识并得出正确答案。R3-RAG分为两个阶段:首先通过冷启动让模型学习交替进行推理与检索;随后通过强化学习进一步优化其探索外部检索环境的能力。我们设计两种奖励机制:1)答案正确性奖励,判断轨迹是否导向正确答案;2)基于相关性的文档验证奖励,鼓励模型检索与用户问题相关的文档,使其学会通过逐步推理与检索获得正确答案。实验表明,R3-RAG显著优于基线,并可良好迁移至不同检索器。代码已开源。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) integrates external knowledge with Large Language Models (LLMs) to enhance factual correctness and mitigate hallucination. However, dense retrievers often become the bottleneck of RAG systems due to their limited parameters compared to LLMs and their inability to perform step-by-step reasoning. While prompt-based iterative RAG attempts to address these limitations, it is constrained by human-designed workflows. To address these limitations, we propose $\textbf{R3-RAG}$, which uses $\textbf{R}$einforcement learning to make the LLM learn how to $\textbf{R}$eason and $\textbf{R}$etrieve step by step, thus retrieving comprehensive external knowledge and leading to correct answers. R3-RAG is divided into two stages. We first use cold start to make the model learn the manner of iteratively interleaving reasoning and retrieval. Then we use reinforcement learning to further harness its ability to better explore the external retrieval environment. Specifically, we propose two rewards for R3-RAG: 1) answer correctness for outcome reward, which judges whether the trajectory leads to a correct answer; 2) relevance-based document verification for process reward, encouraging the model to retrieve documents that are relevant to the user question, through which we can let the model learn how to iteratively reason and retrieve relevant documents to get the correct answer. Experimental results show that R3-RAG significantly outperforms baselines and can transfer well to different retrievers. We release R3-RAG at https://github.com/Yuan-Li-FNLP/R3-RAG.

强化学习检索增强大模型推理

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