MedExAgent: Training LLM Agents to Ask, Examine, and Diagnose in Noisy Clinical Environments

Yicheng Gao, Xiaolin Zhou, Yahan Li, Yue Zhao, Ruishan Liu

TL;DR

Most medical AI benchmarks hand an LLM a neatly packaged clinical vignette like a sterile multiple-choice test, ignoring how messy real medicine actually is. MedExAgent trains a compact 8B-parameter model inside a simulated clinic where patients misremember symptoms, lab tests can fail, and invasive exams carry real financial and physical costs. By learning to dynamically ask questions, order targeted tests, and weigh uncertainty, this lightweight specialist rivals 70B-parameter models in diagnostic accuracy without ordering every test under the sun.

What Problem Does This Paper Address?

If you evaluate a medical LLM today, you usually hand it a complete case file and ask, "What does the patient have?" Real-world clinical diagnosis doesn't work like that. Doctors start with a vague chief complaint and have to build the case themselves.

Specifically, real clinical work has three properties missing from static benchmarks:

  1. It is sequential and unified: Clinicians interleave talking to the patient with ordering lab exams before committing to a diagnosis. Existing interactive agents usually isolate either conversational history-taking or EHR tool-calling, rarely unifying them.
  2. It is noisy: Patients misreport where a pain is (one large study found only 5.5% complete agreement between self-reported data and EHR records), and lab samples get contaminated or yield ambiguous results.
  3. It is costly: Ordering an MRI or an invasive biopsy imposes massive financial burdens and physical discomfort compared to a simple blood draw or X-ray.
Conversation-only LLMs vs. Tool-augmented MedExAgent

The authors ask: Can we build a realistic clinical environment capturing all three properties, and train a single, deployable open-source agent to navigate it?

Methods

