SynEHR: Joint Modeling Inter-visit Temporal Evolution and Intra-visit Clinical Structure for Longitudinal EHR Synthesis
Organizations: Florida State University Tallahassee, Florida, United States
Abstract
Longitudinal electronic health records (EHRs) document patients' sequences of clinical visits over time, preserving the temporal evolution of disease progression and care delivery. However, real longitudinal EHRs are difficult to access because they contain large amounts of fine-grained, patient-specific information. Synthetic EHR generation therefore provides a valuable approach for preserving the statistical patterns and clinical structure of patient visit trajectories, enabling broader modeling and analysis when real records are limited. Although recent generative models have made progress in producing future visit sequences, they remain limited in explicitly integrating inter-visit irregular temporal evolution and intra-visit clinical event structures in EHRs, leading to clinically inconsistent and temporally unrealistic visit sequences. In this work, we propose SynEHR, a lightweight adaptive LLM-based framework for longitudinal EHR synthesis. There are two novel designs in SynEHR, i.e., a Temporal State Conditioning Module captures irregular temporal states across visits and a Temporal-Relational Adaptation Module combines these states with patient history to dynamically construct patient-specific relational representations. SynEHR then builds on a parameter-efficient LoRA-adapted language-model generator with next-visit generation capability to train the two modules for temporally and clinically informed generation. Extensive experiments on real-world EHR datasets across fidelity, privacy, and downstream utility evaluations demonstrate that SynEHR outperforms state-of-the-art models by generating more clinically coherent and temporally faithful longitudinal EHR data.
Figures & tables
| MIMIC-III | MIMIC-IV | ||
|---|---|---|---|
| Total Patients | 1,795 | Total Patients | 56,028 |
| Total Visits | 7,274 | Total Visits | 334,391 |
| Diagnosis | 3,366 | Diagnosis | 24,062 |
| Medications | 2,363 | Medications | 4,479 |
| Lab Items | 633 | Lab Items | 893 |
| Procedure | 1,019 | Procedure | 12,218 |
| Dataset | Data Type | Metric | MLP | BEHRT | medGAN | SynTEG | EVA | TWIN | TabDDPM | MedDiff | ScoEHR | EHRPD | PromptEHR | HALO | HiSGT | EHR2Path | SynEHR-L3.1 | SynEHR-Q2.5 | SynEHR-Q3 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MIMIC-III | Diagnosis | LPL | 318.74 | 96.42 | 236.48 | 35.76 | 28.94 | 26.11 | 111.27 | 651.38 | 672.44 | 16.42 | 72.84 | 88.57 | 39.86 | 15.73 | 16.18 | 15.61 | 15.34 |
| MPL | 305.86 | 91.35 | 224.17 | 33.94 | 27.48 | 24.96 | 103.84 | 629.57 | 648.63 | 15.51 | 68.71 | 81.42 | 37.24 | 15.63 | 15.88 | 15.54 | 15.46 | ||
| Medication | LPL | 541.28 | 148.73 | 394.67 | 74.68 | 41.52 | 39.36 | 182.54 | 918.63 | 921.46 | 20.46 | 88.34 | 96.18 | 63.92 | 18.96 | 19.48 | 18.81 | 18.39 | |
| MPL | 508.46 | 142.51 | 376.42 | 71.93 | 39.68 | 38.12 | 169.87 | 887.14 | 896.85 | 18.74 | 81.57 | 89.33 | 60.85 | 18.91 | 19.02 | 18.83 | 18.79 | ||
| Lab Item | LPL | 162.47 | 48.37 | 79.84 | 24.96 | 18.74 | 16.91 | 56.48 | 401.92 | 419.35 | 15.08 | 39.46 | 84.72 | 22.41 | 14.51 | 14.88 | 14.63 | 14.57 | |
| MPL | 154.32 | 45.82 | 74.19 | 23.41 | 17.82 | 16.36 | 51.27 | 388.16 | 402.84 | 14.22 | 35.78 | 76.39 | 21.08 | 14.37 | 14.58 | 14.31 | 14.41 |
| Dataset | Statistic | MLP | BEHRT | medGAN | SynTEG | EVA | TWIN | TabDDPM | MedDiff | ScoEHR | EHRPD | PromptEHR | HALO | HiSGT | EHR2Path | SynEHR-L3.1 | SynEHR-Q2.5 | SynEHR-Q3 |
| MIMIC-III | Diagnosis Code Freq. | 0.346 | 0.186 | 0.337 | 0.378 | 0.274 | 0.290 | 0.152 | 0.134 | 0.180 | 0.228 | 0.224 | 0.361 | 0.229 | 0.042 | 0.079 | 0.146 | 0.129 |
| Medication Code Freq. | 0.379 | 0.201 | 0.415 | 0.291 | 0.334 | 0.241 | 0.192 | 0.190 | 0.231 | 0.255 | 0.229 | 0.329 | 0.234 | 0.138 | 0.176 | 0.187 | 0.181 | |
| Lab Item Code Freq. | 0.038 | 0.095 | 0.047 | 0.047 | 0.014 | 0.152 | 0.113 | 0.201 | 0.241 | 0.248 | 0.162 | 0.057 | 0.065 | 0.024 | 0.013 | 0.021 | 0.023 | |
| Procedure Code Freq. | 0.430 | 0.301 | 0.298 | 0.494 | 0.283 | 0.360 | 0.148 | 0.199 | 0.241 | 0.262 | 0.258 | 0.401 | 0.331 | 0.111 | 0.106 | 0.168 | 0.141 | |
| Visit Length | 0.193 | 0.266 | 0.662 | 0.632 | 0.116 | 0.268 | 0.046 | 0.425 | 0.371 | 0.559 | 0.224 | 0.662 | 0.040 | 0.640 | 0.017 | 0.034 | 0.029 | |
| Inter-visit Time | 0.250 | 0.227 | 0.274 | 0.332 | 0.371 | 0.171 | 0.055 | 0.071 | 0.090 | 0.193 | 0.243 | 0.274 | 0.159 | 0.271 | 0.049 | 0.068 | 0.061 |
| Approach | 10% | 20% | 35% | 50% |
|---|---|---|---|---|
| MLP | 13.47 [13.43, 13.48] | 13.29 [13.17, 13.33] | 13.08 [12.96, 13.28] | 13.12 [12.97, 13.26] |
| BEHRT | 13.58 [13.55, 13.62] | 13.44 [13.25, 13.62] | 13.19 [13.09, 13.34] | 13.27 [13.17, 13.36] |
| medGAN | 16.94 [16.78, 17.04] | 17.11 [16.92, 17.13] | 17.43 [17.33, 17.55] | 17.67 [17.47, 17.73] |
| SynTEG | 13.18 [13.02, 13.36] | 12.98 [12.78, 13.00] | 12.76 [12.68, 12.89] | 12.81 [12.75, 12.97] |
| EVA | 13.31 [13.21, 13.33] | 13.12 [13.11, 13.17] | 12.88 [12.84, 12.99] | 13.28 [13.22, 13.39] |
| TWIN | 13.29 [13.21, 13.45] | 13.14 [13.02, 13.29] | 12.86 [12.72, 13.05] | 12.91 [12.74, 13.07] |
| Model | ARF | Shock | Mortality | Avg. |
|---|---|---|---|---|
| MLP | 0.690 / 0.318 | 0.652 / 0.236 | 0.701 / 0.207 | 0.681 / 0.254 |
| BEHRT | 0.716 / 0.347 | 0.674 / 0.258 | 0.732 / 0.230 | 0.707 / 0.278 |
| medGAN | 0.648 / 0.283 | 0.615 / 0.198 | 0.666 / 0.178 | 0.643 / 0.220 |
| SynTEG | 0.673 / 0.302 | 0.637 / 0.216 | 0.688 / 0.190 | 0.666 / 0.236 |
| EVA | 0.692 / 0.324 | 0.655 / 0.236 | 0.708 / 0.215 | 0.685 / 0.258 |
| TWIN | 0.706 / 0.337 | 0.671 / 0.258 | 0.723 / 0.225 | 0.700 / 0.273 |
| Model | Macro-F1 | MAE | NLL | Brier | ECE |
|---|---|---|---|---|---|
| MLP | 0.287 | 178.6 | 1.070 | 0.558 | 0.148 |
| BEHRT | 0.319 | 169.4 | 1.018 | 0.523 | 0.126 |
| medGAN | 0.254 | 191.8 | 1.128 | 0.606 | 0.173 |
| SynTEG | 0.276 | 184.7 | 1.091 | 0.582 | 0.157 |
| EVA | 0.291 | 177.2 | 1.058 | 0.552 | 0.139 |
| TWIN | 0.303 | 173.5 | 1.039 | 0.538 | 0.132 |
| Variant | Avg. LPL | Avg. MPL | Inter-visit Time JSD | ARF AUROC | Shock AUROC | Mortality AUROC |
|---|---|---|---|---|---|---|
| SynEHR | 16.03 | 16.01 | 0.059 | 0.827 | 0.791 | 0.838 |
| SynEHR w/o TSCM | 17.64 | 16.94 | 0.113 | 0.798 | 0.753 | 0.812 |
| SynEHR w/o TRAM | 17.02 | 18.25 | 0.078 | 0.791 | 0.745 | 0.805 |
| SynEHR w/o Static Branch | 16.70 | 16.78 | 0.071 | 0.815 | 0.781 | 0.823 |
| SynEHR w/o Dynamic Branch | 17.14 | 17.24 | 0.096 | 0.806 | 0.762 | 0.819 |
| SynEHR w/o Confidence-Aware Fusion | 16.44 | 16.48 | 0.068 | 0.819 | 0.784 | 0.831 |
Synthetic Data Generation
Synthetic data generation creates artificial examples, simulations, and datasets to train, test, or protect machine-learning systems.
See all 620 papers