Elamur Research

RoBERT – A Romanian BERT Model

Paper · 2020 · Mihai Masala, Stefan Ruseti and Mihai Dascalu

Summary

A system trained on many languages offers a practical starting point for Romanian. The question is how much a Romanian application gains from a system trained on Romanian alone. The authors tackle that question with RoBERT, a Romanian adaptation of BERT. They assemble a corpus from Romanian Wikipedia, web text, and a collection of selected Romanian sources, then train and publicly release small, base, and large versions. Each version learns from the same kind of exercise. It fills in hidden pieces of text and decides whether paired sentences were consecutive in the source. The resulting representations are then adapted to tasks with labeled examples.

The authors test RoBERT on product review ratings, on dialect and topic labels for news, and on the restoration of Romanian diacritics. The news corpus yields several distinct tests. A system can learn to recognize topics and be evaluated on articles from the same dialect, or it can learn from one dialect and be tested on the other. For diacritics, RoBERT supplies sentence context to a separate character classifier. This gives the classifier evidence from the word and its sentence as well as the immediate neighborhood of the letter it has to restore.

RoBERT is especially competitive on sentiment and on most of the news tests. RoBERT-large reaches 72.11 macro F1 on the eMAG review test set, the highest score on that metric, while XLM-R-base has the highest test accuracy at 79.19. On the original MOROCO news test sets, RoBERT variants lead on dialect identification, topic classification within either dialect, and topic transfer from Romanian to Moldavian. The reverse transfer favors XLM-R-base, which scores 70.57 macro F1 on the MOROCO test set for transfer from Moldavian to Romanian. That direction also favors a different approach on the separate VarDial challenge test.

For diacritics restoration, adding Romanian contextual representations to the character classifier improves on its character-only results. The strongest word-level results come from the comparison system BERT-base-ro, which is also trained specifically for Romanian. The comparison between RoBERT sizes is task-dependent. The large version leads its family on review sentiment, while the base version is slightly ahead on some of the news and restoration measures. Taken together, the results show the value of Romanian-only pretraining as a starting point for several applications, with the final ranking depending on the task, test split, and metric.

Deep dive: RoBERT – A Romanian BERT Model

RoBERT adapts BERT to Romanian and tests how Romanian-only pretraining fares on reviews, dialect and news classification, and diacritics restoration. · about 32 minutes to read

The problem and its context

Why train a Romanian system separately?

The computationally expensive part of the approach in this paper takes place before the authors have a particular review label or news category in mind. During pretraining, a system learns to represent text using exercises whose answers can be extracted from ordinary writing. During fine-tuning, it starts with those learned representations and adjusts them to a specific task using labeled examples. The distinction matters for Romanian because a team may have enough labeled material to train a review classifier while having relatively few choices about the pretrained system on which to build it.

The paper describes two ways to get that starting point. One is to use a multilingual system that already includes Romanian among its training languages. The other is to collect a Romanian corpus and carry out pretraining separately. The multilingual option shares the initial investment across languages and was available in two established forms for Romanian when the authors began. Multilingual BERT, or mBERT, uses the BERT-base architecture and was trained on 104 languages. XLM-R was trained on a corpus reported as 2.5TB, drawn from 100 languages. Those figures describe the multilingual training collections as a whole. They give the scale of the alternatives, while the Romanian experiments are needed to establish how well each alternative performs on Romanian.

Training specifically for Romanian makes it possible to choose both the texts and the inventory of pieces into which text is divided. Romanian spelling gives a concrete reason to pay attention to that inventory. Some letters have marked forms, and the same unmarked character can require different treatment depending on the word. A system built for Romanian can preserve those distinctions when it processes text. Whether this design choice accounts for a downstream advantage is a separate question from whether the resulting pretrained system is useful. The paper primarily sets up a comparison of complete systems.

The authors identify a Romanian-only comparison system as well. They call it BERT-base-ro, and they describe its corpus as overlapping substantially with their own through Oscar and Romanian Wikipedia. Its vocabulary contains 50k tokens, while the paper describes RoBERT's in rounded form as 38k tokens. The available account of BERT-base-ro's training was sparse. Its inclusion is nevertheless important. If the comparisons had stopped at mBERT and XLM-R, success would have shown that one Romanian effort could beat particular multilingual alternatives. BERT-base-ro also tests how RoBERT fares against another system developed for the same language.

From fixed word vectors to contextual representations

The authors place this question in a broader change in natural language processing. They describe an earlier generation of systems built around recurrent neural networks, which process a sequence by carrying a state from one position to the next. LSTM and GRU cells are designs for maintaining and updating that state. Such networks often began with pretrained word embeddings, vector representations learned from text. The paper names word2vec and GloVe as examples. In the account given here, each word has a fixed vector at the input. Its occurrence in a particular sentence is then handled by the network that consumes those vectors.

With a contextual representation, the vector computed for a position can vary with the surrounding text. This distinction becomes tangible in the restoration task. The useful representation is for the piece of a word in the sentence currently being processed. The surrounding words can change the information carried by that representation even when the characters of the piece stay the same. A task-specific classifier can then use the vector to make a decision about an individual letter. The same pretrained encoder can also supply a representation for a whole review, where the decision concerns an overall rating.

