Training-Free Mapping for Cross-Institutional Transfer of EHR Foundation Models

Raphael Reimann, Robin van de Water, Chris-Bennet Fleger, Bernhard Y Renard, Eugenia AllevaML4H 2026 Poster 2026

TL;DR

When you take an electronic health record (EHR) foundation model trained at one hospital and deploy it at another, nearly half of the new hospital's medical codes can vanish because they aren't in the model's vocabulary. This paper shows that a simple, training-free fix—mapping each unseen code to the in-vocabulary code with the most similar text name at tokenization—recovers about a third of the performance gap on 30-day readmission prediction, matching the benefit of 200 to 300 million tokens of continued pretraining for free.

What Problem Does This Paper Address?

Foundation models for structured EHRs read a patient's medical history as a sequence of coded clinical events (diagnoses, lab tests, medications). Unlike large language models, which use subword tokenizers to break unfamiliar words into known pieces, EHR models treat each medical code as an atomic token. Their vocabularies are typically capped at the most frequent codes from the hospital where they were pretrained.

That creates a quiet crisis for cross-institutional transfer. If a hospital in New York uses different local codes than a hospital in California, those unseen codes produce no tokens and are simply dropped before the model ever sees them. The authors show this isn't a quirk of one dataset, but a bidirectional property of transfer: applying Stanford's publicly released Context Clues models to a large urban health system drops 45.1% of events, while models pretrained on that health system drop 54.7% of events on Stanford's EHRSHOT dataset (compared to just 1.1% and 5.9% when tested in-domain).

Methods

The authors propose a zero-training intervention at tokenization time. For every out-of-vocabulary code, they look up its concept name from standardized Observational Medical Outcomes Partnership (OMOP) tables and encode it into a vector using SapBERT, a biomedical language model. They then map the unseen code to the single nearest in-vocabulary code by cosine similarity—provided it clears a similarity threshold of $\tau = 0.6$ (otherwise, it is still dropped).

Study design showing the transfer setting, inference-time code mapping, and linear-probing evaluation

Crucially, the model weights, tokenizer, and embedding table remain completely untouched. To ensure that downstream fine-tuning doesn't mask the effect of the restored tokens, the authors evaluate the frozen models using linear probing: mean-pooling the final-layer token embeddings, $L_2$-normalizing them, and training an $\ell_2$-regularized logistic regression under 5-fold patient-level cross-validation. (They exclude GPT-2 from aggregate analyses because its representations track raw sequence length with $r \ge 0.96$, which would confound the results.)

Datasets

  • Urban Health System EHR: A large-scale corpus formatted in the Medical Event Data Standard (MEDS), featuring 253,927 patients for 30-day all-cause readmission, plus 11 other tasks (in-hospital mortality, 4 incident-diagnosis tasks, and 6 laboratory-abnormality tasks).
  • EHRSHOT: Stanford's public EHR benchmark (6,739 patients total; 3,718 in the readmission cohort) used to test reverse transfer across 28 task-and-model combinations.
  • Models: Publicly released Stanford Context Clues checkpoints (Mamba, Hyena, GPT-2) paired with matched ~120M-parameter models pretrained on the health-system data up to a 2-billion-token cap.

Key Insights and Ideas

  • Which codes you restore matters more than how you match them: On 30-day readmission, restricting the mapping to SNOMED diagnosis codes reproduces the entire performance gain, while restricting it to LOINC lab codes yields almost nothing—even though labs make up 40.3% of the restored events. Moreover, a simple character $n$-gram matcher without biomedical training recovers nearly as much AUROC as SapBERT.
  • Missing coding systems predict which tasks will benefit: In the Stanford-to-health-system direction, the missing codes are mostly SNOMED diagnoses, so diagnosis and operational tasks improve while lab tasks (whose LOINC codes are already in Stanford's vocabulary) stay flat. In the reverse direction on EHRSHOT, the health-system vocabulary lacks LOINC codes, making LOINC-only mapping the main driver of gains.
  • Mapping complements continued pretraining: Even if a hospital has the GPUs and data to continue pretraining a released checkpoint on local records, keeping the inference-time mapping still adds AUROC at every checkpoint up to 2 billion tokens.

Key Results

  • 30-Day Readmission: Mapping boosts AUROC by +0.0114 for Mamba and +0.0132 for Hyena, recovering 31% and 34% of the performance gap relative to models pretrained directly on the health-system data.
Mapping recovers 31% of the Mamba AUROC gap and 34% of the Hyena AUROC gap on 30-day readmission
  • Compute Equivalence: Continued pretraining on local data needs 302 million tokens (Mamba) and 207 million tokens (Hyena) just to match what mapping achieves with zero training. Combined, mapping plus 2 billion tokens of continued pretraining recover 57% and 70% of the gap, respectively.
  • Reverse Transfer (EHRSHOT): Mapping improves AUROC in 22 out of 28 task-and-model combinations.

Limitations and Future Work

The exact recovery fractions (31% and 34%) and token-equivalence numbers come from a single pair of institutions and one primary task (30-day readmission), so they may vary elsewhere. Additionally, a clinician review of 150 mapped codes found that while 68%–73% were exact or clinically related concepts, 7%–9% were incorrect (e.g., hereditary angioedema mapped to hereditary lymphedema); for tasks hinging on a single specific code, sites may need to raise the similarity threshold $\tau$ or exclude sensitive concepts. Finally, all evaluations used a linear probe on frozen backbones—whether full fine-tuning would absorb or alter the benefit of mapping remains an open question.

Summary updated

BibTeX
@inproceedings{reimann2026training,
  author = {Raphael Reimann and Robin van de Water and Chris-Bennet Fleger and Bernhard Y Renard and Eugenia Alleva},
  title = {{Training-Free Mapping for Cross-Institutional Transfer of EHR Foundation Models}},
  booktitle = {ML4H 2026 Poster},
  year = {2026},
  url = {https://openreview.net/forum?id=b3WpU5nv4w},
}
Figure