Generating Multi-Table Time Series EHR from Latent Space with Minimal Preprocessing

Eunbyeol Cho, Jiyoun Kim, Minjae Lee, Sungjin Park, Edward Choi

Abstract

Synthesizing high-fidelity Electronic Health Records (EHR) is critical for medical AI research due to strict privacy constraints. However, existing generation methods often rely on lossy preprocessing and manual feature selection, which limits the utility of the resulting data. We present RawMed, a framework that synthesizes complex, multi-table time-series EHRs that closely mirror the structure and values of raw databases. By combining text-based encoding with neural compression via Residual Quantization (RQ) and a temporal transformer, RawMed generates high-fidelity synthetic data that preserves clinical utility and patient privacy without requiring expert-driven feature engineering.

Introduction

The development of medical AI is frequently hindered by the sensitive nature of Electronic Health Records (EHRs). While synthetic data generation is a promising alternative, current approaches face two primary bottlenecks: a heavy reliance on expert-driven feature selection and lossy preprocessing techniques like value binning or temporal aggregation. These constraints often result in synthetic datasets that lack the granularity required for diverse downstream tasks. RawMed addresses these challenges by generating synthetic EHRs that preserve the original relational database structure and precise values with minimal preprocessing.

Methodology

RawMed treats EHR synthesis as a language modeling task within a compressed latent space. The framework consists of several key components:

  1. Text-based Representation: Instead of complex vectorization, RawMed converts each row of a database table into a text string. This allows the model to handle any database schema and preserve original values.
  2. Residual Quantization (RQ): To manage the extreme length of textualized EHRs, RawMed uses an encoder to map strings into a latent space, followed by RQ. Unlike standard Vector Quantization, RQ better preserves the distribution of independent numerical columns by decomposing latent vectors into multiple components.
  3. TempoTransformer: A Transformer-based architecture autoregressively predicts subsequent compressed event codes and high-precision timestamps, which are tokenized into individual digits to better capture clinical timing.
  4. Post-processing Pipeline: A two-stage verification process ensures the generated text maps back to valid, chronologically consistent relational tables.
Comparison of the RawMed approach versus traditional lossy preprocessing methods.

Experimental Setup

The model was validated using two major open-source benchmarks, MIMIC-IV and eICU, as well as MIMIC-IV-ED for generalizability testing. The authors focused on three core time-series tables: laboratory tests, prescriptions, and input events (infusions). Modeling in the compressed latent space reduced sequence lengths by up to 84% compared to raw text modeling, making long patient trajectories computationally feasible.

Results and Discussion

RawMed significantly outperformed existing baselines, including SDV, RC-TGAN, and ClavaDDPM, across several critical dimensions:

Clinical Utility: On 11 different clinical prediction tasks, models trained on RawMed data achieved an average AUROC of ~0.87, which is remarkably close to the 0.90 achieved with real data. In contrast, baselines struggled, often scoring between 0.46 and 0.68.

Clinical utility evaluation on MIMIC-IV and eICU datasets showing RawMed's performance relative to real data and baselines.

Temporal Fidelity and Privacy: RawMed excelled at replicating the "Time Gap" between events, achieving a Kolmogorov-Smirnov (KS) statistic of 0.01–0.03, compared to 0.41–0.76 for baselines. Furthermore, Membership Inference Attack (MIA) results showed accuracy near 0.5 (random guessing), suggesting the synthetic data does not leak the identity of real patients from the training set.

Conclusion

RawMed represents a significant advancement in EHR synthesis by enabling the generation of raw-structured, multi-table data with minimal manual intervention. While currently focused on three primary tables, future work will explore scaling the framework to handle the full complexity of EHR databases and integrating static patient features more deeply into the conditional generation process.

Summary updated

BibTeX
@inproceedings{cho2025generating,
  author = {Eunbyeol Cho and Jiyoun Kim and Minjae Lee and Sungjin Park and Edward Choi},
  title = {{Generating Multi-Table Time Series EHR from Latent Space with Minimal Preprocessing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=k5TbfYPYuc},
}
Figure