The paper traces this change to the Transformer, the architecture on which RoBERT is built. Its self-attention mechanism lets positions in a sequence draw information from other positions in that sequence. Multiple attention heads provide parallel ways to combine information, and successive layers build on the representations produced below them. The authors emphasize the computational consequence of this design. Operations across positions can be parallelized, in contrast to the dependence on the preceding state in a recurrent network. The paper identifies this parallelism as one reason the architecture suits expensive pretraining on a large text collection.

RoBERT uses the bidirectional encoder design associated with BERT. For the exercise in which part of the input is hidden, context on either side can help recover it. This form of pretraining yields an encoder that can be reused by attaching a predictor suited to each task. The authors discuss RoBERTa as part of the same line of work, including its findings about changes to the training objectives. The names are similar, but RoBERT's training recipe follows the original BERT objectives. XLM-R, the multilingual comparison system, belongs to the RoBERTa line.

What earlier language-specific comparisons suggested

The paper points to an earlier comparison by Rönnqvist and colleagues involving multilingual BERT and language-specific variants for English and German. That study examined a simple syntactic classification task, a test that required filling a blank, and full text generation. The paper describes small differences on the simple classification task and a widening gap on harder tests, with the multilingual system struggling most in generation. For RoBERT's authors, this was a reason to compare systems on several tasks. A single classification result could give a misleading impression of how much the choice of pretraining matters across applications.

The authors also describe a growing body of work on pretraining for individual languages. For French, they discuss FlauBERT and CamemBERT, reporting that they improved on multilingual BERT across a range of tasks. Their account names Dutch systems such as BERTje and RobBERT, along with efforts in other languages. These examples establish the precedent for building Romanian resources. They leave the Romanian comparison to be settled by Romanian data and evaluation.

One challenge was finding labeled data that would make the comparison informative. The authors were unaware of a broad Romanian collection of natural language understanding benchmarks. They instead assembled an evaluation across tasks with different inputs and prediction units. A product review is informal writing paired with a rating. News offers both a dialect label and a topic label. The restoration data include news and talk-show scripts, with the decisions made at individual character positions. The evaluation is therefore about what can be transferred from the same Romanian pretraining to several distinct tasks, under the conditions specified for each.

The method, step by step

Assemble the text and define the input units

The authors begin with Romanian text from several sources. A dump of Romanian Wikipedia contributes encyclopedia articles. The Romanian portion of Oscar supplies text collected from the web. Selected RoTex sources add material that includes books, newspapers, and institutional texts. The researchers describe the corpus in terms of words, sentences, and uncompressed size. Each of those measurements describes a different aspect of the text collection. The eventual token vocabulary has its own count because its entries are the pieces used to process the text.

After cleaning, the full corpus contains 2.07B words and 103M sentences and occupies 12.6 GB. Romanian Wikipedia accounts for 50M words and 2M sentences, at 0.3 GB. Oscar accounts for 1.78B words and 87M sentences, at 10.8 GB. The selected RoTex material accounts for 240M words and 14M sentences, at 1.5 GB. Oscar dominates the collection on all the reported measures. The other sources broaden the kinds of writing in it, although the experiment treats the mixture as a single pretraining resource.

The authors reserve 10% of the corpus for evaluation of the pretraining exercises. That reservation serves a different purpose from the development and test partitions used for reviews, news, and restoration. The pretraining partition tests whether the pretrained encoder can solve the exercises on held-out Romanian text. The downstream partitions test how the encoder performs after training for a new prediction task. A gain on one of these measurements can be compared descriptively with gains on the others, but the examples and prediction targets differ.

Next comes tokenization, the conversion from written text to units that the encoder can process. RoBERT uses WordPiece, a method of subword tokenization whose units can be smaller than complete words. This makes it possible to represent a word by a sequence of known pieces. The authors report small adaptations to account for Romanian diacritics. The three RoBERT configurations share the same vocabulary, given precisely as 37,788 tokens. The architecture comparison lists that inventory as 38k. Since the inventory stays fixed across the RoBERT family, the size comparison concerns the encoders and their representations rather than different Romanian token inventories.

From Romanian text to task predictions

The steps in order.

From Romanian text to task predictionsStep 1: Combine Romanian text from several sources1. Combine Romanian text from several sourcesStep 2: Reserve text for pretraining evaluation2. Reserve text for pretraining evaluationStep 3: Segment inputs with Romanian WordPiece3. Segment inputs with Romanian WordPieceStep 4: Train on masked tokens and sentence pairs4. Train on masked tokens and sentence pairsStep 5: Use contextual token or sequence representations5. Use contextual token or sequence representationsStep 6: Train the predictor for each task6. Train the predictor for each taskStep 7: Select on development data and evaluate on test7. Select on development data and evaluate on test

Set the depth and width of the encoder

The authors train RoBERT-small, RoBERT-base, and RoBERT-large. The architecture table uses L for the number of Transformer layers, H for the size of the hidden representation, and A for the number of attention heads. The layer count describes how many times the architecture can update a position's representation through a new block. The hidden size is the number of components in that representation. The head count describes how many parallel attention computations are used in a layer.

