Introduction
Existing evaluations for Medical Large Language Models (LLMs) primarily rely on static benchmarks where models are provided with comprehensive patient histories and asked to select a diagnosis from a predefined list. However, clinical practice is inherently dynamic and interactive. In real-world settings, information is often missing or ambiguous, and clinicians must iteratively gather data through patient interviews and targeted diagnostic testing. To bridge this gap, we present MedAgentSim, an open-source, multi-agent simulation environment designed to move medical AI evaluation from static multiple-choice testing to realistic, multi-turn clinical interactions.
The MedAgentSim Framework
MedAgentSim utilizes a 2D simulated hospital environment built on the Phaser game engine. The framework facilitates interactions between three specialized agent types:
- Patient Agent: Simulates a patient experiencing specific symptoms, capable of providing history and responding to inquiries.
- Doctor Agent: Conducts the clinical interview, requests examinations, and formulates a diagnosis.
- Measurement Agent: Acts as the repository for ground-truth diagnostic data (e.g., laboratory results, imaging). This agent only reveals information if the Doctor Agent specifically requests the correct test, simulating the cost and intentionality of medical ordering.
The Self-Evolving Pipeline
A core innovation of MedAgentSim is its "self-evolving" capability, which allows Doctor Agents to improve their diagnostic accuracy through experience. This is achieved via a multi-phase pipeline:
- Conversation and Interaction: The Doctor Agent engages with the Patient and Measurement agents to gather clinical data.
- Experience Replay and Memory: The system maintains two distinct memory buffers. The Medical Records Buffer stores successful diagnostic cases, while the Experience Records Buffer stores reflections on past errors.
- Reasoning and Consensus: For new cases, the system employs k-Nearest Neighbors (kNN) to retrieve relevant past experiences. A team of Doctor Agents then utilizes Chain-of-Thought (CoT) reasoning and a majority-vote ensemble to reach a final consensus, mimicking a clinical consultation.
Experimental Methodology
The framework was evaluated across several diverse medical benchmarks, adapted for multi-turn simulation:
- NEJM & NEJM Extended: Vision-Language tasks requiring the interpretation of medical imagery.
- MedQA & MedQA Extended: Interactive adaptations of USMLE-style board exams.
- MIMIC-IV: Real-world clinical cases derived from electronic health records.
- Dynamic Interaction Benchmark: A novel benchmark introduced by the authors to specifically measure performance in context-aware, interactive scenarios.
Key Results and Insights
MedAgentSim demonstrated substantial performance improvements over existing multi-agent baselines:
- MIMIC-IV Performance: On the complex MIMIC-IV dataset, MedAgentSim achieved a diagnostic accuracy of 79.5%, nearly doubling the 42.7% accuracy of the baseline Multi-Agent Clinic framework.
- Language Model Gains: Using LLaMA 3.3, the framework reached 70.8% on MedQA, compared to a baseline of 62.3%. The inclusion of memory and CoT reasoning alone provided a 16.1% performance boost.
- Vision-Language Integration: In the NEJM benchmark, the framework reached 26.7% accuracy, outperforming models that typically struggle to exceed 20% in interactive settings.
- Behavioral Realism: In a blinded study, human clinicians were unable to distinguish between AI agents and human participants 62.5% of the time, indicating a high degree of behavioral fidelity.
Discussion and Limitations
While MedAgentSim represents a significant advancement in medical AI simulation, several challenges remain. Vision-Language Model (VLM) performance in interpreting specialized medical imaging (e.g., MRIs, X-rays) remains lower than text-based reasoning, suggesting a need for improved medical perception. Additionally, the computational overhead of multi-agent discussions and kNN retrieval is higher than single-turn inference. Finally, the use of LLMs as evaluators for final diagnoses, while validated by manual review, may introduce subtle biases that require ongoing monitoring.
By forcing AI agents to actively gather information and learn from their mistakes, MedAgentSim provides a more robust and realistic pathway for the development and evaluation of clinical AI. The codebase and datasets are available at https://medagentsim.netlify.app/.
Summary updated