Train-Only-Constrained LM for Synthetic Clinical Trajectories: Leak-Safe Calibration and Auditable Dynamics

Yaser Kord, Moritz HessarXiv 2026

TL;DR

Generating synthetic medical records with standard language models often results in biologically impossible patient timelines, sneaky data leakage during calibration, and opaque privacy risks. This paper introduces a lightweight, hybrid pipeline that pairs a tiny GPT-style model with classic Markov chains—separating what happens in a single doctor’s visit from how a patient trends over time. The result is realistic, easily auditable synthetic clinical data calibrated strictly on training data, offering a trustworthy sandbox for healthcare AI without relying on heavy diffusion models.

What Problem Does This Paper Address?

Electronic Health Records (EHRs) are the lifeblood of healthcare AI, yet they are irregular, messy, and fiercely guarded by privacy laws. Synthetic data generators—like GANs, diffusion models, or standard language models (LMs)—promise a way to share clinical patterns without exposing real patients.

However, when applied to clinical time series, unconstrained generators repeatedly trip over three hurdles:

  1. Temporal Drift: Standard LMs frequently "hallucinate" implausible, sudden jumps in a patient's health from one visit to the next.
  2. Calibration Leakage: Synthetic outputs often drift off-scale, tempting researchers to tune and align clinical scales post-hoc using test-set statistics—a subtle form of cheating that invalidates downstream evaluations.
  3. Privacy Opacity: Deep black-box generators make it notoriously hard to audit whether the model is genuinely synthesizing new trajectories or quietly memorizing real patients.

Methods

Instead of throwing a massive neural network at everything, the authors factorize generation—splitting the workload between a neural network and explicit statistical rules, all fit strictly on the TRAIN split.

  • Tokenizing Visits: Continuous lab values across six biomarkers are discretized into 5 quantile "level" tokens (q1..q5), paired with local "direction" tokens (UP, FLAT, DOWN), separated by <STEP> tokens between visits.
  • Compact LM for Co-occurrence: A tiny, 2-layer GPT-style Transformer (dim=192, heads=3) reads these sequences to learn visit rhythm and how biomarkers co-occur within a visit (e.g., if biomarker A is high, biomarker B tends to be low). At decode time, its level predictions are blended with training-set marginal probabilities to prevent out-of-bounds values.
  • Markov Priors for Dynamics: Crucially, the LM does not decide visit-to-visit trends. Instead, temporal directions (UP/FLAT/DOWN) are drawn directly from explicit, per-biomarker $3 \times 3$ Markov transition matrices (with Laplace smoothing) fit on TRAIN.
  • Leak-Safe Calibration (QMap): To align overall patient illness between synthetic and real cohorts without touching test data, the authors define a 1D "severity" score (the first principal component, PC1, of standardized quantile features, scaled to $[0, 100]$). They fit a rank-preserving monotone quantile map (QMap) mapping synthetic TRAIN severities to real TRAIN severities, then apply that frozen map to TEST outputs.
Figure 1: Severity alignment on a TRAIN-fit axis. QMap is fit on SYN TRAIN→REAL TRAIN and then applied to SYN(TEST); Scaler/PCA and QMap fit on TRAIN only; no REAL(TEST) statistics used.

Datasets

Because you cannot falsifiably test whether a generator captures true underlying dynamics if you don't know the ground-truth physics, the authors frame this as a "Stage-1" methods study using a controlled simulator:

  • ODE-Simulated Cohort (SIM): Longitudinal trajectories for $\approx 5,000$ synthetic patients across 6 biomarkers with irregular, clinician-triggered visits. Parameters are kept within published clinical ranges, and patients are split 70/15/15 into TRAIN/VAL/TEST. No real patient EHRs are used in this stage.

Key Insights and Ideas

  • Divide and Conquer Beats Black-Box Scale: Letting a compact LM handle cross-biomarker correlations while delegating temporal arrows to simple $3 \times 3$ Markov chains eliminates hallucinated jumps. Better yet, clinical dynamics become auditable by construction—anyone can inspect a $3 \times 3$ matrix.
  • Linear Vocabulary Scaling: By separating what level a biomarker is at from how it changes, the token vocabulary grows linearly ($2B$ tokens per visit for $B$ biomarkers) rather than exploding combinatorially.
  • Safe Policy Prototyping: Because flip/persistence rates mirror training trajectories without test leakage, hospitals can use this lightweight sandbox to prototype clinical rules—such as lab-stewardship policies that skip redundant blood draws unless a patient shows sustained upward severity trends.

