Editor’s introduction
The study evaluates six state-of-the-art structured EHR foundation models across 14 clinically meaningful prediction tasks, including prognosis and early diagnosis of acute and chronic conditions. It finds that top-performing models outperform traditional approaches in low-labeled settings and show improved fairness across socio-medical groups. However, these models underperform in low-prevalence conditions, where pretraining may lose critical discriminative signals, and exhibit poorer calibration when labeled data is limited. Cross-institutional transportability remains inconsistent, indicating challenges in generalizing model performance beyond single sites. Inference computational cost is also measured, with FLOPs reported as a proxy for clinical usability. The benchmark reveals that while foundation models offer advantages in data efficiency and equity, they do not consistently surpass task-specific models or reliably transfer across institutions, highlighting key limitations in current implementations.
Introduction
Machine learning (ML) has long promised to improve health outcomes by enabling early prediction of disease risk, opportunistic screening, and outcome-based risk stratification. However, while ML models and artificial intelligence (AI)-augmented clinical workflows achieve expert-level performance on many such tasks, they are rarely implemented in real-world clinical settings due to operational factors, high deployment and maintenance costs, and limited generalizability. This inability to generalize across different tasks and patient populations primarily stems from the learning paradigm of traditional supervised learning methods, which require training separate models for each task of interest on curated, labeled data. This approach requires extensive human annotation, limiting both the scale and diversity of the training data and, consequently, the range of medical conditions studied.
Foundation models (FMs) represent a new paradigm in ML. Pre-trained on large amounts of unlabeled data through self-supervised learning, these models learn representations independently of any specific task. These models can then be “fine-tuned” to adapt to specific tasks, or, alternatively, used to extract representations then leveraged for various downstream applications. FMs have demonstrated state-of-the-art performance across natural language, multimodal vision-language, multivariate time-series, and biological data. In particular, these models aim to address the limitations of traditional ML by (i) reducing the need for human annotations: FMs require no label for pretraining, and task-specific post-training promises to be more data efficient than traditional task-specific models, (ii) improving generalizability across tasks: the same FM can be used for post-training for various downstream tasks, and (iii) promising improved transportability across datasets as the model size and data volume scale.
The increasing availability of structured Electronic Health Records (EHRs) presents an opportunity to leverage FMs in healthcare. Reflecting patients’ interactions with the healthcare system, these data capture patients’ health and clinical decision-making thereof, offering a unique opportunity for real-time monitoring and diagnosis at the point of care. Multiple EHR FMs have been proposed in recent years to tackle the unique challenges of EHRs, such as data standardization and interoperability, irregular temporality, and long context windows to better capture physiological progression, and have demonstrated competitive performance across medical tasks.
Despite the proliferation of EHR FMs, there is a critical lack of consensus on evaluation to quantify their potential for clinical utility. While recent efforts to harmonize EHR data and standardize AI pipelines have improved evaluation, existing evaluations have often been limited to a single institution (e.g., MIMIC-IV), a limited set of downstream tasks (e.g., mortality prediction with inconsistent definitions), a single measure of performance (e.g., AUROC), and often a limited set of FMs. Such limited evaluations (i) prevent robust conclusions of which tasks, clinical settings, and populations benefit from structured EHR FMs, (ii) make replicability and reproducibility challenging and resource-intensive, and (iii) preclude end-users, such as researchers at healthcare institutions, from a clear understanding of robust design choices and adaptivity to their own settings, a barrier further exacerbated by limited computational resources to recreate such comparisons. Consequently, this lack of benchmarks leaves the community without a standardized measure of progress and an inability to make informed decisions on infrastructure investment and deployment.
Applying this benchmark on CUMC and MIMIC-IV yields four key insights into how FMs generalize across tasks and patient populations. First, top-performing FMs outperform traditional baselines in discrimination but underperform on calibration under limited labeled data. This weakens their applicability in clinical settings where reliable risk estimates are critical for decision-making. Second, by pretraining on large amounts of data, FMs extract robust representations across diverse groups, yielding fairer predictions. Third, FMs provide the most benefit under limited labeled data, presenting an opportunity for diseases where large-scale annotated data are hard to obtain. However, these models underperform for low-prevalence conditions, as pretraining losses may not capture these conditions. Finally, cross-institutional transportability remains unmet: variations in clinical practice and patient characteristics result in insufficient distributional overlap, limiting the performance of externally trained FMs. Together, these findings highlight that realizing the clinical potential of EHR FMs requires not only technical innovation but also rigorous evaluation frameworks and standardized data pipelines.
How do structured EHR FMs perform with limited labeled data?
When trained with a small amount of labeled data, FMs systematically outperform the best baseline, except for low-prevalence conditions. This finding is particularly relevant in clinical settings where labeled data is scarce, and FMs may offer the most value precisely where traditional supervised approaches are most limited.
Are FMs transportable across healthcare institutions?
A key promise of FMs is their ability to generalize across institutions. A FM pretrained at one hospital could be used to generate patient representations at another site and be directly applied to downstream tasks, eliminating the need for local training and reducing the computational cost of deploying clinical models.
Across tasks, the transported model consistently underperforms its locally trained counterpart and the task-specific baseline. This result calls into question the robustness of FMs to new medical environments, where differences in EHR recording practices, coding, and clinical workflows may fundamentally limit their transportability. For example, healthcare utilization varies significantly across institutions, with CUMC averaging 118.4 distinct events per year and Stanford-EHR averaging only 28.6 (Appendix C). These differences likely reflect both population shifts and differing recording practices.
Discussion
The proposed benchmark for systematic evaluation of structured EHR FMs across diverse tasks and datasets surfaces critical shortcomings of state-of-the-art structured EHR FMs. While FMs present important benefits in low-label regimes and improve predictive fairness, they fail to consistently outperform task-specific baselines and do not reliably transport across institutions.
Across both linear probing and fine-tuning, FMs fail to consistently outperform task-specific baselines. This finding challenges the implicit assumption that data-scale and the pretraining paradigm directly translate into improved performance. While FMs improve discriminative performance when post-trained with limited data, they offer limited benefit when more data is available. Importantly, when linear probing falls short, fine-tuning does not bridge this gap, despite substantially higher computational costs. These results underline that representations learned using existing pretraining strategies for structured EHRs may not always learn embeddings with discriminative signals necessary for meaningful downstream tasks. In particular, low-prevalence conditions may not be captured by such a representation and consequently, the embeddings result in underperformance in this setting.
The top-performing FM presents lower calibration than task-specific baselines under limited labeled data. While discrimination is important for prioritization in clinical practice, practitioners often require risk quantification to inform medical recommendations. The lower calibration of FMs compared with traditional baselines suggests that this paradigm may yield biased risk estimates. This phenomenon may result from non-calibrated pretraining losses. Optimizing for representativeness may fail to capture the true prevalence of clinical conditions at the cost of calibration.
A critical dimension of our benchmark is to extend traditional evaluation to capture potential group disparities. FMs improve fairness relative to task-specific baselines, particularly in healthcare utilization. Pretraining on large, diverse patient populations results in representations that generalize across groups. However, this finding should be interpreted cautiously. Our analysis focuses on a limited set of groups with high missingness rates in recorded identifiers. Further, fairness for one group does not guarantee similar properties across other clinically relevant axes. The observed fairness gains are therefore promising but not sufficient to ensure equitable deployment across diverse patient populations.
FMs do not transport reliably across institutions. The application of MAMBA model, pretrained in Stanford-EHR, and tested in CUMC consistently underperformed the locally pretrained model. The promises of the FM paradigm may fall short when applied to hospitals with different populations and clinical and recording practices. Beyond differences in healthcare utilization, event frequency, and data density (see Appendix C), data harmonization and preprocessing practices across institutions remain a fundamental barrier to ensuring that the benefits of these models reach under-resourced institutions and the populations they serve.
Structured EHR FMs
CEHR-BERT. CEHR-BERT (Chronological Electronic Health Record BERT) aims to leverage EHR temporal information. To this end, CEHR-BERT introduced Artificial Time Tokens (ATTs), inserted between neighboring events to represent the time intervals to capture fine-grained temporal differences more effectively. CEHR-BERT combines concept embeddings with both absolute and relative time embeddings, which reflect the patient’s age at the time of the event. CEHR-BERT focuses on structured EHR inputs, specifically using demographic, visit, diagnosis, procedure, and medication data to model temporal clinical trajectories.
CEHR-GPT. CEHR-GPT is a GPT-2 model trained on the patient representation introduced by CEHR-BERT, to enable generating synthetic structured EHR data. CEHR-GPT differs from the previous model through: (i) demographic tokens placed at the start of each patient sequence, (ii) day tokens inserted between neighboring visits to represent time intervals in days, and (iii) day tokens placed within inpatient visits to preserve the duration of hospital stays, to capture patient timelines. CEHR-GPT only operates on a subset of OMOP domains, including demographics, visits, diagnoses, procedures, and medications.
CORE-BEHRT. CORE-BEHRT is a BERT-based model for early-diagnosis prediction, which stores patient trajectories as sentences with separator tokens to denote the time elapsed between visits. CORE-BEHRT incorporates medication, in addition to diagnosis information used in its precursor model BEHRT. However, it does not use information about procedures or laboratory tests. Unlike CEHR-BERT, which uses Time2Vec to encode temporality, CORE-BEHRT incorporates temporality via patient age.
LLaMA. LLaMA is a general-purpose FM using a transformer-based architecture analogous to GPT but differs in the choice of normalization layers. Additionally, LLaMA does not incorporate time but uses rotary positional embeddings (RoPE) in the attention mechanism to encode the order of medical events. It represents a state-of-the-art transformer architecture.
MAMBA. MAMBA is a selective state-space model that replaces attention blocks with state-space layers. It can be interpreted as a generalized version of gated Recurrent Neural Networks that capture continuous time-varying inputs. This architecture reduces computational time complexity to linear time compared to transformers and has been shown to better handle long sequences with temporal dependencies, a common occurrence in EHRs.
Pre-training
Local. We pretrain all models from scratch independently on CUMC and MIMIC-IV data to generate patient embeddings. To this end, we use the same pre-processing, tokenization, hyperparameters, and training objectives as in the original works. To ensure the same convergence levels for all models despite model-specific losses and learning rates, we use a 0.1-1% change in relative loss as a stopping criterion.
External. We use open weights from a Mamba model pretrained on Stanford-EHR, which we refer to as MAMBA-Transport, on downstream tasks on our EHR data without local fine-tuning. Although MOTOR also provides open weights, we could not evaluate its transportability due to insufficient information on lab measurement units in the original pre-training datasets.
Fine-tuning
Fine-tuning consists of further training a FM using labeled data. As these models are often trained for next-token prediction, one must first add a classification head with a final Softmax based on the intermediary representation. Following the linear probing approach, a single classification layer is appended before training the model. However, unlike linear probing, the classification loss is backpropagated through both the classification network and the base FM. As fine-tuning is sensitive to hyperparameters, we perform a grid search over the fine-tuning learning rate (set to {0.05, 0.1, 0.2, 0.3, 0.5} of the pretraining rate) and the ratio of the classification head learning rate to the fine-tuning rate, drawn from {1, 2, 5}, reflecting the goal of slowing the base model’s updates relative to the classification head. We fix the scheduler to linear decay with a one-epoch warmup, selected via a preliminary search on a single model, and train for up to 10 epochs with early stopping (patience 3 on validation log-loss), choosing the final configuration by validation log-loss.
Acute Myocardial Infarction (AMI)
AMI, also known as a heart attack, is an acute condition. The inclusion event for the at-risk cohort is one of the AMI risk factors from, a related code identified by GloVe embeddings, or a diagnosis from the “Ischemic heart diseases” chapter (ICD10: I20-I25). The inclusion event for the AMI case cohort is an appropriate diagnostic code (SNOMED: 22298006) during an emergency room or inpatient visit. We specifically omit the SNOMED code 1755008 (prior myocardial infarction) from the inclusion event. Additionally, we require a 180-day washout period between AMI diagnoses to ensure that each diagnosis refers to a separate event. This phenotype was also used in.
Systemic Lupus Erythematosus (SLE)
SLE, or lupus, is a chronic disease. We derive the phenotype for SLE from the OHDSI-generated phenotype, which has been previously validated via chart review. The entry event for the at-risk cohort includes: differential diagnoses for SLE, related codes generated by GloVe embeddings, and any code within the “Systemic connective tissue disorders” subchapter of ICD10 (M30-M36). Additionally, the validated phenotype for SLE includes a set of concepts titled “Signs and symptoms suggestive of SLE”; any of these condition occurrences can also constitute an entry event for the at-risk cohort. The entry event for the case cohort starts with at least one condition occurrence from the predefined concept set “Signs and symptoms suggestive of SLE” or a drug exposure from the concept set “SLE treatments”. In both cases, this initial event must be followed by a diagnosis from the SLE concept set within 90 days. Due to its chronic nature, only the first diagnosis of SLE is considered during phenotyping.
Osteoporosis
Osteoporosis is a chronic disease. The at-risk cohort entry event includes any of the following risk criteria: women aged 65 and older, men aged 70 and older, anyone 50 or older who has had a fracture or with the following risk factors, such as White or Asian women, smokers and heavy drinkers, who weigh less than 125 pounds, who have undergone bariatric surgery, with kidney failure, inflammatory bowel disease, rheumatoid arthritis, liver disease or an eating disorder or who take oral corticosteroids daily or other high-risk medications (e.g., thyroid hormone replacement, immunosuppressant drugs, warfarin). The inclusion event for the case cohort is a diagnosis code for “Osteoporosis” (SNOMED: 80502) or any of its descendants.
Schizophrenia
Schizophrenia is a chronic disease. Inclusion into the at-risk cohort requires a non-schizophrenia spectrum psychotic disorder. The case cohort requires a subsequent diagnosis of schizophrenia or schizoaffective disorder. Individuals with schizophreniform disorder were excluded from both cohorts, as their ambiguous diagnostic status could constitute data leakage. We further require that the individual be between 10 and 35 years old at the prediction time, as this is the typical age range of schizophrenia onset. All individuals had at least 3 years of observation, with at least one diagnosis or prescription in the last 3 years of observation. The schizophrenia phenotype, including the 3-year observation lookback, was previously validated in.
As with all chronic diseases, the observation start date is the start of the patient’s observed data in the database. The cohort exit date is either a schizophrenia diagnosis or the end of observed time (if the patient does not have schizophrenia. The index date is 90 days prior to the cohort exit date, leaving a 90-day censoring time to avoid temporal data leakage. We use the full patient history (limited only by the model’s context length) to predict the diagnostic transition from psychosis to schizophrenia because of the relatively small cohort size: 636 patients with a diagnostic transition from psychosis to schizophrenia and 2,634 with psychosis only.
Encoding temporal information
MOTOR incorporates two timestamp features — absolute time and its square — by replacing the last two dimensions of the hidden states. It integrates sinusoidal age embeddings at each layer of the FEMR decoder using RoPE, allowing age and time information to influence the model throughout its depth.
CEHR-BERT integrates timestamp, age, and visit positional embeddings through a feedforward network before passing them to the encoder layers. Additionally, it inserts time tokens between consecutive visits and between inpatient events occurring on different days to capture the temporal irregularity of EHR sequences.
CEHR-GPT encodes temporal information by augmenting patient sequences with explicit time-related tokens. It introduces a start-year token and an age token at the beginning of each trajectory, and inserts fine-grained day tokens between visits and between inpatient events on different days. These temporal embeddings, corresponding to year, age, and day tokens, are learned directly through the model’s next-token prediction objective.
Task-specific performances
The main text focuses on the ranking of different models. The following results present detailed figures for all outcomes of interest. Specifically, Figures 8, 10 and 11 present the discriminative and calibration for all tasks and models given increasing amounts of training data, while Figures 9, 12 and 13 present the fairness discriminative gap for all tasks stratified by sex, race1212 12 Due to the granularity of available demographic data, we consider two groups of interest: Black and White patients., and healthcare utilization.


