When Does the Model Know? Timestamp Leakage in Clinical Prediction Models

Zhuoyu Li, Zhaolu LiuML4H 2026 Poster 2026

TL;DR

When clinical AI models are trained on historical hospital records, they often peek into the future without realizing it—by using lab results or radiology reports based on when a sample was collected rather than when the result was actually available. This paper shows that this "timestamp leakage" inflates model performance, especially in the first 12 hours after admission, and can matter more than which machine learning model you choose.

What Problem Does This Paper Address?

Imagine a blood test is drawn at 10:00 AM, but the lab doesn't finish analyzing it until 1:00 PM. If a clinical prediction model is supposed to make a decision at noon, it shouldn't know the result of that blood test yet.

However, electronic health records (EHRs) store two different timestamps: event time (when the sample was taken or the exam occurred) and recorded availability (when the result was stored or the report was signed). Many retrospective studies filter data using event time. That means a model making a "noon" prediction in a retrospective study accidentally gets to see the 1:00 PM lab result—a form of temporal leakage.

The authors ask: how much does this timestamp leakage inflate apparent model performance, and what happens when a model trained on "future-leaking" event times is deployed in the real world where it only sees what's actually recorded?

Methods

To isolate the effect of timestamp selection, the authors designed a clean, paired $2 \times 2$ experiment. They held the patient cohort, outcomes, train/test splits, and prediction times (12, 24, 48, and 72 hours after admission) completely fixed, and only changed the timestamp rule used to build the input snapshots: Event time ($E$) vs. Recorded availability ($R$).

Paired snapshots isolate the effect of timestamp selection.

This setup yields four training-to-testing combinations ($E \to E$, $E \to R$, $R \to E$, $R \to R$), allowing them to separate two distinct effects:

  1. Deployment drop ($\Delta_{\text{deploy}}$): Training a model on event time and testing it on recorded availability ($E \to E$ minus $E \to R$). This simulates what happens when a model built on leaky retrospective data is deployed live.
  2. Retrained pipeline difference ($\Delta_{\text{same}}$): Comparing a model trained and tested on event time against one trained and tested on recorded availability ($E \to E$ minus $R \to R$).

They evaluated seven model configurations across structured data (labs, ICU observations, medications) and clinical text (radiology reports): Logistic Regression (LR), XGBoost, a simple report presence/count LR, TF-IDF LR, fine-tuned BioClinicalBERT, Llama 3.1 8B Instruct, and a late-fusion model combining XGBoost and BioClinicalBERT.

Datasets

The study uses MIMIC-IV v3.1 (structured EHR data) and MIMIC-IV-Note v2.2 (deidentified radiology reports), covering 545,848 hospital admissions across 223,380 adult patients.

The authors evaluated two clinical prediction tasks at 12, 24, 48, and 72 hours after admission:

  • In-hospital mortality (among patients still hospitalized and alive at prediction time).
  • Remaining length of stay (LOS) > 72 hours (among patients not yet discharged).

Key Insights and Ideas

  • Timestamp choice can outweigh model choice: For 12-hour mortality prediction, switching a fixed Logistic Regression model from event-time to recorded-availability inputs dropped its AUROC by 0.0296—which is larger than the 0.0161 performance gap between Logistic Regression and XGBoost under event time.
  • Early predictions are the most vulnerable: Documentation delays hit hardest right after admission. At 12 hours, 39.0% of radiology rows and 14.6% of lab rows were stored after the prediction time. By 72 hours, these violation rates dropped to 5.2% and 1.3%, respectively.
Documentation delays and availability violations vary across sources.
  • Missingness patterns matter: Logistic Regression suffered a much larger deployment drop than XGBoost. Because LR relies heavily on missingness indicators, a shift in which values are missing at deployment time hurts it badly, whereas XGBoost's native handling of missing values makes it more resilient.
  • Text models lose out mostly because reports aren't signed yet: For radiology-based models, the share of 12-hour admissions with an available report dropped from 22.4% (event time) to 14.7% (recorded availability). Much of the text models' performance drop came simply from this loss of documentation availability, rather than the specific wording of the reports.
  • Rankings stay stable, but clinical utility drops: Even though the late-fusion model ranked first under both timestamp rules, fixed alert thresholds caught fewer true positives under recorded availability.
Structured timestamp effects arise from violations and alter sensitivity.

Key Results

At the 12-hour mark for mortality prediction, every model suffered a deployment drop in AUROC when evaluated on recorded availability:

  • Structured LR: dropped 0.0296 (from 0.8657 to 0.8361). At a 5% alert-rate threshold, its sensitivity fell from 54.7% to 46.2%.
  • Structured XGBoost: dropped 0.0105 (from 0.8818 to 0.8712), with sensitivity falling from 57.9% to 54.3%.
  • Radiology text models: suffered the largest drops—0.0548 for TF-IDF LR, 0.0552 for BioClinicalBERT, and 0.0409 for Llama 3.1 8B.
  • Late fusion (XGBoost + BioClinicalBERT): dropped 0.0115 (from 0.8873 to 0.8759).

For structured models, these losses were concentrated almost entirely in the ~21% of admissions with confirmed timestamp violations, driven primarily by ICU observations (for LR) and laboratory results (for XGBoost). By 72 hours, deployment drops for radiology, fusion, and XGBoost approached zero, though LR's drop persisted.

Limitations and Future Work

The authors note that this is a retrospective, single-center study. Recorded availability (storetime) is itself a proxy—it was missing for a small fraction of lab and ICU rows, and occasionally preceded event time in ICU data. Additionally, microbiology records were excluded; because culture results can take days, they may harbor even larger temporal leakage. Future work should replicate these findings externally, include microbiology and acute prediction tasks, and prospectively evaluate how timestamp alignment affects real-world clinical decisions.

Summary updated

BibTeX
@inproceedings{li2026when,
  author = {Zhuoyu Li and Zhaolu Liu},
  title = {{When Does the Model Know? Timestamp Leakage in Clinical Prediction Models}},
  booktitle = {ML4H 2026 Poster},
  year = {2026},
  url = {https://openreview.net/forum?id=7y3TijBiqI},
}
Figure