cs.AISep 27, 2026

EHRAdapt: Adapting Pretrained Language Models to Electronic Health Records with Semantic Priors for Rare Clinical Events

Authors: Andre R Goncalves, Vincent Liu, Priyadip Ray

Organizations: Lawrence Livermore National Laboratory · Kaiser Permanente

Abstract

Electronic health records (EHRs) encode clinical histories as (time, modality, code) tuples, whereas pretrained language models expect text tokens. Serializing them as text inflates sequence length and redundantly encodes structure. We introduce EHRAdapt, an adapter that maps tuples directly into a frozen language model's embedding space. Modality receives a learned embedding, time gaps enter through learned attention biases, and event codes receive dedicated vectors. Learning event vectors is the central challenge: clinical vocabularies are long-tailed, leaving rare events too few observations for reliable estimates. EHRAdapt therefore represents each event vector as the sum of a semantic prior and an evidence residual. The prior is a frozen embedding of the event's clinical description from a biomedical language model trained on clinical ontologies, mapped into the model's input space by a shared learned projection, so it supplies clinical meaning even when observations are scarce. The residual, a learned low-rank event-specific correction, refines it as evidence accumulates. We run continued pretraining on about 4 million patients' records with three frozen LLM backbones (OLMo2 1B, Llama3.2 1B, and OLMo2 7B), training only the adapter (0.1--0.6% of all parameters). The full adapter outperforms all ablations in held-out next-event prediction on every backbone. Removing the semantic pathway hurts rare events over ten times more than the most frequent ones, whereas removing the residual hurts overall prediction but improves it for the rarest events. On reportable infectious-disease and syndromic downstream classification tasks, EHRAdapt outperforms text-based LLM and count-based baselines, and both pathways improve rare-disease discrimination. The two pathways therefore play complementary roles, visible only when results are broken down by event frequency rather than averaged.

Figures & tables

Appendix figures & tables12 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. PORTER: Language-Grounded Event Representations for Portable Structured EHR Foundation Models

    Jun 23, 2026Lin Lawrence Guo, Adam Paul Yan, Emily Vettese +1Medical World ModelElectronic Health Records

  2. ChatHealthAI: Aligning Electronic Health Record Representations with Large Language Models for Grounded Clinical Reasoning

    Jun 1, 2026Bo-Hong Wang, Baicheng Peng, Ruilin Wang +3Medical World ModelClinical Reasoning Training

  3. RePrompT: Recurrent Prompt Tuning for Integrating Structured EHR Encoders with Large Language Models

    Apr 20, 2026Arya Hadizadeh Moghaddam, Drew Ross, Mohsen Nayebi Kerdabadi +2Electronic Health RecordsLongitudinal Patient Records