Manuscript Offprint

arXiv:2610.27047

Discrete Neural Interlingua for Ontology-Agnostic EHR Modeling

Tong Ding, Caiwei Tian, Dongmin Bang, Ming Y. Lu, Sophia J. Wagner, Andrew Zhang, Rowland Pettit, Long Phi Le, Faisal Mahmood

Abstract

EHR foundation models promise scalable clinical prediction across health systems, yet their deployment is constrained by a tokenization bottleneck. The same clinical concept can appear as different ontology codes, local identifiers, synonyms, or free-text descriptions, which standard EHR tokenizers treat as unrelated symbols. A model trained on MIMIC-III with a closed-vocabulary tokenizer can use only 13% of eICU events. We introduce MEDIATOR, a discrete ontology-agnostic tokenizer that maps any clinical concept expressed as text into a shared vector-quantized codebook, turning EHR harmonization into open-vocabulary tokenization without manual mappings or a fixed vocabulary. Trained with synonym supervision and guided by enriched concept descriptions, code co-occurrence, and relation graphs, MEDIATOR collapses equivalent expressions while organizing distinct concepts in a medically meaningful discrete space. Used as the token interface of an EHR Transformer, MEDIATOR improves mean AUPRC over the strongest prior tokenizer by 4.0 points (8% relative) on 20 MIMIC-III tasks and by 8.6 points (29% relative) in zero-shot transfer to 14 eICU tasks, where it uses all events. The transfer gain combines coverage and representation, as MEDIATOR remains the best tokenizer under identical inputs (+1.0 and +1.9 points on operational and subcohort-mortality tasks). Same-encoder controls show that the text encoder drives in-domain accuracy, while the learned objectives of MEDIATOR drive transfer robustness and entity-linking quality. MEDIATOR also enables transferable attribution across hospitals.

1 Introduction

Electronic health records (EHRs) are central to clinical prediction, real-world evidence generation, cohort construction, and decision support. Transformer-based EHR models have achieved strong results by learning from longitudinal sequences of diagnoses, procedures, medications, laboratory events, and other clinical observations [Shmatko et al., 2025, Waxler et al., 2025, Li et al., 2020, Wornow et al., 2023a, Steinberg et al., 2021]. These models promise to support multi-institutional learning and deployment across health systems. Yet this promise is constrained by a representation problem. Clinical concepts are recorded differently across coding systems, ontology versions, local institutional practice, and free-text documentation. A model trained on MIMIC-III [Johnson et al., 2016] with a closed-vocabulary tokenizer can use only 13% of eICU events [Pollard et al., 2019], since the rest use other codes or free text. As a result, many EHR models learn from an input space that is fragmented, redundant, and difficult to transfer across settings (Figure 1).

Most existing EHR foundation models tokenize structured data by treating each medical code as an independent symbol with a learned embedding [Wornow et al., 2023b]. This design scales poorly to large, heavy-tailed clinical vocabularies and fails to share statistical strength across related concepts.

†^{\dagger}Equal contribution.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

a Hospital vocabularies only partly overlap

b Equivalent strings share one token

c Shared tokens enable transfer

Figure

Figure 1: Motivation for MEDIATOR. a. The vocabularies of Hospital A (light blue) and Hospital B (orange) only partly overlap, so models trained at A fail on B-specific codes and drop free text. b. MEDIATOR maps equivalent surface forms from both hospitals, colored by source hospital, to one shared vector-quantized (VQ) token (dark blue). c. Shared tokens let one EHR model transfer across hospitals, with predictions and attributions defined over the same tokens.

