Sequence models reveal diagnosis accumulation pathways beyond comorbidity burden in population-scale hospital data
Aging trajectories vary among individuals of similar age and disease burden. Comorbidity indices, e.g. the Elixhauser index, aggregate recorded conditions into a single score, but discard the timing, sequence, and pace of morbidity accumulation. Here we ask whether longitudinal hospital diagnosis histories contain information beyond age, sex, and comorbidity burden, and where it is concentrated. Using 13 years of Austrian inpatient data covering 7.4 million patients, we trained a visit-level contrastive transformer to encode diagnosis sequences and inter-admission timing into patient-history embeddings. In a downstream cohort of 1.7 million individuals, the embedding model improved prediction of in-hospital death over the Elixhauser-based comorbidity model, with an area under the curve (AUC) of 0.879 versus 0.866 (AUC gain = 0.0132, 95% CI 0.0118–0.0144). Across 130 incident ICD-10 disease-block outcomes, the embedding model had higher AUC for 93 outcomes, with a modest median gain of 0.006. Gains were concentrated in mental, musculoskeletal, nervous system, and metabolic disorders. We then evaluated event-free survival, defined as remaining alive without accumulating a second unrecorded ICD-10 disease block. The embedding model achieved an AUC of 0.726 versus 0.722 for the comorbidity model. However, among patients with similar age, sex, and comorbidity-model risk, those assigned high residual risk had 127–181 fewer event-free days over five years and observed event rates comparable to low-residual-risk patients more than a decade older. Together, these findings link the embedding’s signal to the breadth, recency, and pace of prior disease accumulation.
Authors
- Katharina Ledebur (ORCID: https://orcid.org/0000-0001-9923-1172)
- Mitja Devetak
- Peter Klimek
Institutions
- Karolinska Institutet (SE)
- Complexity Science Hub (AT)
- Supply Chain Intelligence Institute Austria (AT)
- Medical University of Vienna (AT)
Publication Details
- Journal
- npj Digital Medicine
- Published
- 2026-10-14
- DOI
- https://doi.org/10.1038/s41746-026-03265-2
- Primary Topic
- Machine Learning in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00