EuroBERT: Scaling Multilingual Encoders for European Languages
- Authors
- Nicolas Boizard
- Hippolyte Gisserot-Boukhlef
- Duarte M. Alves
- Andre Martins
- Ayoub Hammal
- Caio Corro
- Celine Hudelot
- Emmanuel Malherbe
- Etienne Malaboeuf
- Fanny Jourdan
- Gabriel Hautreux
- Joao Alves
- Kevin El-Haddad
- Manuel Faysse
- Maxime Peyrard
- Nuno M. Guerreiro
- Patrick Fernandes
- Ricardo Rei
- Pierre Colombo
- Affiliations
- Artefact Research Center
- Diabolocom
- MICS, CentraleSupélec, Université Paris-Saclay
- Instituto Superior Tecnico & Universidade de Lisboa
- others
- Accepted at
- COLM 2025
- Date
- arXiv
- 2503.05500
Abstract
General-purpose multilingual vector representations, used in retrieval, regression and classification, are traditionally obtained from bidirectional encoder models. Despite their wide applicability, encoders have been recently overshadowed by advances in generative decoder-only models. However, many innovations driving this progress are not inherently tied to decoders. In this paper, we revisit the development of multilingual encoders through the lens of these advances, and introduce EuroBERT, a family of multilingual encoders covering European and widely spoken global languages. Our models outperform existing alternatives across a diverse range of tasks, spanning multilingual capabilities, mathematics, and coding, and natively supporting sequences of up to 8,192 tokens. We also examine the design decisions behind EuroBERT, offering insights into our dataset composition and training pipeline. We publicly release the EuroBERT models, including intermediate training checkpoints, together with our training framework.
Cite this paper
@inproceedings{boizard2025eurobert,
title = {EuroBERT: Scaling Multilingual Encoders for European Languages},
author = {Nicolas Boizard and Hippolyte Gisserot-Boukhlef and Duarte M. Alves and Andre Martins and Ayoub Hammal and Caio Corro and Celine Hudelot and Emmanuel Malherbe and Etienne Malaboeuf and Fanny Jourdan and Gabriel Hautreux and Joao Alves and Kevin El-Haddad and Manuel Faysse and Maxime Peyrard and Nuno M. Guerreiro and Patrick Fernandes and Ricardo Rei and Pierre Colombo},
booktitle = {Conference on Language Modeling (COLM 2025)},
year = {2025}
}Copied
Introduction
Many important tasks in Natural Language Processing (NLP), including information retrieval, classification, or regression, are built upon general-purpose vector representations. These representations are traditionally obtained from bidirectional encoder models, which aggregate information from the left and right contexts of each token (Devlin et al., 2019; Conneau et al., 2020; He et al., 2023). In contrast, recent advances in generative modeling have shifted the research community’s attention towards unidirectional architectures (Bai et al., 2023; Llama Team, 2024; OLMo et al., 2025). Notably, these efforts have identified several key performance drivers that span architectural advances, data improvements, and increased scale. Yet, despite no apparent barrier to transferring these insights to bidirectional architectures, little effort has been devoted towards this objective, forcing practitioners to depend on outdated models.
In this paper, we introduce a refreshed recipe for training general-purpose multilingual encoders, resulting in the EuroBERT family. Drawing inspiration from recent progress in decoder models, our models feature an updated architecture (§2.1), and are trained on a 5T-token multilingual dataset, covering widely spoken European and global languages, along with mathematics and code (§2.2). We adopt a masked language modeling objective, and employ a two-phase training pipeline, adjusting the data distribution in the second training phase to improve downstream performance (§2.3).
We extensively evaluate the EuroBERT models, comparing with similarly sized alternatives across a suite of tasks representative of real-world encoder applications (§3). Our models match or exceed the performance of alternative models, such as XLM-RoBERTa (Conneau et al., 2020) and mGTE-MLM (Zhang et al., 2024), on multilingual retrieval, classification and regression tasks, and outperform them on code and mathematics tasks (Figure 1).
We also examine the impact of our design choices through systematic ablations on several components of our annealing recipe (§4). We explore the choice of masking ratio, showing that while higher masking ratios benefit retrieval tasks, lower ratios improve sentence classification. Additionally, we highlight that including data for code and mathematics improves multilingual retrieval, but degrades classification accuracy. Contrary to expectations, we also observe that only selecting documents with high educational value degrades performance, and that instead encoders benefit from a broader range of data sources.
Accompanying this work, we release the EuroBERT family, comprising three models with 210M, 610M and 2.1B parameters. To facilitate future research, we also release intermediate training checkpoints, as well as our training framework.

