A Causal Language Modeling Detour Improves Encoder Continued Pretraining
Summary
This paper demonstrates that switching from Masked Language Modeling to Causal Language Modeling during encoder adaptation improves downstream performance on biomedical texts. The authors release ModernBERT-bio and ModernCamemBERT-bio as state-of-the-art biomedical encoders.
View Cached Full Text
Cached at: 05/13/26, 12:15 PM
Paper page - A Causal Language Modeling Detour Improves Encoder Continued Pretraining
Source: https://huggingface.co/papers/2605.12438
Abstract
Switching from Masked Language Modeling to Causal Language Modeling during encoder adaptation improves downstream performance on biomedical texts through dense supervision effects in lower transformer layers.
When adapting an encoder to a new domain, the standard approach is to continue training withMasked Language Modeling(MLM). We show that temporarily switching toCausal Language Modeling(CLM) followed by a short MLM decay improvesdownstream 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 lowtransformer layers(0-7) far more than MLM does. Freezing low layers during CLM eliminates the downstream benefit; freezing mid layers preserves it. Therepresentational changespersist through the MLM decay phase, even when it matches the CLM phase in length, and they scale withmodel capacity. We release ModernCamemBERT-bio and ModernBERT-bio as state-of-the-art biomedical encoders in Base and Large sizes.
View arXiv pageView PDFAdd to collection
Community
Hi@rntc, very cool idea! Do you btw. Plan to release the code, I would like to try this with other models for domain adaption 😃
·
Paper submitter
Release of ModernBERT-bio and ModernCamemBERT-bio
Upload images, audio, and videos by dragging in the text input, pasting, orclicking here.
Tap or paste here to upload images
Get this paper in your agent:
hf papers read 2605\.12438
Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash
Models citing this paper4
#### almanach/ModernBERT-bio-large Fill-Mask• 0.4B• Updatedabout 4 hours ago • 34 • 2
#### almanach/ModernCamemBERT-bio-base Fill-Mask• Updatedabout 4 hours ago • 1
#### almanach/ModernCamemBERT-bio-large Fill-Mask• 0.4B• Updatedabout 4 hours ago • 226 • 1
#### almanach/ModernBERT-bio-base Fill-Mask• 0.1B• Updatedabout 4 hours ago • 32 • 1
Datasets citing this paper0
No dataset linking this paper
Cite arxiv.org/abs/2605.12438 in a dataset README.md to link it from this page.
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2605.12438 in a Space README.md to link it from this page.
Collections including this paper0
No Collection including this paper
Add this paper to acollectionto link it from this page.
Similar Articles
Steerable by Design: Conditional Pretraining for Robust Control of Language Models
The paper proposes separating instruction and data channels from the start of pretraining, using an encoder with cross-attention to create a robust control handle, and introduces Mancelle-3B and Mancelle-400M models that steer more strongly than prompt- and activation-based methods while resisting adversarial counter-steering.
Unmasking Propaganda: A Comparative Analysis of Masked and Causal Language Models
This paper benchmarks masked language models (XLM-RoBERTa, DeBERTa V3) and causal LLMs (OpenAI, Google, Mistral, Anthropic, Meta) on propaganda technique detection using the SemEval-2020 Task 11 dataset, reporting state-of-the-art F1 scores of 63.18 and 63.62 respectively.
Manifold Projection and Iterative Autoencoder Refinement for Masked Language Modeling
The paper proposes an attention-free approach to masked language modeling using autoencoders and iterative refinement, achieving performance comparable to BERT with fewer FLOPs.
OntoBook: Ontology-Grounded Synthetic Textbooks for Medical Encoder Pretraining
OntoBook converts medical ontology graphs into synthetic textbook prose using LLMs, then uses the resulting 1.3M French textbooks to pretrain ModernCamemBERT, achieving significant gains on medical coding benchmarks.
From Retrieval to Typed Decisions: Calibrated System One Models from Biomedical Sentence Encoders
The paper introduces SBERT2S1, which converts Sentence-Transformers retrieval encoders into calibrated typed decision models, along with the BIODECIDE benchmark and MEDLINE-S1 dataset (243k decisions from NLM indexing), showing that retrieval training helps prior-fused residual heads but often hurts cross-heads, and that RLCD reward training underperforms cross-entropy due to biased reward normalization.