The authors formalize interactive diagnosis as a Partially Observable Markov Decision Process (POMDP)—a mathematical framework for making decisions when the true underlying state (the patient's latent disease) is hidden and must be inferred through noisy observations.

At each turn, the agent chooses from a unified action space: ask a free-form question, order an exam via a <tool_call>, or issue a final diagnosis. To mirror reality, the environment injects stochastic noise (seven types of patient misreporting/omission and three types of exam errors) and simulates 36 distinct patient personas.

Figure 2: Method overview. Top left: The interactive diagnosis POMDP, with latent disease d generating noisy observations ωt from agent actions at. Top right: Two-stage finetuning (SFT then DAPO RL). Bottom: Doctor–patient conversations follow the five-stage Calgary–Cambridge model, with patient and exam noise injected at rates pconv and pexam.

Starting with Meditron3-8B, the authors train MedExAgent using a two-stage recipe:

  • Stage 1: Supervised Fine-Tuning (SFT). They synthesize 5,000 doctor–patient conversations structured around the Calgary–Cambridge model, a gold-standard medical education framework that breaks clinical encounters into five stages (initiating, gathering info, physical exam, planning, closing).
  • Stage 2: Reinforcement Learning (DAPO). Across 20,000 interactive episodes, they optimize a composite reward balancing three terms:
  • Diagnostic reward: Multi-condition Jaccard similarity judged by an LLM.
  • Tool-call reward: A count-aware matching score against ground-truth exams that penalizes redundant test calls.
  • Exam cost penalty: Grounded in real-world US Medicare (CMS) fee schedules for financial cost and an invasiveness taxonomy for patient discomfort (rating non-invasive X-rays at Tier 1 up to surgical biopsies at Tier 3).

Datasets

Rather than creating raw clinical records from scratch, the authors wrap existing datasets into their interactive, noisy POMDP environment:

  • DDxPlus (In-Distribution): Synthetic differential diagnosis cases (~1.3M patients across 49 common pathologies) reflecting realistic U.S. base rates.
  • PMC-Patients-v2 (In-Distribution): Real clinical case reports from PubMed Central (~250k records), naturally enriched with rare diseases, atypical presentations, and multi-condition cases. (Training/test splits draw evenly from DDxPlus and PMC-Patients-v2).
  • AgentClinic-MedQA (Out-of-Distribution): Held-out OSCE-style structured patient profiles (201 cases) grounded in USMLE questions, used strictly to test generalization.

To prevent the agent from overfitting to one specific LLM's conversational quirks, they use different patient simulator models across SFT (gpt-4o-mini), RL (Qwen3-30B-A3B), and evaluation (gpt-4.1-mini).

Key Insights and Ideas

  • Unchecked RL agents become defensive-medicine reward hackers: When the authors removed the exam cost penalty ($w_{\text{cost}}=0$), the agent didn't just spend 2.6× more—its diagnostic accuracy actually dropped dramatically (Jaccard fell from 0.345 to 0.102 on PMC-Patients). Flooding the context with unnecessary, noisy test results hurts reasoning. Conversely, removing the tool-matching reward caused the stingy agent to under-order tests to save money. Both opposing forces are required for smart clinical investigation.
  • Training on clinical noise acts like dropout for medical reasoning: Training with noisy patients and flawed lab results improved performance even on clean test sets (+0.076 Jaccard on PMC-Patients, +0.060 on OOD AgentClinic). When subjected to unseen false-negative test noise at evaluation, the noise-trained model degraded much more gracefully, having learned not to blindly trust a single test result.
  • SFT memorizes routine cases; RL unlocks hard diagnostics: Training an SFT-only variant on all 25,000 samples saturated the routine DDxPlus benchmark just fine, but fell flat on rare/complex cases (PMC-Patients) and unseen distributions (AgentClinic), proving RL is essential for active diagnostic generalization.

Key Results

Across benchmarks, the 8B-parameter MedExAgent punches well above its weight class:

Diagnostic Jaccard Score vs. Model Size on OOD AgentClinic-MedQA
  • Out-of-Distribution Parity at 9× Smaller Scale: On the unseen AgentClinic-MedQA benchmark, MedExAgent-8B achieves a 0.378 Jaccard score and 0.378 strict accuracy—statistically tying Aloe-Beta-70B (0.395) and Qwen3-32B (0.368 strict accuracy), while decisively beating other 27B–70B medical specialists like MedGemma-27B (0.214 Jac) and HuatuoGPT-o1-70B (0.238 Jac).
  • In-Distribution Dominance: Significantly outperforms all open-source baselines ($p < 0.001$), hitting 0.937 Jaccard on DDxPlus and 0.345 on the challenging PMC-Patients-v2 (double the runner-up Aloe-Beta-70B at 0.171).
  • Cost Efficiency: Spends just 1.11× the cost of recorded ground-truth exams on PMC-Patients-v2, achieving the lowest cost per correct diagnosis among all tested baselines.

Limitations and Future Work

The authors are candid about the gap between their simulation and an actual hospital ward:

  • Static patients: The POMDP assumes the disease doesn't progress during an episode, which doesn't hold for critical-care patients deteriorating in real time.
  • Exam-dominated diagnosis: Strangely, stripping away useful patient conversation only dropped Jaccard accuracy by 0.013, whereas real clinicians get most of their diagnostic signal from history-taking. This happens because physical exams are bundled into tool calls in their setup.
  • Rigid unrecorded exams: Ordering a clinically valid alternative test that wasn't recorded in the original case report automatically returns "No significant findings", unfairly penalizing valid lateral thinking.
  • Simulated, English-only setup: Everything relies on English datasets, LLM simulated patients, and LLM judges. Future work aims to tackle multi-visit dynamic states, multilingual nuance, and human-in-the-loop validation with real physicians and patients.

Summary updated

Abstract

Real-world clinical diagnosis is a complex process in which the doctor is required to obtain information from both interaction with the patient and conducting medical exams. Additionally, the doctor needs to adapt to different patient personas, as well as noisy and incomplete information that can happen at any time during the process. However, existing benchmarks for medical LLMs and methods for automatic diagnosis largely simplify this process by reducing it to single-turn question answering, noise-free conversations, or sequential exam making, etc., ignoring the interactive and uncertain nature of clinical diagnosis. In this paper, we aim to address this gap by formalizing clinical diagnosis as a Partially Observable Markov Decision Process (POMDP) with three action types: questioning the patient, ordering medical exams as tool calls, and issuing a diagnosis. We also introduce a systematic noise model comprising seven patient noise types and three exam noise types. Using our proposed environment, we train an effective diagnosis agent, \textbf{MedExAgent}, through a two-stage pipeline that first performs supervised finetuning on synthetic conversations structured after the Calgary-Cambridge model for clinical interviews, and then applies DAPO to optimize a composite reward capturing diagnostic accuracy, tool call quality, and exam cost including financial cost and patient discomfort. Through extensive experiments and ablation studies, we demonstrate that MedExAgent achieves diagnostic performance comparable to larger models while maintaining cost-efficient examination strategies.
BibTeX
@inproceedings{gao2026medexagent,
  author = {Yicheng Gao and Xiaolin Zhou and Yahan Li and Yue Zhao and Ruishan Liu},
  title = {{MedExAgent: Training LLM Agents to Ask, Examine, and Diagnose in Noisy Clinical Environments}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=olngQeJA7J},
}
Figure