RoBERT-small has 12 layers, a hidden size of 256, and 8 attention heads. RoBERT-base likewise has 12 layers and 12 heads, and its hidden size is 768. RoBERT-large has 24 layers, a hidden size of 1024, and 16 heads. The base and large dimensions match the corresponding BERT configurations. The move from small to base changes width and head count at the same depth. The move from base to large changes depth as well. A comparison of these sizes therefore tests packages of architectural changes instead of varying one dimension alone.

The paper reports 19M trainable weights for RoBERT-small, 114M for RoBERT-base, and 341M for RoBERT-large. The vocabulary contributes to the number of parameters because the encoder learns representations for the units it can receive. Its internal dimensions also determine how many parameters the layers need. This helps explain why the name “base” alone gives an incomplete account of a comparison. For example, RoBERT-base and XLM-R-base use the same layer count, hidden size, and head count as given in the architecture table, but the table gives 278M weights for XLM-R-base and lists a 250k vocabulary for it.

The recorded training times are 28 hours for RoBERT-small, 77 hours for RoBERT-base, and 255 hours for RoBERT-large, on a v3-8 TPU. These are times for the RoBERT runs on the reported hardware. The downstream results give a reason to read those times alongside the scores. The large encoder provides a clear advantage on some comparisons, while others favor the base encoder or put the two very close together. Pretraining has a measured cost here, and the return on that cost depends on what the encoder is later asked to do.

Train on hidden tokens and sentence pairs

In the first BERT exercise, masked language modeling, or MLM, some tokens are selected and hidden. The target is the original token in each selected position. Since RoBERT reads context in both directions, the information available for an answer includes what follows as well as what precedes that position. Training on this exercise requires learning to use the context well enough to choose among vocabulary items. The exercise's labels come from the input text itself, so Wikipedia, web material, and RoTex texts can supply examples without manual annotation.

The other exercise is next sentence prediction, or NSP. Its input is a sentence pair. The system must distinguish pairs drawn from consecutive sentences from pairs made by sampling sentences from the collection. The authors keep both exercises from BERT. They recognize that earlier work gives mixed reasons for retaining NSP. The original BERT work reported a benefit, while the RoBERT paper describes unfavorable findings for NSP in other Transformer setups. It also discusses ALBERT, whose sentence order prediction exercise asks the system to distinguish the correct order of sentences from the reversed order. RoBERT's decision is to follow the original recipe, with both masked-token and next-sentence targets.

For pretraining, the authors use Adam to update the weights. The reported learning rate is 1e-4. Its role is to scale the updates made by the optimizer. Adam uses running information about gradients, with β₁ set to 0.9 and β₂ set to 0.999. The symbol β₁ denotes the decay rate for the running estimate based on the gradient, and β₂ denotes the decay rate for the estimate based on squared gradients. The paper also gives L₂ decay of 0.01, where L₂ designates the squared-weight form of regularization. The learning rate warms up over the first 1% of training steps and follows linear decay in the reported schedule.

The systems train for 40 epochs, with the largest batch that fits in the device's memory. An epoch is a pass through the training data. A batch is the group of examples processed together for an update. The length of those examples is an important part of the memory and compute budget because the cost of the attention mechanism grows quadratically with sequence length. The authors set a maximum of 128 tokens for 90% of the training steps, then use a maximum of 512 for the remaining 10%. The shorter stage makes most updates less costly. The longer stage gives the encoder experience at the later positions and permits learning the positional embeddings used there. Those embeddings convey the positions of input tokens to the encoder.

Turn the representations into task decisions

For review sentiment and news classification, the authors use the vector at the special CLS position as the representation of the input sequence. The review or news text passes through the encoder, and the CLS vector is fed into fully connected layers. A fully connected layer uses all the components of its input vector to compute its output. The final layer supplies separate scores for the allowed labels. This arrangement lets the authors use essentially the same prediction design for several tasks while changing the label inventory to match the experiment.

Diacritics restoration uses a different prediction unit. The decision applies to an eligible character, so the model receives explicit character information and a contextual vector for the token containing that character. In Romanian, the unmarked letters considered are a, i, s, and t. The classifier can leave the letter unchanged, apply a circumflex, apply a breve, or choose the relevant comma-below class for s or t. The paper therefore uses 5 classes. The input letter supplies part of the information needed to interpret the class. For example, the circumflex class can produce â or î according to which unmarked letter is being considered.

The character branch starts with a window of size 11 centered on the candidate, including 5 characters on either side. Each position has an embedding of size 50. The shape reported for the resulting matrix is:

E ∈ ℝ^(11 × 50)

E is the matrix of embeddings for the window. The membership sign ∈ indicates that E belongs to the space of real-valued matrices denoted by ℝ with the indicated shape. The dimensions separated by × are the 11 character positions and the 50 components in each position's embedding.

The next layer slides convolutional filters over the window. Each filter can respond to a pattern across a span of characters. The selected filter widths are 2, 3, 4, 5, and 11, with 50 filters of each width. Max-over-time pooling retains the strongest response for each filter across positions, yielding a vector of 250 components. The method appends the embedding of the center character to that pooled vector. The resulting character representation has size 300. Including the center explicitly alongside the pooled features gives the predictor direct access to the character on which it must act.

