[KongchangAI]
· 2 min read· 1,195 words

HERMES: Predicting Patient Outcomes from Clinical Text Using Knowledge Graphs

HERMES: Predicting Patient Outcomes from Clinical Text Using Knowledge Graphs

HERMES uses LLM-extracted knowledge graphs and graph attention networks to improve patient outcome prediction from clinical text.

HERMES is a graph neural network framework for clinical prediction built entirely on clinical text, designed to address the loss of relational and temporal structure when clinical notes are flattened into sequences. It first uses an LLM to extract entities and relationships from patient notes into personalized knowledge graphs, with "contrastive logic modeling" explicitly capturing temporal dynamics, treatment failures, and outcome changes. A GAT then learns patient representations from these graphs. HERMES consistently outperforms text-only baselines on in-hospital mortality and 30-day readmission tasks across MIMIC-III and MIMIC-IV, though specific gains, LLM extraction error impacts, and computational costs remain undisclosed.

From Structured Data to Clinical Text: A New Path for Predictive Models

Clinical prediction models have long relied on structured electronic health record (EHR) data — time-series measurements, diagnosis codes, and the like. This data is clean and easy to model, but it only captures part of the clinical picture. The vast unstructured text that physicians leave in progress notes and nursing records often carries far richer diagnostic reasoning: why a treatment was adjusted, how a patient responded to a particular regimen, and how a condition evolved over time.

Recent work has begun tapping into clinical text, but the dominant approach encodes it as flat sequences. While straightforward, this has a clear drawback: the explicit relational and temporal structure embedded in clinical narratives gets diluted or lost in the flattening process. A chain of causality and sequencing like "drug A proved ineffective, so drug B was started, and symptoms improved" may be reduced to nothing more than word order in a sequence encoding.

To address this limitation, a new paper on arXiv proposes the HERMES framework, which advocates for patient outcome prediction that is entirely text-based while preserving clinical relational structure.

HERMES paper source screenshot

Two Core Design Principles of HERMES

HERMES is a graph-based framework built on two key ideas.

Personalized Knowledge Graphs and Contrastive Logic Modeling

The first step is constructing a Personalized Knowledge Graph for each patient. This is done by using a large language model (LLM) to perform guided extraction from clinical notes — pulling out entities and relationships from the text and organizing them into a graph structure.

The real highlight is what the authors call Contrastive Logic Modeling. Rather than extracting static facts, it explicitly captures three types of critical clinical dynamics: temporal dynamics, treatment failures, and changes in outcomes. In other words, the model aims to understand not just "what a patient has," but "what happened, what didn't work, and how outcomes changed." This explicit modeling of treatment failures and outcome shifts is precisely what flat sequences struggle to express.

Knowledge Graphs are graph-structured data representations where nodes represent entities and directed edges represent relationships. In biomedicine, general-purpose medical knowledge graphs like UMLS and SNOMED CT already exist, but they encode population-level medical knowledge and cannot reflect an individual patient's personalized care trajectory. The "personalized" knowledge graphs in HERMES are designed to fill exactly this gap — extracting entities specific to a single patient (such as specific medications, lab results, and symptom descriptions) and their relationships from that patient's clinical notes, forming a graph structure unique to that individual. This is fundamentally different from adapting a general medical knowledge base to a downstream task: the former builds a graph bottom-up from text, while the latter retrieves and matches top-down from a knowledge base. The LLM here plays the role of a "structured information extractor," converting unstructured free text into a computable graph representation, rather than being used directly to generate predictions.

Graph Attention Networks for Patient Representation

In the second step, HERMES uses a Graph Attention Network (GAT) to perform graph learning on the constructed knowledge graphs, synthesizing an overall patient representation. Compared to simply feeding text into an encoder, graph attention mechanisms can weight different nodes and edges by the importance of their relationships, allowing the model to focus on the clinical associations most critical for predicting outcomes.

Combining these two steps, HERMES transforms unstructured text into structured representations suitable for prediction — while preserving clinical relationships throughout.

Graph Attention Networks (GAT) are an important variant within the graph neural network (GNN) family, introduced by Veličković et al. in 2018. Their core idea is to incorporate an attention mechanism when aggregating information from neighboring nodes, allowing the model to automatically learn importance weights for different neighbors relative to a central node — rather than treating all neighbors equally as early Graph Convolutional Networks (GCN) did. In the context of clinical knowledge graphs, this design has clear intuitive appeal: not every relationship in a patient's graph is equally important for predicting outcomes. An edge like "renal function deteriorated after medication" may deserve far more attention than "patient had an ECG." GAT's attention weights can dynamically direct the model's focus toward the clinical associations most relevant to the prediction target, thereby generating more discriminative overall patient representations.

Experimental Validation: Performance on MIMIC Datasets

The research team validated HERMES on two widely used public clinical databases — MIMIC-III and MIMIC-IV — across two classic clinical prediction tasks:

  • In-hospital mortality prediction
  • 30-day readmission prediction

Results show that HERMES consistently outperforms strong text-only baseline models on these tasks. The paper concludes that explicit relational modeling through contrastive logic modeling can significantly improve prediction performance.

The significance of this finding is that it empirically supports a key judgment: the relational and temporal structure in clinical text is not decorative noise — it carries predictive value. Flattening text into sequences fundamentally discards these signals; preserving them through graphs translates into tangible performance gains.

MIMIC (Medical Information Mart for Intensive Care) is a public clinical database jointly maintained by MIT and Beth Israel Deaconess Medical Center, and is one of the most widely used standard benchmarks in clinical AI research. MIMIC-III covers data from approximately 40,000 ICU patients between 2001 and 2012, while MIMIC-IV extends the time range to 2008–2019 with expanded data scale and quality. Both versions include structured data (vital sign time series, lab results, ICD diagnosis codes) and unstructured data (physician progress notes, nursing notes, discharge summaries), making them ideal for evaluating methods that combine text mining with structured data. In-hospital mortality prediction and 30-day readmission prediction are the two most studied tasks on this dataset, with extensive published baselines available for cross-comparison — which is why HERMES chose them as validation benchmarks.

Significance and Limitations

HERMES offers a noteworthy direction: as medical AI increasingly incorporates large language models, how can LLMs serve not merely as "text compressors" but as structured knowledge extractors? Using LLMs for guided extraction and then applying graph neural networks for learning creates a clean pipeline: text → knowledge graph → representation.

The emphasis on treatment failures and outcome changes in contrastive logic modeling is particularly well-suited for clinical decision-making scenarios — after all, what physicians often care most about is precisely the kind of counterfactual and pivotal information captured by "which interventions didn't work."

That said, as a preprint, its conclusions warrant careful interpretation. The abstract does not disclose specific performance improvement margins, the accuracy and error propagation of LLM extraction, or the computational cost of knowledge graph construction. LLM extraction itself may introduce hallucinations or erroneous relationships, and how such noise affects downstream prediction is a question that must be answered before this type of approach can be deployed in practice. Furthermore, while the MIMIC dataset is a classic benchmark, it primarily reflects intensive care settings, and the model's generalization to broader clinical environments remains to be demonstrated.

Overall, HERMES represents a concrete step in the evolution of clinical predictive modeling from a "sequence mindset" to a "relational mindset," providing a valuable reference for how to more fully unlock the value embedded in clinical text.

#HERMES#clinical text prediction#knowledge graph#graph attention network#patient outcome prediction#MIMIC#EHR#clinical NLP#contrastive logic modeling#graph neural network
Share:

Related articles