/ Модель

Характеристики

Контекст
8 192 токена
Параметры
395 млн
Лицензия
MIT
Архитектура
modernbert · dense
Базовая модель
ModernBERT-large
Библиотека
transformers
Опубликована
7 мая 2025

BioClinical-ModernBERT-large

Заполнение пропусковТекст → текст3 профессии

Англоязычный клинический энкодер ModernBERT для заполнения пропусков и построения решений поиска и классификации медицинских текстов.

4 755скачиваний за 30 дней16лайковвеса обновлены3 окт 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

BioClinical-ModernBERT-large — англоязычный доменно-адаптированный энкодер ModernBERT, разработанный для биомедицинской и клинической обработки естественного языка. Модель содержит около 395 млн параметров, принимает текст и обучена предсказывать замаскированные токены; для неё заявлен контекст до 8192 токенов.

Модель предназначена для заполнения пропусков и как энкодерная основа для решений поиска и классификации длинных клинических и биомедицинских текстов. Обучение включало корпус PubMed и PMC, а также 20 клинических датасетов из разных учреждений, областей и географических регионов. README сообщает об оценке на биомедицинских и клинических задачах, но приведённая карточка не содержит полных результатов таблиц.

Это дообучение answerdotai/ModernBERT-large; файлы доступны в форматах PyTorch и safetensors, использовать модель можно через Transformers. Лицензия — MIT. Модель рассчитана на английский язык, а её качество для других языков не заявлено.

Сценарии применения

  • заполнение пропущенных слов в клинических заметках
  • создание эмбеддингов для поиска по медицинским документам
  • классификация клинических и биомедицинских текстов
  • анализ длинных медицинских документов

Ограничения

Модель обучена для английского языка; пригодность для других языков не заявлена. Основная задача модели — заполнение пропусков, поэтому для поиска и классификации требуется подходящая downstream-система или дообучение.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

BioClinical ModernBERT

BioClinical ModernBERT is available in two sizes: base (150M parameters) and large (396M parameters). The model training checkpoints can be found here, and our code is available in our GitHub repository.

A step-by-step guide for reproducing our model training with your own data is available here!

Table of Contents

  1. Model Summary
  2. Usage
  3. Training
  4. Evaluation
  5. License
  6. Citation

Model Summary

BioClinical ModernBERT is a domain-adapted encoder that builds on ModernBERT base and large, incorporating long-context processing and substantial improvements in speed and performance for biomedical and clinical NLP. BioClinical ModernBERT is trained on the largest biomedical and clinical corpus to date, with over 53.5 billion tokens, and addresses a key limitation of prior clinical encoders by leveraging 20 datasets from diverse institutions, domains, and geographic regions, rather than relying on data from a single source.

Usage

You can use these models directly with the transformers library starting from v4.48.0:

pip install -U transformers>=4.48.0

Since BioClinical ModernBERT is a Masked Language Model (MLM), you can use the fill-mask pipeline or load it via AutoModelForMaskedLM. To use BioClinical ModernBERT for downstream tasks like classification, retrieval, or QA, fine-tune it following standard BERT fine-tuning recipes.

⚠️ If your GPU supports it, we recommend using BioClinical ModernBERT with Flash Attention 2 to reach the highest efficiency. To do so, install Flash Attention as follows, then use the model as normal:

pip install flash-attn

Using AutoModelForMaskedLM:

from transformers import AutoTokenizer, AutoModelForMaskedLM
model_id = "thomas-sounack/BioClinical-ModernBERT-large"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForMaskedLM.from_pretrained(model_id)
text = "Mitochondria is the powerhouse of the [MASK]."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
# To get predictions for the mask:
masked_index = inputs["input_ids"][0].tolist().index(tokenizer.mask_token_id)
predicted_token_id = outputs.logits[0, masked_index].argmax(axis=-1)
predicted_token = tokenizer.decode(predicted_token_id)
print("Predicted token:", predicted_token)
# Predicted token:  cell

Using a pipeline:

import torch
from transformers import pipeline
from pprint import pprint
pipe = pipeline(
    "fill-mask",
    model="thomas-sounack/BioClinical-ModernBERT-large",
    torch_dtype=torch.bfloat16,
)
input_text = "[MASK] is a disease caused by an uncontrolled division of abnormal cells in a part of the body."
results = pipe(input_text)
pprint(results)

