Can LLM Agents Generate Real-World Evidence? Evaluating Observational Studies in Medical Databases
Organizations: Zhejiang University, Hangzhou, China
Abstract
Observational studies can yield clinically actionable evidence at scale, but executing them on real-world databases is open-ended and requires coherent decisions across cohort construction, analysis, and reporting. Prior evaluations of LLM agents emphasize isolated steps or single answers, missing the integrity and internal structure of the resulting evidence bundle. To address this gap, we introduce RWE-bench, a benchmark grounded in MIMIC-IV and derived from peer-reviewed observational studies. Each task provides the corresponding study protocol as the reference standard, requiring agents to execute experiments in a real database and iteratively generate tree-structured evidence bundles. We evaluate six LLMs (three open-source, three closed-source) under three agent scaffolds using both question-level correctness and end-to-end task metrics. Across 162 tasks, task success is low: the best agent reaches 39.9%, and the best open-source model reaches 30.4%. Agent scaffolds also matter substantially, causing over 30% variation in performance metrics. Furthermore, we implement an automated cohort evaluation method to rapidly localize errors and identify agent failure modes. Overall, the results highlight persistent limitations in agents' ability to produce end-to-end evidence bundles, and efficient validation remains an important direction for future work. Code and data are available at https://github.com/somewordstoolate/RWE-bench.
Figures & tables
| Question-level Metrics | Task-level Metrics | |||||
| Model | ACC | RAR | SMR | SR | Steps | CR |
| MLAB | ||||||
| GPT-4.1 | 31.5 ± 1.0 | 16.5 ± 1.8 | 20.4 ± 1.0 | 10.3 ± 0.7 | 79.5 ± 1.8 | 33.1 ± 2.3 |
| Claude-Sonnet-4 | 60.9 ± 1.2 | 50.1 ± 1.8 | 46.8 ± 2.1 | 31.1 ± 2.5 | 49.5 ± 1.5 | 82.1 ± 0.9 |
| OpenHands | ||||||
| MiniMax-M2.1 | 59.8 ± 0.1 | 47.5 ± 2.7 | 47.6 ± 2.6 | 29.4 ± 1.9 | 53.7 ± 1.4 | 91.4 ± 1.8 |
| Model | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| GPT-5 | 93.1±0.4 | 90.7±0.1 | 95.4±0.1 | 90.6±0.2 |
| O4-mini | 81.1±0.3 | 93.0±0.7 | 96.1±0.3 | 78.0±0.2 |
| GPT-4.1 | 80.7±0.7 | 93.3±0.2 | 88.2±1.8 | 79.1±0.5 |
| Qwen3-32B | 69.2±0.3 | 92.3±0.7 | 94.5±0.5 | 66.5±0.1 |
| Lingshu-32B* | 67.0±1.0 | 84.8±0.9 | 88.2±0.8 | 64.0±0.7 |
| ReasonMed-8B* | 78.5±0.0 | 76.1±0.0 | 87.5±0.0 | 66.9±0.0 |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| Benchmark | Domain | Language | Source | Input Scope | Solution Granularity | Primary Verification | Size |
|---|---|---|---|---|---|---|---|
| EHRSQL ( Lee et al., 2022 ) | Med Admin | SQL | Questionnaire | Instruction | Sentence-level | Code Test | 24,405 |
| MedAgentBench ( Xu et al., 2025a ) | Med Admin | - | Clinician | Instruction | Sentence-level | Result Match | 300 |
| MLE-bench ( Chan et al., 2024 ) | ML | Python | Kaggle | Protocol | Repo-level | Code Test | 75 |
| Paperbench ( Starace et al., 2025 ) | ML | Python | Publications | Paper | Repo-level | Rubric | 20 |
| DSBench ( Jing et al., 2025 ) | DA/ML | Python | Kaggle/ModelOff | Instruction | Script-level | Choice/Fill | 540 |
| ScienceAgentBench ( Chen et al., 2024 ) | DA/ML | Python | Publications | Instruction | Script-level | Execution | 102 |
| MLAB | |
|---|---|
| Parameter | Value |
| edit_script_llm | claude-sonnet-3.7-20250219 |
| max_observation_chars | 10000 |
| OpenHands | |
| Parameter | Value |
| LLMSummarizingCondenser.max_size | 50 |
| Task | Study Population | Natural Pos. | Natural Neg. | Counterfactual Neg. | Adversarial Neg. |
|---|---|---|---|---|---|
| 39508803 | Non-traumatic Intracerebral Hemorrhage | 93 | 7 | 30 | 10 |
| 39333879 | Aortic Aneurysms | 100 | 0 | 30 | 10 |
| 37940979 | Heart Failure | 100 | 0 | 30 | 10 |
| 38341579 | Heart Failure | 79 | 21 | 30 | 10 |
| 40703256 | Asthma | 100 | 0 | 30 | 10 |
| 39170390 | Influenza | 100 | 0 | 30 | 10 |
| Task | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| 39508803 | 99.6±0.4 | 85.1±0.0 | 93.0±0.0 | 99.2±0.8 |
| 39333879 | 100.0±0.0 | 79.2±0.8 | 92.3±0.3 | 100.0±0.0 |
| 37940979 | 100.0±0.0 | 100.0±0.0 | 100.0±0.0 | 100.0±0.0 |
| 38341579 | 89.9±0.0 | 68.3±0.6 | 78.6±0.3 | 83.9±0.1 |
| 40703256 | 51.7±5.5 | 99.2±0.8 | 99.2±0.8 | 45.4±3.1 |
| 39170390 | 98.3±0.3 | 89.2±0.8 | 95.8±0.3 | 95.5±0.9 |
| Task | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| 39508803 | 73.5±2.4 | 87.9±0.7 | 92.3±0.6 | 62.8±2.1 |
| 39333879 | 100.0±0.0 | 95.8±0.8 | 98.3±0.3 | 100.0±0.0 |
| 37940979 | 100.0±0.0 | 100.0±0.0 | 100.0±0.0 | 100.0±0.0 |
| 38341579 | 89.5±0.4 | 72.1±1.0 | 80.6±0.5 | 84.1±0.6 |
| 40703256 | 19.7±1.7 | 100.0±0.0 | 100.0±0.0 | 33.3±0.5 |
| 39170390 | 92.7±1.5 | 84.2±3.6 | 93.6±1.3 | 82.4±2.3 |
| Task | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| 39508803 | 92.5±0.6 | 76.6±1.2 | 88.7±0.6 | 83.7±1.2 |
| 39333879 | 98.0±0.0 | 89.2±0.8 | 95.8±0.3 | 94.7±0.0 |
| 37940979 | 100.0±0.0 | 100.0±0.0 | 100.0±0.0 | 100.0±0.0 |
| 38341579 | 74.7±2.6 | 88.0±0.5 | 88.9±0.5 | 73.0±2.0 |
| 40703256 | 68.0±1.2 | 97.5±1.4 | 98.6±0.8 | 55.0±1.1 |
| 39170390 | 99.3±0.3 | 100.0±0.0 | 100.0±0.0 | 98.4±0.8 |
| Task | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| 39508803 | 87.1±3.1 | 85.1±1.2 | 92.0±0.8 | 77.4±4.5 |
| 39333879 | 98.7±0.7 | 92.5±0.0 | 97.0±0.0 | 96.6±1.7 |
| 37940979 | 91.0±1.5 | 100.0±0.0 | 100.0±0.0 | 81.8±2.6 |
| 38341579 | 76.0±2.6 | 75.9±2.0 | 80.4±0.8 | 71.1±1.9 |
| 40703256 | 32.0±2.0 | 100.0±0.0 | 100.0±0.0 | 37.0±0.7 |
| 39170390 | 98.7±0.9 | 90.0±1.4 | 96.1±0.6 | 96.5±2.3 |
| Task | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| 37940979 | 60.3±3.2 | 95.8±2.2 | 97.2±1.5 | 49.3±2.4 |
| 38341579 | 52.3±4.0 | 73.2±1.1 | 71.5±2.3 | 54.4±2.5 |
| 38788038 | 87.6±2.2 | 79.9±0.8 | 90.7±0.5 | 74.4±3.6 |
| 39170390 | 94.0±1.2 | 79.2±5.8 | 92.0±2.1 | 84.2±2.4 |
| 39232111 | 41.3±1.7 | 87.5±5.0 | 89.6±3.5 | 37.3±1.2 |
| 39333879 | 100.0±0.0 | 76.7±3.0 | 91.5±1.0 | 100.0±0.0 |
| Task | Sens | Spec | PPV | NPV |
|---|---|---|---|---|
| 37940979 | 96.0±0.0 | 85.0±0.0 | 94.1±0.0 | 89.5±0.0 |
| 38341579 | 92.4±0.0 | 29.5±0.0 | 62.9±0.0 | 75.0±0.0 |
| 38788038 | 90.7±0.0 | 81.4±0.0 | 91.7±0.0 | 79.5±0.0 |
| 39170390 | 65.0±0.0 | 72.5±0.0 | 85.5±0.0 | 45.3±0.0 |
| 39232111 | 82.0±0.0 | 72.5±0.0 | 88.2±0.0 | 61.7±0.0 |
| 39333879 | 88.0±0.0 | 85.0±0.0 | 93.6±0.0 | 73.9±0.0 |
| Model | ACC | RAR | SMR | SR |
|---|---|---|---|---|
| MLAB | ||||
| GPT-4.1 | 30.0 ± 1.5 | 17.2 ± 1.1 | 15.0 ± 0.4 | 6.2 ± 1.8 |
| Claude-Sonnet-4 | 58.7 ± 3.7 | 45.7 ± 3.1 | 41.1 ± 3.5 | 17.7 ± 2.8 |
| OpenHands | ||||
| MiniMax-M2.1 | 60.6 ± 1.1 | 45.7 ± 2.7 | 44.9 ± 1.1 | 18.8 ± 1.8 |
| GPT-4.1 | 0.9 ± 0.9 | 0.6 ± 0.6 | 0.4 ± 0.4 | 0.0 ± 0.0 |
LLM Agent Evaluation
Large language model agent evaluation measures whether tool-using systems complete tasks reliably, safely, and efficiently.
See all 1,194 papers