Key Results

Across 5 random seeds and 2,000 patient-level paired bootstraps on the held-out TEST split, constraining the LM substantially outperforms unconstrained generation and tabular baselines:

  • Distributional & Temporal Fidelity: Compared to an unconstrained LM, adding constraints drops distributional distance ($\text{MMD}^2$) from 0.212 to 0.031 and normalized Temporal L1 error from 0.380 to 0.060. Post-QMap severity alignment (Kolmogorov–Smirnov $p$-value) improves from 0.418 to 0.787.
  • Indistinguishability: A logistic classifier trained to spot synthetic data drops from an easy 0.900 AUC (unconstrained) right down to 0.500—random chance.
  • Conservative Privacy: Using a 1-nearest-neighbor (1-NN) distance audit in standardized feature space (setting the "leak threshold" $\tau = 2.194$ at the 5th percentile of leave-one-out TRAIN distances), 0.0% (0/750) of synthetic test patients fell below the threshold (compared to 20.0% for a row-wise bootstrap baseline), with larger median distances to training records (4.28 vs 3.17 for real test patients). A membership-inference classifier similarly hovered near chance (AUC $\approx 0.5$).
Figure 2: Privacy (TRAIN-only 1-NN). Distances to REAL(TRAIN); vertical line marks the 5th percentile of REAL(TRAIN)→REAL(TRAIN) leave-one-out (2-NN, 2nd neighbor). Scaler fit on TRAIN only; threshold from TRAIN LOO. No DP claim.
  • Downstream Utility: Regression models trained on synthetic data achieved an $R^2$ of 0.619 vs. 0.831 when trained on real data; due to wide small-sample confidence intervals, paired deltas (+0.212 [-0.380, +0.963]) were statistically indistinguishable at the 95% level. In a prototype lab-ordering vignette, a conservative risk threshold (0.3) saved 15.7% of lab tests at the cost of a 16.0% missed-event rate.

Limitations and Future Work

The authors are refreshingly candid about what this study is—and isn't:

  • Simulated Testbed & Weak Proxies: All results come from a 5,000-patient ODE simulator (yielding wide confidence intervals in smaller strata), and QMap aligns a relatively simple 1D PCA severity proxy rather than hard clinical endpoints like mortality.
  • Garbage In, Garbage Out on Transitions: While Markov chains stop the LM from inventing wild jumps, they will faithfully reproduce any biased or rare transitions already lurking in the TRAIN data.
  • No Formal Privacy Guarantees: Passing 1-NN and classifier audits is encouraging, but the authors explicitly claim no mathematical Differential Privacy (DP).
  • Next Steps (Stage 2): Future work aims to validate the pipeline on real-world EHR cohorts with true clinical endpoints, run full membership-inference attacks, and test rare-event augmentation by reweighting training marginals.

Summary updated

Abstract

Simulating clinical time series necessitates temporal realism, calibration that preserves model integrity, and privacy transparency. We present a train-only, constrained language-model pipeline that factorizes generation. A compact GPT-style language model learns cross-biomarker co-occurrence through quantile tokens, and temporal directions are enforced by 3x3 per-biomarker Markov transitions fit on TRAIN, allowing dynamics to be audited. We fit a monotone quantile map (QMap) on TRAIN only (SYN(TRAIN) -> SIM(TRAIN)); no TEST statistics are used. The fixed map is then applied to SYN(TEST) severities. The constrained LM demonstrated improved distributional fidelity and co-occurrence in a 5,000-patient simulated testbed (parameters within published clinical ranges) compared to an empirical sampler, maintained near-chance detectability after a small lambda-sweep, and exhibits temporal adherence by construction. A classifier-based membership-inference audit results in an AUC of approximately 0.5; we make no differential-privacy claim. We present multi-seed results with paired 95% confidence intervals and quantify the severity of QMap's alignment (Delta W1 with confidence interval). This is a Stage-1 method result obtained on a controlled simulator; Stage-2 validation on real EHR cohorts with clinical endpoints is planned.
BibTeX
@misc{kord2026train,
  author = {Yaser Kord and Moritz Hess},
  title = {{Train-Only-Constrained LM for Synthetic Clinical Trajectories: Leak-Safe Calibration and Auditable Dynamics}},
  year = {2026},
  eprint = {2611.34258},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.34258},
}
Figure