For the combined system, the encoder processes the current sentence. The method takes the contextual vector at the token position containing the candidate character, following the arrangement used in tagging tasks. That vector is appended to the character representation. The combined features pass through a fully connected layer of size 128 and then to the decision layer. The local branch provides evidence about the spelling around the candidate. The sentence branch provides evidence that can depend on words farther away. This is a different use of the pretrained encoder from review rating, where the prediction takes a sequence-level vector and assigns a label to the whole input.

The authors first train the restoration predictor while holding the pretrained encoder fixed. In this phase it functions as a feature extractor. They also continue training from the strongest checkpoint of that phase with the entire architecture trainable. The latter setup allows the contextual representation itself to adapt to the decisions the character classifier must make. Comparing the two phases helps show how well the existing representations serve the task and how the final system changes after those representations have been adapted.

Experiments and results

How the results are selected and read

The paper uses training data to fit each downstream system, development data to choose a checkpoint, and test data to evaluate the selected checkpoint. The development scores help explain the authors' selections. The test scores measure how those selections fare on a separate split. In cross-dialect classification, this distinction has an added consequence. The development set comes from the source dialect, while the test set comes from the target dialect. A development score is then both a checkpoint selection measure and a measure from a different domain than the final test.

For the classification tasks, accuracy is the share of examples assigned the correct label. F1 brings together precision and recall for a class. Precision concerns the reliability of predictions of that class, while recall concerns how much of the class the system finds. Macro F1 gives each class equal influence in the average. Weighted F1 gives classes influence according to their frequency. The distinction matters for a review dataset with many highly rated products. A system can do well on overall accuracy while another does better on the average of the class-level F1 scores.

The authors also report scores on the held-out pretraining corpus. For masked token prediction, accuracies for RoBERT-small, RoBERT-base, and RoBERT-large are 0.5363, 0.6511, and 0.6929, respectively. Their MLM losses on that corpus are 2.4576, 1.7073, and 1.4578 in the same order. Loss measures the quality of the predictions under the training objective and is lower for better predictions. For next sentence prediction, the corresponding evaluation accuracies are 0.9687, 0.9802, and 0.9843, with losses of 0.0838, 0.0601, and 0.0444. Both exercises show a consistent ordering by size on the held-out corpus. The subsequent tests establish how much of that ordering carries over after task-specific training.

Sentiment in product reviews

The sentiment analysis data come from eMAG, a Romanian online shopping platform. The authors collect around 160k reviews spanning 129 product categories. The collection mixes several kinds of purchases, with IT products at 44% and electronics at 23%. The authors use the customer's review text and the associated star rating. The product title and category, the review date, and other available fields stay outside the classifier. Keeping the prediction head and its inputs simple was part of the authors' effort to compare the pretrained encoders directly.

The ratings run from 1 to 5 stars and are unevenly distributed. The paper reports 2.5 times as many reviews at the two endpoints together as at the other ratings together. For the experiment, the authors combine ratings of 2 and 3 stars, leaving 4 classes. They partition the data at proportions of 0.8/0.1/0.1 for training, development, and test, using stratification to preserve class proportions during the split. The paper describes about 133k examples for training and 16k each for development and test. During training, the authors reduce the representation of the largest class by selecting 20k of the 85k reviews with 5 stars. The score on the test set concerns the held-out rating task with these defined classes.

Above the CLS vector, the review predictor uses two fully connected layers of 100 and 4 units, respectively. The authors fine-tune the entire architecture for up to 10 epochs and minimize cross-entropy, a loss that favors assigning high probability to the observed label. They run Adam at a learning rate of 1e-5 and use batches of 64, except for XLM-R, where computational constraints require smaller batches. They search over maximum sequence lengths of 256 and 512 and dropout rates of 0.1 and 0.5. Dropout is a training technique that temporarily suppresses some activations. The authors use development macro F1 to choose the final checkpoint.

eMAG review test macro F1 by pretrained encoder

RoBERT-large leads on macro F1, and RoBERT-base comes close to XLM-R-base.

eMAG review test macro F1 by pretrained encodermBERT: 69.57mBERT69.57XLM-R-base: 71.71XLM-R-base71.71BERT-base-ro: 71.02BERT-base-ro71.02RoBERT-small: 66.37RoBERT-small66.37RoBERT-base: 71.61RoBERT-base71.61RoBERT-large (this paper): 72.11RoBERT-large (this paper)72.11
The numbers
System or settingMacro F1 %
mBERT69.57
XLM-R-base71.71
BERT-base-ro71.02
RoBERT-small66.37
RoBERT-base71.61
RoBERT-large (this paper)72.11

The test macro F1 results show the small version trailing the alternatives and the base version close to the strongest multilingual entry. The large version has the best macro F1, the metric used for development selection. It also has the highest weighted F1 on the test set, at 80.44, compared with XLM-R-base at 80.37. Test accuracy gives the lead to XLM-R-base at 79.19, followed closely by RoBERT-large at 79.16. These metrics bring different information to the comparison. The macro score evaluates the classes with equal weight, while accuracy reflects the distribution of examples in the test set.

On development data, RoBERT-large leads on all the reported review metrics, including 72.48 macro F1 and 79.22 accuracy. Within the RoBERT family, scores increase from small to base to large across the reported review metrics on both splits. RoBERT-base also edges ahead of BERT-base-ro throughout the table. Their development macro F1 values are 70.89 and 70.49, respectively. The broader comparison is particularly informative at base size. The review classifier gets very similar test macro F1 from RoBERT-base and XLM-R-base in spite of their substantially different parameter counts.

