Generative Foundation Model for Structured and Unstructured Electronic Health Records

Sonish Sivarajkumar, Hang Zhang, Yuelyu Ji, Maneesh Bilalpur, Xizhi Wu, Chenyu Li, Min Gu Kwak, Shyam Visweswaran, Yanshan WangarXiv 2025 · OpenReview

Abstract

Electronic health records (EHRs) are rich clinical data sources but complex repositories of patient data, spanning structured elements (demographics, vitals, lab results, codes), unstructured clinical notes and other modalities of data. Harnessing this heterogeneity is critical for improving patient outcomes. Recent advances in large language models (LLMs) have enabled foundation models that can learn from multiple data modalities and support clinical tasks. However, most current approaches simply serialize numeric EHR data into text, which risks losing temporal and quantitative detail. We introduce Generative Deep Patient (GDP), a multimodal foundation model that natively encodes structured EHR time-series via a CNN-Transformer encoder and fuses it with unstructured EHRs through cross-modal attention into a LLaMA-based decoder. GDP is trained in two stages: (1) generative pretraining, where it learns to produce clinical narratives from raw patient timelines while also performing masked feature prediction (MFP) and next time-step prediction (NTP) to capture temporal dynamics; and (2) multi-task fine-tuning for clinically meaningful predictions (e.g., heart failure, type 2 diabetes, 30-day readmission). In clinical prediction, GDP demonstrated superior performance on MIMIC-IV: heart failure AUROC = 0.923, type 2 diabetes AUROC = 0.817, and 30-day readmission AUROC = 0.627. For narrative generation, GDP achieved ROUGE-L = 0.135 and BERTScore-F1 = 0.545. In a blinded human evaluation, GDP-Instruct scored highest on faithfulness, fluency, and overall clinical utility, suggesting reduced hospital documentation workload without sacrificing accuracy. Our results demonstrate that a single multimodal foundation model can both predict clinically actionable events and generate high-quality clinical narratives. Furthermore, GDP's flexible architecture can be extended to additional modalities.

Introduction

Electronic Health Records (EHRs) are a goldmine for clinical AI, yet they present a significant processing challenge due to their inherent heterogeneity. They combine structured data—such as vitals, lab results, and ICD codes—with unstructured clinical notes. Most current Large Language Model (LLM) approaches attempt to bridge this gap by "serializing" numerical data into text. However, this method is often inefficient, as it can obscure precise temporal relationships and risk losing quantitative detail through hallucination or oversimplification.

To address these limitations, we present Generative Deep Patient (GDP), a multimodal foundation model designed to handle the complex reality of EHRs. By natively encoding both structured time-series and unstructured text, GDP can simultaneously predict patient outcomes with high accuracy and generate faithful clinical narratives.

The Generative Deep Patient (GDP) Framework

The GDP framework utilizes a sophisticated multimodal architecture designed to respect the native formats of different data types while enabling them to interact effectively.

The GDP architecture, showing modality-specific encoders and cross-modal fusion for discriminative and generative tasks.

The architecture consists of three primary components:

  1. Native Encoders: Instead of text serialization, GDP employs a hybrid CNN–Transformer encoder for structured time-series data, capturing both local trends and long-range dependencies. Unstructured text is processed via a pretrained BioClinicalBERT encoder.
  2. Cross-Modal Fusion: These representations are integrated using cross-modal attention into a 3.2-billion parameter LLaMA-based decoder. This allows the model to "attend" to specific physiological trends while generating text or making predictions.
  3. Two-Stage Training: The model first undergoes Generative Pretraining, learning to generate hospital summaries while performing auxiliary tasks like Masked Feature Prediction (MFP) and Next Time-step Prediction (NTP). It is then refined through Multi-task Fine-tuning for specific clinical predictions.

Experimental Setup and Results

The model was evaluated using the MIMIC-IV dataset, comprising approximately 35,000 hospital admissions. Evaluation focused on three discriminative tasks—Heart Failure (HF), Type 2 Diabetes (T2DM), and 30-day Readmission—alongside narrative generation.

GDP demonstrated state-of-the-art performance across all tasks. Notably, in clinical prediction, GDP significantly outperformed existing baselines such as CEHR-BERT.

Comparison of AUROC scores for GDP-Non-Instruct against baseline models across three clinical prediction tasks.

Key performance metrics included:

  • Heart Failure: 0.923 AUROC (vs. 0.779 for CEHR-BERT).
  • Type 2 Diabetes: 0.817 AUROC.
  • 30-day Readmission: 0.627 AUROC.

In generative tasks, GDP-Instruct achieved a BERTScore-F1 of 0.545, outperforming larger models like Med42. Human evaluations by clinical experts further validated the model, with GDP-Instruct receiving high scores for fluency (4.6/5) and clinical utility (4.3/5).

Discussion and Key Insights

Our findings highlight several critical aspects of multimodal EHR modeling:

  • The Serialization Tax: Native encoding of time-series data provides a significant performance boost over simple text-only serialization.
  • Temporal Logic: Auxiliary tasks like NTP and MFP are essential; without them, the model's ability to anticipate disease progression drops significantly.
  • Faithfulness over Fluency: GDP’s cross-attention mechanism keeps it "anchored" to actual patient data, achieving a faithfulness score of 4.4/5 in human evaluations and minimizing hallucinations common in generic LLMs.
  • Instruction Tuning Trade-offs: While GDP-Instruct is superior for clinical documentation and interaction, the non-instruct version (GDP-Base) performed slightly better at raw classification, suggesting a regularization effect from instruction tuning.

Conclusion and Future Work

GDP demonstrates that a single multimodal foundation model can effectively predict clinically actionable events and generate high-quality clinical narratives. Future work will focus on expanding the model's context window beyond 50 time steps and integrating additional modalities such as medical imaging and genomics. Additionally, we aim to explore more computationally efficient fusion methods to facilitate real-time clinical use.

Summary updated

BibTeX
@misc{sivarajkumar2025generative,
  author = {Sonish Sivarajkumar and Hang Zhang and Yuelyu Ji and Maneesh Bilalpur and Xizhi Wu and Chenyu Li and Min Gu Kwak and Shyam Visweswaran and Yanshan Wang},
  title = {{Generative Foundation Model for Structured and Unstructured Electronic Health Records}},
  year = {2025},
  eprint = {2508.16054},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.16054},
}
Figure