Accelerating Reproducible Research in Synthetic EHR Generation

Jalen Jiang, Chufan Gao, Ethan Rasmussen, Stephen Z. Xie, Jimeng SunarXiv 2026

TL;DR

This paper introduces a unified, end-to-end benchmarking framework built on PyHealth to standardize the training and evaluation of synthetic Electronic Health Record (EHR) generators. By scaling baselines to full-granularity clinical vocabularies, the authors expose a widespread failure of existing models to capture rare, long-tailed medical codes, while demonstrating that a simple GPT-2 baseline performs surprisingly well.

What Problem Does This Paper Address?

Sharing real Electronic Health Records (EHR) is heavily restricted due to vital privacy regulations like HIPAA. Synthetic data generation offers a promising alternative: creating artificial patient records that preserve the statistical properties of real data without leaking patient identities.

However, progress in this field is bottlenecked by a "reproducibility crisis." Existing generative models live in disjointed codebases with incompatible data loaders, conflicting library dependencies, and inconsistent evaluation protocols. Furthermore, researchers frequently truncate complex International Classification of Diseases (ICD) diagnosis codes to their first 3 digits to simplify modeling (reducing the vocabulary from ~7,000 to ~1,000 codes). This truncation hides a critical flaw: how poorly these models actually perform on rare, long-tailed clinical codes that are essential for precision medicine and identifying rare patient subtypes.

Methods

The authors present a lightweight, end-to-end pipeline spanning data ingestion, standardized model training, and architecture-agnostic evaluation built on top of the community-maintained PyHealth library.

To enable a true apples-to-apples comparison, the framework standardizes all synthetic outputs into a unified long-format schema (Subject ID, Visit ID, Code). The authors scale up and restore four prominent baselines to support the full ICD-9 vocabulary (6,955 codes):

  • MedGAN: Restored its original count-matrix support (omitted in previous PyTorch ports) to handle visit frequencies.
  • CorGAN: Extended from 6 to 8 convolutional layers to natively handle high-dimensional discrete outputs.
  • PromptEHR: Modified to use frequency-guided logit blending during sampling rather than augmenting real patient data, enhancing privacy.
  • HALO: A hierarchical transformer model optimized for full-vocabulary training.

Additionally, they introduce a standard, general-purpose GPT-2 baseline (configured with 8 layers and 8 attention heads) to see how specialized healthcare models stack up against standard sequence-modeling architectures.

For evaluation, they implement an architecture-agnostic suite including distance-based privacy attacks (Membership Inference Attacks and Nearest Neighbor Adversarial Accuracy Risk) and a machine learning discriminator-based fidelity score (using LSTMs for sequential models and Random Forests for flat models).

Different EHR data representations and the standardized long-format evaluation schema.

Datasets

The framework is evaluated using the widely-used MIMIC-III clinical database. The dataset was partitioned into 45,520 training patients for model optimization and 1,000 holdout patients reserved for privacy evaluation.

Key Insights and Ideas

  • Truncation Masks Failure: Evaluating models on full-granularity vocabularies reveals that every single generator's performance degrades sharply in the rarest deciles of the code distribution. Previous benchmarks using 3-digit truncation completely hid this "rare-code collapse."
  • The Flat vs. Sequential Trade-off: "Flat" matrix-based models (MedGAN, CorGAN) perfectly match marginal code prevalence but fail to capture complex, high-dimensional joint correlations and temporal structures, making them easy for a discriminator to detect. Sequential models capture joint probabilities and temporal dynamics much better but sacrifice some marginal alignment.
  • GPT-2 is Surprisingly Formidable: The lightweight, general-purpose GPT-2 baseline achieved the highest fidelity score among all sequential methods, proving that standard, well-tuned autoregressive transformers can outperform complex, domain-specific architectures.

Key Results

  • Fidelity: The GPT-2 baseline achieved the top Discriminative Score (0.3550), followed closely by HALO (0.3266) and PromptEHR (0.3241). Flat models like MedGAN (0.0560) performed poorly here, as discriminators easily distinguished their outputs from real data.
  • Utility & Vocabulary Coverage: HALO demonstrated the best capacity for capturing the long tail, achieving the highest vocabulary coverage (55.3%) and the lowest KL divergence (0.363). CorGAN suffered a total collapse on rare codes, managing only 21.1% coverage and an $R^2$ of 0.0 in rarer percentiles.
  • Privacy: All models successfully satisfied privacy constraints; Membership Inference Attack (MIA) accuracy hovered around 0.5 (equivalent to random guessing), indicating no significant memorization of training data.

Limitations and Future Work

  • Missing Baselines: Several recent diffusion-based models (e.g., EHRDiff, TimeDiff) and sequential models (ConSequence) were omitted due to the time-consuming nature of manual reimplementation.
  • High-Dimensional Sparsity: Current models still struggle significantly with the extreme long tail of medical codes; specialized algorithms are needed to stabilize rare code generation.
  • Data and Code Limitations: The current framework is anchored to the deprecated ICD-9 system and the MIMIC-III dataset. Future work must expand the pipeline to support ICD-10, PheCodes, DRG codes, and multimodal data types like labs, vitals, and demographics.

Summary updated

BibTeX
@misc{jiang2026accelerating,
  author = {Jalen Jiang and Chufan Gao and Ethan Rasmussen and Stephen Z. Xie and Jimeng Sun},
  title = {{Accelerating Reproducible Research in Synthetic EHR Generation}},
  year = {2026},
  eprint = {2606.06990},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.06990},
}
Figure