UR$^2$: Unify RAG and Reasoning through Reinforcement Learning

Weitao Li, Boran Xiang, Xiaolong Wang, Zhinan Gou, Weizhi Ma +1 more
8/8/2025
cs.CLcs.AI

Official code: Tsinghua-dhy/UR2 (131 stars, Apache-2.0, last commit 2026-04-26).

Abstract

Large Language Models (LLMs) have shown remarkable capabilities through two complementary paradigms: Retrieval-Augmented Generation (RAG), which enhances knowledge grounding, and Reinforcement Learning from Verifiable Rewards (RLVR), which optimizes complex reasoning abilities. However, these two capabilities are often developed in isolation, and existing efforts to unify them remain narrow in scope -- typically limited to open-domain QA with fixed retrieval settings and task-specific constraints. This lack of integration constrains generalization and limits the applicability of RAG-RL methods to broader domains. To bridge this gap, we propose UR2 (Unified RAG and Reasoning), a general framework that unifies retrieval and reasoning through reinforcement learning. UR2 introduces two key contributions: a difficulty-aware curriculum training that selectively invokes retrieval only for challenging problems, and a hybrid knowledge access strategy combining domain-specific offline corpora with LLM-generated summaries. These components are designed to enable dynamic coordination between retrieval and reasoning, improving adaptability across a diverse range of tasks. Experiments across open-domain QA, MMLU-Pro, medical, and mathematical reasoning tasks demonstrate that UR$^2$ (built on Qwen-2.5-3/7B and LLaMA-3.1-8B) significantly outperforms existing RAG and RL methods, achieving comparable performance to GPT-4o-mini and GPT-4.1-mini on several benchmarks. We have released all code, models, and data at https://github.com/Tsinghua-dhy/UR2.

View on arXivView PDF

Code Implementations(1)

Tsinghua-dhy/UR2Official100%
Apache-2.0

UR2: Unify RAG and Reasoning through Reinforcement Learning

13111Shell, PythonJun 12, 20255 months agoApache-2.0

Similar Papers

Cite this paper

@article{li2025ur,
  title  = {UR$^2$: Unify RAG and Reasoning through Reinforcement Learning},
  author = {Weitao Li and Boran Xiang and Xiaolong Wang and Zhinan Gou and Weizhi Ma and Yang Liu},
  year   = {2025},
  eprint = {2508.06165},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.06165v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2508.06165.svg)](https://codeofpaper.com/paper/2508.06165)

Discussion