arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.12285cs.CLcs.AI
收藏

Chinese ModernBERT:整词掩码的中文编码器

Chinese ModernBERT with Whole-Word Masking

Ant Group(蚂蚁集团)

Zeyu Zhao, Ningtao Wang, Xing Fu, Yu Cheng

AI总结:

Chinese ModernBERT通过硬件感知词表、整词掩码动态课程、两阶段长上下文预训练及阻尼余弦调度,在中文编码任务上取得高效性能,并超越Qwen-0.6B-embedding。

摘要:

仅编码器Transformer已在架构、数据和系统三个方向上取得进展,在准确率、速度和内存效率方面带来了帕累托改进。然而,这些改进尚未完全迁移到中文,因为中文的标记化和形态学与英语差异显著。我们提出Chinese ModernBERT,一个从零训练的中文编码器,其结合了:(i)面向硬件优化的32k BPE词表,针对中文常见词缀/复合词设计,降低了嵌入预算;(ii)整词掩码(WWM)与动态掩码课程(30%降至15%),使任务难度与训练进度对齐;(iii)两阶段预训练流程,利用RoPE和交替的局部/全局注意力,将原生上下文从1,024扩展到8,192个标记;(iv)阻尼余弦学习率调度,用于稳定的长时程优化。我们在来自CCI3-HQ、CCI4(中文)和Cosmopedia-Chinese的约1.2万亿中文标记上进行了预训练。在CLUE上,在统一微调协议下,Chinese ModernBERT与强中文编码器具有竞争力。在bf16下,它实现了高长序列吞吐量,同时保持强短序列速度,反映了预算分配和注意力设计的收益。为了探究检索导向的质量,我们添加了少量开放对比数据:在SimCLUE(约300万对)上微调,进一步添加T2Ranking(约200万)后性能提升,在SimCLUE测试集上达到0.505(皮尔逊)/0.537(斯皮尔曼)。在此开放数据设置下,Chinese ModernBERT在SimCLUE上超越了Qwen-0.6B-embedding,表明通过额外策划的数据对,STS具有清晰的扩展路径。我们将发布分词器和权重,以促进可复现研究。

英文摘要:

Encoder-only Transformers have advanced along three axes -- architecture, data, and systems -- yielding Pareto gains in accuracy, speed, and memory efficiency. Yet these improvements have not fully transferred to Chinese, where tokenization and morphology differ markedly from English. We introduce Chinese ModernBERT, a from-scratch Chinese encoder that couples: (i) a hardware-aware 32k BPE vocabulary tailored to frequent Chinese affixes/compounds, lowering the embedding budget; (ii) whole-word masking (WWM) with a dynamic masking curriculum (30% -> 15%) to align task difficulty with training progress; (iii) a two-stage pre-training pipeline that extends the native context from 1,024 to 8,192 tokens using RoPE and alternating local/global attention; and (iv) a damped-cosine learning-rate schedule for stable long-horizon optimization. We pre-train on ~1.2T Chinese tokens from CCI3-HQ, CCI4 (Chinese), and Cosmopedia-Chinese. On CLUE, Chinese ModernBERT is competitive with strong Chinese encoders under a unified fine-tuning protocol. Under bf16 it achieves high long-sequence throughput while maintaining strong short-sequence speed, reflecting benefits from budget allocation and attention design. To probe retrieval-oriented quality, we add a small amount of open contrastive data: fine-tuning on SimCLUE (~3M pairs) improves further when adding T2Ranking (~2M), reaching 0.505 (Pearson) / 0.537 (Spearman) on the SimCLUE test set. Under this open-data setting, Chinese ModernBERT surpasses Qwen-0.6B-embedding on SimCLUE, suggesting a clear scaling path for STS with additional curated pairs. We will release tokenizer and weights to facilitate reproducible research.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