Introduction
The application of Large Language Model (LLM) architectures to Electronic Health Records (EHRs) is a rapidly expanding area of research. However, the vast majority of these "EHR foundation models" are trained and evaluated on Intensive Care Unit (ICU) datasets like MIMIC-III/IV. ICU care is characterized by intense, short-term monitoring and highly protocolized treatment pathways, making patient trajectories somewhat predictable.
This paper asks a crucial question: Do the impressive results of EHR foundation models hold up when applied to indolent, chronic, and progressive diseases? To test this, researchers focused on Chronic Hepatitis B (CHB), a disease characterized by sparse monitoring, inconsistent warning signs, and long-term, non-linear progression toward severe outcomes like cirrhosis and hepatocellular carcinoma (HCC).
Methods and Data
The researchers utilized the Optum® de-identified EHR database, a massive, multi-center dataset containing longitudinal records for over 100 million U.S. patients. To handle the massive length of EHR histories and reduce the noise of high-surveillance periods, all medical events (diagnoses, labs, prescriptions, etc.) were aggregated into monthly time bins.
The authors built and compared three distinct modeling approaches:
- Tabular XGBoost (The Baseline): Patient sequences were flattened into tabular data, utilizing ANOVA F-value feature selection to narrow the data down to the top 1,000 features.
- End-to-End Transformer: A transformer encoder trained from scratch exclusively on the target CHB patient population (~78,000 patients).
- Pre-trained EHR Foundation Model: A transformer pre-trained on a massive cohort of ~55 million non-CHB patients, then fine-tuned on the CHB cohort. The pre-training objective included predicting the next month's medical codes, the time offset to the next event, and the mean/variance of numerical lab values.
Key Insights and Attention Patterns
While evaluating the models, researchers uncovered fascinating qualitative findings regarding how transformers process clinical data.
Transformers Learn the Clinical "One-Liner" By analyzing the model's attention maps, the authors found that the model dedicated specific attention heads entirely to the "context token" (fixed traits like age, gender, race). This perfectly mirrors how doctors communicate using a "one-liner" (e.g., "A 55-year-old male with a history of...") to establish a baseline pretest probability before diving into recent symptoms.
Dynamic Attention Shifting Other attention heads learned to fixate on the most recent, highly relevant medical events—such as an abnormal liver imaging result—effectively ignoring the background noise in the rest of the patient's history.
The "ICU Bias" in Medical AI The authors argue that predicting ICU outcomes (like readmission or mortality) is artificially easy because care pathways are systematically enforced by healthcare payment benchmarks. Chronic diseases exhibit ad hoc diagnostics, making them a much harder, yet arguably more valuable, target for AI decision support. Despite their elegant attention patterns, the transformer models often seemed to fall back on simple sequence aggregation rather than learning complex temporal dependencies across sparse timeframes.
Key Results
The models were tasked with predicting the onset of Cirrhosis and HCC at 1, 3, 5, and 10-year horizons.
XGBoost Outperforms Transformers Surprisingly, the simple tabular XGBoost baseline consistently outperformed both transformer models. For 1-year Cirrhosis prediction, XGBoost achieved an AUC of 0.83, compared to the fine-tuned foundation model's 0.80.
Pre-training Helps, but Scaling Plateaus While transformers lagged behind XGBoost, pre-training proved highly beneficial. The fine-tuned foundation model (AUC 0.80 for 1-year Cirrhosis) significantly outperformed the end-to-end transformer trained only on the target cohort (AUC 0.74). The authors also tested 43M, 170M, and 860M parameter models, finding that performance plateaued at 170M, showing no gain from scaling up to 860M.
Limitations and Future Work
The authors acknowledge that vanilla transformer architectures may not fully capture the complexity and temporal sparsity of medical codes compared to natural language. Furthermore, the XGBoost model likely benefited from explicit feature selection, giving it a more focused mathematical space to work within.
Moving forward, the authors suggest introducing greater inductive biases into EHR models, such as improved medical tokenization. Most importantly, they issue a call to action for the field: researchers must start evaluating EHR foundation models on uncertain, slowly progressive diseases. This is where primary care providers actually need the most help flagging subtle signs of deterioration.
Summary updated