Dialect and topic in the original news corpus

MOROCO contains over 30k samples of Romanian and Moldavian text from online news sources. Each article has two labels, one for dialect and one for topic. The six topic categories are culture, finance, politics, science, sports, and technology. Because the corpus supports both kinds of label, it can test whether a classifier identifies the dialect of the article and whether it identifies the subject discussed in it. Topic classification can also be evaluated under two different relationships between training and test data.

In the within-dialect experiments, the training, development, and test sets are from the same dialect. The paper labels these MD Topic and RO Topic, for Moldavian and Romanian respectively. In the transfer experiments, the model is trained and selected on one dialect and tested on the other. In the reported results, MD to RO uses Moldavian development data and Romanian test data, while RO to MD uses Romanian development data and Moldavian test data. The development columns align with those of the within-dialect runs for the corresponding source dialect. This makes it possible to see how a predictor selected for its performance on the source fares on a new test distribution.

The news predictor again uses the CLS vector with fully connected layers. The intermediate layer has size 100. The final layer has outputs for either the dialect labels or the six news categories. According to the authors, Adam is the optimizer, the batch size is 64, and the learning rate is 1e-5. They compare with the pretrained baselines and with the MOROCO baseline, KRR + SK. That baseline uses string kernels to turn similarities between texts into features for kernel ridge regression. It gives the study a comparison with a method built around text patterns as well as comparisons among pretrained encoders.

On binary dialect classification, RoBERT-base gives the highest MOROCO test macro F1 at 97.24, closely followed by RoBERT-large at 97.21. RoBERT-large has the highest development macro F1 at 97.68, compared with 97.36 for RoBERT-base. BERT-base-ro is the highest scoring comparison system on the test split at 95.98. The small RoBERT has a development score of 96.00, just below XLM-R-base at 96.12 on that split, and a test score of 95.76. This comparison puts the clearest test advantage with the base and large versions.

On Moldavian topic classification, the highest test macro F1 is 93.40 for RoBERT-base, followed by 93.26 for RoBERT-large. The development ranking again favors the large version, at 94.82 against 93.92 for base. For Romanian topic classification, RoBERT-large leads on both splits. Its development macro F1 is 84.36 and its test macro F1 is 83.24. RoBERT-base follows at 83.95 and 82.93, respectively. KRR + SK scores 90.57 on the Moldavian topic test and 78.76 on the Romanian topic test. The pretrained systems' advantage and the ordering within the RoBERT family depend on which dialect supplies the articles.

MOROCO Moldavian-to-Romanian topic transfer test macro F1

XLM-R-base leads on the Romanian test set despite stronger Moldavian development results from several alternatives.

MOROCO Moldavian-to-Romanian topic transfer test macro F1KRR + SK: 67.59KRR + SK67.59mBERT: 68.95mBERT68.95XLM-R-base: 70.57XLM-R-base70.57BERT-base-ro: 69.90BERT-base-ro69.90RoBERT-small: 69.05RoBERT-small69.05RoBERT-base: 68.80RoBERT-base68.80RoBERT-large (this paper): 69.50RoBERT-large (this paper)69.50
The numbers
System or settingMacro F1 %
KRR + SK67.59
mBERT68.95
XLM-R-base70.57
BERT-base-ro69.90
RoBERT-small69.05
RoBERT-base68.80
RoBERT-large (this paper)69.50

The Moldavian-to-Romanian direction produces the clearest reversal between development and test results. XLM-R-base has 92.45 macro F1 on the Moldavian development set. RoBERT-large reaches 94.82 on that set, and RoBERT-base reaches 93.92. The ranking changes on the Romanian test set, where XLM-R-base leads and BERT-base-ro has the next highest score. A strong news classifier for the training dialect can therefore remain a weaker choice for the target dialect under this selection procedure.

The transfer from Romanian to Moldavian gives a different result. RoBERT-large has the best test macro F1 at 83.26, and RoBERT-base reaches 82.37. XLM-R-base, the strongest multilingual result on that test, reaches 80.81. The same encoder can thus have a relative advantage in one direction and a disadvantage in the other. The experiment uses the ordinary classifiers and the training and test splits to create the transfer problem. The reported scores measure how well that standard procedure carries over between dialects.

The separate VarDial challenge test

The paper also evaluates on the Moldavian versus Romanian Cross-dialect Topic Identification challenge, or MRC, from VarDial 2019. This benchmark includes dialect identification and both directions of topic transfer. Its training data are the same as in the corresponding MOROCO tasks. Its development data combine the original MOROCO development and test partitions, and the challenge has a separate private test set. The new partitioning matters when reading the scores. The VarDial and MOROCO test columns concern separate evaluations, even though the tasks have the same labels.

The authors compare with challenge entries and their reported post-competition results. One entry combines convolutional text representations using a support vector machine, identified as 2-CNN + SVM. Another, Char+Word SVM, uses character and n-gram features with TF-IDF BM25 weighting. The BiGRU entry uses a bidirectional recurrent network and pretrained FastText vectors from work on word vectors for many languages. Keeping the competition and post-competition figures distinct is important because some of the strongest comparisons came after the competition.

