A transformer reads the blood work already drawn during cancer treatment and estimates which of 162 complications will be newly recorded within the next two years. No additional testing is needed.
Laboratory results are grouped into windows of 10 to 30 days, one token per day with a measurement. An imputation model fills analytes that were not drawn that day, and a transformer encoder turns the window into risk estimates for all 162 complications at once. An endpoint counts as positive if it is newly recorded within 720 days after the window ends.
On 390 held-out patients (1,579 laboratory windows), the model separated future cases from non-cases for every group. Enrichment, the share of true cases among the model's top-ranked windows relative to prevalence, was highest for the rarest endpoints.
Enrichment is relative to prevalence, so high ratios for rare endpoints correspond to modest absolute precision. The myelodysplastic-syndrome estimate rests on 21 positive windows from four patients (enrichment 95% CI 1.9–15.1).
Kidney disease, metastatic disease and fungal infections keep the highest discrimination at 720 days. Excluding events within 30–180 days of the window (washout) lowers but never removes discrimination.
Masking recovers the expected signatures without any analyte–diagnosis prior: glucose for type 2 diabetes, filtration estimates for kidney disease, red-cell indices for myelodysplastic syndromes. It measures the model's learned reliance, not intrinsic biomarker importance.
Mean per-endpoint AUROC 0.734 for the transformer vs. 0.710 for gradient-boosted trajectory summaries (last value, min, max, mean, SD, slope, changes, weighted mean, counts), 0.692 and 0.664 for count-vector logistic regression and XGBoost. Gains are largest for rare and slowly evolving endpoints.
The internally trained model was applied unchanged to MIMIC-IV (8,150 windows, critical care) and MMRF CoMMpass (7,347 windows, newly diagnosed myeloma). Renal and metabolic endpoints transferred best. Infection endpoints were most sensitive to differences in how each system codes diagnoses.
Metastatic disease and myelodysplastic syndrome have no equivalent concept in CoMMpass and were not evaluated there. On CoMMpass, adding the laboratory score to ISS staging improved mortality discrimination (likelihood-ratio P = 0.013).
Routine laboratory panels drawn during cancer treatment constitute longitudinal physiological recordings of organ function, yet their temporal structure is discarded by single-timepoint prognostic tools. A transformer trained on 2,777,595 laboratory measurements from 3905 patients with multiple myeloma or ovarian cancer predicted which of 162 treatment-associated complications would be newly recorded within two years, spanning eight clinical categories, achieving 1.5- to 6.1-fold enrichment above prevalence. Across individual endpoints it exceeded non-sequential baselines, including engineered-trajectory models, by +0.024 to +0.070 in mean AUROC. Predictions generalised across both cancers, divergence concentrating in disease-specific complications, and biomarker masking recovered signatures consistent with established pathophysiology. External validation on MIMIC-IV and MMRF CoMMpass showed transferability, strongest for renal and metabolic endpoints, attenuated for infection endpoints. On CoMMpass it added prognostic value to ISS staging. Routine oncological laboratory data carry complication-specific physiological signal months before a complication is recorded, and require no testing beyond standard oncological care.
The repository contains the full pipeline: structuring, imputation, five-fold training, evaluation and the engineered-trajectory baselines. The clinical data cannot be shared (EU GDPR); the README describes the three CSV files the pipeline expects.
# install git clone https://github.com/jalu1870/lab-forecast && cd lab-forecast pip install -e . # structure → impute → train → evaluate labforecast structure --labs labs.csv --diagnoses diagnoses.csv --deaths deaths.csv --out records.pt labforecast train-imputer --records records.pt --out imputer.pt labforecast impute --records records.pt --imputer imputer.pt --out records_imputed.pt labforecast train --records records_imputed.pt --out-dir models/ labforecast evaluate --records records.pt --imputer imputer.pt --models models/
@article{luebberstedt2026labtrajectories,
title = {Routine laboratory trajectories predict organ-level complications in cancer},
author = {L{\"u}bberstedt, Jannik and Braitsch, Krischan and Lammert, Jacqueline and Winter, Christof
and Gabriel, Florian and Lemke, Tristan and Zirn, Christopher and Graf, Markus
and Puttkammer, Friedrich and H{\"a}ntze, Hartmut and Moll, Johannes and Narayanan, Anirudh
and Zhukov, Andrei and Drexel, Fabian and Ben Chaaben, Zeineb and Ziegelmayer, Sebastian
and Kim, Su Hwan and H{\"o}gner, Marion and Kirschke, Jan and Bassermann, Florian
and Makowski, Marcus and Wachinger, Christian and Adams, Lisa and Bressem, Keno},
journal = {npj Digital Medicine},
year = {2026},
doi = {10.1038/s41746-026-03405-8}
}