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

arXiv cs.AI Papers

Summary

InterGenEHR+ is an interactive framework using an optional LLM parser plus VAEs and diffusion models to generate natural language-conditioned synthetic longitudinal EHR trajectories for critically ill VV-ECMO patients, showing strong fidelity and downstream mortality-prediction utility.

arXiv:2611.33788v1 Announce Type: new 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.
Original Article
View Cached Full Text

Cached at: 11/27/26, 09:33 AM

# InterGenEHR+: An Interactive Framework for Natural Language-Conditioned Generation of Longitudinal Patient Trajectories
Source: [https://arxiv.org/html/2611.33788](https://arxiv.org/html/2611.33788)
Jiafeng Song\*Baraa F AbedChristina CreelSagar B DaveHenry FooteLisa LimaVictor MoasCraig S JabaleyRishikesan KamaleswaranPan Xu††thanks:\*Yu Yang and Jiafeng Song contributed equally to this work\.††thanks:Yu Yang is with the Department of Electrical and Computer Engineering, Duke University, Durham, NC \(e\-mail: yu\.yang@duke\.edu\)\.††thanks:Jiafeng Song is with the Department of Biomedical Engineering, Duke University, Durham, NC \(e\-mail: stuart\.song@duke\.edu\)\.††thanks:Baraa F Abed is with the Department of Electrical and Computer Engineering, Duke University, Durham, NC \(e\-mail: baraa\.abed@duke\.edu\)\.††thanks:Christina Creel is with the Department of Emergency Medicine, Emory University, Atlanta, GA \(e\-mail: maria\.christina\.creel\-bulos@emory\.edu\)\.††thanks:Sagar B Dave is with the Department of Emergency Medicine, Emory University, Atlanta, GA \(e\-mail: sagar\.bharat\.dave@emory\.edu\)\.††thanks:Henry Foote is with the Department of Pediatrics, Duke University, Durham, NC \(e\-mail: henry\.foote@duke\.edu\)\.††thanks:Lisa Lima is with the Department of Emergency Medicine, Emory University, Atlanta, GA \(e\-mail: lisa\.lima@emory\.edu\)\.††thanks:Victor Moas is with the Department of Surgery, Duke University, Durham, NC \(e\-mail: victor\.moas@duke\.edu\)\.††thanks:Craig S Jabaley is with the Department of Anesthesiology, Emory University, Atlanta, GA \(e\-mail: csjabaley@emory\.edu\)\.††thanks:Rishikesan Kamaleswaran is with the Department of Surgery, Duke University, Durham, NC \(e\-mail: r\.kamaleswaran@duke\.edu\)\.††thanks:Pan Xu is with the Department of Biostatistics and Bioinformatics, Duke University, Durham, NC \(e\-mail: pan\.xu@duke\.edu\)\.

###### Abstract

Objective:To develop and validate InterGenEHR\+, an interactive framework for natural language–conditioned generation of synthetic tabular data and longitudinal EHR trajectories for critically ill patients requiring mechanical ventilation and venovenous extracorporeal membrane oxygenation \(VV\-ECMO\), enabling scenario\-based evaluation of machine learning models in high\-risk cohorts\.Methods:InterGenEHR\+uses an optional large language model \(LLM\) parser for text\-driven input\. For single\-time\-point generation, we integrate variational autoencoders \(VAEs\) and diffusion models conditioned on observed variables\. Multiple diffusion architectures support conditional longitudinal generation\. The framework is evaluated on a multi\-institutional VV\-ECMO cohort of 874 patients using distributional fidelity metrics, imputation accuracy, adherence to clinical constraints, downstream mortality prediction tasks, and clinician evaluation\.Results:Gemma 3 4B with few\-shot prompting achieves the best performance in parsing clinician prompts while maintaining a low spurious slot rate\. The experimental results demonstrate strengths across IGE variants: IGE\-TabDDPM and IGE\-PMVAE show strong performance in single\-time\-point generation, whereas IGE\-CSDI, IGE\-FGTI, and IGE\-MTSCI achieve the best performance on different longitudinal fidelity metrics\. In downstream evaluations across five random seeds and three classifiers, models trained on synthetic cohorts retain predictive utility for mortality prediction on real test data\. Clinician ratings further indicate that the generated trajectories are clinically plausible and consistent with the requested scenarios\.Conclusion:InterGenEHR\+enables clinician\-specified conditional generation of clinically coherent EHR trajectories with strong statistical fidelity and downstream predictive utility in the evaluated VV\-ECMO cohort and could be extended to other clinical settings\.Significance:This framework supports the development and evaluation of machine learning systems in data\-sparse critical care settings and advances clinically grounded synthetic data generation for biomedical research\.111Project page:[https://panxulab\.github\.io/InterGenEHR/](https://panxulab.github.io/InterGenEHR/)

###### Index Terms:

Generative models, large language models, human in the loop, electronic health record \(EHR\)

††aftertitle:Author\-accepted manuscript\.Published as: Y\. Yang et al\., “InterGenEHR\+: An Interactive Framework for Natural Language\-Conditioned Generation of Longitudinal Patient Trajectories,”IEEE Transactions on Biomedical Engineering, early access, Nov\. 19, 2026, doi:[https://doi\.org/10\.1109/TBME\.2026\.3753060](https://doi.org/10.1109/TBME.2026.3753060)\.
© 2026 IEEE\. Personal use of this material is permitted\. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works\.## IIntroduction

In critical care settings, machine learning \(ML\) models have demonstrated the potential to support patient management by enabling real\-time risk prediction and clinical decision support\[[1](https://arxiv.org/html/2611.33788#bib.bib1),[2](https://arxiv.org/html/2611.33788#bib.bib2)\]\. Electronic health records \(EHRs\) have become a primary data source for training and evaluating ML models in critical care\. ML models trained on EHR data have shown promise in predicting patient outcomes, detecting early warning signals, and supporting treatment recommendations\[[3](https://arxiv.org/html/2611.33788#bib.bib3),[4](https://arxiv.org/html/2611.33788#bib.bib4),[5](https://arxiv.org/html/2611.33788#bib.bib5)\]\. Despite these advances, the evaluation of specific patient scenarios in intensive care unit \(ICU\) settings remains challenging due to limited data availability for rare and high\-risk patient cohorts, as well as the heterogeneity and complexity of patient states\. In real\-world applications, clinicians often need to evaluate model performance in specific patient scenarios that are not well represented in training data\. To address data scarcity, generative models have been proposed to synthesize realistic EHR data\[[6](https://arxiv.org/html/2611.33788#bib.bib6),[7](https://arxiv.org/html/2611.33788#bib.bib7),[8](https://arxiv.org/html/2611.33788#bib.bib8)\]\. However, these approaches do not fully satisfy clinicians’ needs to design customized patient scenarios based on user\-specified clinical features\. Therefore, interactive frameworks are needed to let clinicians explicitly define patient characteristics and generate scenario\-consistent synthetic EHR data\.

InterGenEHR\[[9](https://arxiv.org/html/2611.33788#bib.bib9)\]was previously proposed as an interactive framework for generating synthetic EHR data conditioned on user\-specified clinical features\. Using VAE\-based models with arbitrary conditioning\[[10](https://arxiv.org/html/2611.33788#bib.bib10),[11](https://arxiv.org/html/2611.33788#bib.bib11)\], clinicians can define constraints on variables such as the PaO2/FiO2ratio and ventilator settings through a web interface and iteratively refine outputs via human feedback\. This framework enables clinicians to construct patient scenarios for evaluating ML models trained on the same dataset for tasks such as mortality prediction, diagnosis prediction, and treatment decision support\. While effective, the prior approach requires manual variable selection and precise numerical specification\. The high\-dimensional nature of longitudinal EHR data makes manual constraint specification difficult for clinicians, creating a barrier to targeted scenario exploration\. LLMs can reduce manual feature specification by translating clinical language into structured inputs\. Existing studies have used LLMs to extract structured variables or labels from clinical text\[[12](https://arxiv.org/html/2611.33788#bib.bib12),[13](https://arxiv.org/html/2611.33788#bib.bib13)\], directly generate synthetic clinical text or tabular records\[[13](https://arxiv.org/html/2611.33788#bib.bib13),[14](https://arxiv.org/html/2611.33788#bib.bib14)\], and support patient\-level EHR understanding and querying\[[15](https://arxiv.org/html/2611.33788#bib.bib15),[16](https://arxiv.org/html/2611.33788#bib.bib16),[17](https://arxiv.org/html/2611.33788#bib.bib17)\]\. In InterGenEHR\+, the LLM is used only as an optional parser\. It converts a clinician’s request into a JSON conditioning specification, while a separate VAE\- or diffusion\-based backbone generates the numerical EHR values and trajectories\. InterGenEHR uses VAE\-based backbones and supports arbitrary conditioning only for records at a single time point\. It therefore does not model relationships between time points in a patient trajectory\. Diffusion models offer another approach to EHR generation and can be used for either single\-time\-point records or longitudinal trajectories\. EHRDiff generates unconditional static binary patient records\[[18](https://arxiv.org/html/2611.33788#bib.bib18)\], while MedDiff supports class\-conditional generation of static EHR records\[[19](https://arxiv.org/html/2611.33788#bib.bib19)\]\. TabDDPM has also been evaluated for mixed\-type static tabular EHR synthesis\[[20](https://arxiv.org/html/2611.33788#bib.bib20)\]\. These methods still generate records at a single time point and do not model relationships between time points\. Other diffusion work generates complete longitudinal EHR trajectories with mixed\-type variables\[[21](https://arxiv.org/html/2611.33788#bib.bib21)\], but it does not support arbitrary clinician\-specified conditioning over features and time\.

We propose InterGenEHR\+to address these limitations by connecting an LLM parsing interface with established VAE\- and diffusion\-based generative backbones\. First, the LLM interface translates a clinician’s natural\-language description into a structured specification of supported observed features and values\. The framework checks the JSON format and value ranges and requires clinician confirmation before generation\. Clinicians may also bypass the LLM and enter the same constraints through the structured interface\. Second, we include diffusion\-based methods in addition to the VAE\-based backbones used in InterGenEHR\. These conditional backbones are adopted from prior work and connected to the same arbitrary\-conditioning interface\. Finally, we extend arbitrary conditioning from single\-time\-point generation to longitudinal generation using a feature\-by\-time mask\. This extension allows the longitudinal backbones to model relationships between time points rather than generating each time point independently\. We evaluate the LLM parsing interface and the generative framework using a pooled cohort of 874 patients receiving venovenous extracorporeal membrane oxygenation \(VV\-ECMO\) at Duke and Emory\. The experiments on pooled patient data show that the framework can handle data combined from multiple institutions\. The contributions of this work are as follows:

- •We propose InterGenEHR\+, an interactive framework that accepts either a natural\-language request through an optional LLM parser or directly entered constraints\. After clinician confirmation of the observed features, established VAE\- and diffusion\-based backbones generate the remaining EHR values for clinician\-specified scenarios at a single time point or across a longitudinal trajectory\.
- •We develop an optional LLM\-based semantic parsing module that translates natural\-language clinical descriptions into structured conditioning specifications\. The module extracts requested variables, values or ranges, and temporal information\. The framework validates the JSON format, flags values outside the feature dictionary ranges, and requires clinician correction before generation\.
- •We integrate multiple conditional generative models tailored for tabular and time\-series EHR data, enabling synthetic patient trajectory generation conditioned on arbitrary clinician\-specified features\. Compared with prior VAE\-based approaches, the diffusion backbones are designed to capture complex joint distributions, temporal dynamics, and physiological correlations\.
- •We evaluate InterGenEHR\+on a multi\-institutional dataset of VV\-ECMO patients, assessing LLM parsing accuracy and generative performance \(e\.g\., data fidelity, physiological plausibility, and clinical utility\)\. We also conduct a clinician evaluation of generated trajectories, showing that the framework can generate clinically plausible trajectories aligned with clinician\-specified scenarios\. Our evaluation focuses on VV\-ECMO patients, while the framework could be extended to other clinical settings\. Further adaptation and validation remain future work\.

## IIMethods

InterGenEHR\+accepts either constraints entered through the structured interface or a natural\-language request\. For natural\-language input, the optional LLM parser converts the request into JSON; direct input skips this step\. In both cases, the constraints undergo schema and range validation, followed by clinician confirmation\. A deterministic adapter converts the confirmed constraints into observed values, which the selected conditional backbone uses to generate unspecified EHR values\.[Figure1](https://arxiv.org/html/2611.33788#S2.F1)summarizes this workflow\. The following sections describe LLM parsing, its evaluation, and arbitrary conditioning at a single time point and across longitudinal trajectories\. Implementation details and standard backbone formulations are provided in Appendix I and Appendix III \(see Supplementary Material\)\.

![Refer to caption](https://arxiv.org/html/2611.33788v1/Figure_1_v2.png)Fig\. 1:Overview of InterGenEHR\+\. The LLM parser converts a clinician’s natural\-language request into structured JSON; a clinician may instead enter constraints directly\. After validation and clinician confirmation, an adapter converts the constraints into observed values and observation masksbborBB\. The selected conditional backbone keeps the observed entries fixed and generates a patient record at a single time point or a longitudinal trajectory\.### II\-ALLM Prompt Engineering and Evaluation Framework

To reduce the burden of specifying conditioning variables and numeric constraints, we implement an optional LLM parser that maps clinicians’ natural language into a JSON conditioning specification\. We develop a prompt engineering framework to \(i\) enforce structured outputs, \(ii\) compare alternative prompt designs, and \(iii\) quantify performance across models and decoding settings\.

#### II\-A1Target conditioning schema and validation

We define fixed, machine\-verifiable JSON schemas for requests at a single time point and longitudinal requests\. Both schemas represent a scenario name, the number of requested samples, and a list of conditioning items\. Each conditioning item identifies a supported feature and a constraint type, including a value, range, or trajectory\. Depending on the constraint type, the item records fields such as a value, minimum and maximum bounds, units, a trajectory pattern, endpoint values, and a time window\. Model outputs are parsed and validated against the applicable schema using JSON Schema validation\. Invalid JSON or output that does not follow the schema is rejected\. The feature dictionary maps clinical terms to supported features and records their units and value ranges\. Values outside the defined ranges are flagged for clinician review, and the clinician must confirm or modify the parsed constraints before generation\. Constraints entered directly through the structured interface follow the same validation and review steps\. To identify a simple prompt design for reliable clinical parsing, we evaluate four configurations: \(1\) Direct Zero\-Shot, \(2\) Direct Few\-Shot, \(3\) Stepwise Few\-Shot, and \(4\) Role\-Anchored Few\-Shot\. All configurations include the target JSON schema and the feature dictionary, which enumerates supported EHR variables and their clinical semantics\.

Direct Zero\-Shot instructs the model to convert the clinician’s request into JSON using the schema and feature dictionary\. Direct Few\-Shot adds labeled examples that map clinical language to structured fields\. Role\-Anchored Few\-Shot is identical to Direct Few\-Shot but adds an expert role instruction to the system prompt to test whether specifying an expert role improves structured output reliability\. Stepwise Few\-Shot further adds procedural instructions that decompose the task into extracting temporal context, mapping variables, and determining constraint types before JSON construction\. This design isolates the effects of demonstrations, task decomposition, and role conditioning while holding the schema constant\.

#### II\-A2Benchmark set and experimental setup

We curate a benchmark of clinician utterances paired with gold references that instantiate the target schema\. Experiments are conducted across the evaluated LLM backends at decoding temperatures of 0\.0, 0\.2, and 0\.5\. These temperatures cover deterministic to moderate sampling because the task requires stable JSON rather than diverse text\. For reproducibility, each run uses fixed random seeds and writes a complete execution trace, including prompts, raw model outputs, parsed JSON, and validation outcomes\.

#### II\-A3Automatic evaluation metrics

We compute both syntactic and semantic metrics\. Syntactic metrics include the parse success rate and schema compliance rate\. Semantic evaluation is performed at the slot level by flattening nested JSON fields into key–value “slots” and computing agreement with the gold reference \(true positives, false positives, false negatives\), from which we derive slot\-level Precision, Recall, and F1 Score\. We additionally report the spurious slot rate, defined as the fraction of predicted slots absent from the gold reference\. This metric does not measure factual errors in free\-form text\. We also report an ambiguity\-handling indicator based on whether the output explicitly flags uncertainty in its free\-text notes\.

### II\-BSingle\-Time\-Point Arbitrary Conditioning

We generate a patient record at a single clinical time point conditioned on observed features\. Letx∈ℝdx\\in\\mathbb\{R\}^\{d\}denote a patient record, whereddis the number of clinical features\. The observed\-value vector isxo=b⊙xx\_\{o\}=b\\odot x, whereb∈\{0,1\}db\\in\\\{0,1\\\}^\{d\}is a binary mask andbi=1b\_\{i\}=1indicates that featureiiis specified by the clinician\. The unobserved\-value vector isxu=\(1−b\)⊙xx\_\{u\}=\(1\-b\)\\odot x\. The goal is to estimatep⁡\(xu∣xo,b\)p\(x\_\{u\}\\mid x\_\{o\},b\)and generatex^u\\hat\{x\}\_\{u\}while keepingxox\_\{o\}fixed\. The complete generated record isx^=xo\+\(1−b\)⊙x^u\\hat\{x\}=x\_\{o\}\+\(1\-b\)\\odot\\hat\{x\}\_\{u\}\.

We use IGE\-VAEAC, IGE\-PMVAE, and IGE\-TabDDPM for single\-time\-point generation\. IGE\-VAEAC uses the conditional prior of VAEAC\[[10](https://arxiv.org/html/2611.33788#bib.bib10)\]to generate values under different observation masks\. IGE\-PMVAE uses the posterior\-matching objective of PMVAE\[[11](https://arxiv.org/html/2611.33788#bib.bib11)\]to align the posteriors inferred from partial and complete observations\. IGE\-TabDDPM uses TabDDPM\[[22](https://arxiv.org/html/2611.33788#bib.bib22)\]with replacement\-based conditional sampling\[[23](https://arxiv.org/html/2611.33788#bib.bib23)\], which keeps the observed entries fixed while generating the remaining entries\. Their detailed objectives and sampling equations are provided in Appendix III\.

### II\-CLongitudinal Arbitrary Conditioning

We extend arbitrary conditioning from a single clinical time point to a longitudinal trajectory\. LetX∈ℝd×LX\\in\\mathbb\{R\}^\{d\\times L\}denote a patient trajectory, whereddis the number of clinical features andLLis the number of clinical time points\. We usettfor clinical time andτ\\taufor diffusion steps\. The maskB∈\{0,1\}d×LB\\in\\\{0,1\\\}^\{d\\times L\}satisfiesBi,t=1B\_\{i,t\}=1when featureiiat clinical timettis specified by the clinician\. The observed matrix isXo=B⊙XX\_\{o\}=B\\odot X, and the remaining values are denoted byXuX\_\{u\}\. The goal is to estimatep⁡\(Xu∣Xo,B\)p\(X\_\{u\}\\mid X\_\{o\},B\)and generate the unobserved values while keepingXoX\_\{o\}fixed\. The complete generated trajectory isX^=Xo\+\(1−B\)⊙X^u\.\\hat\{X\}=X\_\{o\}\+\(1\-B\)\\odot\\hat\{X\}\_\{u\}\.

We use IGE\-CSDI, IGE\-FGTI, and IGE\-MTSCI for longitudinal generation\. IGE\-CSDI uses CSDI\[[24](https://arxiv.org/html/2611.33788#bib.bib24)\]to model temporal and cross\-feature relationships\. IGE\-FGTI uses FGTI\[[25](https://arxiv.org/html/2611.33788#bib.bib25)\]to incorporate dominant\-frequency information\. IGE\-MTSCI uses MTSCI\[[26](https://arxiv.org/html/2611.33788#bib.bib26)\]to improve consistency across adjacent trajectory segments\. All three methods receive the sameXoX\_\{o\}andBB, keep the observed features fixed, and generate the remaining trajectory\. Their detailed formulations are provided in Appendix III \(see Supplementary Material\)\.

## IIIResults

We present experimental results for each component of the framework\. We evaluate \(1\) LLM\-based parsing of clinical requests, \(2\) single\-time\-point generation with VAE\- and diffusion\-based methods, \(3\) longitudinal generation with diffusion\-based methods, and \(4\) clinical plausibility and request adherence through a structured clinician evaluation\. The LLM parsing results are in Appendix V\-A, and results on clinically salient features are in Appendix V\-B \(see Supplementary Material\)\. We estimate 95% confidence intervals using 1000 bootstrap samples for fidelity, data perturbation, and imputation experiments\.

### III\-ADataset

We collected data from adult patients who underwent VV\-ECMO at two tertiary academic centers\. The Emory University Hospital cohort included 183 patients treated between 2015 and 2021, while the Duke University cohort included 691 patients treated between 2016 and 2024\. The dataset includes patients with documented VV\-ECMO cannulation, including recorded initiation and removal dates, as well as hospital outcomes \(in\-hospital mortality or discharge status\)\.

In collaboration with clinical experts, we formatted the patient data into clinical trajectories from VV\-ECMO cannulation to decannulation\. We selected patients with sufficient physiological and ventilatory data during VV\-ECMO support\. Each trajectory was segmented with a 4\-hour sliding window and a 1\-hour step size\. Following\[[27](https://arxiv.org/html/2611.33788#bib.bib27)\], measurements within each 4\-hour window were aggregated using the median value, reducing transient fluctuations and measurement noise while preserving fine\-grained temporal resolution through the 1\-hour stride\. Preprocessing yielded 93,149 timestamps for the Emory cohort and 295,540 timestamps for the Duke cohort\. The dataset includes 35 features representing the patient’s physiological state across four domains: vital signs, ventilation settings and respiratory measures, laboratory tests, and sedation scores\.

To address missing values, we used forward\-filling to propagate the most recent valid measurement for each patient\. Residual missing values were then imputed using the population median for each variable, yielding a complete dataset for analysis\.

TABLE I:Study Cohort Demographics
### III\-BGenerative Backbones and Baselines

We summarize the generative backbones integrated into the framework and the baseline models used for comparison\. Because the framework must generate unobserved features conditioned on arbitrary clinician\-provided observations, we select backbones designed for conditional imputation\.

##### Single\-Time\-Point Generation

For single\-time\-point generation, we incorporate VAEAC\[[10](https://arxiv.org/html/2611.33788#bib.bib10)\], PMVAE\[[11](https://arxiv.org/html/2611.33788#bib.bib11)\], and TabDDPM\[[22](https://arxiv.org/html/2611.33788#bib.bib22)\]as generative backbones\. We denote the corresponding framework variants asIGE\-VAEAC,IGE\-PMVAE, andIGE\-TabDDPM, respectively\. We compare them with standard unconditional generative baselines, including a VAE\[[28](https://arxiv.org/html/2611.33788#bib.bib28)\]and CTGAN\[[29](https://arxiv.org/html/2611.33788#bib.bib29)\]\.

We also include EHRDiff\[[18](https://arxiv.org/html/2611.33788#bib.bib18)\]and TabDiff\[[30](https://arxiv.org/html/2611.33788#bib.bib30)\]as recent diffusion baselines\. We adapt both methods to the continuous clinical data and single\-time\-point conditioning setting used in our experiments\. We keep their training objectives unchanged and extend their sampling interfaces to preserve the observed values while generating the remaining features\. We evaluate all methods using the same data split, conditioning masks, evaluation metrics, and preprocessing fitted on the training set\. Because neither model generates longitudinal trajectories or accepts feature\-by\-time masks, we include them only in the single\-time\-point evaluations\.

##### Longitudinal Generation

For longitudinal generation, we integrate CSDI\[[24](https://arxiv.org/html/2611.33788#bib.bib24)\], FGTI\[[25](https://arxiv.org/html/2611.33788#bib.bib25)\], and MTSCI\[[26](https://arxiv.org/html/2611.33788#bib.bib26)\]\. As discussed in[SectionII\-C](https://arxiv.org/html/2611.33788#S2.SS3), these architectures support arbitrary conditioning and are therefore compatible with LLM\-parsed constraints\. We denote the corresponding variants asIGE\-CSDI,IGE\-FGTI, andIGE\-MTSCI\.

### III\-CEvaluation of Single\-Time\-Point Generation

We first evaluate the fidelity of single\-time\-point synthetic data generated by the framework and compare it with data generated by baseline generative models\. We use Maximum Absolute Mean Difference \(MAMD\), Root Mean Square Percentage Error \(RMSPE\), and Mean Absolute Percentage Error \(MAPE\), computed on unnormalized data\. Detailed metric definitions are provided in Appendix VII \(see Supplementary Material\)\.

These metrics quantify deviations between synthetic and real data\. The results are summarized in[TableII](https://arxiv.org/html/2611.33788#S3.T2)\.IGE\-TabDDPM achieves the lowest RMSPE and MAPE\. This indicates that the diffusion\-based architecture generates feature values that closely align with the real data\. TabDiff achieves the lowest MAMD of22\.515822\.5158, followed by IGE\-PMVAE at23\.210623\.2106\. The high MAMD for IGE\-VAEAC occurs in unconditional generation, where no observed features are provided\. This setting differs from the main use of VAEAC, which is designed to generate missing values using observed features\. Overall, these results show that diffusion and posterior\-matching backbones can generate synthetic data similar to the original clinical records\. EHRDiff and TabDiff are competitive in unconditional generation, but no method achieves the lowest value for every metric\.

TABLE II:Fidelity of synthetic data for single\-time\-point generation\.
### III\-DEvaluation of Longitudinal Generation

We next evaluate the fidelity of generated longitudinal trajectories against real patient records\. We use metrics that cover marginal distributions, discriminative quality, and dependency structures\. To measure marginal distribution alignment, we use the Kolmogorov\-Smirnov \(KS\) statistic and Total Variation \(TV\) distance\. The KS statistic measures the distance between empirical cumulative distribution functions, while TV distance quantifies divergence between empirical feature distributions\. To evaluate overall realism, we train a two\-layer long short\-term memory \(LSTM\) classifier to distinguish real from synthetic sequences\. We report theDetection ScoreandDetection Accuracy; lower detection accuracy indicates that synthetic data are harder to distinguish from real data\.

To assess dependency preservation, we calculate the Frobenius norm of the difference in correlation matrices\. Specifically, we use the Difference in Pairwise Correlation Matrices \(DPCM\) to measure inter\-feature correlation preservation and the Difference in Cross\-Sequence Matrices \(DCSM\) to capture temporal correlations across time steps\. The results are summarized in[TableIII](https://arxiv.org/html/2611.33788#S3.T3)\.IGE\-CSDI achieves the lowest KS Statistic of0\.23740\.2374and Detection Score of0\.13380\.1338\. This suggests thatIGE\-CSDI effectively models the overall data distribution\. Additionally,IGE\-FGTI achieves the best performance in preserving inter\-feature dependencies, with the lowest DPCM score of3\.96643\.9664\. This improvement is consistent with its frequency\-aware architecture, which models feature coupling in the spectral domain\.IGE\-MTSCI preserves temporal dynamics well, achieving the lowest DCSM score\.

TABLE III:Fidelity of synthetic data for longitudinal generation\.
### III\-EEvaluation of Single\-Time\-Point Perturbation

We assess conditional generation under perturbed observed features\. Unlike standard generation tasks, this evaluation focuses on scenarios in which features are manually perturbed to simulate diverse patient states\. We simulate clinician feedback by explicitly modifying a subset of observed featuresxox\_\{o\}\. The results are summarized in[TableIV](https://arxiv.org/html/2611.33788#S3.T4)\. IGE\-PMVAE achieves the lowest RMSPE of2\.34742\.3474and MAPE of1\.55001\.5500, while EHRDiff achieves the lowest MAMD of5\.09325\.0932\. No method has the lowest value for every metric\. This indicates thatIGE\-PMVAE captures conditional dependencies needed to generate realistic responses to specific clinical perturbations\. Although VAE has a lower MAMD than IGE\-PMVAE, its RMSPE and MAPE are higher than those of IGE\-PMVAE\.

TABLE IV:Performance comparison under single\-time\-point perturbation\.
### III\-FEvaluation of Single\-Time\-Point Data Imputation

We further evaluate InterGenEHR\+on clinical data imputation\. Clinicians may specify a subset of observed featuresxox\_\{o\}through the LLM module based on domain knowledge or specific clinical scenarios\. We formulate this task as the generation of the unobserved feature subsetxux\_\{u\}, conditioned on the available observationsxox\_\{o\}\. Effective imputation indicates that the framework can generate plausible data from partial clinical inputs\.

To simulate missing data during inference, we apply a random50%50\\%missingness mask to the clinical features in the test cohort\. Each model reconstructs the missing featuresxux\_\{u\}using only the retained observationsxox\_\{o\}\. Reconstruction fidelity is measured using Mean Squared Error \(MSE\) for pointwise accuracy and Negative Log\-Likelihood \(NLL\) for the quality of the predictive density\. The results are summarized in[TableV](https://arxiv.org/html/2611.33788#S3.T5)\. They show the value of explicitly modeling the conditional distribution\. IGE\-VAEAC achieves the lowest MSE of0\.29180\.2918, while TabDiff achieves the lowest NLL of0\.64290\.6429\. IGE\-PMVAE and IGE\-TabDDPM also have lower MSE values than the VAE baseline of1\.44821\.4482\. Architectures designed for imputation improve the accuracy and reliability of imputed clinical features\.

TABLE V:Performance Comparison on Single\-Time\-Point Imputation\.
### III\-GEvaluation of Longitudinal Data Imputation

We extend the imputation analysis to longitudinal patient trajectories\. Here, models reconstruct missing trajectory segments conditioned on observed features provided by clinicians\. This task is more challenging than single\-time\-point imputation because models must preserve both inter\-feature correlations and temporal dynamics\. Following the same protocol, we apply50%50\\%missingness masks to time\-series data and evaluate each model’s ability to recover unobserved trajectory features\. Reconstruction quality is measured using MSE for accuracy and NLL for the quality of the predictive density\.

The results are summarized in[TableVI](https://arxiv.org/html/2611.33788#S3.T6)\.IGE\-FGTI performs best on this imputation task, yielding both the lowest MSE of0\.03220\.0322and the lowest NLL of−2\.1719\-2\.1719\. This precision highlights the advantage of its frequency\-aware architecture\. By decomposing the signal into frequency components, FGTI achieves highly accurate pointwise reconstructions\. Meanwhile,IGE\-CSDI remains competitive, indicating that its 2D attention mechanism models spatiotemporal correlations useful for imputation\. AlthoughIGE\-MTSCI has a higher MSE of0\.05700\.0570, it remains competitive for longitudinal imputation\. Overall, these results show that the diffusion\-based variants capture temporal dependencies needed for clinical sequence imputation and can support reconstruction of missing data within patient trajectories\.

TABLE VI:Performance comparison on longitudinal imputation\.
### III\-HEvaluation of Clinically Constrained Single\-Time\-Point Generation

We evaluate the ability of the framework to generate clinically valid synthetic data that adhere to established clinical constraints\. Traditional generative models approximate the joint distribution of the data without incorporating deterministic clinical laws, which can yield samples that violate clinical relationships\. In addition, sensor artifacts, preprocessing, and recording delays can cause even real patient records to deviate from theoretical constraints\. To address this, the framework enables clinicians to specify critical variables through the LLM interface\. By treating these variables as observed featuresxox\_\{o\}, the generative models condition on them and preserve the supplied constraints\. We compare the framework with traditional baselines using three well\-established clinical equations from\[[9](https://arxiv.org/html/2611.33788#bib.bib9)\]\. We selected these equations because they describe explicit relationships among variables related to oxygenation, ventilation, and acid\-base balance during VV\-ECMO support\. All variables in these equations are available in both institutional datasets\. Other clinically relevant relationships among the available variables are less deterministic and are therefore not included as fixed equation\-based checks\. First, the pH is governed by the Henderson\-Hasselbalch equation\[[31](https://arxiv.org/html/2611.33788#bib.bib31)\]:

pH=6\.1\+log10⁡\(HCO3−0\.03×PaCO2\)\.\\displaystyle\\text\{pH\}=6\.1\+\\log\_\{10\}\\bigg\(\\frac\{\\text\{HCO\}\_\{3\}^\{\-\}\}\{0\.03\\times\\text\{PaCO\}\_\{2\}\}\\bigg\)\.\(1\)Then, the relationship between base excess and pH is defined as\[[32](https://arxiv.org/html/2611.33788#bib.bib32)\]:

Base Excess=0\.9287×HCO3−\+13\.77×pH−124\.58\.\\displaystyle\\text\{Base Excess\}=0\.9287\\times\\text\{HCO\}\_\{3\}^\{\-\}\+13\.77\\times\\text\{pH\}\-124\.58\.\(2\)Finally, the oxygen\-hemoglobin dissociation curve is modeled by the Severinghaus equation\[[33](https://arxiv.org/html/2611.33788#bib.bib33)\]:

SpO2=\(23400PaO23\+150×PaO2\+1\)−1\.\\displaystyle\\text\{SpO\}\_\{2\}=\\bigg\(\\frac\{23400\}\{\\text\{PaO\}\_\{2\}^\{3\}\+150\\times\\text\{PaO\}\_\{2\}\}\+1\\bigg\)^\{\-1\}\.\(3\)
We calculate the Mean Absolute Error \(MAE\) between generated values and theoretically derived values from these equations\. As shown in[TableVII](https://arxiv.org/html/2611.33788#S3.T7), standard generative models such as VAE and CTGAN can violate these constraints and produce clinically inconsistent samples\. Real EHR data also exhibit non\-zero MAE because of measurement and recording noise\.

[TableVIII](https://arxiv.org/html/2611.33788#S3.T8)summarizes the conditional generation performance of InterGenEHR\+\. When only a single variable such as pH is constrained,IGE\-PMVAE andIGE\-VAEAC generate the remaining related variables with MAE levels comparable to or better than the baselines in[TableVII](https://arxiv.org/html/2611.33788#S3.T7)\. This suggests that explicitly modeling the conditional distribution helps preserve clinical relationships among related variables\.

TABLE VII:MAE for Clinical Constraints Across Generative Models\.TABLE VIII:MAE for Clinical Constraints Under Single\-Variable Conditioning\.
### III\-IClinician Evaluation

In this section, we evaluate the generated VV\-ECMO trajectories through direct assessment by four clinicians\. For this experiment, we combine the Duke and Emory cohorts and train the IGE\-FGTI model\. The clinician evaluation uses the same 35 clinical variables as the main experiments\.

For each requested clinical scenario, clinicians review the generated trajectories and rate each trajectory using five questions\. The 10 scenarios cover severe lung injury, persistent low blood oxygen levels, respiratory and metabolic acidosis, recovery and possible removal of ECMO support, suspected breakdown of red blood cells, a sudden drop in blood oxygen levels, difficulty clearing carbon dioxide, acute kidney injury, and falling platelet counts\. The questions assess clinical plausibility, internal physiological consistency, requested\-scenario representation, physiological possibility, and agreement with the requested scenario\. The complete questions and scenario definitions are provided in Appendix VI \(see Supplementary Material\)\. The trajectories are presented in randomized order without disclosing the generating model, and all ratings use a 1–5 scale\. Higher scores indicate greater clinical plausibility or closer alignment with the requested scenario\.

For each evaluation question and scenario, we compare all six pairs of scores from the four clinicians\. We define “Exact pairwise agreement” as the proportion of pairs with identical scores \([TableIX](https://arxiv.org/html/2611.33788#S3.T9)\)\. To allow for variation between raters, we also report “Pairwise difference≤1\\leq 1”, the proportion of pairs whose scores differ by at most one point\. The mean scores range from 3\.68 to 4\.20 on the 1–5 scale, with higher mean ratings for clinical plausibility and physiological possibility\. These results suggest that the generated trajectories are clinically plausible and broadly aligned with clinician\-specified scenarios\.

TABLE IX:Clinician Evaluation Results with Four Independent Raters
### III\-JDownstream Clinical Utility: In\-Hospital Mortality Prediction

Fig\. 2:MLP\-based in\-hospital mortality classification results under unconditional generation without clinician\-provided observed features\.TABLE X:MLP\-based in\-hospital mortality classification results using scenario\-conditioned synthetic data\.We evaluate the utility of the generated synthetic data through a critical downstream clinical task: predicting in\-hospital mortality\. High\-fidelity synthetic data should preserve the underlying predictive relationships between clinical features and patient outcomes, thereby serving as an augmentation tool for real patient data in machine learning pipelines\.

We focus on the VV\-ECMO dataset, extracting time\-series trajectories and their corresponding in\-hospital mortality labels\. To evaluate the utility of the generated data, we employ the “Train on Synthetic, Test on Real” \(TSTR\) paradigm\. We train three classifiers—logistic regression \(LR\), gradient\-boosted decision trees \(GBDT\), and a multilayer perceptron \(MLP\)—on the synthetic data and evaluate them on real test data\. We report train\-on\-real, test\-on\-real performance as the reference\. Each experiment is repeated with five seeds, and we report the mean and standard deviation for AUROC, AUPRC, accuracy, precision, recall, and F1 score\. This reference evaluation uses unconditional generation without clinician\-provided observed features or scenario\-specific constraints\. Overall, IGE\-PMVAE has the highest mean AUROC among the synthetic\-data methods with LR and GBDT, while EHRDiff has the highest mean AUROC with MLP classifiers\. Complete numerical results for MLP, LR, and GBDT under unconditional generation are provided in Appendix V\-C \(see Supplementary Material\)\. For illustration, the MLP results are shown in[Figure2](https://arxiv.org/html/2611.33788#S3.F2)\. Performance varies across generative methods and classifiers; synthetic data may not fully preserve all predictive information\. Although EHRDiff achieves the highest mean MLP AUROC, its performance is close to the real\-data reference\.

We further evaluate scenario\-conditioned generation using the ten clinician\-specified scenarios in Appendix VI\. For each model, we generate 1,400 synthetic records\. The clinical features specified in each parsed scenario are fixed to their observed encounter values, while the remaining features are generated\. These features correspond to the clinician\-requested conditions\. We train an MLP classifier and evaluate it via TSTR\. As shown in Table[X](https://arxiv.org/html/2611.33788#S3.T10), IGE\-CSDI and IGE\-PMVAE achieve the highest AUROC values of 0\.7638 and 0\.7631, respectively, indicating that the synthetic data retain predictive utility\.

## IVDiscussion

In this work, we introduce InterGenEHR\+, an interactive framework that integrates LLM\-based semantic parsing with conditional generative modeling to enable clinician\-driven synthesis of tabular and longitudinal EHR trajectories\. By combining structured natural language interpretation with diffusion and posterior\-matching architectures, the proposed system reduces the manual burden of feature specification while supporting conditional generation both at single time points and across longitudinal trajectories\. Across multi\-institutional VV\-ECMO cohorts, we show that LLM prompting strategies substantially affect structured parsing reliability, and different diffusion and posterior\-matching variants show strengths on different fidelity, conditioning, and imputation metrics\.

The LLM evaluation shows that prompt design affects the reliability of clinical scenario parsing\. Zero\-shot prompting produces lower semantic accuracy and schema compliance, whereas few\-shot prompting achieves the highest slot\-level F1 and lowest spurious slot rates\. These results suggest that providing examples is more effective than adding stepwise instructions for this structured parsing task\. The feature dictionary and JSON schema further constrain the model outputs and support validation before generation\.

Schema validation cannot detect all parsing errors\. LLMs may add information not supported by clinicians’ requests \(spurious slots\) or generate incorrect values\. For example, a parser may give a creatinine value of150150mg/dL, above the2020mg/dL upper limit in our feature dictionary\. Such errors can distort generated trajectories and mislead downstream analysis\. The framework checks value ranges and feature names, flags out\-of\-range values for review and correction, and excludes unsupported features from conditioning\. Only conditions confirmed by clinicians are used for generation\.

For single\-time\-point generation, diffusion and posterior\-matching approaches exhibit complementary strengths\. The diffusion\-based methodIGE\-TabDDPM achieves the lowest relative error metrics, showing better agreement with marginal feature statistics\. In contrast,IGE\-PMVAE achieves the lowest relative error metrics under single\-time\-point perturbation, reflecting improved performance under conditional perturbation\. By explicitly aligning latent posteriors under partial observations,IGE\-PMVAE better preserves conditional relationships when clinicians specify arbitrary subsets of features\. These findings suggest that diffusion enhances fidelity in unconditional generation, while posterior matching strengthens performance under conditioning\. Both are critical for interactive scenario generation\. Single\-time\-point conditional generation also enables practical testing of ML models at specific clinical decision points\. For example, it can complete partially specified records and construct rare or borderline cases to evaluate model performance in patient states underrepresented in the available data\.

In the longitudinal setting, different diffusion architectures show different strengths across evaluation metrics\.IGE\-CSDI provides strong marginal distribution alignment and low detection scores, indicating effective modeling of the overall data distribution\.IGE\-FGTI achieves the best preservation of inter\-feature correlations and the best imputation performance, likely due to its frequency\-aware design that captures temporal patterns at different frequencies\.IGE\-MTSCI best preserves temporal correlations across time steps\. No single architecture uniformly dominates across all metrics, underscoring that model selection should depend on whether marginal distribution fidelity, inter\-feature correlation, temporal correlation, or imputation accuracy is prioritized\.

In clinical settings, this framework enables scenario\-based evaluation of machine learning systems in high\-risk cohorts such as VV\-ECMO patients, where rare physiological states are often underrepresented\. By allowing clinicians to specify targeted trajectories, the system supports the evaluation of predictive models, policy evaluation in reinforcement learning settings, and structured data augmentation\. However, synthetic plausibility does not imply causal validity\. The generated trajectories reflect learned statistical structure rather than mechanistic physiology and should therefore be interpreted as simulation tools rather than clinical decision engines\.

The imbalance between Duke \(691 patients\) and Emory \(183 patients\) is a limitation of this study\. The generated data may therefore reflect Duke patients more strongly and may not generalize to other institutions\. We did not separately evaluate site\-specific effects because the smaller Emory cohort would make these comparisons less reliable\. Further evaluation with larger and more balanced multi\-site cohorts is needed\. Validation on external cohorts and in other clinical settings is needed to establish broader applicability\.

## VConclusion

We introduce InterGenEHR\+, a clinician\-interactive framework that combines structured LLM\-based scenario parsing with conditional diffusion and posterior\-matching generative models to synthesize realistic EHR trajectories\. By enabling natural language specification and arbitrary conditioning, the system improves usability, fidelity, and temporal coherence in both single\-time\-point and longitudinal generation\. Evaluation on multi\-institutional VV\-ECMO cohorts demonstrates reliable scenario translation and high\-quality synthetic data generation, supporting simulation\-driven evaluation of machine learning models in the evaluated VV\-ECMO setting\.

## VIEthics Statement

This study was reviewed by the Duke University Health System Institutional Review Board and determined to be exempt under IRBPro00114885\. All procedures were conducted in accordance with applicable regulations and institutional guidelines\.

## Acknowledgment

This work was supported in part by the National Institutes of Health under Award Numbers R01GM139967 and R21GM148931 \(to R\. Kamaleswaran and J\. Song\)\. H\. P\. Foote is supported by the Eunice Kennedy Shriver National Institute of Child Health and Human Development under Awards T32HD094671 and T32HD104576\. P\. Xu and Y\. Yang are supported by the National Science Foundation under Grant No\. IIS\-2541960 \(CAREER\) and the Whitehead Scholars Program at the Duke University School of Medicine\.

## References

- \[1\]X\. Wu, R\. Li, Z\. He, T\. Yu, and C\. Cheng, “A value\-based deep reinforcement learning model with human expertise in optimal treatment of sepsis,”*NPJ Digital Medicine*, vol\. 6, no\. 1, p\. 15, 2023\.
- \[2\]H\. Lee, H\.\-K\. Yoon, J\. Kim, J\. S\. Park, C\.\-H\. Koo, D\. Won, and H\.\-C\. Lee, “Development and validation of a reinforcement learning model for ventilation control during emergence from general anesthesia,”*npj Digital Medicine*, vol\. 6, no\. 1, p\. 145, 2023\.
- \[3\]D\. P\. Edelson, M\. M\. Churpek, K\. A\. Carey, Z\. Lin, C\. Huang, J\. M\. Siner, J\. Johnson, H\. M\. Krumholz, and D\. J\. Rhodes, “Early warning scores with and without artificial intelligence,”*JAMA network open*, vol\. 7, no\. 10, pp\. e2 438 986–e2 438 986, 2024\.
- \[4\]H\. Logan Ellis, E\. Palmer, J\. T\. Teo, M\. Whyte, K\. Rockwood, and Z\. Ibrahim, “The early warning paradox,”*npj Digital Medicine*, vol\. 8, no\. 1, p\. 81, 2025\.
- \[5\]J\. Song, S\. B\. Dave, Y\. Yang, H\. Foote, R\. Moore, P\. Upadhyaya, L\. Lima, C\. Creel, P\. Xu, C\. S\. Jabaley*et al\.*, “recmomender: Reinforcement learning for decision support in venovenous extracorporeal membrane oxygenation management,”*Critical Care Explorations*, vol\. 8, no\. 2, p\. e1369, 2026\.
- \[6\]E\. Choi, S\. Biswal, B\. Malin, J\. Duke, W\. F\. Stewart, and J\. Sun, “Generating multi\-label discrete patient records using generative adversarial networks,” in*Machine learning for healthcare conference*\. PMLR, 2017, pp\. 286–305\.
- \[7\]J\. Li, B\. J\. Cairns, J\. Li, and T\. Zhu, “Generating synthetic mixed\-type longitudinal electronic health records for artificial intelligent applications,”*NPJ digital medicine*, vol\. 6, no\. 1, p\. 98, 2023\.
- \[8\]M\. Tian, B\. Chen, A\. Guo, S\. Jiang, and A\. R\. Zhang, “Reliable generation of privacy\-preserving synthetic ehr time series via diffusion models,”*arXiv preprint arXiv:2310\.15290*, 2023\.
- \[9\]Y\. Yang, J\. Song, Z\. Liu, H\. Foote, R\. Kamaleswaran, and P\. Xu, “An interactive framework for generating clinical data with human feedback,” in*2025 IEEE EMBS International Conference on Biomedical and Health Informatics \(BHI\)*\. IEEE, 2025, pp\. 1–7\.
- \[10\]O\. Ivanov, M\. Figurnov, and D\. Vetrov, “Variational autoencoder with arbitrary conditioning,”*arXiv preprint arXiv:1806\.02382*, 2018\.
- \[11\]R\. Strauss and J\. B\. Oliva, “Posterior matching for arbitrary conditioning,”*Advances in Neural Information Processing Systems*, vol\. 35, pp\. 18 088–18 099, 2022\.
- \[12\]V\. Ntinopoulos, H\. R\. C\. Biefer, I\. Tudorache, N\. Papadopoulos, D\. Odavic, P\. Risteski, A\. Haeussler, and O\. Dzemali, “Large language models for data extraction from unstructured and semi\-structured electronic health records: a multiple model performance evaluation,”*BMJ health & care informatics*, vol\. 32, no\. 1, p\. e101139, 2025\.
- \[13\]R\. Li, X\. Wang, and H\. Yu, “Two directions for clinical data generation with large language models: data\-to\-label and label\-to\-data,” in*Findings of the Association for Computational Linguistics: EMNLP 2023*, 2023, pp\. 7129–7143\.
- \[14\]A\. A\. Barr, J\. Quan, E\. Guo, and E\. Sezgin, “Large language models generating synthetic clinical datasets: a feasibility and comparative analysis with real\-world perioperative data,”*Frontiers in artificial intelligence*, vol\. 8, p\. 1533508, 2025\.
- \[15\]Z\. Wu, A\. Dadu, M\. Nalls, F\. Faghri, and J\. Sun, “Instruction tuning large language models to understand electronic health records,”*Advances in Neural Information Processing Systems*, vol\. 37, pp\. 54 772–54 786, 2024\.
- \[16\]W\. Shi, R\. Xu, Y\. Zhuang, Y\. Yu, J\. Zhang, H\. Wu, Y\. Zhu, J\. C\. Ho, C\. Yang, and M\. D\. Wang, “Ehragent: Code empowers large language models for few\-shot complex tabular reasoning on electronic health records,” in*Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing*, 2024, pp\. 22 315–22 339\.
- \[17\]J\. Ryu, S\. Cho, G\. Lee, and E\. Choi, “Ehr\-seqsql: A sequential text\-to\-sql dataset for interactively exploring electronic health records,” in*Findings of the association for computational linguistics: aCL 2024*, 2024, pp\. 16 388–16 407\.
- \[18\]H\. Yuan, S\. Zhou, and S\. Yu, “Ehrdiff: Exploring realistic ehr synthesis with diffusion models,”*arXiv preprint arXiv:2303\.05656*, 2023\.
- \[19\]H\. He, S\. Zhao, Y\. Xi, and J\. C\. Ho, “Meddiff: Generating electronic health records using accelerated denoising diffusion model,”*arXiv preprint arXiv:2302\.04355*, 2023\.
- \[20\]T\. Ceritli, G\. O\. Ghosheh, V\. K\. Chauhan, T\. Zhu, A\. P\. Creagh, and D\. A\. Clifton, “Synthesizing mixed\-type electronic health records using diffusion models,”*arXiv preprint arXiv:2302\.14679*, 2023\.
- \[21\]N\. I\. Kuo, L\. Jorm, S\. Barbieri*et al\.*, “Synthetic health\-related longitudinal data with mixed\-type variables generated using diffusion models,”*arXiv preprint arXiv:2303\.12281*, 2023\.
- \[22\]A\. Kotelnikov, D\. Baranchuk, I\. Rubachev, and A\. Babenko, “Tabddpm: Modelling tabular data with diffusion models,” in*International Conference on Machine Learning*\. PMLR, 2023, pp\. 17 564–17 579\.
- \[23\]A\. Lugmayr, M\. Danelljan, A\. Romero, F\. Yu, R\. Timofte, and L\. Van Gool, “Repaint: Inpainting using denoising diffusion probabilistic models,” in*Proceedings of the IEEE/CVF conference on computer vision and pattern recognition*, 2022, pp\. 11 461–11 471\.
- \[24\]Y\. Tashiro, J\. Song, Y\. Song, and S\. Ermon, “Csdi: Conditional score\-based diffusion models for probabilistic time series imputation,”*Advances in neural information processing systems*, vol\. 34, pp\. 24 804–24 816, 2021\.
- \[25\]X\. Yang, Y\. Sun, X\. Yuan, and X\. Chen, “Frequency\-aware generative models for multivariate time series imputation,” in*The Thirty\-eighth Annual Conference on Neural Information Processing Systems*, 2024\. \[Online\]\. Available:[https://openreview\.net/forum?id=UE6CeRMnq3](https://openreview.net/forum?id=UE6CeRMnq3)
- \[26\]J\. Zhou, J\. Li, G\. Zheng, X\. Wang, and C\. Zhou, “Mtsci: A conditional diffusion model for multivariate time series consistent imputation,” in*Proceedings of the 33rd ACM International Conference on Information and Knowledge Management*, 2024, pp\. 3474–3483\.
- \[27\]A\. Peine, A\. Hallawa, J\. Bickenbach, G\. Dartmann, L\. B\. Fazlic, A\. Schmeink, G\. Ascheid, C\. Thiemermann, A\. Schuppert, R\. Kindle*et al\.*, “Development and validation of a reinforcement learning algorithm to dynamically optimize mechanical ventilation in critical care,”*NPJ digital medicine*, vol\. 4, no\. 1, p\. 32, 2021\.
- \[28\]D\. P\. Kingma, M\. Welling*et al\.*, “Auto\-encoding variational bayes,” 2013\.
- \[29\]L\. Xu, M\. Skoularidou, A\. Cuesta\-Infante, and K\. Veeramachaneni, “Modeling tabular data using conditional gan,”*Advances in neural information processing systems*, vol\. 32, 2019\.
- \[30\]J\. Shi, M\. Xu, H\. Hua, H\. Zhang, S\. Ermon, and J\. Leskovec, “Tabdiff: a mixed\-type diffusion model for tabular data generation,” in*International Conference on Learning Representations*, vol\. 2025, 2025, pp\. 37 353–37 375\.
- \[31\]A\. J\. Kitching and C\. J\. Edge, “Acid\-base balance: a review of normal physiology,”*BJA CEPD Reviews*, vol\. 2, no\. 1, pp\. 3–6, 2002\.
- \[32\]J\. Juern, V\. Khatri, and J\. Weigelt, “Base excess: a review,”*Journal of Trauma and Acute Care Surgery*, vol\. 73, no\. 1, pp\. 27–32, 2012\.
- \[33\]J\. W\. Severinghaus, “Simple, accurate equations for human blood o2 dissociation computations,”*Journal of Applied Physiology*, vol\. 46, no\. 3, pp\. 599–602, 1979\.
- \[34\]G\. Team, A\. Kamath, J\. Ferret, S\. Pathak, N\. Vieillard, R\. Merhej, S\. Perrin, T\. Matejovicova, A\. Ramé, M\. Rivière, L\. Rouillard, T\. Mesnard, G\. Cideron, J\. bastien Grill, S\. Ramos, E\. Yvinec, M\. Casbon, E\. Pot, I\. Penchev, G\. Liu, F\. Visin, K\. Kenealy, L\. Beyer, X\. Zhai, A\. Tsitsulin, R\. Busa\-Fekete, A\. Feng, N\. Sachdeva, B\. Coleman, Y\. Gao, B\. Mustafa, I\. Barr, E\. Parisotto, D\. Tian, M\. Eyal, C\. Cherry, J\.\-T\. Peter, D\. Sinopalnikov, S\. Bhupatiraju, R\. Agarwal, M\. Kazemi, D\. Malkin, R\. Kumar, D\. Vilar, I\. Brusilovsky, J\. Luo, A\. Steiner, A\. Friesen, A\. Sharma, A\. Sharma, A\. M\. Gilady, A\. Goedeckemeyer, A\. Saade, A\. Feng, A\. Kolesnikov, A\. Bendebury, A\. Abdagic, A\. Vadi, A\. György, A\. S\. Pinto, A\. Das, A\. Bapna, A\. Miech, A\. Yang, A\. Paterson, A\. Shenoy, A\. Chakrabarti, B\. Piot, B\. Wu, B\. Shahriari, B\. Petrini, C\. Chen, C\. L\. Lan, C\. A\. Choquette\-Choo, C\. Carey, C\. Brick, D\. Deutsch, D\. Eisenbud, D\. Cattle, D\. Cheng, D\. Paparas, D\. S\. Sreepathihalli, D\. Reid, D\. Tran, D\. Zelle, E\. Noland, E\. Huizenga, E\. Kharitonov, F\. Liu, G\. Amirkhanyan, G\. Cameron, H\. Hashemi, H\. Klimczak\-Plucińska, H\. Singh, H\. Mehta, H\. T\. Lehri, H\. Hazimeh, I\. Ballantyne, I\. Szpektor, I\. Nardini, J\. Pouget\-Abadie, J\. Chan, J\. Stanton, J\. Wieting, J\. Lai, J\. Orbay, J\. Fernandez, J\. Newlan, J\. yeong Ji, J\. Singh, K\. Black, K\. Yu, K\. Hui, K\. Vodrahalli, K\. Greff, L\. Qiu, M\. Valentine, M\. Coelho, M\. Ritter, M\. Hoffman, M\. Watson, M\. Chaturvedi, M\. Moynihan, M\. Ma, N\. Babar, N\. Noy, N\. Byrd, N\. Roy, N\. Momchev, N\. Chauhan, N\. Sachdeva, O\. Bunyan, P\. Botarda, P\. Caron, P\. K\. Rubenstein, P\. Culliton, P\. Schmid, P\. G\. Sessa, P\. Xu, P\. Stanczyk, P\. Tafti, R\. Shivanna, R\. Wu, R\. Pan, R\. Rokni, R\. Willoughby, R\. Vallu, R\. Mullins, S\. Jerome, S\. Smoot, S\. Girgin, S\. Iqbal, S\. Reddy, S\. Sheth, S\. Põder, S\. Bhatnagar, S\. R\. Panyam, S\. Eiger, S\. Zhang, T\. Liu, T\. Yacovone, T\. Liechty, U\. Kalra, U\. Evci, V\. Misra, V\. Roseberry, V\. Feinberg, V\. Kolesnikov, W\. Han, W\. Kwon, X\. Chen, Y\. Chow, Y\. Zhu, Z\. Wei, Z\. Egyed, V\. Cotruta, M\. Giang, P\. Kirk, A\. Rao, K\. Black, N\. Babar, J\. Lo, E\. Moreira, L\. G\. Martins, O\. Sanseviero, L\. Gonzalez, Z\. Gleicher, T\. Warkentin, V\. Mirrokni, E\. Senter, E\. Collins, J\. Barral, Z\. Ghahramani, R\. Hadsell, Y\. Matias, D\. Sculley, S\. Petrov, N\. Fiedel, N\. Shazeer, O\. Vinyals, J\. Dean, D\. Hassabis, K\. Kavukcuoglu, C\. Farabet, E\. Buchatskaya, J\.\-B\. Alayrac, R\. Anil, Dmitry, Lepikhin, S\. Borgeaud, O\. Bachem, A\. Joulin, A\. Andreev, C\. Hardin, R\. Dadashi, and L\. Hussenot, “Gemma 3 technical report,” 2025\. \[Online\]\. Available:[https://arxiv\.org/abs/2503\.19786](https://arxiv.org/abs/2503.19786)
- \[35\]A\. Sellergren, S\. Kazemzadeh, T\. Jaroensri, A\. Kiraly, M\. Traverse, T\. Kohlberger, S\. Xu, F\. Jamil, C\. Hughes, C\. Lau, J\. Chen, F\. Mahvar, L\. Yatziv, T\. Chen, B\. Sterling, S\. A\. Baby, S\. M\. Baby, J\. Lai, S\. Schmidgall, L\. Yang, K\. Chen, P\. Bjornsson, S\. Reddy, R\. Brush, K\. Philbrick, M\. Asiedu, I\. Mezerreg, H\. Hu, H\. Yang, R\. Tiwari, S\. Jansen, P\. Singh, Y\. Liu, S\. Azizi, A\. Kamath, J\. Ferret, S\. Pathak, N\. Vieillard, R\. Merhej, S\. Perrin, T\. Matejovicova, A\. Ramé, M\. Riviere, L\. Rouillard, T\. Mesnard, G\. Cideron, J\. bastien Grill, S\. Ramos, E\. Yvinec, M\. Casbon, E\. Buchatskaya, J\.\-B\. Alayrac, D\. Lepikhin, V\. Feinberg, S\. Borgeaud, A\. Andreev, C\. Hardin, R\. Dadashi, L\. Hussenot, A\. Joulin, O\. Bachem, Y\. Matias, K\. Chou, A\. Hassidim, K\. Goel, C\. Farabet, J\. Barral, T\. Warkentin, J\. Shlens, D\. Fleet, V\. Cotruta, O\. Sanseviero, G\. Martins, P\. Kirk, A\. Rao, S\. Shetty, D\. F\. Steiner, C\. Kirmizibayrak, R\. Pilgrim, D\. Golden, and L\. Yang, “Medgemma technical report,” 2025\. \[Online\]\. Available:[https://arxiv\.org/abs/2507\.05201](https://arxiv.org/abs/2507.05201)
- \[36\]A\. Q\. Jiang, A\. Sablayrolles, A\. Mensch, C\. Bamford, D\. S\. Chaplot, D\. de las Casas, F\. Bressand, G\. Lengyel, G\. Lample, L\. Saulnier, L\. R\. Lavaud, M\.\-A\. Lachaux, P\. Stock, T\. L\. Scao, T\. Lavril, T\. Wang, T\. Lacroix, and W\. E\. Sayed, “Mistral 7b,” 2023\. \[Online\]\. Available:[https://arxiv\.org/abs/2310\.06825](https://arxiv.org/abs/2310.06825)
- \[37\]A\. Yang, A\. Li, B\. Yang, B\. Zhang, B\. Hui, B\. Zheng, B\. Yu, C\. Gao, C\. Huang, C\. Lv, C\. Zheng, D\. Liu, F\. Zhou, F\. Huang, F\. Hu, H\. Ge, H\. Wei, H\. Lin, J\. Tang, J\. Yang, J\. Tu, J\. Zhang, J\. Yang, J\. Yang, J\. Zhou, J\. Zhou, J\. Lin, K\. Dang, K\. Bao, K\. Yang, L\. Yu, L\. Deng, M\. Li, M\. Xue, M\. Li, P\. Zhang, P\. Wang, Q\. Zhu, R\. Men, R\. Gao, S\. Liu, S\. Luo, T\. Li, T\. Tang, W\. Yin, X\. Ren, X\. Wang, X\. Zhang, X\. Ren, Y\. Fan, Y\. Su, Y\. Zhang, Y\. Zhang, Y\. Wan, Y\. Liu, Z\. Wang, Z\. Cui, Z\. Zhang, Z\. Zhou, and Z\. Qiu, “Qwen3 technical report,” 2025\. \[Online\]\. Available:[https://arxiv\.org/abs/2505\.09388](https://arxiv.org/abs/2505.09388)

## Appendix AImplementation Details

The following implementation details correspond to the pooled Duke–Emory experiments with 35 clinical variables\.

##### VAE

The VAE is used as an unconditional reference model for generation at a single time point\. It maps the 35\-variable input through a two\-layer MLP encoder to a 32\-dimensional latent representation and reconstructs the input with a symmetric decoder\. The architecture and optimization settings are summarized in Table[XI](https://arxiv.org/html/2611.33788#A1.T11)\.

TABLE XI:Hyperparameters for VAE\.
##### CTGAN

CTGAN is used as a GAN\-based reference model for unconditional tabular synthesis\. The generator and discriminator each contain two hidden layers, and packing is applied to the discriminator to reduce mode collapse\. Table[XII](https://arxiv.org/html/2611.33788#A1.T12)reports the adversarial optimization and training settings\.

TABLE XII:Hyperparameters for CTGAN\.
##### EHRDiff

EHRDiff is trained as an unconditional EDM model on the standardized training data\. The input dimension is set from the pooled training data after preprocessing\. For the conditional evaluations, we add replacement\-based sampling that restores the observed entries at the corresponding noise level during each reverse\-diffusion step and generates the remaining entries\. This sampling adaptation accepts a separate observation mask and observed values for each record without changing the EHRDiff denoiser or training objective\. Table[XIII](https://arxiv.org/html/2611.33788#A1.T13)summarizes the configuration\.

TABLE XIII:Hyperparameters for EHRDiff\.
##### TabDiff

TabDiff is trained on the same pooled training data using its continuous\-time diffusion objective, learnable feature\-wise noise schedules, and the released UniModMLP backbone with two encoder and decoder layers\. Its original imputation interface uses a designated target column\. We extend the conditional sampling procedure to accept a separate observation mask and observed values for each record\. The replacement\-based sampler restores the observed entries and generates the remaining entries\. This adaptation leaves the TabDiff training objective unchanged\. Table[XIV](https://arxiv.org/html/2611.33788#A1.T14)summarizes the configuration\.

TABLE XIV:Hyperparameters for TabDiff\.
##### IGE\-PMVAE

IGE\-PMVAE extends the VAE backbone with a partial encoder that maps observed values and their mask to the latent representation required for arbitrary conditioning\. The model is trained in two stages: the VAE is fitted first, followed by the partial encoder under random masking\. The complete settings are provided in Table[XV](https://arxiv.org/html/2611.33788#A1.T15)\.

TABLE XV:Hyperparameters for IGE\-PMVAE\.
##### IGE\-VAEAC

IGE\-VAEAC directly learns conditional distributions for arbitrary observed\-feature subsets\. During training, 50% random masks expose the model to varying conditioning patterns, and importance\-weighted samples are used for validation\. Table[XVI](https://arxiv.org/html/2611.33788#A1.T16)summarizes the network and training configuration\.

TABLE XVI:Hyperparameters for IGE\-VAEAC\.
##### IGE\-TabDDPM

IGE\-TabDDPM generates records at a single time point with an MLP denoiser and a discrete Gaussian diffusion process\. We use a cosine noise schedule and exponential moving averaging during optimization\. Detailed settings are listed in Table[XVII](https://arxiv.org/html/2611.33788#A1.T17)\.

TABLE XVII:Hyperparameters for IGE\-TabDDPM\.
##### IGE\-CSDI

IGE\-CSDI models multivariate trajectories using residual diffusion layers with temporal and feature embeddings\. It is trained on 96\-step trajectories and uses conditional diffusion\-based denoising to generate the unobserved entries while conditioning on feature\-by\-time observation masks\. Table[XVIII](https://arxiv.org/html/2611.33788#A1.T18)reports the architecture, optimization, and diffusion settings\.

TABLE XVIII:Hyperparameters for IGE\-CSDI\.
##### IGE\-FGTI

IGE\-FGTI augments the longitudinal diffusion backbone with a frequency encoder to capture dominant spectral components in physiological trajectories\. The implementation uses a frequency cutoff of 0\.3 and retains the 10 dominant frequencies\. The remaining settings are given in Table[XIX](https://arxiv.org/html/2611.33788#A1.T19)\.

TABLE XIX:Hyperparameters for IGE\-FGTI\.
##### IGE\-MTSCI

IGE\-MTSCI uses a residual diffusion architecture with an additional consistency objective to improve agreement across generated trajectory segments\. Noise\-prediction and consistency losses are jointly optimized with separately weighted terms\. Table[XX](https://arxiv.org/html/2611.33788#A1.T20)provides the complete implementation settings\.

TABLE XX:Hyperparameters for IGE\-MTSCI\.

## Appendix BLLM Prompt Templates and JSON Schemas

Listingsandprovide the complete few\-shot prompt templates for parsing requests at a single time point and across a longitudinal trajectory\. The prompt\-family instructions used in the LLM evaluation are provided in the LLM Module Evaluation subsection\. Each evaluation prompt combines the corresponding instruction with the applicable schema and feature catalog reported here\. Both templates use the 35 clinical variables listed in Table[XXI](https://arxiv.org/html/2611.33788#A4.T21), together with their units and value ranges\. Listingsandprovide the corresponding JSON Schemas\. The schemas validate the output fields, supported feature names, and conditioning types\. Value ranges are checked separately against the feature dictionary before clinician confirmation\.

Complete Few\-Shot Prompt Template for Parsing a Request at a Single Time Point

\#SYSTEM

Youconvertaclinician’snatural\-languagerequest\(plusanyexplicitfeaturevalues\)intoONEJSONobjectthatdrivesaSINGLE\-TIME\-POINTsynthetic\-patientgenerator\.TheJSONmustvalidateagainst‘single\_step\.schema\.json‘\.

RULES\(mustfollowexactly\):

\-OutputONLYoneJSONobject,noprose,nomarkdownfences\.

\-‘feature‘MUSTbecopiedverbatimfromthecatalogbelow\.NEVERinventorabbreviateafeaturename\.

\-Keepnumericvaluesinthelisted‘unit‘,withinthe‘plausiblerange‘,unlesstheclinicianexplicitlyasksforanextreme\.

\-AnyquantitytheclinicianmentionsthatisNOTinthecatalog\(e\.g\.FiO2,PEEP,lungcompliance,plateaupressure,urineoutput,ventilator/ECMOsettings\)goesin‘unsupported\_facts‘asashortstring\-\-NEVERin‘conditioning‘\.

\-Putanythingyoucouldnotmapconfidentlyinto‘ambiguity\_flags‘;set‘confidence‘\(0\.\.1\)toyouroverallparseconfidence\.

\-LeaveanyfeatureyouarenottoldaboutOUTof‘conditioning‘\(thegeneratorfillsitin\)\.

\#ALLOWEDFEATURES\(35\)\-\-names,units,plausibleranges

\|feature\(usethisexactname\)\|unit\|plausiblerange\|type\|

\|\-\-\-\|\-\-\-\|\-\-\-\|\-\-\-\|

\|‘temperature‘\|degC\|30\-\-43\|continuous\|

\|‘map\_line‘\|mmHg\|20\-\-160\|continuous\|

\|‘map\_cuff‘\|mmHg\|20\-\-160\|continuous\|

\|‘pulse‘\|bpm\|20\-\-220\|continuous\|

\|‘unassisted\_resp\_rate‘\|breaths/min\|0\-\-60\|continuous\|

\|‘end\_tidal\_co2‘\|mmHg\|0\-\-80\|continuous\|

\|‘o2\_flow\_rate‘\|L/min\|0\-\-60\|continuous\|

\|‘base\_excess‘\|mmol/L\|\-30\-\-30\|continuous\|

\|‘bicarb\_\(hco3\)‘\|mmol/L\|5\-\-50\|continuous\|

\|‘blood\_urea\_nitrogen\_\(bun\)‘\|mg/dL\|1\-\-200\|continuous\|

\|‘creatinine‘\|mg/dL\|0\.1\-\-20\|continuous\|

\|‘phosphorus‘\|mg/dL\|0\.5\-\-15\|continuous\|

\|‘hemoglobin‘\|g/dL\|2\-\-22\|continuous\|

\|‘met\_hgb‘\|%

\|‘platelets‘\|10^3/uL\|1\-\-1000\|continuous\|

\|‘white\_blood\_cell\_count‘\|10^3/uL\|0\-\-100\|continuous\|

\|‘carboxy\_hgb‘\|%

\|‘alanine\_aminotransferase\_\(alt\)‘\|U/L\|0\-\-10000\|continuous\|

\|‘ammonia‘\|umol/L\|0\-\-500\|continuous\|

\|‘aspartate\_aminotransferase\_\(ast\)‘\|U/L\|0\-\-10000\|continuous\|

\|‘bilirubin\_total‘\|mg/dL\|0\-\-50\|continuous\|

\|‘fibrinogen‘\|mg/dL\|30\-\-1000\|continuous\|

\|‘inr‘\|ratio\|0\.5\-\-12\|continuous\|

\|‘lactate\_dehydrogenase‘\|U/L\|50\-\-10000\|continuous\|

\|‘lactic\_acid‘\|mmol/L\|0\-\-30\|continuous\|

\|‘partial\_prothrombin\_time\_\(ptt\)‘\|sec\|10\-\-200\|continuous\|

\|‘lipase‘\|U/L\|0\-\-10000\|continuous\|

\|‘partial\_pressure\_of\_carbon\_dioxide\_\(paco2\)‘\|mmHg\|10\-\-150\|continuous\|

\|‘ph‘\|pH\|6\.6\-\-7\.8\|continuous\|

\|‘saturation\_of\_oxygen\_\(sao2\)‘\|%

\|‘procalcitonin‘\|ng/mL\|0\-\-500\|continuous\|

\|‘gcs\_total\_score‘\|score\|3\-\-15\|ordinal\|

\|‘spo2‘\|%

\|‘partial\_pressure\_of\_oxygen\_\(pao2\)‘\|mmHg\|20\-\-700\|continuous\|

\|‘rass\_score‘\|score\|\-5\-\-4\|ordinal\|

\#OUTPUTFORMAT

\{

"mode":"single\_step",

"scenario\_name":"<shortlabel\>",

"csn\_or\_template":null,

"num\_samples":<int\>=1\>,

"seed":<intornull\>,

"conditioning":\[

\{"feature":"<name\>","type":"value","value":<number\>,"units":"<unit\>"\},

\{"feature":"<name\>","type":"range","min":<number\>,"max":<number\>,"sampling":"uniform\|midpoint\|reject","units":"<unit\>"\}

\],

"unsupported\_facts":\["<statedbutunmodeledquantity\>"\],

"confidence":<0\.\.1\>,

"notes":null,

"ambiguity\_flags":\[\]

\}

\-‘type:"value"‘=fixthefeatureexactly\.‘type:"range"‘=boundit\(uniform/midpoint\-\>adrawnobservedvalue;reject\-\>keepfreeandfiltergeneratedsamplestotherange\)\.

\-Notimefieldsandnotrajectoriesareusedinthismode\.

\#EXAMPLE

INPUT:"Generate200VV\-ECMOrecordswithlowoxygensaturationandarterialoxygenpressure\."

OUTPUT:

\{

"mode":"single\_step",

"scenario\_name":"VV\-ECMOwithlowoxygenation",

"csn\_or\_template":null,

"num\_samples":200,

"seed":0,

"conditioning":\[

\{

"feature":"spo2",

"type":"range",

"min":85,

"max":92,

"sampling":"uniform",

"units":"%

\},

\{

"feature":"partial\_pressure\_of\_oxygen\_\(pao2\)",

"type":"range",

"min":50,

"max":80,

"sampling":"uniform",

"units":"mmHg"

\}

\],

"unsupported\_facts":\[\],

"confidence":0\.9,

"notes":null,

"ambiguity\_flags":\[\]

\}

\#USERREQUEST

<<<clinicianutterancehere\>\>\>

Complete Few\-Shot Prompt Template for Parsing a Longitudinal Request

\#SYSTEM

Youconvertaclinician’snatural\-languagerequest\(plusanyexplicitfeaturevalues\)intoONEJSONobjectthatdrivesaLONGITUDINAL\(time\-series\)synthetic\-trajectorygeneratoroverLtimesteps\.TheJSONmustvalidateagainst‘time\_series\.schema\.json‘\.

RULES\(mustfollowexactly\):

\-OutputONLYoneJSONobject,noprose,nomarkdownfences\.

\-‘feature‘MUSTbecopiedverbatimfromthecatalogbelow\.NEVERinventorabbreviateafeaturename\.

\-Keepnumericvaluesinthelisted‘unit‘,withinthe‘plausiblerange‘,unlesstheclinicianexplicitlyasksforanextreme\.

\-AnyquantitytheclinicianmentionsthatisNOTinthecatalog\(e\.g\.FiO2,PEEP,lungcompliance,plateaupressure,urineoutput,ventilator/ECMOsettings\)goesin‘unsupported\_facts‘asashortstring\-\-NEVERin‘conditioning‘\.

\-Putanythingyoucouldnotmapconfidentlyinto‘ambiguity\_flags‘;set‘confidence‘\(0\.\.1\)toyouroverallparseconfidence\.

\-LeaveanyfeatureyouarenottoldaboutOUTof‘conditioning‘\(thegeneratorfillsitin\)\.

\-ThisisTIME\-SERIESmode:include‘time\_grid‘andputtimewindowsonconditionsvia‘window‘\(stepindicesORhours,notboth\)\.Use‘type:"trajectory"‘fortime\-varyingpatterns\.

\#ALLOWEDFEATURES\(35\)\-\-names,units,plausibleranges

\|feature\(usethisexactname\)\|unit\|plausiblerange\|type\|

\|\-\-\-\|\-\-\-\|\-\-\-\|\-\-\-\|

\|‘temperature‘\|degC\|30\-\-43\|continuous\|

\|‘map\_line‘\|mmHg\|20\-\-160\|continuous\|

\|‘map\_cuff‘\|mmHg\|20\-\-160\|continuous\|

\|‘pulse‘\|bpm\|20\-\-220\|continuous\|

\|‘unassisted\_resp\_rate‘\|breaths/min\|0\-\-60\|continuous\|

\|‘end\_tidal\_co2‘\|mmHg\|0\-\-80\|continuous\|

\|‘o2\_flow\_rate‘\|L/min\|0\-\-60\|continuous\|

\|‘base\_excess‘\|mmol/L\|\-30\-\-30\|continuous\|

\|‘bicarb\_\(hco3\)‘\|mmol/L\|5\-\-50\|continuous\|

\|‘blood\_urea\_nitrogen\_\(bun\)‘\|mg/dL\|1\-\-200\|continuous\|

\|‘creatinine‘\|mg/dL\|0\.1\-\-20\|continuous\|

\|‘phosphorus‘\|mg/dL\|0\.5\-\-15\|continuous\|

\|‘hemoglobin‘\|g/dL\|2\-\-22\|continuous\|

\|‘met\_hgb‘\|%

\|‘platelets‘\|10^3/uL\|1\-\-1000\|continuous\|

\|‘white\_blood\_cell\_count‘\|10^3/uL\|0\-\-100\|continuous\|

\|‘carboxy\_hgb‘\|%

\|‘alanine\_aminotransferase\_\(alt\)‘\|U/L\|0\-\-10000\|continuous\|

\|‘ammonia‘\|umol/L\|0\-\-500\|continuous\|

\|‘aspartate\_aminotransferase\_\(ast\)‘\|U/L\|0\-\-10000\|continuous\|

\|‘bilirubin\_total‘\|mg/dL\|0\-\-50\|continuous\|

\|‘fibrinogen‘\|mg/dL\|30\-\-1000\|continuous\|

\|‘inr‘\|ratio\|0\.5\-\-12\|continuous\|

\|‘lactate\_dehydrogenase‘\|U/L\|50\-\-10000\|continuous\|

\|‘lactic\_acid‘\|mmol/L\|0\-\-30\|continuous\|

\|‘partial\_prothrombin\_time\_\(ptt\)‘\|sec\|10\-\-200\|continuous\|

\|‘lipase‘\|U/L\|0\-\-10000\|continuous\|

\|‘partial\_pressure\_of\_carbon\_dioxide\_\(paco2\)‘\|mmHg\|10\-\-150\|continuous\|

\|‘ph‘\|pH\|6\.6\-\-7\.8\|continuous\|

\|‘saturation\_of\_oxygen\_\(sao2\)‘\|%

\|‘procalcitonin‘\|ng/mL\|0\-\-500\|continuous\|

\|‘gcs\_total\_score‘\|score\|3\-\-15\|ordinal\|

\|‘spo2‘\|%

\|‘partial\_pressure\_of\_oxygen\_\(pao2\)‘\|mmHg\|20\-\-700\|continuous\|

\|‘rass\_score‘\|score\|\-5\-\-4\|ordinal\|

\#OUTPUTFORMAT

\{

"mode":"time\_series",

"scenario\_name":"<shortlabel\>",

"csn\_or\_template":null,

"num\_samples":<int\>=1\>,

"seed":<intornull\>,

"time\_grid":\{"n\_timesteps":96,"hours\_per\_step":1\.0\},

"conditioning":\[

\{"feature":"<name\>","type":"value","value":<number\>,"units":"<unit\>","window":\{"start\_step":<int\>,"end\_step":<int\>\}\},

\{"feature":"<name\>","type":"range","min":<number\>,"max":<number\>,"sampling":"uniform\|midpoint\|reject","units":"<unit\>"\},

\{"feature":"<name\>","type":"trajectory","pattern":"increasing\|decreasing\|stable\|linear\|spike\|drop","from":<number\>,"to":<number\>,"units":"<unit\>","window":\{"start\_hour":<num\>,"duration\_hours":<num\>\}\}

\],

"unsupported\_facts":\["<statedbutunmodeledquantity\>"\],

"confidence":<0\.\.1\>,

"notes":null,

"ambiguity\_flags":\[\]

\}

\-‘window‘omitted=\>wholetrajectory\.SamefeaturemayusemultipleDISJOINTwindows\(e\.g\.stablethendeclining\)\.Overlappingwindowsononefeatureareinvalid\.

\-‘trajectory‘directionmustbeconsistent:increasingneedsto\>from;decreasingto<from;stableuses‘from‘only;spike/dropgobaseline\-\>peak/trough\-\>baseline\(window\>=3steps\)\.

\#EXAMPLE

INPUT:"Patientstableforthefirstday,thenSpO2dropsfrom96to80overhours24\-48withrisingPaCO2andtachycardia\."

OUTPUT:

\{

"mode":"time\_series",

"scenario\_name":"Acutehypoxemicdeteriorationduringhours24\-48",

"csn\_or\_template":null,

"num\_samples":50,

"seed":3,

"time\_grid":\{

"n\_timesteps":96,

"hours\_per\_step":1\.0

\},

"conditioning":\[

\{

"feature":"spo2",

"type":"trajectory",

"pattern":"stable",

"from":96,

"units":"%

"window":\{

"start\_step":0,

"end\_step":24

\}

\},

\{

"feature":"spo2",

"type":"trajectory",

"pattern":"decreasing",

"from":96,

"to":80,

"units":"%

"window":\{

"start\_hour":24,

"duration\_hours":24

\}

\},

\{

"feature":"partial\_pressure\_of\_carbon\_dioxide\_\(paco2\)",

"type":"trajectory",

"pattern":"increasing",

"from":45,

"to":70,

"window":\{

"start\_hour":24,

"duration\_hours":24

\}

\},

\{

"feature":"pulse",

"type":"range",

"min":100,

"max":130,

"sampling":"uniform",

"units":"bpm",

"window":\{

"start\_hour":24,

"duration\_hours":24

\}

\}

\],

"notes":"Twodisjointwindowsonspo2\(stable0\-24h,declining24\-48h\);hour\-basedwindows;steps48\-96leftfree\.",

"ambiguity\_flags":\[\]

\}

\#USERREQUEST

<<<clinicianutterancehere\>\>\>

JSON Schema for a Request at a Single Time Point

\{

"$schema":"https://json\-schema\.org/draft/2020\-12/schema",

"$id":"https://ige\.local/schema/single\_step\.schema\.json",

"title":"IGEsingle\-time\-pointgenerationrequest",

"description":"ConstrainstheLLMoutputforSINGLE\-TIME\-POINTgeneration\(IGE\-PMVAE/IGE\-VAEAC/IGE\-TabDDPM\)\.TheLLMreadsaclinician’sfree\-textdescriptionplusanyexplicitfeaturevaluesandemitsTHISobject\.‘conditioning‘fixes/boundsobservedfeatures;everythingelseisgenerated\.Notimedimensionisusedhere\(usetime\_series\.schema\.jsonfortrajectories\)\.",

"type":"object",

"additionalProperties":false,

"required":\[

"scenario\_name",

"conditioning",

"num\_samples"

\],

"properties":\{

"mode":\{

"const":"single\_step"

\},

"scenario\_name":\{

"type":"string",

"minLength":1

\},

"csn\_or\_template":\{

"type":\[

"string",

"null"

\],

"description":"Seed/conditiononarealpatientCSNoranamedtemplate;null=generatefromscratch\."

\},

"num\_samples":\{

"type":"integer",

"minimum":1,

"default":100

\},

"seed":\{

"type":\[

"integer",

"null"

\]

\},

"conditioning":\{

"type":"array",

"items":\{

"$ref":"\#/$defs/condition"

\}

\},

"unsupported\_facts":\{

"type":"array",

"items":\{

"type":"string"

\},

"description":"ClinicallystatedbutNOToneofthe35modeledfeatures\(e\.g\.FiO2,PEEP,lungcompliance,plateaupressure,urineoutput,ventilator/ECMOsettings\)\.Recordedforprovenance;themodelCANNOTgeneratethem\.DoNOTputthesein‘conditioning‘\."

\},

"confidence":\{

"type":"number",

"minimum":0,

"maximum":1

\},

"notes":\{

"type":\[

"string",

"null"

\]

\},

"ambiguity\_flags":\{

"type":"array",

"items":\{

"type":"string"

\},

"description":"Phrasestheparsercouldnotresolve;non\-emptyshouldtriggeraclarifyingquestion,notgeneration\."

\}

\},

"$defs":\{

"feature":\{

"description":"Canonicalfeature;MUSTbeoneofthe35modelfeatures\(feature\_dictionary\.json\)\.",

"enum":\[

"temperature",

"map\_line",

"map\_cuff",

"pulse",

"unassisted\_resp\_rate",

"end\_tidal\_co2",

"o2\_flow\_rate",

"base\_excess",

"bicarb\_\(hco3\)",

"blood\_urea\_nitrogen\_\(bun\)",

"creatinine",

"phosphorus",

"hemoglobin",

"met\_hgb",

"platelets",

"white\_blood\_cell\_count",

"carboxy\_hgb",

"alanine\_aminotransferase\_\(alt\)",

"ammonia",

"aspartate\_aminotransferase\_\(ast\)",

"bilirubin\_total",

"fibrinogen",

"inr",

"lactate\_dehydrogenase",

"lactic\_acid",

"partial\_prothrombin\_time\_\(ptt\)",

"lipase",

"partial\_pressure\_of\_carbon\_dioxide\_\(paco2\)",

"ph",

"saturation\_of\_oxygen\_\(sao2\)",

"procalcitonin",

"gcs\_total\_score",

"spo2",

"partial\_pressure\_of\_oxygen\_\(pao2\)",

"rass\_score"

\]

\},

"condition":\{

"oneOf":\[

\{

"type":"object",

"additionalProperties":false,

"description":"Fixthefeaturetoanexactvalue\(observed\)\.",

"required":\[

"feature",

"type",

"value"

\],

"properties":\{

"feature":\{

"$ref":"\#/$defs/feature"

\},

"type":\{

"const":"value"

\},

"value":\{

"type":"number"

\},

"units":\{

"type":\[

"string",

"null"

\]

\}

\}

\},

\{

"type":"object",

"additionalProperties":false,

"description":"Constrainthefeaturetoarange\.sampling=uniform\|midpointbecomesanobservedvalue;sampling=rejectkeepsthefeaturefreeandfiltersgeneratedsamplestotherange\.",

"required":\[

"feature",

"type",

"min",

"max"

\],

"properties":\{

"feature":\{

"$ref":"\#/$defs/feature"

\},

"type":\{

"const":"range"

\},

"min":\{

"type":"number"

\},

"max":\{

"type":"number"

\},

"sampling":\{

"enum":\[

"uniform",

"midpoint",

"reject"

\],

"default":"uniform"

\},

"units":\{

"type":\[

"string",

"null"

\]

\}

\}

\}

\]

\}

\}

\}

JSON Schema for a Longitudinal Request

\{

"$schema":"https://json\-schema\.org/draft/2020\-12/schema",

"$id":"https://ige\.local/schema/time\_series\.schema\.json",

"title":"IGEtime\-series\(trajectory\)generationrequest",

"description":"ConstrainstheLLMoutputforLONGITUDINALgeneration\(IGE\-CSDI/IGE\-FGTI/IGE\-MTSCI\)\.TheLLMreadsaclinician’sfree\-textdescriptionplusanyexplicitfeaturevaluesandemitsTHISobject\.‘conditioning‘fixes/boundsobserved\(feature,timestep\)entries;everythingelseisgeneratedovertheL\-steptrajectory\.",

"type":"object",

"additionalProperties":false,

"required":\[

"scenario\_name",

"time\_grid",

"conditioning",

"num\_samples"

\],

"properties":\{

"mode":\{

"const":"time\_series"

\},

"scenario\_name":\{

"type":"string",

"minLength":1

\},

"csn\_or\_template":\{

"type":\[

"string",

"null"

\],

"description":"Seed/conditiononarealpatientCSNoranamedtemplate;null=fromscratch\."

\},

"num\_samples":\{

"type":"integer",

"minimum":1,

"default":100

\},

"seed":\{

"type":\[

"integer",

"null"

\]

\},

"time\_grid":\{

"type":"object",

"additionalProperties":false,

"required":\[

"n\_timesteps"

\],

"description":"Trajectorylengthandhour<\-\>stepresolution\.Currentcheckpointsusen\_timesteps=96at1h/step\.",

"properties":\{

"n\_timesteps":\{

"type":"integer",

"minimum":1,

"default":96

\},

"hours\_per\_step":\{

"type":\[

"number",

"null"

\],

"exclusiveMinimum":0,

"default":1

\}

\}

\},

"conditioning":\{

"type":"array",

"items":\{

"$ref":"\#/$defs/condition"

\}

\},

"unsupported\_facts":\{

"type":"array",

"items":\{

"type":"string"

\},

"description":"ClinicallystatedbutNOToneofthe35modeledfeatures\(FiO2,PEEP,compliance,plateaupressure,urineoutput,vent/ECMOsettings\)\.Recordedonly;NOTgeneratable\.DoNOTputin‘conditioning‘\."

\},

"confidence":\{

"type":"number",

"minimum":0,

"maximum":1

\},

"notes":\{

"type":\[

"string",

"null"

\]

\},

"ambiguity\_flags":\{

"type":"array",

"items":\{

"type":"string"

\}

\}

\},

"$defs":\{

"feature":\{

"description":"Canonicalfeature;MUSTbeoneofthe35modelfeatures\(feature\_dictionary\.json\)\.",

"enum":\[

"temperature",

"map\_line",

"map\_cuff",

"pulse",

"unassisted\_resp\_rate",

"end\_tidal\_co2",

"o2\_flow\_rate",

"base\_excess",

"bicarb\_\(hco3\)",

"blood\_urea\_nitrogen\_\(bun\)",

"creatinine",

"phosphorus",

"hemoglobin",

"met\_hgb",

"platelets",

"white\_blood\_cell\_count",

"carboxy\_hgb",

"alanine\_aminotransferase\_\(alt\)",

"ammonia",

"aspartate\_aminotransferase\_\(ast\)",

"bilirubin\_total",

"fibrinogen",

"inr",

"lactate\_dehydrogenase",

"lactic\_acid",

"partial\_prothrombin\_time\_\(ptt\)",

"lipase",

"partial\_pressure\_of\_carbon\_dioxide\_\(paco2\)",

"ph",

"saturation\_of\_oxygen\_\(sao2\)",

"procalcitonin",

"gcs\_total\_score",

"spo2",

"partial\_pressure\_of\_oxygen\_\(pao2\)",

"rass\_score"

\]

\},

"window":\{

"type":"object",

"additionalProperties":false,

"description":"Timestepwindowtheconstraintappliesto\.ProvideEITHERstepindicesORhours\(notboth\)\.Omit=\>wholetrajectory\.Inclusivestart,exclusiveend\.",

"properties":\{

"start\_step":\{

"type":\[

"integer",

"null"

\],

"minimum":0

\},

"end\_step":\{

"type":\[

"integer",

"null"

\],

"minimum":0

\},

"start\_hour":\{

"type":\[

"number",

"null"

\],

"minimum":0

\},

"duration\_hours":\{

"type":\[

"number",

"null"

\],

"exclusiveMinimum":0

\}

\}

\},

"condition":\{

"oneOf":\[

\{

"type":"object",

"additionalProperties":false,

"description":"Fixthefeaturetoanexactvalueoverthewindow\.",

"required":\[

"feature",

"type",

"value"

\],

"properties":\{

"feature":\{

"$ref":"\#/$defs/feature"

\},

"type":\{

"const":"value"

\},

"value":\{

"type":"number"

\},

"units":\{

"type":\[

"string",

"null"

\]

\},

"window":\{

"$ref":"\#/$defs/window"

\}

\}

\},

\{

"type":"object",

"additionalProperties":false,

"description":"Constrainthefeaturetoarangeoverthewindow\.sampling=uniform\|midpoint\-\>observed;reject\-\>free\+post\-filter\.",

"required":\[

"feature",

"type",

"min",

"max"

\],

"properties":\{

"feature":\{

"$ref":"\#/$defs/feature"

\},

"type":\{

"const":"range"

\},

"min":\{

"type":"number"

\},

"max":\{

"type":"number"

\},

"sampling":\{

"enum":\[

"uniform",

"midpoint",

"reject"

\],

"default":"uniform"

\},

"units":\{

"type":\[

"string",

"null"

\]

\},

"window":\{

"$ref":"\#/$defs/window"

\}

\}

\},

\{

"type":"object",

"additionalProperties":false,

"description":"Atemporalpatternmaterializedacrossthewindow\.‘from‘/‘to‘areendpointvalues\(rawunits\)\.increasingrequiresto\>from;decreasingto<from;stableusesfromonly;spike/dropgofrombaselinetoapeak/troughandback\.",

"required":\[

"feature",

"type",

"pattern"

\],

"properties":\{

"feature":\{

"$ref":"\#/$defs/feature"

\},

"type":\{

"const":"trajectory"

\},

"pattern":\{

"enum":\[

"increasing",

"decreasing",

"stable",

"linear",

"spike",

"drop"

\]

\},

"from":\{

"type":\[

"number",

"null"

\]

\},

"to":\{

"type":\[

"number",

"null"

\]

\},

"units":\{

"type":\[

"string",

"null"

\]

\},

"window":\{

"$ref":"\#/$defs/window"

\}

\}

\}

\]

\}

\}

\}

## Appendix CSupporting Backbone Formulations

This appendix provides the standard objectives and sampling equations for the generative backbones summarized in Methods\. These formulations follow the cited backbone papers\.

##### VAEAC and PMVAE

VAEAC\[[10](https://arxiv.org/html/2611.33788#bib.bib10)\]learns a mask\-dependent conditional prior by maximizing

ℒVAEAC=𝔼qϕ​\(z∣x,b\)\[logpθ\(xu∣z,xo,b\)\]−DKL\(qϕ\(z∣x,b\)∥pψ\(z∣xo,b\)\)\.\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{VAEAC\}\}=\\mathbb\{E\}\_\{q\_\{\\phi\}\(z\\mid x,b\)\}\[\\log p\_\{\\theta\}\(x\_\{u\}\\mid z,x\_\{o\},b\)\]\-D\_\{\\mathrm\{KL\}\}\\\!\\left\(q\_\{\\phi\}\(z\\mid x,b\)\\,\\\|\\,p\_\{\\psi\}\(z\\mid x\_\{o\},b\)\\right\)\.\(4\)PMVAE\[[11](https://arxiv.org/html/2611.33788#bib.bib11)\]trains a partial encoder by matching the posterior inferred from observed features to the full\-data posterior, using

ℒPM=−𝔼z∼qψ\(⋅∣x\)\[logqθ\(z∣xo\)\]\.\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{PM\}\}=\-\\mathbb\{E\}\_\{z\\sim q\_\{\\psi\}\(\\cdot\\mid x\)\}\[\\log q\_\{\\theta\}\(z\\mid x\_\{o\}\)\]\.\(5\)

##### IGE\-TabDDPM

IGE\-TabDDPM uses replacement\-based conditional sampling\[[23](https://arxiv.org/html/2611.33788#bib.bib23)\]\. During the reverse update from diffusion stepτ\\tautoτ−1\\tau\-1, the sampler combines the observed entries at the corresponding noise level,xknownτ−1x\_\{\\mathrm\{known\}\}^\{\\tau\-1\}, with the entries proposed by the denoiser,xsampleτ−1x\_\{\\mathrm\{sample\}\}^\{\\tau\-1\}:

xτ−1=b⊙xknownτ−1\+\(1−b\)⊙xsampleτ−1\.\\displaystyle x^\{\\tau\-1\}=b\\odot x\_\{\\mathrm\{known\}\}^\{\\tau\-1\}\+\(1\-b\)\\odot x\_\{\\mathrm\{sample\}\}^\{\\tau\-1\}\.\(6\)Thus, the observed entries are restored at each reverse\-diffusion step while the remaining entries are generated\.

##### CSDI

At diffusion stepτ\\tau, CSDI\[[24](https://arxiv.org/html/2611.33788#bib.bib24)\]updates the unobserved trajectory according to

Xuτ−1←1ατ\(Xuτ−1−ατ1−α¯τϵθ\(Xuτ,τ∣Xo,B\)\)\+στz,\\displaystyle X\_\{u\}^\{\\tau\-1\}\\leftarrow\\frac\{1\}\{\\sqrt\{\\alpha\_\{\\tau\}\}\}\\left\(X\_\{u\}^\{\\tau\}\-\\frac\{1\-\\alpha\_\{\\tau\}\}\{\\sqrt\{1\-\\bar\{\\alpha\}\_\{\\tau\}\}\}\\epsilon\_\{\\theta\}\(X\_\{u\}^\{\\tau\},\\tau\\mid X\_\{o\},B\)\\right\)\+\\sigma\_\{\\tau\}z,\(7\)wherez∼𝒩⁡\(0,I\)z\\sim\\mathcal\{N\}\(0,I\)\. Its conditional noise\-matching objective is

ℒCSDI=𝔼Xo,Xu,ϵ,τ\[∥ϵ−ϵθ\(Xuτ,τ∣Xo,B\)∥2\]\.\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{CSDI\}\}=\\mathbb\{E\}\_\{X\_\{o\},X\_\{u\},\\epsilon,\\tau\}\\left\[\\\|\\epsilon\-\\epsilon\_\{\\theta\}\(X\_\{u\}^\{\\tau\},\\tau\\mid X\_\{o\},B\)\\\|^\{2\}\\right\]\.\(8\)

##### FGTI

FGTI\[[25](https://arxiv.org/html/2611.33788#bib.bib25)\]augments conditional noise matching with a frequency\-domain term:

ℒFGTI\\displaystyle\\mathcal\{L\}\_\{\\mathrm\{FGTI\}\}=𝔼Xo,Xu,ϵ,τ\[∥ϵ−ϵθ\(Xuτ,τ∣Xo,B\)∥2\\displaystyle=\\mathbb\{E\}\_\{X\_\{o\},X\_\{u\},\\epsilon,\\tau\}\\left\[\\\|\\epsilon\-\\epsilon\_\{\\theta\}\(X\_\{u\}^\{\\tau\},\\tau\\mid X\_\{o\},B\)\\\|^\{2\}\\right\.\+λ∥ℱ\(ϵ\)−ℱ\(ϵθ\(Xuτ,τ∣Xo,B\)\)∥2\],\\displaystyle\\left\.\+\\lambda\\\|\\mathcal\{F\}\(\\epsilon\)\-\\mathcal\{F\}\(\\epsilon\_\{\\theta\}\(X\_\{u\}^\{\\tau\},\\tau\\mid X\_\{o\},B\)\)\\\|^\{2\}\\right\],\(9\)whereℱ\\mathcal\{F\}denotes the Fourier transform\.

##### MTSCI

MTSCI\[[26](https://arxiv.org/html/2611.33788#bib.bib26)\]mixes the noisy target with an adjacent context window before denoising:

Xin=B⊙Xo\+\(1−B\)⊙\(γ​Xctx\+\(1−γ\)​Xuτ\),\\displaystyle X\_\{\\mathrm\{in\}\}=B\\odot X\_\{o\}\+\(1\-B\)\\odot\\left\(\\gamma X\_\{\\mathrm\{ctx\}\}\+\(1\-\\gamma\)X\_\{u\}^\{\\tau\}\\right\),\(10\)whereγ∈\[0,1\]\\gamma\\in\[0,1\]is sampled from a Beta distribution\.

## Appendix DClinical Variables

The pooled Duke–Emory representation comprises the 35 clinical variables listed in Table[XXI](https://arxiv.org/html/2611.33788#A4.T21)\. These variables form the input at a single time point and at each time point in a longitudinal trajectory\.

TABLE XXI:Clinical Variables in the Pooled Duke–Emory Representation
## Appendix EAdditional Experiments

### E\-ALLM Module Evaluation

We evaluate the optional LLM parser, which converts natural\-language clinical requests into structured JSON specifications\. We construct evaluation datasets to assess Gemma3\-4B, MedGemma\-4B, MedAlpaca 7B, Mistral\-7B, and Qwen3\-4B\[[34](https://arxiv.org/html/2611.33788#bib.bib34),[35](https://arxiv.org/html/2611.33788#bib.bib35),[36](https://arxiv.org/html/2611.33788#bib.bib36),[37](https://arxiv.org/html/2611.33788#bib.bib37)\]\. All prompt families share a common system instruction:

"YourtaskistoconvertclinicianrequestsintostructuredJSONspecificationsforgeneratingsyntheticclinicaldata\.Beprecise,thorough,andalwaysincludeaconfidencescore\."

The only exception is the role\-anchored variant, where the system role is specified as: “You are an expert clinical data specification assistant\.” The differences across prompt families lie primarily in the user prompts\. We illustrate these differences using the following clinician utterance:“Severe ARDS patient on VV\-ECMO with gradual improvement in oxygenation over 48 hours\.”

Below are the prompt templates for each variant, all applied to the same clinician utterance\.

1. 1\.Direct Zero\-Shot ConvertthefollowingclinicianutterancesintoaJSONobjectthatfollowsthisschema: <JSON\_SCHEMA\> Hereisavariabledictionaryformappingclinicaltermstofeaturenames: <VARIABLE\_DICTIONARY\> <CLINICIAN\_UTTERANCE\>
2. 2\.Few\-Shot ConvertclinicianutteranceintostructuredJSON\.TheJSONmustfollowthisschema: <JSON\_SCHEMA\> Hereisavariabledictionaryformappingclinicaltermstofeaturenames: <VARIABLE\_DICTIONARY\> Studythefollowingexamplescarefully: <few\-shotexamples\> Nowconvertthisutteranceusingthesameschemaandvariablemappings: <CLINICIAN\_UTTERANCE\>
3. 3\.Role\-Anchored Few\-Shot Youareanexpertclinicaldataspecificationassistant\.HereareexamplesofhowtoconvertclinicianutterancesintoJSON\.TheJSONmustconformtothisschema: <JSON\_SCHEMA\> Hereisavariabledictionaryformappingclinicaltermstofeaturenames: <VARIABLE\_DICTIONARY\> Studytheseexamples: <few\-shotexamples\> Nowconvertthefollowingclinicianutterance\.Includeaconfidencescore\. <CLINICIAN\_UTTERANCE\>
4. 4\.Stepwise Few\-Shot Followtheseexamplestolearnthetask: <few\-shotexamples\> Forthenextutterance,followthesestepssystematically: Step1:Extractthescenarionameandtimewindow\. Step2:Mapclinicalparameterstofeaturenames\. Step3:Determinetype\(fixedvalue,range,ortrajectory\)\. Step4:ConstructtheJSONfollowingthisschema: <JSON\_SCHEMA\> Hereisavariabledictionaryformappingclinicaltermstofeaturenames: <VARIABLE\_DICTIONARY\> Step5:Addnotesaboutambiguities\. <CLINICIAN\_UTTERANCE\>

[TableXXII](https://arxiv.org/html/2611.33788#A5.T22)summarizes the performance of the optional LLM parser across four prompt formats and five large language models\. We report syntactic metrics \(parse success rate and schema compliance\), semantic metrics \(slot\-level F1 and spurious slot rate\), and the ambiguity flagging rate\.

TABLE XXII:LLM Module PerformanceGemma3 4B with Few\-Shot prompting achieves the best overall parsing performance, with a slot F1 of 0\.97, 100% parse success, 100% schema compliance, and a 2\.7% spurious slot rate\. Few\-Shot prompting gives a higher slot F1 than Direct Zero\-Shot prompting for all five models\. Biomedical instruction tuning does not consistently improve parsing: MedGemma 4B reaches a slot F1 of 0\.94 with Role\-Anchored Few\-Shot prompting, whereas MedAlpaca 7B reaches at most 0\.32 and often returns output that cannot be parsed or does not follow the schema\. MedAlpaca’s 0% spurious slot rate under Stepwise Few\-Shot prompting results from complete parsing failure rather than correct extraction\.

### E\-BSubset Evaluation on Clinically Salient Features

We evaluate model performance when conditioning on a subset of clinically salient features identified in consultation with domain experts\. Specifically, we collaborated with clinicians to select 12 key variables critical to the management of VV\-ECMO patients in our dataset\. Focusing on this targeted subset allows us to simulate real\-world clinical scenarios where practitioners prioritize specific physiological indicators\. These features serve as the observed conditioning inputsxox\_\{o\}to guide the generation of the remaining patient features\. The selected features are grouped into three primary physiological categories:

1. 1\.Oxygenation\-related features:Indicators of systemic oxygenation, including peripheral oxygen saturation \(SpO2\\text\{SpO\}\_\{2\}\), partial pressure of oxygen \(PaO2\\text\{PaO\}\_\{2\}\), and arterial oxygen saturation \(SaO2\\text\{SaO\}\_\{2\}\)\.
2. 2\.Ventilation and acid\-base features:Indicators of ventilation and acid\-base balance, including base excess, partial pressure of carbon dioxide \(PaCO2\\text\{PaCO\}\_\{2\}\), bicarbonate \(HCO3−\\text\{HCO\}\_\{3\}^\{\-\}\), and pH\.
3. 3\.Laboratory and organ function markers:Laboratory values related to hemolysis, renal function, and hepatic function, including hemoglobin, platelet count, creatinine, lactate dehydrogenase, and total bilirubin\.

To evaluate the framework on a targeted data\-imputation task, we compare the InterGenEHR\+variants with VAE, EHRDiff, and TabDiff\. We keep these 12 clinically salient features unmasked as the conditioning inputsxox\_\{o\}and mask the remaining variables as the generation targetsxux\_\{u\}\.

The results are summarized in[TableXXIII](https://arxiv.org/html/2611.33788#A5.T23)\. IGE\-VAEAC achieves the lowest MSE of0\.30580\.3058, while TabDiff achieves the lowest NLL of0\.71660\.7166\. IGE\-PMVAE also performs well, with an MSE of0\.45660\.4566and NLL of0\.76510\.7651\. These results show that the framework can generate the unobserved features in a patient record from a clinician\-selected subset of observed features\.

TABLE XXIII:Imputation with a Clinically Salient Conditioning Subset\.IGEdenotes generative backbones integrated into the InterGenEHR\+framework\.
### E\-CMore Results on In\-Hospital Mortality Prediction

[TableXXIV](https://arxiv.org/html/2611.33788#A5.T24)provides additional results for LR, GBDT, and MLP\. These results compare classification performance when training on synthetic data with the corresponding real\-data reference\.

TABLE XXIV:Additional Downstream Utility Results for In\-Hospital Mortality Classification Using Logistic Regression, Gradient\-Boosted Decision Trees, and a Multilayer Perceptron \(Mean±\\pmStandard Deviation Across Five Independent Seeds\)

## Appendix FClinician Evaluation Protocol

The clinician evaluation uses IGE\-FGTI trained on the combined Duke–Emory dataset with the same 35 clinical variables as the main experiments \(Table[XXI](https://arxiv.org/html/2611.33788#A4.T21)\)\.

##### Evaluation procedure

Critical\-care clinicians review each requested scenario together with its generated trajectories\. The trajectory order is randomized, and the generating model is not disclosed\. For each trajectory, the clinicians rate clinical plausibility, internal physiological consistency, requested\-scenario representation, physiological possibility, and agreement with the requested scenario\. All questions use a 1–5 scale\.

##### Survey instrument

Table[XXV](https://arxiv.org/html/2611.33788#A6.T25)provides the exact five questions and response scales shown to the clinicians\. Q1, Q2, and Q4 assess the clinical realism of the displayed trajectory, while Q3 and Q5 assess its agreement with the requested scenario\.

TABLE XXV:Exact Questions and Response Scales Used in the Clinician Evaluation
##### Scenario definitions

The 10 requests in Table[XXVI](https://arxiv.org/html/2611.33788#A6.T26)cover severe lung injury, low blood oxygen levels, respiratory and metabolic acidosis, recovery and possible ECMO removal, hemolysis, impaired carbon dioxide clearance, acute kidney injury, and thrombocytopenia during VV\-ECMO support\. The original request is shown with each generated trajectory so that clinical plausibility and agreement with the requested scenario can be evaluated separately\.

TABLE XXVI:Clinical Scenario Requests Used in the Clinician Evaluation
##### LLM parsing of the scenario requests

To examine how the optional LLM parser processes the same 10 scenario requests, Tables[XXVII](https://arxiv.org/html/2611.33788#A6.T27)and[XXVIII](https://arxiv.org/html/2611.33788#A6.T28)summarize the longitudinal JSON specifications produced before clinician review\. This parsing analysis is reported separately from the clinician ratings\. Each specification uses a 96\-step grid with one\-hour time points, and all 10 outputs are parseable and follow the JSON schema\. Schema compliance verifies the JSON structure but does not establish whether the extracted values, ranges, or directions are clinically appropriate\. Because the saved outputs do not record later clinician confirmation or modification, the tables describe the parser outputs rather than the final clinician\-confirmed constraints\.

TABLE XXVII:LLM\-Parsed Longitudinal Specifications Before Clinician Review: Scenarios 1–5TABLE XXVIII:LLM\-Parsed Longitudinal Specifications Before Clinician Review: Scenarios 6–10The raw parser outputs record requested concepts that are not represented in the interface, such as FiO2, PEEP, lung compliance, plateau pressure, urine output, and ventilator or ECMO settings, underunsupported\_facts\. These concepts are not included in the conditioning mask\. The raw outputs for scenarios 4 and 8 contain direction labels that conflict with their numerical endpoints, while those for scenarios 4 and 9 include values outside the ranges in the feature dictionary\. These outputs require range and direction checks and clinician confirmation or modification before the constraints can be used for generation\.

## Appendix GMetric Definitions for Single\-Time\-Point Generation

Formally, letMMdenote the number of samples in the real dataset andNNdenote the number of synthetic samples, withddrepresenting the number of features\. Maximum Absolute Mean Difference \(MAMD\) measures the largest absolute difference between the feature\-wise means of real and synthetic data, defined as

MAMD=maxj∈\{1,…,d\}⁡\|μ^syn\(j\)−μ^real\(j\)\|\.\\mathrm\{MAMD\}=\\max\_\{j\\in\\\{1,\\ldots,d\\\}\}\\left\|\\hat\{\\mu\}\_\{\\mathrm\{syn\}\}^\{\(j\)\}\-\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}\\right\|\.\(11\)Here,μ^syn\(j\)\\hat\{\\mu\}\_\{\\mathrm\{syn\}\}^\{\(j\)\}andμ^real\(j\)\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}denote the empirical means of featurejjin the synthetic and real datasets, respectively:

μ^syn\(j\)\\displaystyle\\hat\{\\mu\}\_\{\\mathrm\{syn\}\}^\{\(j\)\}=1N​∑i=1Nxi,syn\(j\),μ^real\(j\)=1M​∑i=1Mxi,real\(j\)\.\\displaystyle=\\frac\{1\}\{N\}\\sum\_\{i=1\}^\{N\}x^\{\(j\)\}\_\{i,\\mathrm\{syn\}\},\\quad\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}=\\frac\{1\}\{M\}\\sum\_\{i=1\}^\{M\}x^\{\(j\)\}\_\{i,\\mathrm\{real\}\}\.\(12\)MAMD quantifies the maximum feature\-wise mean deviation and is sensitive to feature scales\.

The mean\-based RMSPE and MAPE metrics are defined as follows:

RMSPE\\displaystyle\\mathrm\{RMSPE\}=100​1d​∑j=1d\(μ^syn\(j\)−μ^real\(j\)μ^real\(j\)\)2,\\displaystyle=100\\sqrt\{\\frac\{1\}\{d\}\\sum\_\{j=1\}^\{d\}\\Bigg\(\\frac\{\\hat\{\\mu\}\_\{\\mathrm\{syn\}\}^\{\(j\)\}\-\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}\}\{\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}\}\\Bigg\)^\{2\}\},\(13\)MAPE\\displaystyle\\mathrm\{MAPE\}=100d​∑j=1d\|μ^syn\(j\)−μ^real\(j\)μ^real\(j\)\|\.\\displaystyle=\\frac\{100\}\{d\}\\sum\_\{j=1\}^\{d\}\\Bigg\|\\frac\{\\hat\{\\mu\}\_\{\\mathrm\{syn\}\}^\{\(j\)\}\-\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}\}\{\\hat\{\\mu\}\_\{\\mathrm\{real\}\}^\{\(j\)\}\}\\Bigg\|\.\(14\)

Similar Articles

Learning Continuous Patient Trajectories from Electronic Health Records

arXiv cs.LG

The paper introduces EHRFlow, a multi-marginal flow-matching framework that conditions on encoded patient history to learn continuous-time patient trajectories from irregular electronic health records, outperforming autoregressive and history-independent baselines on clinical-code forecasting across datasets with over a million patients.