🚀 Medical mT5: An Open-Source Multilingual Text-to-Text LLM for the Medical Domain
Medical mT5 is the first open - source text - to - text multilingual model for the medical domain. It continues the training of publicly available mT5 checkpoints on medical domain data in English, Spanish, French, and Italian, aiming to improve medical communication and understanding across languages.
🚀 Quick Start
You can load the model using the following code:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("HiTZ/Medical-mT5-large")
model = AutoModelForSeq2SeqLM.from_pretrained("HiTZ/Medical-mT5-large")
The model has been trained using the T5 masked language modelling tasks. You need to finetune the model for your task.
✨ Features
- Multilingual Support: Supports English, Spanish, French, and Italian, facilitating cross - language medical communication.
- Open - Source: The data, code, and models are publicly available, promoting collaboration within the research community.
- Medical Domain Focus: Trained on medical domain data, making it suitable for medical text - to - text generation tasks.
📦 Installation
The installation mainly involves using the transformers
library. If you haven't installed it yet, you can use the following command:
pip install transformers
📚 Documentation
Model Card for MedMT5 - large
We present Medical mT5, the first open - source text - to - text multilingual model for the medical domain. Medical mT5 is an encoder - decoder model developed by continuing the training of publicly available mT5 checkpoints on medical domain data for English, Spanish, French, and Italian.
Model Description
- Developed by: Iker García - Ferrero, Rodrigo Agerri, Aitziber Atutxa Salazar, Elena Cabrio, Iker de la Iglesia, Alberto Lavelli, Bernardo Magnini, Benjamin Molinet, Johana Ramirez - Romero, German Rigau, Jose Maria Villa - Gonzalez, Serena Villata and Andrea Zaninello
- Contact: [Iker García - Ferrero](https://ikergarcia1996.github.io/Iker - Garcia - Ferrero/) and Rodrigo Agerri
- Website: [https://univ - cotedazur.eu/antidote](https://univ - cotedazur.eu/antidote)
- Funding: CHIST - ERA XAI 2019 call. Antidote (PCI2020 - 120717 - 2) funded by MCIN/AEI /10.13039/501100011033 and by European Union NextGenerationEU/PRTR
- Model type: text2text - generation
- Language(s) (NLP): English, Spanish, French, Italian
- License: apache - 2.0
- Finetuned from model: mT5
Training Data
Language |
Source |
Words |
English |
ClinicalTrials |
127.4M |
English |
EMEA |
12M |
English |
PubMed |
968.4M |
Spanish |
EMEA |
13.6M |
Spanish |
PubMed |
8.4M |
Spanish |
Medical Crawler |
918M |
Spanish |
SPACC |
350K |
Spanish |
UFAL |
10.5M |
Spanish |
WikiMed |
5.2M |
French |
PubMed |
1.4M |
French |
Science Direct |
15.2M |
French |
Wikipedia - Médecine |
5M |
French |
EDP |
48K |
French |
Google Patents |
654M |
Italian |
Medical Commoncrawl - IT |
67M |
Italian |
Drug instructions |
30.5M |
Italian |
Wikipedia - Medicina |
13.3M |
Italian |
E3C Corpus - IT |
11.6M |
Italian |
Medicine descriptions |
6.3M |
Italian |
Medical theses |
5.8M |
Italian |
Medical websites |
4M |
Italian |
PubMed |
2.3M |
Italian |
Supplement description |
1.3M |
Italian |
Medical notes |
975K |
Italian |
Pathologies |
157K |
Italian |
Medical test simulations |
26K |
Italian |
Clinical cases |
20K |
Evaluation
Medical mT5 for Sequence Labelling
We have released two Medical mT5 models finetuned for multilingual sequence labelling.
Single - task supervised F1 scores for Sequence Labelling

Multi - task supervised F1 scores for Sequence Labelling

Zero - shot F1 scores for Argument Mining
Models have been trained in English and evaluated in Spanish, French and Italian.

Ethical Statement
Our research in developing Medical mT5, a multilingual text - to - text model for the medical domain, has ethical implications that we acknowledge. Firstly, the broader impact of this work lies in its potential to improve medical communication and understanding across languages, which can enhance healthcare access and quality for diverse linguistic communities. However, it also raises ethical considerations related to privacy and data security.
To create our multilingual corpus, we have taken measures to anonymize and protect sensitive patient information, adhering to data protection regulations in each language's jurisdiction or deriving our data from sources that explicitly address this issue in line with privacy and safety regulations and guidelines. Furthermore, we are committed to transparency and fairness in our model's development and evaluation. We have worked to ensure that our benchmarks are representative and unbiased, and we will continue to monitor and address any potential biases in the future. Finally, we emphasize our commitment to open source by making our data, code, and models publicly available, with the aim of promoting collaboration within the research community.
Citation
@misc{garcíaferrero2024medical,
title={Medical mT5: An Open - Source Multilingual Text - to - Text LLM for The Medical Domain},
author={Iker García - Ferrero and Rodrigo Agerri and Aitziber Atutxa Salazar and Elena Cabrio and Iker de la Iglesia and Alberto Lavelli and Bernardo Magnini and Benjamin Molinet and Johana Ramirez - Romero and German Rigau and Jose Maria Villa - Gonzalez and Serena Villata and Andrea Zaninello},
year={2024},
eprint={2404.07613},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Pre - Training settings for MedMT5
|
Medical mT5 - Large (HiTZ/Medical-mT5-large) |
Medical mT5 - XL (HiTZ/Medical-mT5-xl) |
Param. no. |
738M |
3B |
Sequence Length |
1024 |
480 |
Token/step |
65536 |
30720 |
Epochs |
1 |
1 |
Total Tokens |
4.5B |
4.5B |
Optimizer |
Adafactor |
Adafactor |
LR |
0.001 |
0.001 |
Scheduler |
Constant |
Constant |
Hardware |
4xA100 |
4xA100 |
Time (h) |
10.5 |
20.5 |
CO₂eq (kg) |
2.9 |
5.6 |