Abstract
Although recent advances in scaling large language models (LLMs) have resulted in improvements on many NLP tasks, it remains unclear whether these models trained primarily with general web text are the right tool in highly specialized, safety-critical domains such as clinical text. Recent results have suggested that LLMs encode a surprising amount of medical knowledge. This raises an important question regarding the utility of smaller domain-specific language models. With the success of general-domain LLMs, is there still a need for specialized clinical models? To investigate this question, we conduct an extensive empirical analysis of 12 language models, ranging from 220M to 175B parameters, measuring their performance on 3 different clinical tasks that test their ability to parse and reason over electronic health records. As part of our experiments, we train T5-Base and T5-Large models from scratch on clinical notes from MIMIC III and IV to directly investigate the efficiency of clinical tokens. We show that relatively small specialized clinical models substantially outperform all in-context learning approaches, even when finetuned on limited annotated data. Further, we find that pretraining on clinical tokens allows for smaller, more parameter-efficient models that either match or outperform much larger language models trained on general text. We release the code and the models used under the PhysioNet Credentialed Health Data license and data use agreement.
Introduction
The artificial intelligence landscape is currently dominated by Large Language Models (LLMs) trained on massive, heterogeneous datasets from the general web. These models, such as GPT-3, have demonstrated a remarkable ability to pass medical licensing exams and provide coherent answers to consumer health queries. However, the specialized environment of clinical practice presents a different challenge. Clinical text—the raw notes authored by clinicians within Electronic Health Records (EHRs)—is notoriously "messy." It is characterized by non-standard abbreviations (e.g., "CTA," "APGAR"), telegraphic shorthand, and highly specific jargon that differs significantly from the prose found on the web.
This study addresses a fundamental question for the future of healthcare AI: Should the industry pivot toward massive, general-purpose LLM APIs, or is there a continued necessity for smaller, specialized models trained specifically on clinical data? By evaluating 12 models across a range of parameters, we demonstrate that domain-specific pretraining remains the most efficient and effective path for clinical NLP.
Methodology
To provide a comprehensive comparison, we categorized 12 language models (ranging from 220M to 175B parameters) into four distinct architectural approaches:
- Specialized Models (From Scratch): Models like our Clinical-T5, trained exclusively on clinical corpora to optimize for medical vocabulary.
- Domain-Adaptive Pretraining (DAPT): General-purpose models that undergo additional training on clinical text to bridge the domain gap.
- Finetuned General Models: Standard architectures (e.g., RoBERTa or T5) trained directly on specific clinical downstream tasks.
- In-Context Learning (ICL): Massive LLMs (e.g., GPT-3) prompted with examples to perform tasks without updating their internal weights.
A core component of our research involved training Clinical-T5-Base and Clinical-T5-Large from scratch using nearly 2 billion tokens from the MIMIC-III and MIMIC-IV databases. This allowed us to measure the specific impact of clinical-specific vocabularies versus general-purpose tokenization.
Experimental Setup
Models were evaluated on three diverse tasks designed to test clinical reasoning and parsing:
- MedNLI: A Natural Language Inference task requiring the model to determine if a clinical premise entails, contradicts, or is neutral toward a hypothesis.
- RadQA: An extractive question-answering task focused on interpreting radiology reports.
- CLIP: A multi-label classification task identifying follow-up instructions (e.g., imaging, appointments, labs) within complex discharge summaries.
Key Insights
The Efficiency of Clinical Tokens
Our analysis revealed that clinical tokens are "denser" than general-purpose tokens. Specifically, one clinical token is approximately equivalent to 1.12 general tokens. Specialized models use a vocabulary tailored to the medical domain, allowing them to represent complex medical terms as single units. In contrast, general models often break these terms into multiple sub-word fragments, which increases computational overhead and can obscure semantic meaning.
Scaling: Tokens vs. Parameters
One of the most significant findings is that increasing the volume of domain-specific tokens is more impactful than simply increasing the number of model parameters. For example, the 345M parameter BioClinRoBERTa outperformed the 175B parameter GPT-3 on the MedNLI task. This suggests that for specialized domains, "small and deep" domain knowledge beats "massive and general" knowledge.
Parsing vs. Medical Fact Retrieval
While general LLMs possess a vast repository of medical facts, they struggle with the "parsing" requirements of EHR data. There is a distinct difference between understanding a medical textbook and interpreting a doctor’s shorthand. General models often failed to navigate the aggressive sentence segmentation and non-standard formatting found in discharge summaries, whereas specialized models handled these nuances with high accuracy.
Results
- MedNLI: BioClinRoBERTa (345M) achieved an accuracy of 0.900, significantly outperforming GPT-3’s 0.805.
- RadQA: Clinical-T5-Large (770M) outperformed the much larger T5-XL (3B), proving that domain-specific pretraining allows models to punch significantly above their weight class.
- CLIP: Specialized models were vastly superior to GPT-3 and Flan-T5-XXL. The general models struggled with the specific label space and structure of clinical discharge summaries.
- Parameter Efficiency: Clinical-T5-Base (220M) outperformed the general T5-Large (770M) across all tasks, despite being 3.5x smaller.
Conclusion and Future Work
Our findings confirm that specialized clinical models are not only relevant but superior for tasks involving EHR data. Even when finetuned on as little as 1% of annotated data, these smaller models outperform the zero-shot and few-shot capabilities of the world’s largest general LLMs.
However, challenges remain. Future research must address the limitations of current clinical models, including their relatively short context windows and the need for better performance on generative tasks like clinical summarization. Furthermore, the use of these models must be balanced with privacy concerns, as training on clinical data necessitates strict credentialed access to prevent the leakage of protected health information (PHI).
Summary updated