The birth of Romanian BERT

Stefan Daniel Dumitrescu, Andrei-Marius Avram, Sampo Pyysalo

Abstract

Researchers have introduced Romanian BERT, the first monolingual transformer-based model specifically designed for the Romanian language. By training on a massive 15.2 GB corpus, the model addresses the "capacity tax" inherent in multilingual models like Google’s mBERT. Romanian BERT significantly outperforms existing baselines across standard NLP tasks, including Part-of-Speech tagging, Named Entity Recognition, and dependency parsing, while offering greater computational efficiency through optimized tokenization.

Introduction

While Large Language Models (LLMs) like BERT revolutionized Natural Language Processing, they initially focused almost exclusively on English. Google eventually released a "multilingual" version (mBERT) trained on over 100 languages simultaneously. However, multilinguality comes with a "capacity tax": because the model's vocabulary and parameters are shared across dozens of languages, it often fails to capture the nuances, specific characters, and morphological richness of individual languages like Romanian.

Before this research, Romanian NLP relied on these diluted multilingual models. This paper addresses the need for a dedicated, high-performance model tailored specifically to the Romanian linguistic landscape.

Methods

The authors followed the standard BERT-base architecture but optimized it for the Romanian context through several key steps:

  • Architecture: The team trained both "cased" (preserving capitalization) and "uncased" versions.
  • Cleaning Pipeline: Raw web data was processed through a rigorous pipeline to remove non-UTF8 tokens, fix broken hyphenation (common in Romanian OCR), normalize Unicode dashes, and strip out low-quality lines.
  • Vocabulary Building: Byte-Pair Encoding (BPE) was used to create a 50,000-wordpiece vocabulary.
  • Training: The models were trained for 1 million steps on eight NVIDIA Volta V100 GPUs using the LAMB optimizer. This optimizer is specifically designed for large-batch training, allowing the process to complete in approximately two weeks per model.

Datasets

The model was pre-trained on a combined 15.2 GB corpus containing approximately 2.4 billion words. This dataset represents a significant aggregation of Romanian digital text.

Corpus statistics for Romanian BERT pre-training.

For evaluation, the researchers utilized the Romanian Reference Treebank (RRT) for Universal Dependencies and RONEC for fine-grained Named Entity Recognition.

Key Insights: Vocabulary Efficiency

A primary advantage of the monolingual approach is tokenization efficiency. Because Romanian BERT was built specifically for the language, it breaks words into fewer pieces compared to multilingual models.

Comparison of tokenization efficiency between mBERT and Romanian BERT.

On average, Romanian BERT uses ~1.4 tokens per word, whereas mBERT requires ~2.0 tokens. This efficiency allows the model to process longer sequences and maintain better semantic coherence. Furthermore, "frozen" weight tests—where only a small classification layer is trained—demonstrated that Romanian BERT's internal representation of Romanian grammar is fundamentally superior to multilingual baselines.

Key Results

Romanian BERT established new state-of-the-art results for the language:

  • Named Entity Recognition (NER): The cased model achieved an F1 score of 86.21, outperforming mBERT (84.52).
  • Universal Dependencies: In "Simple" tagging tasks (UPOS/XPOS), the model showed significant gains, particularly in frozen settings where it outperformed mBERT by up to 6%.
  • Parsing: In Labeled Attachment Score (LAS), Romanian BERT reached 89.69, a clear improvement over mBERT’s 88.05.

Limitations and Future Work

While 15GB is a substantial corpus, it remains small compared to the datasets used for English models. Future iterations could benefit from larger corpora and improved cleaning techniques. Additionally, while the current model handles standard Romanian effectively, future work may explore specialized versions for legal or medical domains, as well as models optimized for the informal, diacritic-free writing common on social media platforms.

Summary updated

BibTeX
@inproceedings{dumitrescu2020birth,
  author = {Stefan Daniel Dumitrescu and Andrei-Marius Avram and Sampo Pyysalo},
  title = {{The birth of Romanian BERT}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.387},
}
Figure