Hierarchical ICD Code Modeling Improves EHR Foundation Models

Megha Thukral, Dong Gyun Kang, Rudra Pratap Singh, Shruthi Kashinath Hiremath, Katrin H\"ansel, Thomas Pl\"otz· June 16, 2026 View original

Summary

New research demonstrates that explicitly incorporating the hierarchical structure of ICD diagnosis codes into Electronic Health Record (EHR) foundation models significantly improves predictive performance. This approach, tested across transformer and graph-based models, enhances both in-domain and cross-dataset transferability compared to treating codes as flat tokens.

A recent study explores how to improve Electronic Health Record (EHR) foundation models by leveraging the inherent hierarchical structure of ICD diagnosis codes. Traditionally, these models treat ICD codes as independent, flat data points, overlooking the rich clinical relationships embedded within their hierarchical organization, which defines disease families and subcategories. The researchers investigated two primary methods for integrating this hierarchy: augmenting diagnosis sequences in transformer models with hierarchical tokens and injecting hierarchy into graph-based code representations using specialized edges. These methods were evaluated on large clinical datasets, MIMIC-IV and eICU, to assess their impact on predictive accuracy and transferability. The findings indicate that explicitly encoding ICD hierarchy consistently enhances model performance, both within the same dataset and when transferring knowledge to new datasets. The optimal level of hierarchy to incorporate was found to vary depending on the specific task and modeling technique, confirming the generalizable benefits of this hierarchy-aware approach for clinical representation learning.

Why it matters

For healthcare professionals and AI developers in health tech, this research provides a pathway to building more accurate and clinically intelligent EHR models. By better understanding disease relationships, these models can improve diagnostic support, treatment planning, and patient outcome predictions.

How to implement this in your domain

  1. 1Review existing EHR models to identify opportunities for incorporating hierarchical ICD code structures.
  2. 2Experiment with augmenting transformer-based models with hierarchical tokens for diagnosis sequences.
  3. 3Explore graph-based representations of clinical data that include hierarchy-aware edges for ICD codes.
  4. 4Evaluate the impact of different hierarchical levels on specific clinical prediction tasks.
  5. 5Collaborate with clinical experts to validate the clinical relevance of hierarchy-aware model improvements.

Who benefits

HealthcarePharmaceuticalsBiotechHealthTech

Key takeaways

  • ICD code hierarchy is a valuable inductive bias for EHR foundation models.
  • Explicitly encoding hierarchy improves predictive performance in clinical tasks.
  • Both transformer and graph-based models benefit from hierarchy integration.
  • The optimal hierarchical level depends on the specific task and model.

Original post by Megha Thukral, Dong Gyun Kang, Rudra Pratap Singh, Shruthi Kashinath Hiremath, Katrin H\"ansel, Thomas Pl\"otz

"arXiv:2606.15447v1 Announce Type: new Abstract: Electronic health record foundation models typically treat ICD diagnosis codes as flat tokens, overlooking the clinically meaningful hierarchical structure that captures disease families, subcategories, and fine-grained diagnostic d…"

View on X

Originally posted by Megha Thukral, Dong Gyun Kang, Rudra Pratap Singh, Shruthi Kashinath Hiremath, Katrin H\"ansel, Thomas Pl\"otz on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses