How Important Is Tokenization in French Medical Masked Language Models?
Yanis Labrak, Adrien Bazoge, Beatrice Daille, Mickael Rouvier, Richard Dufour
TL;DR
This study interrogates how subword tokenization affects French biomedical language modeling, comparing standard statistical methods (BPE, SentencePiece) with a morpheme-enriched approach that injects a curated set of lexical morphemes during tokenizer training. Using RoBERTa-based pre-training on 1.1B words from the French biomedical NACHOS corpus and 16 tokenizers, the authors evaluate 23 downstream tasks spanning NER, CLS, POS, and STS, across 10 datasets. They find a general negative relation between tokenization granularity and performance ($\rho = -0.48$), with task- and domain-specific variations; morpheme enrichment yields improvements in a subset of tasks but is not universally beneficial. Data source strongly shapes outcomes, with domain-aligned corpora sometimes outperforming domain-mismatched but linguistically richer sources, underscoring that optimal tokenization depends on balancing segmentation, domain data, and morphological knowledge in the target language.
Abstract
Subword tokenization has become the prevailing standard in the field of natural language processing (NLP) over recent years, primarily due to the widespread utilization of pre-trained language models. This shift began with Byte-Pair Encoding (BPE) and was later followed by the adoption of SentencePiece and WordPiece. While subword tokenization consistently outperforms character and word-level tokenization, the precise factors contributing to its success remain unclear. Key aspects such as the optimal segmentation granularity for diverse tasks and languages, the influence of data sources on tokenizers, and the role of morphological information in Indo-European languages remain insufficiently explored. This is particularly pertinent for biomedical terminology, characterized by specific rules governing morpheme combinations. Despite the agglutinative nature of biomedical terminology, existing language models do not explicitly incorporate this knowledge, leading to inconsistent tokenization strategies for common terms. In this paper, we seek to delve into the complexities of subword tokenization in French biomedical domain across a variety of NLP tasks and pinpoint areas where further enhancements can be made. We analyze classical tokenization algorithms, including BPE and SentencePiece, and introduce an original tokenization strategy that integrates morpheme-enriched word segmentation into existing tokenization methods.
