对比了MLM与CLM预训练编码器的效果,发现混合策略更优。
Should We Still Pretrain Encoders with Masked Language Modeling?
- 用大尺度实验对比MLM和CLM预训练,控制模型与数据规模。
- CLM更省数据、调优更稳定,混合策略在固定算力下表现最佳。
- 适合想高效训练高质量编码器的研究者和开发者参考。
学习高质量文本表征是众多自然语言处理任务的基础。尽管编码器预训练传统上依赖掩码语言建模(MLM),但近期研究表明,通过因果语言建模(CLM)预训练的解码器模型可有效转为编码器,并在文本表征基准上常优于传统编码器。然而,这种提升是源于CLM目标的内在优势,还是受模型规模、数据量等混杂因素影响尚不明确。本文通过一系列大规模、精心设计的预训练消融实验,训练了共38个模型(参数量210百万至10亿),完成超过15,000次微调与评估。结果表明:尽管整体上MLM训练性能更优,但CLM训练模型更具数据效率且微调更稳定。基于此,我们实验验证了一种分阶段训练策略——先用CLM后用MLM——在固定计算预算下实现最优性能。此外,当从现成的预训练CLM模型初始化时,该策略更具吸引力,显著降低训练顶级编码器所需算力。项目所有成果已公开于 https://hf.co/MLMvsCLM,以促进后续研究。
原文摘要 · Abstract (English)
Learning high-quality text representations is fundamental to a wide range of NLP tasks. While encoder pretraining has traditionally relied on Masked Language Modeling (MLM), recent evidence suggests that decoder models pretrained with Causal Language Modeling (CLM) can be effectively repurposed as encoders, often surpassing traditional encoders on text representation benchmarks. However, it remains unclear whether these gains reflect an inherent advantage of the CLM objective or arise from confounding factors such as model and data scale. In this paper, we address this question through a series of large-scale, carefully controlled pretraining ablations, training a total of 38 models ranging from 210 million to 1 billion parameters, and conducting over 15,000 fine-tuning and evaluation runs. We find that while training with MLM generally yields better performance across text representation tasks, CLM-trained models are more data-efficient and demonstrate improved fine-tuning stability. Building on these findings, we experimentally show that a biphasic training strategy that sequentially applies CLM and then MLM, achieves optimal performance under a fixed computational training budget. Moreover, we demonstrate that this strategy becomes more appealing when initializing from readily available pretrained CLM models, reducing the computational burden needed to train best-in-class encoder models. We release all project artifacts at https://hf.co/MLMvsCLM to foster further research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。