[Su et al., 2025]. Code-level tokens also discard informative structure. Each code is defined by a textual description, belongs to an ontology hierarchy, and is linked to many synonyms and near-synonyms across other coding systems [Johnson et al., 2026]. Ignoring these semantics leads to inefficient vocabularies and fragmented representations, especially for rare or institution-specific codes. This brittleness is most visible across institutions. Hospitals differ in the ontologies they use, which versions they deploy, and how they encode local variants of common concepts. When a model is trained with one hospital's code vocabulary, deploying it elsewhere typically requires manual code mapping, vocabulary alignment, and coverage audits. Such mapping is expensive, error-prone, and often incomplete in the long tail. As a result, most models avoid clinical text entirely [Wornow et al., 2023b] and restrict modeling to a narrow subset of structured data such as diagnostic codes, labs, and medications, sacrificing clinical signal for modeling convenience.

Previous studies have attempted to address this heterogeneity from several complementary angles. Ontology-normalization approaches map events to a common vocabulary such as the Unified Medical Language System (UMLS) [Bodenreider, 2004, Wu et al., 2026a]; representation-learning approaches enrich fixed code vocabularies with text descriptions and medical knowledge graphs, and LLM-generated definitions [Su et al., 2025, Kim et al., 2026]; text-based embedding methods represent codes directly in continuous semantic space [Hur et al., 2022]; and multi-institutional harmonization frameworks align site-specific vocabularies using EHR summary statistics, biomedical graphs, and language-model semantics [Zhou et al., 2026]. These efforts improve semantic coverage and reduce reliance on manual pairwise code mapping, but they do not fully address the modeling interface required for scalable EHR sequence modeling. First, UMLS defines a massive and evolving vocabulary. It aggregates multiple source vocabularies, introducing redundancy and fine-grained distinctions that are often unnecessary for downstream prediction. Consequently, using UMLS identifiers directly as tokens reintroduces the problems of scale, sparsity, and redundancy inherent in raw code vocabularies [Su et al., 2025]. Fixed-vocabulary code embeddings remain closed over a prespecified set of structured codes, and site-alignment methods generally must be rerun when a new hospital, ontology, or local code system is introduced. Continuous embeddings are more flexible, but they do not provide the stable discrete interface used by standard masked-token and autoregressive EHR Transformers, which also complicate event-level inspection, attribution, caching, and generative trajectory modeling. A useful EHR tokenizer should therefore be both discrete and open-vocabulary. It should accept any medical concept expressed as text and map it into a shared, reusable code space.

To this end, we introduce MEDical Interlingua TokenizeR (MEDIATOR), a discrete and ontology-agnostic concept space that serves as a neural interlingua. MEDIATOR takes as input any clinical concept expressible as text (including ontology code descriptions, local code descriptions, and uncoded text entries) and maps it to a discrete index from a fixed-size vector-quantized (VQ) codebook, in which each code is a semantic prototype with an embedding. Leveraging strong pretrained text encoders, we learn this mapping from large-scale cross-ontology synonym supervision, treating each underlying concept as an equivalence class of surface forms. To better shape the representation geometry, we further guide codebook learning with three complementary sources of medical knowledge including enriched concept descriptions, empirical code co-occurrence, and curated relation-graph structure. The resulting codebook defines a compact, reusable clinical vocabulary that can be used as a drop-in token interface for standard EHR Transformers, improving interoperability and interpretability while avoiding fragile ontology-specific tokenization and manual code mapping.

We show that MEDIATOR is effective in settings that stress current EHR modeling. As the token interface of an EHR Transformer, MEDIATOR improves mean AUPRC over the strongest prior tokenizer by 4.0 points (8% relative) on 20 MIMIC-III tasks and by 8.6 points (29% relative) in zero-shot transfer to 14 eICU tasks without manual vocabulary alignment, and remains the best tokenizer when input coverage is matched to closed-vocabulary baselines. Controlled analyses decompose these gains. The transfer gain combines broader input coverage with better representations, the pretrained text encoder drives in-domain accuracy, and the learned objectives of MEDIATOR drive transfer robustness and entity-linking quality. Finally, the shared discrete space supports transferable interpretability across hospitals through common concept tokens.

References (71)