Abstract
Advances in large language models (LLMs) provide new opportunities in healthcare for improved patient care, clinical decision-making, and enhancement of physician and administrator workflows. However, the potential of these models importantly depends on their ability to generalize effectively across clinical environments and populations, a challenge often underestimated in early development. To better understand reasons for these challenges and inform mitigation approaches, we evaluated ClinicLLM, an LLM trained on [HOSPITAL]'s clinical notes, analyzing its performance on 30-day all-cause readmission prediction focusing on variability across hospitals and patient characteristics. We found poorer generalization particularly in hospitals with fewer samples, among patients with government and unspecified insurance, the elderly, and those with high comorbidities. To understand reasons for lack of generalization, we investigated sample sizes for fine-tuning, note content, patient characteristics, and health system aspects. We found that, along with sample size, patient age, number of comorbidities, and the number of words in notes are all important factors related to generalization. Finally, we compared local fine-tuning, instance-based augmented fine-tuning, and cluster-based fine-tuning for improving generalization. Among these, local fine-tuning proved most effective, increasing AUC by 0.25% to 11.74%, proving most helpful in settings with limited data.
Introduction
While Large Language Models (LLMs) show immense promise in healthcare, their "generalizability"—the ability to perform consistently across different clinical settings and diverse populations—remains a major hurdle. A model trained on a prestigious urban hospital's data might fail when deployed in a smaller community clinic or when treating a demographic underrepresented in its training set. This study addresses the "Generalization Gap" in clinical AI by investigating why a model's predictive power fluctuates across four different hospitals within the same health system and across patient subgroups defined by age, insurance type, race, and medical complexity.
Methods and Data
The researchers developed ClinicLLM, based on a BERT-base architecture with 109 million parameters. The model was pretrained using Masked Language Modeling (MLM) on a massive corpus of 7.2 million clinical notes from the [HOSPITAL] system, encompassing 387,144 patients and 4.1 billion words spanning 2011–2020.
To bridge the generalization gap, the study compared four distinct fine-tuning strategies:
- Global Fine-tuning: Training on the entire multi-hospital dataset.
- Local Fine-tuning: Training a model specifically on data from a single hospital.
- Instance-Based Augmented Fine-tuning: Using patient embeddings to find "similar" notes from other hospitals to supplement a small hospital's local data.
- Cluster-Based Fine-tuning: Grouping patients into clusters based on clinical similarity (using UMAP and K-means) and fine-tuning on those clusters.
The fine-tuning dataset consisted of 170,191 patients and 222,824 "History and Physical" (H&P) notes. Analysis involved Perplexity Analysis to measure model "surprise" and Decision Trees to identify features—such as note length or patient age—that most influenced performance.
Key Insights and Results
The study revealed a significant "Small Hospital Penalty." Performance dropped sharply in smaller facilities; while the largest hospital (Hospital 1) achieved an AUC of 74.6%, the smallest (Hospital 4) hovered at 51.2%, barely outperforming random chance. Interestingly, controlled experiments showed that even with equal sample sizes, Hospital 1 outperformed Hospital 2, suggesting that clinical documentation styles and patient mix are as critical as data volume.
Demographic disparities were also stark. The model struggled most with patients over 60 and those with "Severe" comorbidities (Charlson Comorbidity Index Level 4). For instance, the AUC for "Young Adults" was 80.81%, compared to only 64.75% for those above 60. These patients often have more complex and "noisier" clinical histories, making readmission harder to predict.
Regarding mitigation, Local Fine-tuning emerged as the superior strategy for smaller hospitals. For Hospital 4, local fine-tuning boosted the AUC from 51.20% to 57.21% (an 11.74% proportional increase). It also improved the Expected Calibration Error (ECE), ensuring the model's confidence scores more accurately reflected its actual performance.
Limitations and Future Work
A primary technical limitation is the BERT architecture's 512-token limit. Clinical notes are often much longer, leading to information loss through truncation. Furthermore, while the study covers four hospitals, they belong to a single NYC-based health system, and the focus was restricted to "History and Physical" notes.
Future research should explore "Long-context" models like Longformer and incorporate a broader range of note types, such as discharge summaries and progress notes, to provide a more holistic clinical view. Refining patient-similarity metrics could also further enhance model adaptation for specific clinical niches.
Summary updated