arXiv:2606.22722cs.CL2026-06

为葡萄牙语优化的现代编码器模型,性能超越现有方案。

moBERTo: A Modern Encoder for Portuguese via Continued Pretraining of ModernBERT

  • 在600亿词元上持续预训练ModernBERT-base,构建葡萄牙语专用模型。
  • 长上下文检索任务最高达8192词元,多项指标领先现有方法。
  • 适合需要高精度葡萄牙语理解的生产级NLP应用。

编码器类Transformer模型在生产级自然语言处理中仍具关键作用。我们提出moBERTo,通过在600亿词元(基于FineWeb2数据集并经教育与STEM分类器筛选的120亿词元语料库上进行5轮持续预训练)上对ModernBERT-base检查点进行持续预训练,构建葡萄牙语专用模型。保持原始架构设计,包括旋转位置编码、交替局部-全局注意力、Flash Attention和去填充机制。在信息检索(含最长8192词元的长上下文检索)、文档分类、命名实体识别及自然语言理解任务上评估moBERTo。最佳变体结合葡萄牙语分词器与子词匹配嵌入迁移及长上下文后训练,在三个葡萄牙语文本检索基准上实现最高平均reranking nDCG@10,并在PLUE-PT上表现最优。消融实验表明:(i) 持续预训练显著优于从头训练,尤其利于保留长上下文能力;(ii) 分词器适配提升词级别任务表现但降低长上下文检索效果;(iii) 在8192词元长度上进行专门的长上下文后训练可进一步提升重排序与NER性能;(iv) 编码器架构在判别性任务中仍可媲美更大规模的解码器模型。模型权重与训练数据已公开于Hugging Face。

原文摘要 · Abstract (English)

Encoder-only transformer models remain essential for production NLP pipelines. We introduce moBERTo, a Portuguese adaptation of ModernBERT obtained through continued pretraining of the ModernBERT-base checkpoint on 60 billion tokens (5 epochs over a 12-billion-token corpus curated from FineWeb2 and filtered with educational and STEM classifiers). We preserve the original architecture, including rotary positional embeddings, alternating local-global attention, flash attention, and unpadding. We evaluate moBERTo across information retrieval (including long-context retrieval at up to 8,192 tokens), document classification, named entity recognition, and natural language understanding. Our best variant, which combines a Portuguese tokenizer with subword-matching embedding transfer and long-context post-training, achieves the highest average reranking nDCG@10 across three Portuguese retrieval benchmarks and the best results on PLUE-PT. Through ablation studies, we show that (i) continued pretraining is strongly preferable to training from scratch, particularly for preserving long-context capabilities; (ii) tokenizer adaptation improves token-level tasks but degrades long-context retrieval; (iii) a dedicated long-context post-training phase at 8,192 tokens further improves reranking and NER; and (iv) encoder-only architectures remain competitive with larger decoder-only alternatives for discriminative tasks. We publicly release the model weights at https://huggingface.co/Tropic-AI/moBERTo and training data at https://huggingface.co/datasets/Tropic-AI/moberto-pretraining-dataset-c4-compatible on Hugging Face.

葡萄牙语编码器持续预训练长上下文

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。