CamemBERT-bio: Leveraging Continual Pre-training for Cost-Effective Models on French Biomedical Data

Rian Touchent, Laurent Romary, Éric Villemonte de la Clergerie · DOI

Abstract

Clinical data in hospitals are increasingly accessible for research through clinical data warehouses. However, these documents are unstructured, necessitating the extraction of information from medical reports to conduct clinical studies. Transfer learning with BERT-like models such as CamemBERT has allowed major advances for French, especially for named entity recognition (NER). However, these models are trained for plain language and are less efficient on biomedical data. Addressing this gap, we introduce CamemBERT-bio, a dedicated French biomedical model derived from a new public French biomedical dataset. Through continual pre-training of the original CamemBERT, CamemBERT-bio achieves an improvement of 2.54 points of F1-score on average across various biomedical NER tasks, reinforcing the potential of continual pre-training as an equally proficient yet less computationally intensive alternative to training from scratch. Additionally, we highlight the importance of using a standard evaluation protocol that provides a clear view of the current state-of-the-art for French biomedical models.

Introduction

Natural Language Processing (NLP) has been revolutionized by transformer-based models, but these "generalists" often struggle with specialized domains. In the French context, the standard model, CamemBERT, is trained on general web crawls (the OSCAR dataset), making it highly effective for everyday prose but less proficient at deciphering medical reports. Biomedical text presents unique challenges: technical jargon, pervasive abbreviations, and a "telegraphic" syntax that often lacks standard sentence structure.

While some French biomedical models exist, many are inaccessible due to strict privacy regulations governing hospital data. There is a critical need for high-performing, publicly available models capable of extracting entities—such as symptoms, dosages, and diagnoses—from unstructured French medical text to facilitate clinical research.

Methodology and Data

This study employs a strategy known as continual pre-training. Rather than training a model from scratch, which is computationally and environmentally expensive, the researchers utilized the existing weights of camembert-base and subjected it to a second phase of training. This phase utilized the Masked Language Modeling (MLM) task, forcing the model to learn the specific nuances and vocabulary of medical French.

The training was conducted for 50,000 steps (approximately 39 hours) on two Tesla V100 GPUs. To evaluate the impact of data volume, a smaller version (biomed-fr-small) was also trained on 10% of the data. The researchers curated a new public corpus, biomed-fr, totaling 413 million words (2.7 GB) from three primary sources: ISTEX (scientific literature), CLEAR (drug leaflets), and E3C (clinical cases).

Key Results

CamemBERT-bio consistently outperformed the base model across all tested benchmarks, showing an average gain of 2.54 points in F1-score. On the CAS2 clinical dataset, the model reached an F1-score of 81.66, a significant improvement over the base model's 79.02. When using standardized evaluation protocols that exclude the "O" (Outside) token—which can otherwise inflate accuracy metrics—CamemBERT-bio achieved state-of-the-art results, matching or exceeding specialized models like DrBERT and AliBERT.

Table 1: Performance comparison between base CamemBERT and CamemBERT-bio variants across multiple NER datasets.

Key Insights and Discussion

A primary factor in the model's success is its improved handling of specialized vocabulary. Analysis revealed only a 45% vocabulary overlap between general CamemBERT and the biomedical version. General models often "oversplit" complex medical terms into meaningless sub-word fragments, whereas CamemBERT-bio maintains more coherent representations of technical terms.

Table 2: Comparison of tokenization strategies for medical terms between general and specialized models.

Furthermore, the study highlights the environmental benefits of continual pre-training. CamemBERT-bio emitted approximately 0.8 kg of CO2, whereas models trained from scratch (such as DrBERT) emitted up to 26.11 kg—a 32x difference for comparable performance. This demonstrates that domain adaptation can be both effective and ecologically responsible.

Conclusion and Future Work

CamemBERT-bio provides a cost-effective "prescription" for French biomedical NLP. While highly effective, the authors note that the biomed-fr corpus relies on public scientific text, which may not perfectly mirror the "messy" reality of private hospital records. Future research should focus on expanding the model's evaluation to tasks beyond NER, such as relation extraction and medical question-answering, and exploring explicit vocabulary expansion to further reduce sub-word fragmentation.

Summary updated

Abstract

Clinical data in hospitals are increasingly accessible for research through clinical data warehouses. However these documents are unstructured and it is therefore necessary to extract information from medical reports to conduct clinical studies. Transfer learning with BERT-like models such as CamemBERT has allowed major advances for French, especially for named entity recognition. However, these models are trained for plain language and are less efficient on biomedical data. Addressing this gap, we introduce CamemBERT-bio, a dedicated French biomedical model derived from a new public French biomedical dataset. Through continual pre-training of the original CamemBERT, CamemBERT-bio achieves an improvement of 2.54 points of F1-score on average across various biomedical named entity recognition tasks, reinforcing the potential of continual pre-training as an equally proficient yet less computationally intensive alternative to training from scratch. Additionally, we highlight the importance of using a standard evaluation protocol that provides a clear view of the current state-of-the-art for French biomedical models.
BibTeX
@inproceedings{touchent2024camembert,
  author = {Rian Touchent and Laurent Romary and Éric Villemonte de la Clergerie},
  title = {{CamemBERT-bio: Leveraging Continual Pre-training for Cost-Effective Models on French Biomedical Data}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=b1BwLqgyAF},
}
Figure