InterGenEHR$^+$: An Interactive Framework for Natural Language-Conditioned Generation of Longitudinal Patient Trajectories

Yu Yang, Jiafeng Song, Baraa F Abed, Christina Creel, Sagar B Dave, Henry Foote, Lisa Lima, Victor Moas, Craig S Jabaley, Rishikesan Kamaleswaran, Pan XuarXiv 2026 · DOI

TL;DR

How do you safely stress-test a hospital AI on a rare, life-threatening crisis if you barely have any real patient records of that crisis? InterGenEHR$^+$ lets doctors simply type out a clinical "what-if" scenario in plain English—like "severe lung injury, improving oxygenation over 48 hours, lactate under 2"—and generates realistic, hour-by-hour synthetic patient histories on demand. By pairing a language model translator with specialized time-series generative models, it gives engineers and clinicians a safe flight simulator for critical care algorithms.

What Problem Does This Paper Address?

In intensive care units (ICUs), machine learning models help predict patient risk and guide treatments. However, testing how these models behave in rare, high-stakes scenarios is tough because real Electronic Health Record (EHR) data for edge cases is scarce. Think of patients on VV-ECMO—a form of life support that pumps and oxygenates blood outside the body when the lungs fail completely. Cohorts are small, and patient states are wildly complex.

Synthetic data generators exist, and an earlier version of this tool (InterGenEHR) let doctors dial in specific lab values to generate fake records. Two big hurdles remained:

  1. Manual tedium: Specifying exact numerical constraints across dozens of variables is exhausting for clinicians.
  2. Snapshots vs. movies: Most conditional EHR generators only create a static snapshot at a single point in time, ignoring how physiology evolves hour by hour.

Methods

InterGenEHR$^+$ bridges plain clinical language and longitudinal math without letting a Large Language Model (LLM) hallucinate actual medical numbers.

Overview of the InterGenEHR+ pipeline, from natural language parsing to masked diffusion generation and synthetic trajectory output.

Here is how the pipeline works:

  • 1. The Optional LLM Parser (New): A clinician types a scenario in plain text (or enters constraints directly). An LLM maps this text into a strict JSON schema grounded in a dictionary of valid variables, units, and physiological ranges. Crucially, the system flags out-of-bounds numbers or ambiguities and requires human-in-the-loop confirmation before generating a single data point.
  • 2. Arbitrary Masking Across Time (New Extension): Confirmed constraints are converted into observed values alongside a binary "feature-by-time" mask ($B$). Entries marked 1 stay locked to the doctor's specifications; entries marked 0 are left for the generative model to fill in.
  • 3. Conditional Generative Backbones (Standard Models, Unified Interface): Instead of inventing a new generator from scratch, the authors wire established conditional imputation architectures into their adapter:
  • Single-time-point: Variational Autoencoders (VAEAC, PMVAE) and tabular diffusion (TabDDPM).
  • Longitudinal trajectories: Time-series diffusion models that capture different physiological rhythms—CSDI (2D spatiotemporal attention), FGTI (frequency-aware spectral modeling), and MTSCI (segment-consistent imputation).

Datasets

  • Multi-Institutional VV-ECMO Cohort: Pooled real-world ICU data from 874 adult patients on VV-ECMO across two academic centers—Duke University (691 patients, 2016–2024) and Emory University (183 patients, 2015–2021). Using a 4-hour sliding window with a 1-hour step size, this yielded 388,689 timestamps across 35 physiological features (vitals, ventilator settings, labs, and sedation scores).
  • Clinical Utterance Benchmark (Newly Curated): A benchmark of clinician natural-language requests paired with gold-standard JSON schemas to test LLM parsing accuracy across prompting styles and temperatures.

Key Insights and Ideas

  • Use LLMs as translators, not calculators: Asking an LLM to directly invent tabular lab trajectories invites subtle physiological nonsense. Restricting the LLM to semantic parsing—guarded by JSON schema validation and clinician sign-off—harnesses its language fluency while leaving numerical correlation to diffusion and VAE models.
  • Examples beat step-by-step lectures for parsing: When configuring the LLM parser, simple few-shot prompting (showing labeled examples) achieved higher accuracy and fewer "spurious slots" (invented constraints) than complex stepwise instructions.
  • No single generative architecture rules them all:
  • In single-step tasks, diffusion (IGE-TabDDPM) nails overall population statistics, whereas posterior matching (IGE-PMVAE) handles manual clinician "perturbations" better because it explicitly aligns partial and complete latent states.
  • In time-series generation, IGE-FGTI wins at preserving cross-feature relationships and filling in missing gaps—its frequency-domain approach naturally syncs up physiological signals oscillating at different speeds.
  • Conditioning enforces laws of physiology: Standard unconditional generators frequently violate deterministic medical equations (like the Henderson-Hasselbalch acid-base balance). Conditioning on even a single variable (e.g., pH) pulls related variables into realistic physiological alignment.

