TL;DR
Most AI models for Electronic Health Records (EHRs) treat medical events like arbitrary, meaningless IDs—forcing the model to learn from scratch that "hypertension" and "high blood pressure" are related. This paper introduces tEHR, a framework that translates structured patient histories into plain English and adapts pretrained Large Language Models (LLMs) to predict clinical outcomes. The result? Pretrained language semantics give models a massive boost in predictive power—even when controlling for model size—though it comes with a noticeable computational price tag.
What Problem Does This Paper Address?
When you visit a hospital, your diagnoses, lab results, and medications are logged as structured codes from systems like ICD or SNOMED-CT. Traditional EHR models treat each code as a unique, isolated token. That creates two major headaches:
- No prior knowledge: The model has no idea what a code means—it can only learn relationships between concepts by seeing them co-occur in the dataset.
- Vocabulary lock-in: Different hospitals use different coding systems, and even the same system evolves over time. Moving a model to a new hospital requires painstakingly mapping codes to the model's expected vocabulary, which often loses information.
Replacing these opaque codes with their natural-language descriptions lets an LLM tap into the medical knowledge it already learned during pretraining. But it hasn't been clear how much of the performance comes from the language semantics themselves versus sheer model size, or what the best way is to feed that language into a longitudinal prediction pipeline.
Methods
The authors propose tEHR, a two-stage framework built on top of causal LLMs (like Mistral-7B and Qwen3) using Low-Rank Adaptation (LoRA) so the base weights stay frozen:
- Clinical Narrative Textualisation: Structured EHRs are first standardized into the Medical Event Data Standard (MEDS). Each event's code is swapped for its human-readable description, numerical values (like lab results) are rounded to one decimal place, and the elapsed time between events is written out in plain units (e.g., "2 weeks later").
- Stage 1 – Domain-Adaptive Continued Pretraining: The LLM is trained via standard next-token prediction on unlabelled, textualised patient trajectories to adapt it to the rhythm and structure of longitudinal clinical data.
- Stage 2 – Discriminative Fine-Tuning: For a specific prediction task, the patient's history is truncated at the prediction time and capped with a
[PREDICT]token. The hidden state of that token is passed to a simple linear classifier trained with binary cross-entropy.
Datasets
The primary evaluation uses MIMIC-IV (v3.1), a large critical-care dataset containing roughly 15,000 unique medical codes (primarily ICD and NDC). The authors evaluate four binary prediction tasks:
- ICU mortality
- ICU readmission
- Hospital mortality
- 30-day hospital readmission
In the discussion, the authors also note an additional evaluation on a private UK primary care dataset for 12-month pancreatic cancer prediction, which spans over 241,000 unique medical codes.
Key Insights and Ideas
- Language semantics matter—it's not just model size: In a capacity-controlled experiment, the authors took the exact same Mistral-7B backbone and two-stage training setup, but replaced the English descriptions with newly initialized atomic code tokens. Performance plummeted (ICU mortality AUROC dropped from 0.887 to 0.772).
- Both adaptation stages are essential: Skipping Stage 1 (continued pretraining) or freezing the LLM during Stage 2 (fine-tuning) consistently hurt performance. Using an unadapted, frozen base LLM performed worst of all.
- Grounding and numbers are critical, but explicit time deltas are optional: Replacing clinical descriptions with meaningless hashed IDs or scrambling them within a patient's record tanked AUROC. Removing numerical lab values also consistently hurt performance. Surprisingly, removing explicit elapsed-time text ("2 weeks later") had almost no effect—chronological ordering alone seems to capture most of the temporal signal.
- Vocabulary lock-in is a real-world blocker: The structured foundation model CLMBR-T could only map 79.4% of MIMIC-IV events to its vocabulary, and couldn't be run at all on the UK primary care dataset due to unmapped codes. Textualisation sidesteps this entirely.
Key Results
- Best overall performance: tEHR-Mistral-7B achieved the highest AUROC and AUPRC across all four MIMIC-IV tasks. For ICU mortality, it reached an AUROC of 0.887 and AUPRC of 0.424, outperforming fine-tuned CLMBR-T (0.861 / 0.406) and a code-based Transformer Encoder (0.866 / 0.370).
- Prompting isn't enough: Zero-shot prompting with Mistral-7B performed poorly (AUROC 0.528–0.627), and compact alternatives like using frozen event-level LLM embeddings or projecting them into a smaller model fell short of full textualisation.
- The computational trade-off: Full textualisation expands each clinical event into multiple subword tokens. On a single NVIDIA H200, tEHR-Mistral-7B required 85.11 GPU-hours for pretraining and 26.09 GPU-hours for ICU mortality fine-tuning, with an inference latency of 301 ms per patient (compared to just 8.8 ms for the code-based Transformer Encoder).
Limitations and Future Work
The authors note two main limitations:
- Scope of evaluation: Results are limited to four tasks in MIMIC-IV and one private UK dataset; broader testing across diverse healthcare systems is needed.
- Token expansion: Turning codes into text lengthens sequences, increasing compute costs and forcing truncation of very long patient histories (tEHR used a 16,000-token limit).
Future work could explore cross-dataset transfer (e.g., training a tEHR model on one hospital's data and testing it on another without code mapping) and the interpretability of the learned representations.
Summary updated