For dialect classification, RoBERT-large scores 97.78 macro F1 on the VarDial test, and RoBERT-base reaches 97.39. Char+Word SVM reaches 96.20 in its post-competition result, while XLM-R-base reaches 96.28 in the authors' table. The result favors the larger RoBERT on this split, even though the base version narrowly leads it on the original MOROCO dialect test. This is a case where the broader conclusion about the RoBERT family is stable, while the preferred size changes with the evaluation.

For Moldavian-to-Romanian topic transfer on the VarDial test, the top reported score is the BiGRU post-competition result of 70.10 macro F1. BERT-base-ro and XLM-R-base both have 69.93 in the table. RoBERT-large achieves 69.91 and RoBERT-base has 68.30. The result reinforces the difficulty of this direction for RoBERT. On the transfer from Romanian to Moldavian, RoBERT-large leads the comparison with 83.65 macro F1. XLM-R-base reaches 82.28, the post-competition Char+Word SVM reaches 81.93, and RoBERT-base reaches 81.09. The choice of RoBERT size matters more to the ranking here than it does in several of the original MOROCO tests.

Restoring diacritics

The restoration corpus introduced by Iordache and colleagues contains over 40M words and over 2.5M sentences, including online news and talk-show scripts. It has training, validation, and test partitions, with a public challenge for evaluation and a private reference for the test. The authors compare the restoration architecture with their CharCNN alone and with the prior BiLSTM baseline, a bidirectional recurrent classifier that works with character sequences. The paper describes the latter as a system with 2.4M trainable parameters. It uses a different grouping of character transformations, so its results are a comparison between complete restoration systems.

The authors report word accuracy and character accuracy. At word level, the entire word must match the reference. At character level, a correctly restored position counts even if another position in the same word is wrong. For each unit, the paper reports accuracy both on the subset eligible for diacritics and on all units in the text. The eligible subset concentrates the evaluation on cases where a restoration decision is available. The all-unit score describes performance across the complete text, including positions that are already correct when left alone.

The CharCNN is trained with cross-entropy and Adam at a learning rate of 1e-5. After adding a contextual encoder, the authors first train with its weights frozen for 20 epochs, with Adam at 1e-3. They then start from the best checkpoint of that stage and fine-tune the entire architecture for 5 epochs at 1e-5. This setup lets the paper compare frozen and trainable contextual features for the same character task, as well as compare the complete systems with the local character network.

Romanian diacritics challenge test accuracy on eligible words

Trainable contextual encoders improve on the character classifier, with BERT-base-ro and RoBERT-base leading the displayed comparison.

Romanian diacritics challenge test accuracy on eligible wordsCharCNN: 98.03CharCNN98.03CharCNN + mBERT fine-tuned: 99.66CharCNN + mBERT fine-tuned99.66CharCNN + XLM-R-base fine-tuned: 99.71CharCNN + XLM-R-base fine-tuned99.71CharCNN + BERT-base-ro fine-tuned: 99.74CharCNN + BERT-base-ro fine-tuned99.74CharCNN + RoBERT-small fine-tuned: 99.67CharCNN + RoBERT-small fine-tuned99.67CharCNN + RoBERT-base fine-tuned (this paper): 99.73CharCNN + RoBERT-base fine-tuned (thispaper)99.73CharCNN + RoBERT-large fine-tuned: 99.70CharCNN + RoBERT-large fine-tuned99.70
The numbers
System or settingEligible word accuracy %
CharCNN98.03
CharCNN + mBERT fine-tuned99.66
CharCNN + XLM-R-base fine-tuned99.71
CharCNN + BERT-base-ro fine-tuned99.74
CharCNN + RoBERT-small fine-tuned99.67
CharCNN + RoBERT-base fine-tuned (this paper)99.73
CharCNN + RoBERT-large fine-tuned99.70

The strongest word results on the challenge test come from the fine-tuned BERT-base-ro system. It records 99.79 accuracy on all words, with fine-tuned RoBERT-base at 99.78. The character results show how close the systems are. Both of those configurations score 99.95 on all characters. On eligible characters, BERT-base-ro gives 99.88 and RoBERT-base gives 99.87. On development data, the corresponding fine-tuned systems tie at 99.88 on eligible characters. Taken together, these scores support a clear advantage for the contextual architectures over the local baseline and a much narrower distinction among the best fine-tuned systems.

The frozen results tell a somewhat different story about size. The frozen RoBERT-base system reaches 99.51 accuracy on eligible words in the test set, and the frozen large system reaches 98.82. The frozen BERT-base-ro system has 99.62 on the same measure. Full fine-tuning improves both RoBERT versions, with a larger change in the reported scores for the large version. That brings the two much closer together. The result makes the adaptation procedure part of the comparison: a wider pretrained representation can behave differently when it is used as a fixed input to a small classifier and when its own weights can change.

What the ablations show

Which character patterns the restoration system uses

The study's most direct architectural comparison is in the character branch. The authors try concatenating the individual character embeddings and feeding the result to a fully connected layer. They also try convolutional designs using widths of 2, 3, 4, and 5, with one variant adding a width of 11. They choose the design that includes the width of 11 for the subsequent runs. This variant can detect patterns in a span as wide as the entire character window, alongside the shorter patterns available to both convolutional choices. The paper reports which design worked best and leaves the magnitude of the difference between the three designs unspecified.

