GraphWalker: Patient Analogy Meets Information Gain for Clinical Reasoning with Large Language Models
About
Clinical reasoning over electronic health records (EHRs) is a fundamental yet challenging task in modern healthcare. While large language models (LLMs) offer a promising paradigm via in-context demonstrations that requires no task-specific parameter updates, existing methods for reasoning by patient analogy in EHR settings suffer from three core limitations: (1) Perspective Limitation, where data-driven similarity misaligns with LLM reasoning needs while model-driven signals are constrained by limited clinical competence; (2) Cohort Awareness, as demonstrations are selected independently without modeling population-level structure; and (3) Information Aggregation, where redundancy and interaction effects among demonstrations are ignored. We propose GraphWalker, a training-free framework that lets frozen LLMs reason by analogy over retrieved patient cases. GraphWalker (i) jointly leverages data-driven and model-driven perspectives, (ii) discovers patient cohorts to ground retrieval in population-level structure, and (iii) employs a lazy greedy search with frontier expansion to compose demonstrations with high marginal information gain. Extensive experiments on multiple real-world EHR benchmarks show that GraphWalker consistently outperforms state-of-the-art demonstration selection baselines, and remains substantially more robust under cross-dataset distribution shift, without task-specific parameter updates. GraphWalker further generalizes to black-box LLMs and composes naturally with agentic reasoning frameworks, positioning it as a pluggable patient-analogy skill in LLM-based clinical workflows. Our code is available at https://github.com/PuppyKnightUniversity/GraphWalker.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Readmission prediction | MIMIC IV | AUC-ROC0.7591 | 90 | |
| Mortality Prediction | MIMIC-III | AUROC84.19 | 59 | |
| Readmission Prediction (RA) | MIMIC-IV (test) | ROC AUC0.7757 | 37 | |
| Length-of-Stay Prediction | MIMIC-III | Macro ROC AUC69.51 | 28 | |
| Length of Stay (LOS) prediction | MIMIC-III (test) | Macro ROC AUC67.4 | 14 | |
| Mortality Prediction | MIMIC-III (test) | AUROC85.88 | 14 | |
| Medical Reasoning | CMB | Exact Match (EM)84.05 | 12 | |
| Medical Reasoning | MedQA | EM61.1 | 12 | |
| Medical Reasoning | CMB clin | BLEU-129.68 | 12 |