Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

A Causal Language Modeling Detour Improves Encoder Continued Pretraining

About

When adapting an encoder to a new domain, the standard approach is to continue training with Masked Language Modeling (MLM). We show that temporarily switching to Causal Language Modeling (CLM) followed by a short MLM decay improves downstream performance. On biomedical texts with ModernBERT, this CLM detour outperforms MLM baselines trained on identical data and compute across 8 French and 11 English biomedical tasks, by +1.2-2.8pp and +0.3-0.8pp respectively, depending on model size. We investigate the reasons for these gains. We find that CLM's dense supervision impacts low transformer layers (0-7) far more than MLM does. Freezing low layers during CLM eliminates the downstream benefit; freezing mid layers preserves it. The representational changes persist through the MLM decay phase, even when it matches the CLM phase in length, and they scale with model capacity. We release ModernCamemBERT-bio and ModernBERT-bio as state-of-the-art biomedical encoders in Base and Large sizes.

Rian Touchent, Eric de la Clergerie• 2026

Related benchmarks

TaskDatasetResultRank
Named Entity RecognitionJNLPBA (test)
Macro F1 (span-level)75.3
32
Named Entity RecognitionSocial--
12
ClassificationPheno
Macro F161.9
9
ClassificationGAD
Macro F179.7
9
Named Entity RecognitionCOS
Macro F195.2
9
Named Entity RecognitionDEID
Macro F184.2
9
Named Entity RecognitionBC5CDR
Macro F189.8
9
ClassificationHOC
Macro F170
9
Named Entity RecognitionAnatEM
Macro F183.2
9
Named Entity RecognitionNCBI
Macro F181.7
9
Showing 10 of 19 rows

Other info

Follow for update