End-to-End Agentic RAG System Training for Traceable Diagnostic Reasoning
Qiaoyu Zheng, Yuze Sun, Chaoyi Wu, Weike Zhao, Pengcheng Qiu, Yongguo Yu, Kun Sun, Jian Zhang, Yanfeng Wang, Ya Zhang, Weidi Xie
TL;DR
This work tackles the trust gap in clinical AI by reimagining diagnostic AI as an agentic, end-to-end reinforcement-learned system (Deep-DxSearch) that actively searches and reasons over a vast medical retrieval environment. By formalizing diagnosis as a sequential decision process with five primitives (<reason>, <lookup>, <match>, <search>, <diagnose>) and optimizing a composite reward for reasoning validity and evidence quality, the approach achieves superior accuracy and generalization across common and rare diseases in multi-center benchmarks. Human-in-the-loop studies show physicians prefer its auditable evidence chains, suggesting improved clinical trust and utility despite longer processing times. The method addresses rare-disease challenges, reduces hallucinations, and provides a blueprint for trustworthy, transparent diagnostic assistants grounded in Evidence-Based Medicine, with data, code, and checkpoints publicly available.
Abstract
The integration of Large Language Models (LLMs) into healthcare is constrained by knowledge limitations, hallucinations, and a disconnect from Evidence-Based Medicine (EBM). While Retrieval-Augmented Generation (RAG) offers a solution, current systems often rely on static workflows that miss the iterative, hypothetico-deductive reasoning of clinicians. To address this, we introduce Deep-DxSearch, an agentic RAG system trained end-to-end via reinforcement learning (RL) for traceable diagnostic reasoning. Deep-DxSearch acts as an active investigator, treating the LLM as an agent within an environment of 16,000+ guideline-derived disease profiles, 150,000+ patient records for case-based reasoning, and over 27 million biomedical documents. Using soft verifiable rewards that co-optimize retrieval and reasoning, the model learns to formulate queries, evaluate evidence, and refine searches to close diagnostic gaps. Experiments show our end-to-end RL framework consistently outperforms prompt-engineering and training-free RAG methods. On in-distribution (ID) and out-of-distribution (OOD) benchmarks for common and rare diseases, Deep-DxSearch surpasses strong baselines-including GPT-4o, DeepSeek-R1, and medical-specific frameworks-achieving an average accuracy gain of 22.7% over the second-best model. In validation with 150 real-world cases, Deep-DxSearch boosts physicians' average diagnostic accuracy from 45.6% to 69.1%. These results indicate that evolving agentic systems to leverage statistical regularities in large-scale healthcare data is key for trustworthy diagnostic assistants. All data, code, and checkpoints are available at https://qiaoyu-zheng.github.io/Deep-DxSearch.
