EHRAdapt: Adapting Pretrained Language Models to Electronic Health Records with Semantic Priors for Rare Clinical Events
Abstract
Electronic health records (EHRs) encode clinical histories as (time, modality, code) tuples, whereas pretrained language models expect text tokens. Serializing tuples as text inflates sequence length and repeatedly encodes the same structure. We introduce EHRAdapt, an adapter that maps tuples directly into a frozen language model's embedding space. Modality and time gaps enter through a learned embedding and attention biases, and event codes receive dedicated vectors. Learning them is challenging because clinical vocabularies are long-tailed, leaving rare events with few observations. EHRAdapt therefore represents each event vector as the sum of a semantic prior and an evidence residual. The prior is a frozen, ontology-trained biomedical embedding of the event's clinical description, mapped into the input space by a shared learned projection, so it supplies clinical meaning even when observations are scarce. The residual is a learned low-rank, event-specific correction that refines it as evidence accumulates. We perform continued pretraining on records from about 4 million patients 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 most, 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 classification, EHRAdapt outperforms text-based LLM and count-based baselines and the same LLMs adapted to the same records through next-event prediction, and both pathways improve rare-disease discrimination. The two pathways therefore play complementary roles, visible only when results are broken down by event frequency.
Create a lesson
Related papers
SeLMRoute: Probabilistic Semantic Evidence for Large Language Model Routing
Shared title terminologycs.AIVasilis Perifanis, Nikolaos Pavlidis, Symeon Symeonidis
Large Language Models for Structured Clinical Data Analysis: Dual-Agent Grounding and Validation
Shared title terminologycs.AIErfan D. Dehkalani, Seetha Shankaran, Abbot R. Laptook et al.
PPG-LM: A Photoplethysmography-Language Model with Multi-Level Clinical Alignment
Shared title terminologycs.AIXiaoda Wang, Minxiao Wang, Maxwell A Xu et al.
Unmask the State: When Does State Adaptation Matter for Masked Diffusion Language Models
Shared title terminologycs.AIInjin Kong, Sunghwan Choi, Yohan Jo
Modeling Event-Conditioned Emotional Expression Response with LLM Agents in a Synthetic Social Simulation
Shared title terminologycs.AIRebecca Marigliano, Peter Carragher, Kathleen M. Carley
TACT-Bench: Testing Adaptive Conversational Threats against Tool-Use Agents
Shared title terminologycs.AIIlia Hashemi Rad, Feijie Wu, Haoyu Wang et al.