The comparison with CharCNN alone provides a clearer measure of what sentence context adds to the authors' restoration pipeline. Its score of 98.03 on eligible words in the challenge test describes a classifier with access to the local character window. Pairing that architecture with contextual encoders improves the reported result, even in the frozen setup. The experiment supports using features from the containing token and its sentence for these decisions. It leaves open how many corrected cases depended on distant words, where the token representation supplied a better account of the immediate word, or how the effect varies with the diacritic being restored.

What changes when the encoder is allowed to learn

The frozen and fine-tuned variants isolate a more specific choice in using contextual features. The frozen encoder provides the predictor with vectors learned during pretraining. Updating the whole architecture gives the contextual branch a further opportunity to fit the restoration labels. The additional phase also means more training from the first stage's checkpoint. The scores describe the effect of the authors' complete adaptation procedure, including that schedule.

The size ordering under frozen features is especially informative. On eligible test characters, frozen RoBERT-base reaches 99.77 and frozen RoBERT-large reaches 99.44. With full fine-tuning, their scores become 99.87 and 99.86. The authors suggest an explanation for the weaker frozen result of the large variant. Its token vector has size 1024, compared with 768 for the base version. The vector is combined with a character representation of size 300, then passed through a layer of size 128. In that setup, the frozen large vector gives the small task head a wider input to organize. This is an interpretation of the results. A separate test varying the prediction head or the dimensions of the contextual input would be needed to establish the mechanism.

The authors likewise suggest that BERT-base-ro's larger vocabulary could give it an advantage in restoration. The comparison motivating this explanation is particularly visible when the encoders are frozen. BERT-base-ro's vocabulary has 50k tokens, compared with 38k for RoBERT in the architecture table. A different vocabulary can change how a word is split and, as a result, which contextual token vector is paired with a candidate character. The reported systems also differ in their training and corpora. The evidence establishes an advantage for the BERT-base-ro configuration on this task and leaves the vocabulary explanation open.

What the size and transfer comparisons establish

The three RoBERT sizes give a useful comparison because the authors use the same vocabulary and the same pretraining recipe. The larger configurations solve the held-out masked-token and next-sentence exercises more accurately. There is also a clear size ordering on the review task. In news classification, the gain from base to large depends on the test. For Moldavian topic classification and dialect identification in MOROCO, the base result is slightly higher on the test set even though the large result is higher on development. The same base configuration is also slightly stronger on several of the test measures in restoration.

The size comparison is consequently about a choice among complete configurations. Hidden size and head count vary across the family, and the large version also adds depth. From the scores, a reader can tell where the smaller architecture is competitive and where the larger one improves the final task result. The experiment provides no separate estimate for the contribution of an additional layer, a wider hidden vector, or a change in the number of heads. Those mechanisms would require comparisons in which the other architecture settings stayed fixed.

The two directions of news transfer offer a diagnostic of the selection procedure. Development data drawn from the source dialect can be useful for choosing a classifier for that dialect, as the within-dialect results show. For cross-dialect use, the same choice is assessed on a new distribution. The Moldavian-to-Romanian scores show that even the relative ranking among pretrained encoders can change. In the reverse direction, RoBERT-large leads on both MOROCO development and target test macro F1. The experiments establish directional differences under the authors' setup. They leave open which differences between the article collections drive the transfer results.

Finally, the review experiments include a tuning search. The authors compare sequence length and dropout settings and report that their early checks with learning rates of 5e-5, 2e-5, and 1e-5 produced no significant performance differences. The paper gives the main results for the selected configurations. Its tuning description explains how those configurations were obtained, while the effect sizes of the individual dropout and length choices remain unspecified. The study's strongest controlled evidence concerns the restoration architecture and the conditions under which the encoder is allowed to adapt.

Limitations

Limits the authors identify

The authors identify the scarcity of a broad Romanian natural language understanding benchmark as a constraint. They choose tasks covering informal product reviews, news articles, and talk-show scripts to obtain some diversity in source material. The tasks still represent a particular sample of Romanian text processing. The evaluation provides direct evidence for rating classification, dialect and topic classification, and restoration in these collections. Performance in other settings remains an open question, even when a task also uses a sequence classification head or a token representation.

They also explain their decision to keep the task heads similar and tune relatively few hyper-parameters. That makes the encoders easier to compare within a common experimental design. It leaves room for task-specific optimization, which the authors discuss as a way to get better scores. This matters in comparisons that are close enough for a different training setup or choice of predictor to matter. On the review task, for example, XLM-R uses a smaller batch because of computing constraints. The reported performance belongs to each system under the conditions the authors could run.

Another limitation the authors flag is the training information available for BERT-base-ro. They identify overlapping source material and a difference in vocabulary size. A fuller reconstruction of the comparison would require details about the other encoder's data preparation and training. Its empirical importance remains clear in the paper. It is a Romanian baseline that leads the restoration comparison on word accuracy and is competitive in the difficult direction of news transfer. The causes of its advantages are harder to determine from the configurations described.

Limits visible in the experimental setup