Note: BioClinical ModernBERT, similarly to ModernBERT, does not use token type IDs unlike some earlier BERT models. Most downstream usage is identical to standard BERT models on the Hugging Face Hub, except you can omit the token_type_ids parameter.

Training

Data

BioClinical ModernBERT is trained on 50.7B tokens of biomedical text gathered from PubMed and PMC, and 2.8B tokens of clinical text from 20 datasets which are detailed in the table below.

NameCountryClinical SourceClinical ContextSamplesTokens (M)
ACI-BENCHUSClinical NotesNot Reported2070.1
ADE CorpusSeveralClinical NotesNot Reported20,8960.5
Brain MRI StrokeKoreaRadiology ReportsNeurology2,6030.2
CheXpert PlusUSRadiology ReportsPulmonology223,46060.6
CHIFIRAustraliaPathology ReportsHematology / Oncology2830.1
CORALUSProgress NotesHematology / Oncology2400.7
Eye Gaze CXRUSRadiology ReportsPulmonology8920.03
Gout Chief ComplaintsUSChief ComplaintInternal Medicine8,4290.2
ID-68UKClinical NotesPsychology780.02
InspectUSRadiology ReportsPulmonology22,2592.8
MedNLIUSClinical NotesInternal Medicine14,0470.5
MedQAUSNational Medical Board ExaminationNot Reported14,3662.0
MIMIC-IIIUSClinical NotesInternal Medicine2,021,4111,047.7
MIMIC-IV NoteUSClinical NotesInternal Medicine2,631,2431,765.7
MTSamplesNot ReportedClinical NotesInternal Medicine2,3581.7
NegexUSDischarge SummariesNot Reported2,0560.1
PriMock57UKSimulated Patient CareInternal Medicine570.01
Q-PainUSClinical VignettesPalliative Care510.01
REFLACXUSRadiology ReportsPulmonology2,5430.1
Simulated Resp. InterviewsCanadaSimulated Patient CarePulmonology2720.6

Methodology

BioClinical ModernBERT large is trained in two phases. This model is initialized from the last stable-phase checkpoint of ModernBERT large and trained with the same hyperparameters: learning rate of 5e-5 and batch size of 77.

  • Phase 1: Training on 160.5B tokens from PubMed, PMC, and the 20 clinical datasets. Learning rate remains constant throughout this stage, and the masking probability is set at 30%.
  • Phase 2: Training on the 20 clinical datasets only. Masking probability is reduced to 15%. The model is trained for 3 epochs using a hybrid schedule: constant learning rate for the first two epochs, followed by a 1-sqrt decay in the final epoch.

Evaluation

ModelContext LengthChemProtPhenotypeCOSSocial HistoryDEID
BaseBioBERT51289.526.694.955.874.3
Clinical BERT51288.325.895.055.274.2
BioMed-RoBERTa51289.036.894.955.281.1
Clinical-BigBird409687.426.594.053.371.2
Clinical-Longformer409674.246.495.256.882.3
Clinical ModernBERT819286.954.993.753.844.4
ModernBERT - base819289.548.494.053.178.3
BioClinical ModernBERT - base819289.958.195.158.582.7
LargeModernBERT - large819290.258.394.454.882.1
BioClinical ModernBERT - large819290.860.895.157.183.8

License

We release the BioClinical ModernBERT base and large model weights and training checkpoints under the MIT license.

Citation

If you use BioClinical ModernBERT in your work, please cite our preprint:

@misc{sounack2025bioclinicalmodernbertstateoftheartlongcontext,
      title={BioClinical ModernBERT: A State-of-the-Art Long-Context Encoder for Biomedical and Clinical NLP}, 
      author={Thomas Sounack and Joshua Davis and Brigitte Durieux and Antoine Chaffin and Tom J. Pollard and Eric Lehman and Alistair E. W. Johnson and Matthew McDermott and Tristan Naumann and Charlotta Lindvall},
      year={2025},
      eprint={2506.10896},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2506.10896}, 
}

This project was a collaboration between members of the Dana-Farber Cancer Institute, LightOn, MIT, OpenEvidence and Microsoft.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · fill-mask

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForMaskedLM
Ревизия весов
c684f47

0 моделей