Language models are an effective representation learning technique for electronic health record data

Ethan Steinberg, Kenneth Jung, Jason A. Fries, Conor K. Corbin, Stephen R. Pfohl, Nigam H. Shah

Introduction

Building machine learning models for clinical outcomes—such as predicting mortality or hospital readmission—is notoriously difficult. Electronic Health Record (EHR) data is high-dimensional, sparse, and irregularly timed. While hospitals possess millions of records, specific outcomes of interest often involve only a small fraction of patients. This "small data" problem makes it difficult for complex end-to-end models to learn meaningful patterns without overfitting.

This paper introduces CLMBR (Clinical Language Model Based Representations), a method that treats a patient’s longitudinal record as a sequence of "documents." By pre-training a language model on the vast history of the entire patient population, the authors demonstrate that it is possible to learn a general "language" of health that significantly boosts the accuracy of specific clinical predictions, especially when labeled training data is scarce.

The CLMBR Framework

The core innovation of CLMBR is the application of self-supervised learning to EHR data. Traditionally, researchers have relied on manual feature engineering (e.g., counting specific codes) or training deep learning models from scratch for every new task. CLMBR shifts this paradigm by learning patient representations first and then applying them to downstream tasks.

Comparison of clinical prediction paradigms: manual feature engineering, end-to-end neural networks, and the CLMBR representation learning approach.

Technical Architecture

CLMBR utilizes a generative sequence modeling approach similar to GPT, but adapted for the medical domain. The model is trained to predict the "next day" of medical codes based on the patient's prior history.

  1. Day Embeddings: For each day of care, medical codes (diagnoses, procedures, medications) are embedded and combined via mean pooling. These are concatenated with "time delta" features to capture the irregular intervals between clinical encounters.
  2. Temporal Modeling: A Gated Recurrent Unit (GRU) processes these daily embeddings to maintain a running state of the patient's health history.
  3. Hierarchical Decomposition: To manage a vocabulary of over 20,000 codes, the model incorporates medical ontologies (UMLS) into a hierarchical sigmoid layer, allowing it to learn relationships between related medical concepts.
  4. Representation Extraction: Once pre-trained, the GRU's internal state serves as a fixed-length patient embedding that can be used as input for simpler, more robust models like Logistic Regression.
The CLMBR architecture, showing how daily medical codes are transformed into patient embeddings through mean pooling and a GRU sequence model.

Experimental Design

The study utilized a de-identified EHR dataset from Stanford Hospital and Lucile Packard Children’s Hospital, encompassing 3.4 million patient records and over 21,000 unique medical codes. The model was evaluated on five clinical outcomes:

  • Inpatient Mortality: Death during a hospital stay.
  • Long Admission: Stays exceeding seven days.
  • ICU Transfer: Movement to intensive care.
  • 30-day Readmission: Return to the hospital within a month of discharge.
  • Abnormal HbA1c: Identifying non-diabetic patients with high blood sugar.

Key Results

CLMBR consistently outperformed standard baselines, including count-based models, Word2Vec, and even end-to-end trained GRUs.

  • The Power of Transfer Learning: The most significant gains were observed in "small data" scenarios. When only 100 patient records were available for training, CLMBR provided a 19% average improvement in AUROC compared to traditional methods.
  • Model Simplicity: Interestingly, using CLMBR embeddings with simple Logistic Regression often outperformed complex Gradient Boosted Trees. This indicates that the language model successfully captures complex, non-linear relationships during pre-training, simplifying the final prediction task.
  • Regularization via Language Modeling: CLMBR proved superior to end-to-end models even when data was plentiful, suggesting that the self-supervised objective acts as a powerful regularizer that prevents overfitting to specific clinical labels.

Limitations and Future Directions

While powerful, CLMBR requires significant initial computational resources for pre-training. Additionally, as the study was conducted at a single institution, further research is needed to determine how well these representations generalize across different hospital systems with varying coding practices. Future iterations of the model could also incorporate unstructured data, such as clinical notes and medical imaging, to provide a more holistic view of patient health.

Summary updated

BibTeX
@article{steinberg2021language,
  author = {Ethan Steinberg and Kenneth Jung and Jason A. Fries and Conor K. Corbin and Stephen R. Pfohl and Nigam H. Shah},
  title = {{Language models are an effective representation learning technique for electronic health record data}},
  journal = {J. Biomed. Informatics},
  year = {2021},
  url = {https://openreview.net/forum?id=Hik9OAD1RhK},
}
Figure