Romanian-only pretraining is varied here by comparing systems that differ in several ways at once. The language mixture, the amount and origin of the text, the vocabulary, tokenization, and parameter count can differ between systems. RoBERT-base and XLM-R-base share some architectural dimensions, which makes their comparison informative, while their vocabularies and pretraining backgrounds differ substantially. The results support the practical claim that a Romanian-only encoder can be competitive with established multilingual alternatives. The independent effect of pretraining on Romanian alone remains unresolved by that comparison.

The composition of the Romanian corpus raises a similar question. Oscar supplies the bulk of the material, with Wikipedia and RoTex contributing distinct source types. The paper reports a combined corpus and uses that mixture throughout the RoBERT experiments. The contribution of each component, and the effect of changing the proportions, remain open. Likewise, the pretraining accuracies establish how well the systems solve the particular MLM and NSP evaluation tasks. Because both objectives are used across the RoBERT family, the study cannot attribute its downstream gains to retaining NSP or to a particular interaction between the two objectives.

Each downstream benchmark also imposes a narrower interpretation than its task name might suggest. The eMAG labels come from ratings, and the authors combine reviews with 2 and 3 stars into one class. The results therefore describe how well the system predicts that rating scheme from the review body. The benchmark gives limited evidence about identifying a particular emotion, interpreting mixed opinions within a review, or handling reviews from a different source. The training procedure deliberately reduces the largest class, so the scores also belong to a particular approach to learning from skewed data.

For the news experiments, the source collections supply the dialect labels and the topic labels together. The dialect scores show that the systems distinguish the news samples under those labels. The topic-transfer scores show that the two directions pose different challenges. These experiments leave the basis of the decisions open. A classifier can draw on several properties of a source collection, including its wording, editorial patterns, and distribution of stories. The paper offers no controlled separation of those possible sources of evidence.

The restoration results are most informative when the measurement unit and the eligible subset remain visible. A high score on all characters reflects success over the complete text, including many cases where leaving a character alone is correct. Eligible-word accuracy puts more of the evaluation on the places where restoration is possible and requires the whole word to match. The paper reports these complementary views, but it does not provide a breakdown by diacritic or by the context required for the decision. Close scores among the fine-tuned systems are best read as the observed ordering on these data. The tables give point estimates, leaving uncertainty across training runs or alternative test collections unspecified.

These qualifications also matter when reading the paper's broad claims about how consistently RoBERT leads. The detailed experiments distinguish test macro F1 from test accuracy on reviews. They identify Moldavian-to-Romanian transfer as a recurring exception, and they give the best restoration results on words to BERT-base-ro. The experiments make the case for releasing and testing Romanian-specific pretrained systems. Their strongest evidence concerns the tasks and comparison conditions in which the advantages are measured.

What came after

The later work that cites RoBERT approaches related problems at different stages, from gathering multilingual text to building systems for many languages and refining Romanian pretraining data. The citation identifies a connection to the RoBERT paper. A more specific dependency, such as reusing a checkpoint, repeating one of its benchmarks, or applying its treatment of Romanian diacritics, would require information beyond the citation and the scope named by each work.

In 2021, Quality at a Glance cites RoBERT in a study devoted to auditing web-crawled multilingual datasets. The area of overlap is the training material. RoBERT reports the sources and size of its cleaned corpus, with most of its words coming from web text in Oscar, and evaluates the resulting encoders on particular language tasks. A dataset audit addresses quality at the level of the collection itself. The connection is relevant because an evaluation of the resulting Romanian encoder and an audit of the text that feeds pretraining ask different questions about the same broad resource problem.

In 2022, mGPT: Few-Shot Learners Go Multilingual cites RoBERT from work on multilingual few-shot learning. The connection is the question of what a pretrained system supplies across languages and tasks. RoBERT answers a specific version of that question by comparing Romanian-only and multilingual encoders after supervised task adaptation. mGPT's stated scope concerns multilingual few-shot use, which frames the amount and role of task examples differently. Its citation places the paper in that broader discussion without furnishing a direct comparison on the Romanian experiments.

In 2026, Improving Romanian LLM Pretraining Data using Diversity and Quality Filtering cites RoBERT in work centered on Romanian text and on filtering for diversity and quality. This is the closest of the listed works to RoBERT's choice to assemble a substantial corpus specifically for Romanian. RoBERT describes combining sources, cleaning the resulting collection, and training encoders on the mixture. The later work's stated focus is how to select material for Romanian pretraining, bringing the composition of the collection itself to the foreground. Across these citations, RoBERT serves as an earlier Romanian case in which assembling a corpus, choosing a language-specific encoder, and testing on several applications were carried out together.

Cite

Cite as Mihai Masala, Stefan Ruseti and Mihai Dascalu. 2020. RoBERT – A Romanian BERT Model. Proceedings of the 28th International Conference on Computational Linguistics.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2020.coling-main.581

@inproceedings{masala2020robert,
  title = {{RoBERT – A Romanian BERT Model}},
  author = {Mihai Masala, Stefan Ruseti and Mihai Dascalu},
  booktitle = {Proceedings of the 28th International Conference on Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.coling-main.581},
  url = {https://doi.org/10.18653/v1/2020.coling-main.581}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/masala-2020-robert-romanian-bert-model/