InterGenEHR lets a clinician pin down the part of a patient they care about, either by setting values or by describing the case in plain language. A generative model then fills in the rest of the electronic health record around it, from a single bedside snapshot to a four-day VV-ECMO course.
clinicians who rated the generated trajectories, blinded to the model
01 · The problem
The case you want to test is rarely in the dataset
Suppose a model predicts outcomes for patients on venovenous extracorporeal membrane oxygenation (VV-ECMO), which supports patients in severe respiratory failure. It scores well on a held-out test set. A clinician then asks a narrower question. What does the model do for a patient whose PaCO₂ climbs from 50 to 80 mmHg over a day while pH falls to 7.20? Or for a patient being weaned off ECMO oxygen over two days?
Those are the cases that matter at the bedside. They are also the ones a retrospective cohort holds too few of. Building such a patient by hand is not realistic, because a VV-ECMO record has dozens of interacting blood-gas, ventilator, hemodynamic and laboratory values that move together over time. Change one number on its own and the result is usually a patient who could not exist.
We want to state only the part of the patient that defines the question, and have every other value filled in consistently, at a single time point or across the whole course.
02 · The idea
Hold fixed what the clinician specifies. Generate the rest.
InterGenEHR rests on one operation, arbitrary conditioning. Lay a patient's record out as a grid, with clinical variables as rows and hours as columns. The clinician marks the cells they care about and gives their values. A binary mask records which cells were specified. A conditional generative model samples every unmarked cell given the marked ones, and the marked cells are copied into the output unchanged.
A snapshotone time point · mask b ∈ {0,1}35
x̂ = xo + (1 − b) ⊙ x̂u
A trajectory24 hours · mask B ∈ {0,1}35×24
X̂ = Xo + (1 − B) ⊙ X̂u
specified by the clinician, kept exactlygenerated by the model
The same equation covers both cases: a snapshot is a single column of a trajectory. Which cells are specified can change from one request to the next, so a single trained model can answer many different clinical questions.
Everything else in the project follows from this. There are two ways to fill in the mask, a form for exact values or a sentence in plain language. There are two shapes of record, a snapshot or a trajectory. And the generator is a component you can swap out. Each request runs through the same loop:
DescribeSet values directly or write the scenario in plain language.
ConfirmConstraints are checked against a schema and plausible ranges, then confirmed by the clinician.
GenerateThe selected backbone keeps the confirmed cells fixed and samples the rest of the record.
Review & refineInspect several samples, tighten or relax constraints, and generate again.
03 · Demonstration
From one sentence to a patient course
Each tab below is a request from the clinician study. It shows the conditions that were held fixed, the mask they produce, and three trajectories generated by IGE-FGTI trained on the pooled Duke–Emory cohort. In each panel, a single straight line shared by all three samples is a specified condition. Lines that separate were generated.
Needs a second look
1Request
“VV-ECMO patient with worsening respiratory acidosis, increasing PaCO₂, and declining pH over the next 24 hours.”
2Held fixed
PaCO₂ 50 → 80 mmHg · h 0–24
pH 7.35 → 7.20 · h 0–24
3Mask
4What to look at
Bicarbonate was never specified. The Henderson–Hasselbalch equation gives HCO₃⁻ ≈ 30 mEq/L at pH 7.20 and PaCO₂ 80 mmHg. The generated samples drift upward toward roughly 28–32 mEq/L by hour 23. So the model fills in a related variable in a direction consistent with acid–base physiology, while the three patients still differ from one another.
PaCO₂ and pH are held fixed. End-tidal CO₂ and HCO₃⁻ are generated.
1Request
“VV-ECMO patient demonstrating gradual recovery with improving oxygenation, decreasing FiO₂ requirements, and readiness for ECMO weaning over 72 hours.”
2Held fixed
SaO₂ 70 → 95 % · h 0–72
O₂ flow 15 → 0 L/min · h 24–72
3Mask
4What to look at
The conditions cover only part of the timeline. Before hour 24 and after hour 72 the model generates O₂ flow and SaO₂ itself, and those generated segments join the fixed taper without a jump. Over the same course, PaO₂ and the P/F ratio rise in all three samples although neither was specified.
Fixed segments can cover only part of the timeline. The model fills in the hours before and after them.
1Request
“Severe ARDS patient on VV-ECMO with gradually improving oxygenation over 48 hours.”
2Held fixed
SaO₂ 60 → 95 % · h 0–48
3Mask
4What to look at
Only one variable is fixed, yet PaO₂, SpO₂ and the PaO₂-based P/F ratio all improve with it, most clearly over the final hours. ECMO O₂ flow differs between the three patients but stays steady within each one.
One fixed variable (SaO₂). The other oxygenation measures follow it.
1Request
“VV-ECMO patient with persistent refractory hypoxemia despite high ECMO support and stable ventilator settings.”
2Held fixed
SaO₂ 85 → 70 % · h 0–96
3Mask
4What to look at
This is the mirror image of the previous case. With SaO₂ falling, the generated PaO₂ drifts down over four days and the P/F ratios stay low, at roughly 150–250. The three samples reach that state along different paths.
The same conditioning mechanism, specified in the opposite direction.
1Request
“VV-ECMO patient with suspected hemolysis, showing progressively increasing lactate dehydrogenase, decreasing hemoglobin, and stable respiratory function.”
2Held fixed
LDH 100 → 500 U/L · h 0–96
Hemoglobin 12 → 8 g/dL · h 0–96
3Mask
4What to look at
“Stable respiratory function” was not turned into a constraint, and the generated SpO₂ stays stable anyway. Total bilirubin, which a clinician might expect to rise with hemolysis, mostly stays flat apart from a transient spike in one sample. A reviewer could add a rising bilirubin condition and generate again.
Two laboratory trends held fixed. Bilirubin and SpO₂ are generated.
1Request
“VV-ECMO patient with improving carbon dioxide clearance, gradually decreasing sweep gas requirements, and normalization of acid–base status over 48 hours.”
2Held fixed
End-tidal CO₂ 50 → 40 mmHg · h 0–48
3Mask
4What to look at
The request asks for acid–base status to normalize. The generated pH stays near 7.33–7.42 and HCO₃⁻ near 23–30 mEq/L, both close to normal. PaCO₂ fluctuates around 40–50 mmHg and does not clearly follow the falling end-tidal CO₂. A reviewer judging how well the samples express “improving clearance” would have this to weigh.
End-tidal CO₂ is held fixed. The blood gases are generated.
1Request
“VV-ECMO patient with stable respiratory mechanics and oxygenation but progressive thrombocytopenia and laboratory abnormalities suggestive of ECMO-related complications.”
2Held fixed
Platelet count 50 → 20 ×10³/µL · h 0–96
3Mask
4What to look at
Only the platelet count is held fixed. Hemoglobin, INR and fibrinogen are generated for all 96 hours, and each of the three patients has its own coagulation picture. SpO₂ stays stable, as the request asked.
One hematologic trend held fixed. The coagulation panel is generated.
1Request
“VV-ECMO patient with progressive metabolic acidosis characterized by rising lactate and increasingly negative base excess while oxygenation remains stable.”
2Held fixed
Lactic acid 1 → 8 mmol/L · h 0–96
Base excess −12 → −30 mEq/L · h 0–96
3Mask
4Why it needs a second look
The generated HCO₃⁻ (≈25–32 mEq/L) and pH (≈7.35–7.43) look normal, and they do not fit the fixed base excess. Using the base-excess relation from our consistency checks (BE = 0.9287·HCO₃⁻ + 13.77·pH − 124.58), those values imply a base excess of about +2, not −30. Each curve looks possible on its own, but the patient as a whole is internally inconsistent. The fix is to refine the request, for example by also constraining pH or HCO₃⁻, which is what the review step is for.
Each variable looks plausible on its own, but they do not agree with each other. This is the kind of error the review step needs to catch.
1Request
“VV-ECMO patient who develops sudden oxygenation deterioration requiring increased ECMO flow and ventilator support over the next 12 hours.”
2Held fixed
O₂ flow 20 → 40 L/min · h 0–12
3Mask
4Why it needs a second look
The conditions encode the clinical response (more ECMO O₂ flow), not the deterioration itself. Nothing about oxygenation was fixed. In the result, SaO₂ stays at 95–97.5 %, and PaO₂ rises in one sample and falls in another. The trajectories are physiologically possible but do not clearly show the requested event. This gap between “possible” and “what was asked for” also appears in the clinician ratings below. Adding a falling SaO₂ or PaO₂ condition makes the request explicit.
Possible, but not a clear deterioration. Conditioning on the treatment does not force the event it is a response to.
held fixedgenerated · plotted on the rightgenerated · not plotted
The panels come from the project's scenario figures. Each request was parsed into conditions and three samples were drawn. The conditions listed are those visible as fixed lines in the plots. The “what to look at” notes are our own reading of the figures and are not clinician ratings. The two cases under “Needs a second look” were chosen because they show how the output can fail.
04 · Two ways in
A form for exact values, a sentence for everything else
Both entry points produce the same thing, a validated list of conditions that becomes the mask. They are two front ends to one generator.
Edit values directlyExact control over one time point
The web editor. Choose a patient and time point, change a variable such as bicarbonate, and the model reconstructs the rest of the state. Bars compare each variable's original value (blue) with the reconstruction (orange).
Describe the scenarioFor conditions that span many hours
A worked example from the prompt template. A language model translates the sentence into a structured specification. It never produces the numbers in the patient record itself.
The language model only translates
The parser has one narrow job: map clinical language onto the 35 supported variables, their units and their ranges, and record each condition as a value, a range or a trend over a time window. Concepts the system cannot model are not dropped silently. Requests for PEEP, plateau pressure or urine output, for example, are listed under unsupported_facts. Values outside the feature dictionary are flagged. In one example, the parser produced a creatinine of 150 mg/dL against a dictionary limit of 20. Nothing is generated until a clinician confirms or edits the parsed conditions, and the parser can be skipped entirely.
Slot-level F1 for parsing clinician requests, by language model (direct few-shot prompting; higher is better)
Two findings stand out. First, worked examples matter more than formatting: zero-shot Gemma 3 4B produced 100 % valid, schema-compliant JSON but reached a slot F1 of only 0.74, against 0.97 with examples. Valid JSON does not mean the request was understood. Second, biomedical tuning did not help: MedAlpaca 7B often failed to produce parseable output. Adding an expert role or step-by-step instructions did not beat plain few-shot prompting.
The generator is a plug-in
Any model that can sample missing entries given observed ones and a mask can serve as the generator. We connect six established backbones to the same interface, and they do not share one winner:
Record shape
Backbone
Where it led in our evaluation
Snapshot
VAEAC VAE · arbitrary conditioning
Most accurate at reconstructing hidden values (imputation MSE 0.29)
PMVAE VAE · posterior matching
Most accurate when clinicians perturb inputs; best mortality AUROC with LR and GBDT
TabDDPM diffusion
Closest per-feature values in free generation (lowest RMSPE and MAPE)
Trajectory
CSDI diffusion · 2-D attention
Best marginal distributions; hardest to tell apart from real sequences
FGTI diffusion · frequency-aware
Best preservation of correlations between variables; best trajectory imputation
MTSCI diffusion · consistency
Best preservation of correlations across time
The choice depends on what the scenario has to get right. If a test hinges on how variables relate at one moment, choose differently than if it hinges on how a patient evolves over time.
05 · Evidence
Four questions to ask of a generated patient
We evaluate on 874 adult VV-ECMO patients, 691 from Duke (2016–2024) and 183 from Emory (2015–2021). Records are summarized into hourly steps using 4-hour windows. Each test below answers a different question, and none of them is enough alone.
Q1
Does it keep what was asked, and obey known physiology?
Specified values come back exactly, by construction. The harder test is the values that were not specified. We check three standard equations: Henderson–Hasselbalch, the base-excess relation and the Severinghaus oxygen-dissociation curve. When only pH is fixed, IGE-PMVAE generates base excess and SpO₂ that deviate from those equations by MAE 1.64 and 2.29. Real records show 1.61 and 2.72 because of measurement noise.
Q2
Does it look like real data?
A two-layer LSTM trained to separate real from synthetic trajectories reaches 63 % accuracy on IGE-CSDI output, where 50 % would be chance. CSDI also has the lowest Kolmogorov–Smirnov distance (0.237). FGTI keeps the correlations between variables best, and MTSCI keeps the correlations across time best. No single model wins every measure.
Q3
Does it carry real predictive signal?
Train a mortality classifier only on synthetic patients, then test it on real ones. With an MLP, IGE-PMVAE and EHRDiff come within 0.003 AUROC of a model trained on real data, and their confidence intervals include zero.
Q4
Do clinicians find it credible?
Four clinicians rated IGE-FGTI trajectories for ten requested scenarios, in random order and without knowing the generating model. Mean scores ranged from 3.68 to 4.20 out of 5. Raters' scores fell within one point of each other in 87–93 % of pairs.
Train on synthetic, test on real: in-hospital mortality AUROC relative to training on real data (MLP · mean ± 95 % CI · 0 = same as real)
Intervals that include zero mean the classifier could not be distinguished from one trained on real data. This is not a formal equivalence test. With logistic regression and boosted trees, IGE-PMVAE has the highest mean AUROC among the synthetic sources.
Clinician ratings of generated trajectories (1–5, higher is better · mean ± reported spread)
Clinicians rated whether a trajectory could happen more highly than whether it matches the scenario that was requested. The oxygenation-deterioration example in the demo above shows how that can happen. Closing this gap is a large part of the remaining work.All numbers: tables from the papers
Longitudinal fidelity (lower is better; ± 95 % bootstrap CI half-widths).
Metric
IGE-CSDI
IGE-FGTI
IGE-MTSCI
KS statistic
0.2374 ± 0.0075
0.2393 ± 0.0139
0.3430 ± 0.0069
TV distance
0.3108 ± 0.0233
0.3157 ± 0.0171
0.4097 ± 0.0323
Detection accuracy
0.6338 ± 0.1180
0.6901 ± 0.1862
0.8732 ± 0.0807
Inter-feature corr. diff. (DPCM)
5.8983 ± 0.1464
3.9664 ± 0.1690
6.3826 ± 0.1130
Temporal corr. diff. (DCSM)
7.8984 ± 0.0842
7.8830 ± 0.0284
7.4248 ± 0.1881
Imputation MSE (50 % masked)
0.0478 ± 0.0120
0.0322 ± 0.0119
0.0570 ± 0.0107
Single-time-point generation (lower is better). Fidelity is free generation; perturbation fixes clinician-modified inputs; imputation hides 50 % of features.
Method
Fidelity RMSPE
Fidelity MMD
Perturbation RMSPE
Imputation MSE
VAE
10.96
34.69
3.70
1.448
CTGAN
15.61
26.28
—
—
EHRDiff
11.26
33.59
3.58
1.414
TabDiff
11.98
22.52
5.50
1.286
IGE-PMVAE
13.63
23.21
2.35
0.423
IGE-VAEAC
42.69
136.28
10.20
0.292
IGE-TabDDPM
8.44
33.01
8.59
0.896
Clinician evaluation, four raters, ten scenarios. Agreement columns compare all six rater pairs.
Question
Score
Exact agreement
Within 1 point
Clinical plausibility
4.10 ± 0.59
51.7 %
91.7 %
Internal physiological consistency
3.90 ± 0.63
43.3 %
86.7 %
Representative of requested scenario
3.80 ± 0.61
53.3 %
93.3 %
Physiological possibility
4.20 ± 0.65
38.3 %
93.3 %
Agreement with requested scenario
3.68 ± 0.62
46.7 %
91.7 %
06 · Limits
What a generated patient is not
Not a counterfactual. The generators learn statistical associations from observational records. Fixing a treatment variable does not predict what that treatment would do.
Not self-checking. As the metabolic-acidosis example shows, a sample can satisfy its conditions and look plausible variable by variable, yet still be inconsistent as a whole. Clinician review is part of the method.
Not yet general. All results are for VV-ECMO, and the pooled cohort is weighted toward Duke patients. We have not tested on a hospital the models never saw, or in other clinical settings.
The open question is concrete: when does a clinician-guided generator produce test scenarios that are useful and coherent, and how can its failures be made visible before anyone relies on them?
07 · How the project grew
Publications
2025 · IEEE BHI also at the NeurIPS 2025 Workshop on GenAI for Health
An Interactive Framework for Generating Clinical Data with Human Feedback
Yu Yang*, Jiafeng Song*, Zhishuai Liu, Henry P. Foote, Rishikesan Kamaleswaran, Pan Xu
Introduced the conditioning interface and the interactive web editor for single time points, with VAE-based backbones, on 184 Emory VV-ECMO patients and 41 variables.
@inproceedings{yang2025interactive,
title = {An interactive framework for generating clinical data with human feedback},
author = {Yang, Yu and Song, Jiafeng and Liu, Zhishuai and Foote, Henry and Kamaleswaran, Rishikesan and Xu, Pan},
year = 2025,
booktitle = {2025 IEEE EMBS International Conference on Biomedical and Health Informatics (BHI)},
pages = {1--7},
organization = {IEEE}
}
2026 · IEEE Transactions on Biomedical Engineering accepted
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 Xu
Extended the interface to plain-language requests and to masks over both variables and time, added diffusion backbones, and evaluated on 874 Duke and Emory patients, including the clinician study.
Paper link coming soon ·
@article{yang2026intergenehrplus,
title = {{InterGenEHR}$^+$: An Interactive Framework for Natural Language-Conditioned Generation of Longitudinal Patient Trajectories},
author = {Yang, Yu and Song, Jiafeng and Abed, Baraa F and Creel, Christina and Dave, Sagar B and Foote, Henry and Lima, Lisa and Moas, Victor and Jabaley, Craig S and Kamaleswaran, Rishikesan and Xu, Pan},
journal = {IEEE Transactions on Biomedical Engineering},
year = 2026,
note = {Accepted}
}
* Equal contribution. A collaboration between Duke University (Biostatistics & Bioinformatics, Electrical & Computer Engineering, Biomedical Engineering, Surgery, Pediatrics) and Emory University School of Medicine (Emergency Medicine, Anesthesiology).