Adaptive Test-Time Training for Predicting Need for Invasive Mechanical Ventilation in Multi-Center Cohorts

Xiaolei Lu, Shamim Nemati

TL;DR

Predicting which ICU patients will need invasive mechanical ventilation (IMV) is critical, but machine learning models often fail when deployed at new hospitals due to shifts in data distributions. This paper introduces Adaptive Test-Time Training (AdaTTT), a framework that dynamically adapts predictive models to new patients on the fly using feature-aware self-supervised learning and optimal transport, significantly improving cross-hospital generalization without needing labeled target data.

What Problem Does This Paper Address?

Machine learning models leveraging Electronic Health Record (EHR) data show great promise in predicting the need for invasive mechanical ventilation 24 hours in advance. However, deploying these models in the real world reveals a major vulnerability: domain shift. Differences in patient demographics, clinical workflows, and EHR systems across different hospitals can severely degrade a model's accuracy.

Traditionally, fixing this requires collecting labeled data from the new hospital and fine-tuning the model—a slow, expensive, and sometimes impossible process due to privacy constraints. While Test-Time Training (TTT) has emerged as a way to adapt models dynamically during inference using an auxiliary self-supervised task, standard TTT methods (often built for image data) struggle with the complex, irregular, and highly imbalanced nature of clinical EHR data.

Methods

Standard TTT adapts a model to a new test sample by updating its encoder to solve a generic self-supervised learning (SSL) task, like reconstructing randomly masked features. AdaTTT overhauls this process for the clinical domain with two key innovations:

  1. Dynamic Self-Supervised Learning: Instead of randomly masking features, AdaTTT uses a dynamic masking strategy. It calculates which clinical features (e.g., respiratory rate, oxygen saturation) are most critical for the main IMV prediction task. It then assigns higher masking probabilities to these highly informative features. This forces the SSL task to focus on reconstructing the physiological signals that actually matter for predicting respiratory failure.
Dynamic feature masking probabilities over iterations
  1. Prototype-Guided Adaptation via Partial Optimal Transport (POT): Adapting a model based on a single test patient can lead to overfitting to noise. During training, AdaTTT learns "prototypes" that represent the core distribution of the source data. At test time, it uses Partial Optimal Transport (POT) to softly align the test patient's features with these learned prototypes. POT allows for partial matching, meaning it won't force-fit a test patient with a rare condition into an inappropriate source prototype, preserving clinically meaningful representations.

Crucially, AdaTTT is source-free, meaning it only updates the encoder on a per-encounter basis and resets the weights afterward, requiring no access to the original training data or cross-patient memory during deployment.

Datasets

The authors evaluated their method on multi-center, retrospective ICU cohorts:

  • Site A (2016–2023): The development and validation cohort (24,943 encounters).
  • Site A (2024): A temporal out-of-distribution testing cohort (1,835 encounters).
  • Site B (2023–2024): A spatial/external out-of-distribution testing cohort (2,564 encounters).
  • MIMIC-IV: A widely used public ICU dataset, randomly downsampled to 2,069 encounters for computational efficiency, representing a severe domain shift.

Key Insights and Ideas

  • Theory dictates SSL design: The authors mathematically prove (via information-theoretic bounds) that test-time adaptation success is strictly constrained by the alignment between the main task and the auxiliary SSL task. This provides a theoretical justification for why dynamic, feature-aware masking works better than random masking—it maximizes the mutual information between the two tasks.
  • Not all EHR features are created equal: In clinical data, treating all features equally during SSL introduces spurious patterns. By dynamically tracking and masking the most predictive features, the model is forced to learn robust representations of the variables that actually drive clinical deterioration.
  • Soft alignment beats rigid alignment: Standard domain adaptation often tries to perfectly align source and target distributions. By using POT, AdaTTT acknowledges that target distributions (new hospitals) might have features or patient sub-populations that simply don't exist in the source data, allowing for flexible, partial alignment.

Key Results

AdaTTT consistently outperformed 9 state-of-the-art test-time adaptation baselines (including TENT, standard TTT, and CoTTA) across all test sites.

AUC performance across testing sites
  • Site A (Temporal shift): Achieved 85.02% AUC (vs. 84.01% for the unadapted baseline).
  • Site B (Spatial shift): Achieved 84.10% AUC (vs. 83.75% for the unadapted baseline).
  • MIMIC-IV (Severe spatial shift): Achieved 77.17% AUC (vs. 75.28% for the unadapted baseline).
  • Calibration: AdaTTT also improved or matched the calibration (measured via Brier score) across all sites, which is vital for clinical trust.
  • Ablations: Replacing the dynamic, task-aware masking with standard random masking degraded the AUC by 1.5 to 3.0 points, proving the necessity of the dynamic masking module.

Limitations and Future Work

  • Computational Overhead: Calculating feature importance updates and running the Sinkhorn algorithm for Optimal Transport increases inference time. A single gradient update takes about 0.29 seconds, which is heavier than standard TTT frameworks (though still viable for hourly clinical predictions).
  • Sequential Update Degradation: AdaTTT resets its weights after every patient. The authors experimented with sequential updates (carrying learned weights from patient to patient) but found that performance eventually degrades due to accumulated adaptation noise shifting the model away from its learned feature structure.
  • Residual Bias: The authors note that despite adaptation, residual biases and under-representation are still possible. Models trained in one setting may still underperform in highly divergent settings, meaning AdaTTT is a mitigation strategy, not a silver bullet that removes the need for clinical oversight.

Summary updated

BibTeX
@inproceedings{lu2026adaptive,
  author = {Xiaolei Lu and Shamim Nemati},
  title = {{Adaptive Test-Time Training for Predicting Need for Invasive Mechanical Ventilation in Multi-Center Cohorts}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=lgBnP4agDK},
}
Figure