Clinical interventions for cancer treatment toxicities can reduce morbidity, mortality, and healthcare cost, if high risk patients can be identified. We developed SPARC, a transformer-based foundation model, using real-world, longitudinal, routinely collected health measurements, to predict adverse event risk. Pre-training and fine-tuning SPARC on 101,920,379 measurements from 224,047 patients with cancer led to state-of-the-art performance at predicting cancer-related adverse events on (i) held-out data from the development cohort, (ii) a prospective validation cohort from the same center (Npatients=23,126), (iii) multiple publicly available external datasets (Npatients=26,012), and (iv) external, multi-hospital cohorts (Npatients=562,620, 206,840). SPARC generalized to multiple external centers and identified patients most likely to benefit from an intervention (G-CSF). Pooled multi-institution, more than single-institution, fine-tuning improved generalizability. We release SPARC as a community resource. Our results highlight the utility of AI time series models in oncologic management.
Presented at ISMB 2026 (Best Oral Presentation).