Dana-Farber's BioClinical ModernBERT Doubles Healthcare AI Accuracy on Long Medical Notes
A new long-context encoder from the LightOn and Lindvall Lab team beats Bio_ClinicalBERT across clinical NLP benchmarks with 8,192-token windows.
ProTakeaways
- BioClinical ModernBERT released as successor to Bio_ClinicalBERT with 8,192-token context, base and large sizes.
- Trained on 53.5B tokens, the largest biomedical and clinical pretraining corpus assembled.
- Uses 20 clinical datasets across countries and institutions, not just MIMIC-III.
- Beats Bio_ClinicalBERT on 4 of 5 benchmarks, including a 25 to 60 F1 jump on Phenotype.
- Maintains 71K tokens/sec throughput at 8,192-token inputs thanks to ModernBERT architecture.
- Weights, checkpoints, and code available on GitHub and Hugging Face.
Clinical NLP has been stuck on encoders trained six years ago. Bio_ClinicalBERT, BioBERT, and Clinical-Longformer still power most healthcare pipelines despite short context windows, single-institution training data, and outdated architectures. A team from Dana-Farber, LightOn, Microsoft Research, and MIT is trying to reset the baseline with BioClinical ModernBERT, a domain-adapted encoder that pairs an 8,192-token context window with the largest biomedical and clinical pretraining corpus assembled to date.
The model ships in two sizes, both openly released on Hugging Face along with training checkpoints. It targets the workhorse jobs that decoder-only LLMs handle poorly or expensively: classification, named entity recognition, span extraction, and retrieval over long clinical documents.
Why encoders still matter in medicine
Encoder-based transformers remain central to biomedical NLP because bidirectional self-attention suits the discriminative work of pulling structured information out of unstructured text. Development on the encoder side has lagged behind decoders, though, leaving domain adaptation for clinical settings thin. The authors frame this as a gap worth closing, especially since encoders remain the backbone of retrieval-augmented generation pipelines where inference cost matters at scale.
The starting point is ModernBERT, which introduced a longer context window, rotary positional embeddings, alternating local and global attention, and an unpadding mechanism that skips computation on padding tokens. BioClinical ModernBERT inherits all of that and adapts it to medical text through continued pretraining.
The training recipe
The pretraining corpus is the headline number. The team gathered 50.7 billion tokens of PubMed abstracts and PMC full-text articles for the biomedical side, plus 2.8 billion tokens from 20 curated clinical datasets, for a total of 53.5 billion tokens.
Corpus breadth is the second major shift. Rather than leaning only on MIMIC-III notes from a single Boston ICU, the clinical mix spans radiology reports, pathology notes, chief complaints, patient interviews, and progress notes from institutions in the US, UK, Korea, Australia, and Canada. The team argues this diversity should improve generalization across writing styles and specialties.
Training happens in two phases:
- Phase 1: Joint pretraining on the full 160.5B-token mixture of biomedical and clinical data, resumed from ModernBERT's pre-decay stable checkpoint. Clinical data is folded in here to prevent catastrophic forgetting of biomedical knowledge later.
- Phase 2: Clinical-only specialization on the 20 clinical datasets for three epochs, with the masked language modeling rate dropped from 30% to 15%, followed by a 1-sqrt learning rate decay.
The compute footprint is modest for a foundation model release. The team ships both base (150M parameters) and large (396M parameters) versions along with training checkpoints. Continued pretraining ran on 8 NVIDIA H100 GPUs, taking roughly four days for the base model and eight for the large.
Benchmark results
The team evaluated against BioBERT, Bio_ClinicalBERT, BioMed-RoBERTa, Clinical-Longformer, Clinical-BigBird, and the recently released Clinical ModernBERT across five tasks: two classification (ChemProt, Phenotype) and three NER (Change-Of-State, Social History, DEID).
| Model | Context | ChemProt | Phenotype | DEID |
|---|---|---|---|---|
| Bio_ClinicalBERT | 512 | 88.3 | 25.8 | 74.2 |
| Clinical-Longformer | 4096 | 74.2 | 46.4 | 82.3 |
| Clinical ModernBERT | 8192 | 86.9 | 54.9 | 44.4 |
| BioClinical ModernBERT base | 8192 | 89.9 | 58.1 | 82.7 |
| BioClinical ModernBERT large | 8192 | 90.8 | 60.8 | 83.8 |
The Phenotype jump is the biggest story. Notes in that dataset average over 3,000 tokens, so short-context encoders like Bio_ClinicalBERT have to chunk inputs and lose signal along the way. The large model more than doubles Bio_ClinicalBERT's F1 there.
De-identification results deserve attention too. On i2b2 2006 and 2014, general BERT and BioBERT historically outperformed the original clinical BERT, which the original authors attributed to fundamental facets of the de-ID context. The new model closes that gap by including datasets like CheXpert Plus that replace protected health information with realistic surrogates rather than generic placeholder tokens, so the model learns what PHI actually looks like in context.
Speed at long contexts
Inference speed is where the architectural inheritance from ModernBERT pays off. Alternating attention restricts two-thirds of layers to local sliding windows, and unpadding dynamically skips padding tokens. The base model processes roughly 76,000 tokens per second at 512-token inputs and still manages 71,000 tokens per second at 8,192 tokens.
Clinical ModernBERT, a concurrent release from a different team, does not scale the same way. Its throughput drops from 86,200 tokens per second at 512 tokens to 28,800 at 8,192, apparently because its config file follows a BERT-style architecture rather than the full ModernBERT one.
What this changes for practitioners
If you're running a clinical NLP pipeline today, the practical implications are concrete:
- Drop-in replacement for Bio_ClinicalBERT: Same fine-tuning workflow, better numbers on essentially every task the paper measured.
- No more chunking for long notes: Discharge summaries, radiology reports, and progress notes routinely exceed 512 tokens. An 8,192-token window handles most of them whole.
- Better retrieval backbone for medical RAG: Efficiency at long contexts makes it viable as an embedding model for indexing full clinical documents.
- Improved PHI detection: Training data diversity translates into real gains on de-identification, historically a weak spot for clinical BERTs.
The main limitations are English-only training and heavy reliance on MIMIC data, which still accounts for over 95% of the clinical corpus despite the 20-dataset mix. The team also could not evaluate on the standard i2b2 benchmarks because those datasets were unavailable during the project.
Weights, checkpoints, and fine-tuning code sit on Hugging Face and GitHub under permissive licenses. For anyone whose stack still points at emilyalsentzer/Bio_ClinicalBERT, this is the successor worth benchmarking against.