EuroBERT: A Refreshed Multilingual Encoder
The EuroBERT models are available in three sizes (210M, 610M, and 2.1B parameters) and closely follow the Llama 3 architecture (Llama Team, 2024) (§2.1). They are trained on a large multilingual corpus, which also includes code and mathematics (§2.2). Their training pipeline has two stages, pre-training and annealing, and employs the masked language modeling (MLM) objective (§2.3).
Architecture
The EuroBERT models are based on a standard dense transformer (Vaswani et al., 2017), with several architectural changes. Similarly to Llama 2 (Touvron et al., 2023), we remove all biases. Additionally, we incorporate grouped query attention (Ainslie et al., 2023), swish gated linear units (Shazeer, 2020), root mean square layer normalization (Zhang and Sennrich, 2019), and rotary position embeddings (Su et al., 2024).
Dataset
To train EuroBERT, we construct a multilingual 5T-token corpus --- 4.8T tokens for pre-training and 200B for annealing --- which includes 15 languages: English, French, German, Spanish, Chinese, Italian, Russian, Polish, Portuguese, Japanese, Vietnamese, Dutch, Arabic, Turkish, and Hindi. Following prior work on curriculum learning (Hu et al., 2024), we adjust the data distribution to emphasize higher-quality datasets during annealing.
We use FineWeb (Penedo et al., 2024) for English, and CulturaX (Nguyen et al., 2024) for multilingual data. We also incorporate EuroLLM parallel data (Martins et al., 2024), which can improve cross-lingual transfer (Conneau and Lample, 2019; Reid and Artetxe, 2022; Reid and Artetxe, 2023), by concatenating to-English and from-English translation pairs, separated by a special <|parallel_sep|> token. Finally, inspired by the benefits of training on code for decoder models (Aryabumi et al., 2024), we add 38 programming languages from The Stack v2 (Lozhkov et al., 2024) and Proof-Pile-2 (Azerbayev et al., 2024), which we find improves multilingual retrieval (§4).
We classified data not seen during pre-training into four quality levels according to educational value using the EuroLLM classifier (Martins et al., 2024). We then kept the documents above the third threshold which, contrary to our expectations, improved performance on downstream tasks (§4). Additionally, we adjusted the data distribution based on multiple ablations (§4). Specifically, we decreased English while proportionally increasing the remaining languages. We also decreased the amount of code and math while increasing parallel data.
Training Recipe
We pre-train EuroBERT models with a 50% masking ratio, following the insights from Wettig et al. (2023), which find that masking 15% and 30% of tokens is sub-optimal, and that larger models benefit from higher masking ratios. For the subsequent annealing, however, we lower the masking ratio to 10% based on downstream evaluations (§4), aligning with the findings from Yang et al. (2023) and Ankner et al. (2024).
We employed the Warmup-Stable-Decay (WSD) scheduler (Shen et al., 2024), with a linear warm-up phase of 2,000 steps, a constant learning rate of during pre-training, and a cosine scheduler decaying to 0 during the annealing phase. During pre-training, we packed sentences to 2,048 tokens and used a Rotary Position Embedding (RoPE) value of 10,000. In the annealing phase, we increased the RoPE theta to 250,000 and randomly cropped our training documents to lengths between 12 and 8,192 tokens. We adopted this approach because, due to pre-processing constraints, our training data had already been segmented into fixed-length documents, making standard variable-length training infeasible. Therefore, we introduced random cropping of these fixed-length sequences as an approximation of variable-length training. Surprisingly, we found that this approach outperforms training only on fixed lengths (§4), further highlighting the necessity for variable length documents during long context training (Gao et al., 2024).
We trained EuroBERT on Adastra, using 92 MI250X GPUs for EuroBERT-210M, 384 MI250X GPUs for EuroBERT-610M, and 96 MI300A GPUs for EuroBERT-2.1B, for a total of 200k GPU hours. Our training framework incorporates FlashAttention (Dao, 2023), fused cross-entropy from LigerKernel (Hsu et al., 2024), torch.compile (Ansel et al., 2024), and hybrid sharding with Fully Sharded Data Parallel (Zhao et al., 2023).
Evaluation
Evaluation Setup
We select a suite of tasks to cover various real-world use cases for encoders. For multilingual tasks, we evaluate retrieval using MIRACL (Zhang et al., 2023), MLDR (Chen et al., 2024), WikipediaRetrieval (https://huggingface.co/datasets/Samoed/WikipediaRetrievalMultilingual), and CC-News (de Gibert et al., 2024). We assess sentence classification with XNLI (Conneau et al., 2018), PAWS-X (Yang et al., 2019), AmazonReviews (Keung et al., 2020) and MassiveIntent (Keung et al., 2020). Additionally, we evaluate token classification using the NER task from the XGLUE benchmark (Liang et al., 2020). We evaluate sequence regression on the WMT quality estimation task (Bojar et al., 2017; Bojar et al., 2018; Barrault et al., 2019; Barrault et al., 2020; Akhbardeh et al., 2021; Kocmi et al., 2022), and on summary evaluation using SeaHorse (Clark et al., 2023). For code-related tasks, we evaluate retrieval on CodeSearchNet (Husain et al., 2019) and DupStackMath (Hoogeveen et al., 2015), and classification on CodeDefect (Zhou et al., 2019) and CodeComplexity (Jeon et al., 2023). Finally, in the mathematical domain, we test retrieval on the MathFormula (Drechsel et al., 2025) task, and classification on MathShepherd (Wang et al., 2024b).
We compare EuroBERT with the multilingual encoders XLM-RoBERTa (Conneau et al., 2020; Goyal et al., 2021), mGTE-MLM (Zhang et al., 2024) and mDeBERTa-v3. Additionally, for code and mathematical tasks, we compare with the English-only ModernBERT (Warner et al., 2024) models.
We follow a standardized fine-tuning protocol to ensure fair model comparison. For each task, models are trained for 10,000 steps (unless otherwise specified) on the corresponding training split using a batch size of 32, a 10% warm-up ratio, and a linear learning rate decay. For small datasets requiring multiple epochs, we apply early stopping with a patience of one epoch based on validation performance. To account for model specificities, we fine-tune using 10 logarithmically spaced learning rates ( to ), selecting the one that achieves the highest validation metric. For sequence classification, we use the cross-entropy loss during training, while for sequence regression, we substitute it with mean squared error. For token classification tasks, we use the token-level cross-entropy loss, assigning each sub-token in an entity to the corresponding entity label. For all retrieval tasks, we finetune for 1,000 steps on MS-MARCO (Bajaj et al., 2016) using the InfoNCE loss (Oord et al., 2018) with in-batch negatives and cosine similarity.
We report accuracy for sequence classification, Spearman rank correlation for regression, F1 score for token classification, and nDCG@10 for retrieval tasks. We also follow Freitag et al. (2023), and group systems into language-specific clusters based on statistically significant performance gaps at 95% confidence thresholds. We then compute system-level rankings using a normalized Borda count (Colombo et al., 2022), defined as the average over the obtained per-language clusters. Note that a first cluster will only exist if a model significantly outperforms all others on a majority of languages.
Results
Table 1presents the aggregated results across multilingual tasks, and Table 2 summarizes performance on code and mathematics benchmarks.
Our largest model, EuroBERT-2.1B, ranks first on 10 out of 18 tasks, competing closely with the larger XLM-RoBERTa-3.5B. EuroBERT-610M is also on part with XLM-RoBERTa-3.5B across several multilingual tasks while being five times smaller, and outperforms it on code and mathematics benchmarks. Likewise, EuroBERT-210M matches XLM-RoBERTa-560M performance while having less than half the parameters, and consistently outperforms other models of similar size, showing especially strong results on European languages.
Across domains, EuroBERT consistently ranks high for retrieval tasks. Notably, the 210M and 610M parameter models outperform all models of comparable sizes, and are competitive with the larger XLM-RoBERTa-3.5B.
On sequence classification, no model significantly outperforms all others. During the development of EuroBERT, we found that several design decisions lead to a trade-off between retrieval and classification capabilities (§4). We highlight, however, that EuroBERT-2.1B is still among the highest ranking systems, and that the smaller models in the family are competitive with models of comparable size.
On the NER task, EuroBERT lags behind XLM-RoBERTa. However, we observed that models achieve comparable F1 scores when splitting entities into a similar number of tokens, as shown in Figure 2. In contrast, models are significantly better when dividing entities into fewer tokens. We posit that token classification tasks may benefit from larger vocabularies, with lower fertility, such as the one used in the XLM-RoBERTa family. We also note, however, that increasing the vocabulary size also increases the number of parameters, particularly for smaller models.
EuroBERT models match or exceed the performance of similarly sized systems in reference-based translation evaluation. For reference-free evaluation, while EuroBERT-2.1B lags behind the larger XLM-RoBERTa, the 210M and 610M variants are competitive with other baselines. In the future, we will explore other training signals to further enhance EuroBERT’s cross-lingual capabilities. For summary evaluation, EuroBERT models consistently outperform similarly sized alternatives.
Figure 3 compares the long context performance of EuroBERT and XLM-RoBERTa. While both models achieve similar performance for shorter inputs, EuroBERT maintains performance at longer contexts, whereas XLM-RoBERTa suffers notable degradation.
On these tasks in the code and math domain, all EuroBERT models consistently surpass other systems. Notably, EuroBERT-210M reflects most of the performance of the larger models in the family, and ranks above all baselines, highlighting its capabilities at a smaller scale.


Training Recipe Analysis
We measure the impact of various design decisions made during the development of EuroBERT with extensive ablations. Following Blakeney et al. (2024) and Llama Team (2024), we perform multiple annealing runs on 40B tokens, each varying a different component of our recipe, and measure the performance on the XNLI and MIRACL validation sets, the former representing multilingual classification and the latter multilingual retrieval.
The left-most plot in Figure 4 reports retrieval and classification performance as the proportion of English is reduced and re-distributed between other languages. We observe that a more balanced distribution improves overall results. However, when the language distribution becomes too close to uniform, there is a degradation in performance.
The second and third plots in Figure 4 show MIRACL performance dropping and XNLI accuracy rising as the quantity of math and code data decreases. In future work, we will investigate how to better balance downstream task performance during pre-training.
The forth plot in Figure 4 presents XNLI and MIRACL performance when increasing parallel data. In line with recent work showing the benefits of pre-training with parallel data (Anil et al., 2023; Briakou et al., 2023; Alves et al., 2024), we find it improves both benchmarks.
The right-most plot in Figure 4 analyses the impact of adding instructions during annealing, which can improve performance for decoder language models (Wei et al., 2022; Chung et al., 2024). In contrast to decoders, it leads to worse performance when training an encoder model.
The first plot in Figure 5 examines the impact of variable sentence lengths during annealing. Compared to the fixed packed sentence lengths employed in pretraining, variable sentence lengths significantly boosts XNLI and moderately MIRACL performance. This improvement remains stable, without degradation when the maximum context length is extended to 8,192 tokens.
Similarly to previous research advocating a lower masking ratio in later training (Yang et al., 2023; Ankner et al., 2024), we also find that reducing it to 10% during the annealing phase improves EuroBERT’s accuracy on XNLI, though it leads to a decline in MIRACL scores.
Contrary to initial expectations, using the highest quality data bucket during annealing does not result in better performance on XNLI and MIRACL. Instead, as illustrated in the right-most plot of Figure 5, mixing the buckets with quality levels 3 and 4 leads to the best overall results. Curiously, inspecting the evaluation splits of these datasets revealed that our quality filter would discard nearly all examples in XNLI, and many in MIRACL, as shown in Figure 6. This result highlights a potential domain mismatch, wherein our training data deviates from the distribution of downstream tasks. Indeed, while educational value fits assistant-like tasks typically delegated to LLMs, a broader coverage of textual data, reflected in mixing both quality buckets, may be more inline with general-purpose vector representations. In future work, we would like to explore quality filters that are better tailored to encoders.
The previous results revealed several design choices that trade off classification and retrieval performance. In the final data mix, we aimed to balance these two tasks. Based on the previous analysis, we created our final annealing dataset by selecting data above the third threshold. We reduced the proportion of English to 26% while proportionally increasing the share of the remaining languages. We allocated 6% and 4% of the data mix to math and code, respectively. Additionally, we increased the proportion of parallel data to 6%, and removed instructions. We finally lowered the masking ratio to 10% and performed annealing with random sentence lengths of up to 8,192 tokens.



Related Work
Encoder models have shown strong performance in non-generative tasks, such as classification and retrieval (Devlin et al., 2019; Liu et al., 2019; He et al., 2023; Acheampong et al., 2021; Ma et al., 2019; Karpukhin et al., 2020; Wang et al., 2024a). Variants of these models have also extended support to multiple languages and cross-lingual tasks (Conneau et al., 2020). However, scaling to many languages introduces the “curse of multilinguality” (Conneau et al., 2020; Chang et al., 2024), where interference across languages degrades performance. Notably, increasing model capacity has been shown to mitigate this effect (Conneau et al., 2020), motivating our focus on scale.
Encoders are typically trained with masked language modeling (MLM) (Devlin et al., 2019). While alternatives like replaced token detection (He et al., 2023) exist, we adopt the MLM objective because initial evaluations of existing models showed more balanced results across tasks. Building upon the effectiveness of higher masking ratios (Wettig et al., 2023), we mask 50% of the training tokens during pre-training. Prior work has also shown the benefits of decreasing the masking ratio in later phases of training (Yang et al., 2023; Ankner et al., 2024), we also lower our masking ratio to 10% during annealing. Interestingly, we demonstrate that this choice improves classification accuracy, but reduces retrieval quality.
Recent concurrent work, such as ModernBERT (Warner et al., 2024) and mGTE (Zhang et al., 2024), also revisits encoders in light of advances in decoder models. Similar to our approach, they incorporate grouped query attention (Ainslie et al., 2023), rotary positional embeddings (Su et al., 2024), gated linear units (Shazeer, 2020), root mean square layer normalization (Zhang and Sennrich, 2019), and support for longer context windows. However, we additionally draw inspiration from Llama Team (2024); Yang et al. (2024) by including code and mathematical data during pre-training, which we show improves retrieval quality.
Conclusion
We propose a recipe for training general-purpose multilingual encoders, creating the EuroBERT family. We incorporate recent architectural advances from decoder models, and train on a multilingual dataset containing European and globally spoken languages, together with code and mathematics. Our models outperform existing alternatives on a comprehensive suite of tasks covering multilingual capabilities, mathematics and code. We also extensively analyze the design decisions behind EuroBERT’s dataset and training pipeline. Alongside this paper, we release all models in the EuroBERT family, including intermediate training checkpoints, and our training framework to facilitate future research.
Next step
A problem worth researching?
Tell us what you are trying to solve, and we will put you in touch with the people who work on it.