Key Results

  • LLM Parsing: Gemma 3 4B with few-shot prompting delivered the strongest prompt-to-JSON parsing performance while keeping spurious slot rates low.
  • Statistical Fidelity & Imputation:
  • Single-time-point: IGE-TabDDPM achieved the lowest error on unnormalized synthetic data (MAPE of 4.81%), while IGE-PMVAE led under manual feature perturbation (MAPE of 1.55%).
  • Longitudinal: IGE-CSDI produced trajectories hardest for an LSTM discriminator to tell apart from real data (KS statistic 0.2374, Detection Score 0.1338). IGE-FGTI dominated 50%-missing longitudinal imputation (MSE 0.0322, NLL -2.1719).
  • Clinician Blind Review: Four independent critical-care clinicians rated trajectories across 10 complex ICU scenarios on a 1–5 scale. Mean scores hit 4.20 for physiological possibility and 4.10 for clinical plausibility, with raters agreeing within 1 point 86.7% to 93.3% of the time.
  • Downstream Utility ("Train on Synthetic, Test on Real"): Classifiers trained purely on scenario-conditioned synthetic cohorts predicted real in-hospital mortality effectively, with an MLP reaching an AUROC of 0.7638 (IGE-CSDI) and 0.7631 (IGE-PMVAE).

Limitations and Future Work

  • Correlation is not causation: Synthetic trajectories reflect learned statistical patterns, not true mechanistic human physiology. They are built for stress-testing ML pipelines, not making bedside clinical decisions.
  • Institutional imbalance: Nearly 80% of the cohort comes from Duke (691 vs. 183 Emory patients), meaning generated trajectories likely skew toward Duke's clinical protocols.
  • Broader validation needed: Because evaluation focused exclusively on VV-ECMO patients, adapting and validating the feature dictionaries and models on larger, balanced external cohorts and other hospital settings remains future work.

Summary updated

Abstract

Objective: To develop and validate InterGenEHR$^+$, an interactive framework for natural language-conditioned generation of synthetic tabular electronic health records (EHRs) and longitudinal trajectories for scenario-based evaluation of machine learning models. Methods: An optional large language model (LLM) parser converts clinical requests into structured constraints. Conditional variational autoencoders and diffusion models generate single-time-point records, while diffusion models generate longitudinal trajectories. We evaluate parsing, distributional fidelity, imputation, clinical-constraint adherence, mortality prediction, and clinical plausibility using a multi-institutional cohort of 874 patients receiving venovenous extracorporeal membrane oxygenation (VV-ECMO). Results: Gemma 3 4B with few-shot prompting achieves the highest parsing performance with a low spurious slot rate. IGE-TabDDPM and IGE-PMVAE perform well in single-time-point generation; IGE-CSDI, IGE-FGTI, and IGE-MTSCI lead on different longitudinal fidelity metrics. Across five random seeds and three classifiers, synthetic cohorts retain predictive utility for mortality prediction on real test data. Clinician ratings support trajectory plausibility and alignment with requested scenarios. Conclusion: InterGenEHR$^+$ supports clinician-specified generation of EHR trajectories with statistical fidelity and downstream predictive utility in the evaluated VV-ECMO cohort. Extension to other clinical settings requires further validation. Significance: The framework supports scenario-based evaluation of machine learning models in data-sparse critical care settings.
BibTeX
@misc{yang2026intergenehr,
  author = {Yu Yang and Jiafeng Song and Baraa F Abed and Christina Creel and Sagar B Dave and Henry Foote and Lisa Lima and Victor Moas and Craig S Jabaley and Rishikesan Kamaleswaran and Pan Xu},
  title = {{InterGenEHR$^+$: An Interactive Framework for Natural Language-Conditioned Generation of Longitudinal Patient Trajectories}},
  year = {2026},
  eprint = {2611.33788},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.33788},
}
Figure