DeepRAG: Thinking to Retrieve Step by Step for Large Language Models

Xinyan Guan, Jiali Zeng, Fandong Meng, Chunlei Xin, Yaojie Lu +4 more
2/3/2025
cs.AIcs.CLcs.IR

No official code found. Best implementation: gxy-gxy/DeepRAG (39 stars, last commit 2026-02-17).

Abstract

Large Language Models (LLMs) have shown remarkable reasoning capabilities, while their practical applications are limited by severe factual hallucinations due to limitations in the timeliness, accuracy, and comprehensiveness of their parametric knowledge. Meanwhile, enhancing retrieval-augmented generation (RAG) with reasoning remains challenging due to ineffective task decomposition and redundant retrieval, which can introduce noise and degrade response quality. In this paper, we propose DeepRAG, a framework that models retrieval-augmented reasoning as a Markov Decision Process (MDP), enabling reasonable and adaptive retrieval. By iteratively decomposing queries, DeepRAG dynamically determines whether to retrieve external knowledge or rely on parametric reasoning at each step. Experiments show that DeepRAG improves retrieval efficiency and boosts answer accuracy by 26.4%, demonstrating its effectiveness in enhancing retrieval-augmented reasoning.

View on arXivView PDF

Code Implementations(1)

gxy-gxy/DeepRAGCommunity65%

DeepRAG: Thinking to Retrieve Step by Step for Large Language Models

392Shell, PythonApr 8, 20258 months ago

Similar Papers

Cite this paper

@article{guan2025deeprag,
  title  = {DeepRAG: Thinking to Retrieve Step by Step for Large Language Models},
  author = {Xinyan Guan and Jiali Zeng and Fandong Meng and Chunlei Xin and Yaojie Lu and Hongyu Lin and Xianpei Han and Le Sun and Jie Zhou},
  year   = {2025},
  eprint = {2502.01142},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.01142v2}
}

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/2502.01142.svg)](https://codeofpaper.com/paper/2502.01142)

Discussion