The ITE-Transformer: A pre-trained foundation model for predicting individualized treatment effects from electronic health records
Transformer-based foundation models have shown strong potential for modeling longitudinal electronic health records (EHRs), yet existing models focus primarily on risk prediction rather than treatment effect estimation, which limits evidence generation. Here, we introduce the ITE-Transformer, a transformer-based framework that combines self-supervised representation learning from longitudinal patient trajectories with doubly robust causal machine learning for predicting individualized treatment effects (ITEs). As a result, our ITE-Transformer allows to study counterfactual questions of how an individual patient's outcome may differ under alternative treatment strategies. The ITE-Transformer learns temporally contextualized representations of patients' diagnosis and medication histories and subsequently uses these representations to predict treatment assignment, treatment-specific outcome risks, and patient-specific ITEs. The ITE-Transformer is trained using structured EHR data from ~350,000 participants in the All of Us Research Program and evaluated in two clinically different comparative-effectiveness tasks: (i) GLP-1 receptor agonists versus DPP-4 inhibitors among patients with type 2 diabetes, with major adverse cardiovascular events as the outcome, and (ii) immunotherapy versus chemotherapy in a pan-cancer cohort, with all-cause mortality as the outcome. Across both applications, the ITE-Transformer improves the discrimination and calibration of treatment assignment and outcome models compared with existing tabular machine learning approaches and an otherwise identical transformer trained without self-supervised pre-training. The ITE-Transformer further identifies substantial heterogeneity in predicted ITEs and yields interpretable patterns of treatment response associated with patients' diagnoses, medication histories, and comorbidities. Together, our work demonstrates how clinical foundation models can be developed for analyzing heterogeneity in treatment effects and thus support real-world evidence generation.
Authors
- Valentyn Melnychuk (ORCID: https://orcid.org/0000-0002-2401-6803)
- Emmanouil Angelis
- Stefan Feuerriegel (ORCID: https://orcid.org/0000-0001-7856-8729)
- Stefan Bauer (ORCID: https://orcid.org/0000-0002-8462-1845)
- Philip Heesen
- Clemente Arceri
- Martin Bendszus
Institutions
- University Hospital Heidelberg (DE)
- Technical University of Munich (DE)
- Ludwig-Maximilians-Universität München (DE)
Publication Details
- Journal
- medRxiv
- Published
- 2026-11-20
- DOI
- https://doi.org/10.64898/2026.11.19.26368479
- Primary Topic
- Machine Learning in Healthcare
- Type
- preprint
Funders
- National Institutes of Health