Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul 17;8(1):453.
doi: 10.1038/s41746-025-01806-9.

Identifying clusters of people with Multiple Long-Term Conditions using Large Language Models: a population-based study

Affiliations

Identifying clusters of people with Multiple Long-Term Conditions using Large Language Models: a population-based study

Alexander Smith et al. NPJ Digit Med. .

Abstract

Identifying clusters of people with similar patterns of Multiple Long-Term Conditions (MLTC) could help healthcare services to tailor care. In this population-based study, we developed a pipeline incorporating a DeBERTa language model to generate gender-specific clusters. Our model, EHR-DeBERTa, was pre-trained on longitudinal sequences of diagnoses, medications and test results from primary care electronic health records of 5.8 million patients in the UK. EHR-DeBERTa was used to generate patient embeddings for males and females separately, and clusters were identified by K-Means. Fifteen clusters were identified in females and seventeen in males, categorized into low disease burden, mental health, cardiometabolic, respiratory and mixed diseases. Cardiometabolic and mental health conditions showed the strongest separation across clusters, with older patients in cardiometabolic clusters. Our approach demonstrates how LLMs can provide interpretable insights into disease patterns. Future work incorporating clinical outcomes could enhance risk prediction and support precision-medicine for people with MLTC.

PubMed Disclaimer

Conflict of interest statement

Competing interests: The authors declare no competing interests.

Figures

Fig. 1
Fig. 1. Study overview.
The study overview of training the large language model and generating patient clusters using EHRs.
Fig. 2
Fig. 2. Disease prevalence within female clusters.
The disease prevalence across clusters of 3,201,230 females from CPRD. The heatmap colour indicates the cluster-weighted frequency (c-DF-IPF) of each LTC, with red indicating higher frequency. The symbols within each cell are indicators of the Z-score difference between observed and expected disease frequency from 1-vs-all Chi-squared testing (++ ≥ 50, 50> + ≥10, - - ≤ −50, −50< − ≤−10). LB low burden, CM cardiometabolic, MH mental health, MIX mixed, RES respiratory.
Fig. 3
Fig. 3. Disease prevalence within male clusters.
The disease prevalence across clusters in 2,645,250 males from CPRD. The heatmap colour indicates the cluster-weighted frequency (c-DF-IPF) of each LTC, with red indicating higher frequency. The symbols within each cell are indicators of the Z-score difference between observed and expected disease frequency from 1-vs-all Chi-squared testing (++ ≥ 50, 50> + ≥10, - - ≤ −50, −50< − ≤−10). LB low burden, CM cardiometabolic, MH mental health, MIX mixed, RES respiratory.
Fig. 4
Fig. 4. Ethnicity and deprivation associations across female clusters.
Heatmap colours indicate the Z-scores differences in observed and expected frequency of each ethnicity and deprivation quantile with red indicating higher frequency (overrepresentation) and blue indicating lower frequency (underrepresentation), based on 1-vs-all Chi-squared testing. LB low burden, CM cardiometabolic, MH mental health, MIX mixed, RES respiratory.
Fig. 5
Fig. 5. Ethnicity and deprivation associations across male clusters.
Heatmap colours indicate the Z-scores differences in observed and expected frequency of each ethnicity and deprivation quantile with red indicating higher frequency (overrepresentation) and blue indicating lower frequency (underrepresentation), based on 1-vs-all Chi-squared testing. LB low burden, CM cardiometabolic, MH mental health, MIX mixed, RES respiratory.

References

    1. The Academy of Medical Sciences. Multimorbidity: A Priority for Global Health Research. https://acmedsci.ac.uk/file-download/82222577 (2018).
    1. Johnston, M. C., Crilly, M., Black, C., Prescott, G. J. & Mercer, S. W. Defining and measuring multimorbidity: a systematic review of systematic reviews. Eur. J. Public Health29, 182–189 (2019). - PubMed
    1. Pearson-Stuttard, J., Ezzati, M. & Gregg, E. W. Multimorbidity—a defining challenge for health systems. Lancet Public Health4, e599–e600 (2019). - PubMed
    1. Nunes, B. P., Flores, T. R., Mielke, G. I., Thumé, E. & Facchini, L. A. Multimorbidity and mortality in older adults: a systematic review and meta-analysis. Arch. Gerontol. Geriatr.67, 130–138 (2016). - PubMed
    1. Makovski, T. T., Schmitz, S., Zeegers, M. P., Stranges, S. & van den Akker, M. Multimorbidity and quality of life: systematic literature review and meta-analysis. Ageing Res. Rev.53, 100903 (2019). - PubMed