Large Language Models are Powerful Electronic Health Record Encoders
This addresses the problem of limited access to diverse EHR datasets and inconsistent coding standards for clinical prediction, offering a more flexible and generalizable approach, though it builds incrementally on existing LLM and EHR foundation model work.
The study tackled the challenge of encoding Electronic Health Records (EHRs) for clinical prediction by using general-purpose Large Language Models (LLMs) to convert structured EHR data into text, enabling effective encoding without private medical training data. The result showed that LLM-based embeddings matched or surpassed a specialized EHR foundation model across 15 clinical tasks and achieved superior performance on an out-of-domain cohort for disease onset, hospitalization, and mortality prediction.
Electronic Health Records (EHRs) offer considerable potential for clinical prediction, but their complexity and heterogeneity present significant challenges for traditional machine learning methods. Recently, domain-specific EHR foundation models trained on large volumes of unlabeled EHR data have shown improved predictive accuracy and generalization. However, their development is constrained by limited access to diverse, high-quality datasets, and inconsistencies in coding standards and clinical practices. In this study, we explore the use of general-purpose Large Language Models (LLMs) to encode EHR into high-dimensional representations for downstream clinical prediction tasks. We convert structured EHR data into Markdown-formatted plain-text documents by replacing medical codes with natural language descriptions. This enables the use of LLMs and their extensive semantic understanding and generalization capabilities as effective encoders of EHRs without requiring access to private medical training data. We show that LLM-based embeddings can often match or even surpass the performance of a specialized EHR foundation model, CLMBR-T-Base, across 15 diverse clinical tasks from the EHRSHOT benchmark. Critically, our approach requires no institution-specific training and can incorporate any medical code with a text description, whereas existing EHR foundation models operate on fixed vocabularies and can only process codes seen during pretraining. To demonstrate generalizability, we further evaluate the approach on the UK Biobank (UKB) cohort, out-of-domain for CLMBR-T-Base, whose fixed vocabulary covers only 16% of UKB codes. Notably, an LLM-based model achieves superior performance for prediction of disease onset, hospitalization, and mortality, indicating robustness to population and coding shifts.