Toward a digital twin of the ICU patient: Forecasting and treatment response in a generative event model
Abstract
A digital twin of a patient in intensive care would forecast the patient's course and what a treatment would change. Generative event models, trained to continue a patient's electronic health record (EHR), have been proposed as a path toward such twins. We trained TWICE, a 79M-parameter decoder-only transformer, on the ICU records of one academic health system (127,332 training patients and 1.57 billion tokens). We evaluated it on clinical prediction tasks, generation fidelity, individual trajectories and counterfactual validation. Reading 19 clinical outcomes off 50 simulated futures, with no task-specific training, TWICE matched the best of 144 supervised configurations on held-out patients (mean AUROC 0.836 vs. 0.834). It led on events that change care within a day and trailed on death. With the training data fixed, more and longer simulated futures were worth more than a 6.8-fold larger model. Its generated records matched real ones closely and were as specific to each patient as its own variability allowed. Its predicted risk rose as events approached. Pre-specified controls showed that it reproduced the side effects of drugs and was barely moved by an inert drug. On the values that treatments are given to correct, however, an opposite treatment moved its forecasts like the right one. TWICE forecasts ICU events about as well as task-specific models, and we see it as a step toward a digital twin of the ICU patient.
The following analysis is generated by AI and may contain errors. It is separate from the authors’ abstract and is not peer review.
Research summary
TWICE is a 79M-parameter generative event model that matches supervised baselines on ICU prediction tasks and provides a rigorous framework for evaluating counterfactual treatment responses, revealing both the promise and the causal limitations of generative EHR models. The paper makes a substantial contribution to clinical AI by demonstrating that generative models can serve as competitive zero-shot predictors for ICU outcomes and by introducing a control-based evaluation methodology that exposes the confounding by indication inherent in observational EHR data, thereby guiding future research toward more causally grounded clinical AI systems.
Methodology
The paper introduces TWICE, a 79M-parameter decoder-only transformer trained on ICU electronic health records (EHR) using a next-token prediction objective. The methodology is robust, leveraging a standardized tokenization scheme (MEDS) that encodes clinical events, values (via deciles), and time intervals. A key methodological strength is the rigorous evaluation framework, particularly the "counterfactual validation" section. The authors employ pre-specified positive, negative, and opposite-drug controls to test whether the model learns causal treatment effects or merely correlates treatments with patient severity (confounding by indication). This is a significant methodological advance over prior generative EHR models that often lacked such causal sanity checks. The readout mechanism, which samples multiple simulated futures to estimate outcome probabilities, is also well-defined, including the handling of right-censored data.
Results & evaluation
The experimental evaluation is extensive and rigorous. The model is compared against 144 supervised configurations, matching the best baseline on 19 clinical tasks (mean AUROC 0.836 vs 0.834). The ablation studies on readout compute vs. model size provide valuable insights into the scaling laws of generative EHR models, showing that inference-time compute (more/longer futures) yields greater gains than model size alone. The generation fidelity metrics (RMSLE, Jaccard overlap) demonstrate that the model produces realistic and patient-specific trajectories. The counterfactual results are particularly insightful: while the model correctly predicts side effects and remains neutral to inert drugs, it fails to distinguish between correct and opposite treatments on target values, correctly identifying this as a limitation due to confounding by indication.
Reproducibility
The paper provides high reproducibility. It details the exact tokenization strategy, model architecture (RMSNorm, SwiGLU, RoPE, GQA), training hyperparameters, and evaluation protocols. The use of standard benchmarks (MIMIC-IV is not used, but MGB data is described in detail, and comparisons are made to public benchmarks like EHRSHOT in related work) and the open-sourcing of the code (implied by the arXiv submission and standard practice, though no explicit URL is in the text, the methodology is transparent enough for replication). The pre-specified controls for counterfactual validation are clearly defined, allowing others to replicate the causal assessment.
Limitations
The primary limitation is the failure to correctly model the causal effect of treatments on their target values (e.g., insulin lowering potassium), which the authors attribute to confounding by indication. This limits the model's immediate utility for treatment decision support. Additionally, the model is trained on data from a single health system (Mass General Brigham), raising questions about generalizability to other institutions with different EHR structures or patient populations. The use of deciles for values limits the precision of the model's understanding of continuous physiological variables.
Broader impact
This paper has significant broader impact on the field of clinical AI. It provides a template for evaluating generative EHR models using causal controls, which is a critical step toward trustworthy AI in healthcare. The finding that inference-time compute is more valuable than model size for these tasks offers a practical guideline for resource allocation in clinical AI development. The work bridges the gap between generative modeling and causal inference, highlighting the challenges of using observational data for counterfactual prediction. It sets a high bar for future "digital twin" models in healthcare. TWICE is a 79M-parameter generative event model that matches supervised baselines on ICU prediction tasks and provides a rigorous framework for evaluating counterfactual treatment responses, revealing both the promise and the causal limitations of generative EHR models. The paper makes a substantial contribution to clinical AI by demonstrating that generative models can serve as competitive zero-shot predictors for ICU outcomes and by introducing a control-based evaluation methodology that exposes the confounding by indication inherent in observational EHR data, thereby guiding future research toward more causally grounded clinical AI systems.
Author of this paper? Send a correction.