GraphWalker: Patient Analogy Meets Information Gain for Clinical Reasoning with Large Language Models

Yue Fang, Weibin Liao, Yuxin Guo, Jiaran Gao, Hongxin Ding +6 more
4/8/2026
cs.LG

Official code: PuppyKnightUniversity/GraphWalker (4 stars, Python, last commit 2026-10-04).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

40Python, ShellJan 6, 20261 months ago

Similar Papers

Cite this paper

@article{fang2026graphwalker,
  title  = {GraphWalker: Patient Analogy Meets Information Gain for Clinical Reasoning with Large Language Models},
  author = {Yue Fang and Weibin Liao and Yuxin Guo and Jiaran Gao and Hongxin Ding and Jinyang Zhang and Xinke Jiang and Zhibang Yang and Junfeng Zhao and Yasha Wang and Liantao Ma},
  year   = {2026},
  eprint = {2604.06684},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.06684v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.06684.svg)](https://codeofpaper.com/paper/2604.06684)

Discussion