CORE-BEHRT: A Carefully Optimized and Rigorously Evaluated BEHRT
Mikkel Odgaard, Kiril Vadimovic Klein, Sanne Møller Thysen, Espen Jimenez-Solem, Martin Sillesen, Mads Nielsen
TL;DR
CORE-BEHRT systematically optimizes BEHRT for EHR data by dissecting the impact of data representation, architectural components, and training procedures. The study shows that enriching inputs with medications, full-depth codes, background context, and precise timestamps, combined with Time2Vec embeddings, RoPE/SwiGLU refinements, and diversified pooling, yields robust AUROC gains (e.g., from 0.785 to 0.801, $p<10^{-7}$) that generalize across 25 clinical tasks and withstand temporal shifts in out-of-time evaluations. Across optimization rounds, 17 of 25 tasks showed significant improvements, with 24 tasks benefitting overall, underscoring the approach’s generalizability and potential for broader adoption in clinical decision support. Limitations include dataset size, reliance on medication-coded data, and challenges of replicating private EHR setups, but the work provides a concrete, evidence-backed foundation for trustworthy, scalable BERT-based EHR models.
Abstract
The widespread adoption of Electronic Health Records (EHR) has significantly increased the amount of available healthcare data. This has allowed models inspired by Natural Language Processing (NLP) and Computer Vision, which scale exceptionally well, to be used in EHR research. Particularly, BERT-based models have surged in popularity following the release of BEHRT and Med-BERT. Subsequent models have largely built on these foundations despite the fundamental design choices of these pioneering models remaining underexplored. Through incremental optimization, we study BERT-based EHR modeling and isolate the sources of improvement for key design choices, giving us insights into the effect of data representation, individual technical components, and training procedure. Evaluating this across a set of generic tasks (death, pain treatment, and general infection), we showed that improving data representation can increase the average downstream performance from 0.785 to 0.797 AUROC ($p<10^{-7}$), primarily when including medication and timestamps. Improving the architecture and training protocol on top of this increased average downstream performance to 0.801 AUROC ($p<10^{-7}$). We then demonstrated the consistency of our optimization through a rigorous evaluation across 25 diverse clinical prediction tasks. We observed significant performance increases in 17 out of 25 tasks and improvements in 24 tasks, highlighting the generalizability of our results. Our findings provide a strong foundation for future work and aim to increase the trustworthiness of BERT-based EHR models.
