Introduction
For years, the NLP community has relied on two distinct paradigms: Masked Language Modeling (MLM) for training encoders (like BERT) to learn bidirectional representations, and Causal Language Modeling (CLM) for training decoders (like GPT) to generate text. Recently, however, massive CLM-based decoders have been repurposed as encoders, often outperforming traditional BERT-style models on text representation benchmarks like MTEB.
This raises a critical question: Is CLM inherently better for learning text representations, or do these models simply win because they are trained at a much larger scale? This paper seeks to disentangle these factors through a massive, controlled ablation study. The authors reveal that while traditional MLM remains essential for high-quality text representations, starting with CLM and finishing with MLM—a "biphasic" approach—yields superior encoders and is the most compute-efficient path to state-of-the-art performance.
Methodology: A Controlled Ablation Study
To determine which objective actually builds a better encoder when model size and data are held constant, the authors conducted a rigorous study using the EuroBERT architecture across three scales: 210M, 610M, and 1B parameters.
The models were trained on 100 billion tokens from FineWeb-Edu, a high-quality subset of web data. To ensure results weren't due to luck or fine-tuning variance, the team performed over 15,000 fine-tuning runs across various learning rates and random seeds. They compared three primary training setups:
- Pretraining From Scratch (PFS): Comparing pure MLM versus pure CLM.
- Biphasic Training: A two-stage protocol where a model is trained first with CLM and then switched to MLM.
- Continued PreTraining (CPT): Taking an already converged CLM or MLM model and applying additional MLM training to see which "base" adapts better.
Baseline Results: MLM is Still the Gold Standard
When comparing pure pretraining objectives from scratch, the study found that MLM remains the "gold standard" for final downstream performance. Pure MLM generally outperforms pure CLM across a broad suite of text representation tasks, including Sequence Classification (SC), Token Classification (TC), and Question Answering (QA).
The performance gap is particularly pronounced in Question Answering, where bidirectional context is critical. Interestingly, CLM models performed very competitively on Information Retrieval (IR) tasks even without MLM, with the performance gap narrowing as model size increased.
The Winning Strategy: Biphasic Training and CPT
While MLM achieves higher peak performance, CLM acts as the ultimate "warmup." CLM is significantly more data-efficient in the early stages of training, building a solid foundation for token-level understanding much faster than MLM. Furthermore, CLM-pretrained models are much more stable during fine-tuning and less sensitive to learning rate choices.
By combining the strengths of both, the authors discovered that a biphasic training strategy is optimal.
Under a fixed compute budget, starting with CLM and then "finishing" the model with a phase of MLM combines CLM’s early data efficiency with MLM’s superior bidirectional reasoning. Specifically, a split of roughly 75% CLM followed by 25% MLM consistently outperformed pure MLM across almost all tasks.
Additionally, the Continued PreTraining (CPT) approach offers a powerful shortcut. Adapting an existing, readily available CLM-pretrained model with a short burst of MLM training proved more effective than simply training an MLM model from scratch for longer. For example, on Sequence Classification, the MLM-adapted CLM model significantly outperformed the MLM-only baseline, reducing the computational burden needed to train best-in-class encoder models.
Limitations and Future Work
While comprehensive, the study notes a few limitations:
- Scale Ceiling: The study capped models at 1B parameters. While this covers standard encoders, it remains to be seen if these exact ratio trends hold at the 7B+ parameter scale common in modern LLMs.
- English-Centric: The evaluation focused on English data. CLM's data efficiency might prove even more beneficial for low-resource or multilingual settings.
- No Contrastive Learning: The evaluation focused on "raw" pretraining objectives. Many top-tier embedding models use a final stage of contrastive post-training, which was outside the scope of this study.
Ultimately, this research provides a clear, empirically backed recipe for training next-generation text encoders: leverage the data efficiency of CLM first, and refine with the bidirectional power of MLM.
Summary updated