Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

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

About

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.

Thiago Laitz, Thales Sales Almeida, Jo\~ao Guilherme Alves Santos, Giovana Kerche Bon\'as• 2026

Related benchmarks

TaskDatasetResultRank
Natural Language UnderstandingGLUE
Average Score (GLUE)77.24
76
Long-context retrievalMLDR
nDCG@1062.86
36
Information Retrieval RerankingQUATI
nDCG@100.5609
11
Information Retrieval RerankingmMARCO PT
nDCG@100.5169
11
Information Retrieval RerankingRobust04 PT
nDCG@1050.1
11
Portuguese Natural Language UnderstandingPLUE PT
PLUE-PT Score69.8
11
Educational Content ClassificationEduc.
F1 Score63.94
11
Document Type ClassificationDocs
F1 Score90.39
11
Named Entity RecognitionLeNER-br
F1 Score (LeNER-br)87.26
11
Showing 9 of 9 rows

Other info

Follow for update