---
title: "HerBERT — paper by Mroczkowski et al. (2021)"
description: "HerBERT adapts a multilingual Transformer to Polish and tests which pretraining choices improve language understanding, tagging, and parsing."
canonical: "https://research.elamur.ai/free/en/papers/mroczkowski-2021-herbert-efficiently-pretrained-transformer-based/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/mroczkowski-2021-herbert-efficiently-pretrained-transformer-based/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / HerBERT: Efficiently Pretrained Transformer-based Language Model for Polish

# HerBERT: Efficiently Pretrained Transformer-based Language Model for Polish

Paper · 2021 · Robert Mroczkowski, Piotr Rybak, Alina Wróblewska et al.

**Authors:** [Robert Mroczkowski](https://md.research.elamur.ai/free/en/authors/robert-mroczkowski/), [Piotr Rybak](https://md.research.elamur.ai/free/en/authors/piotr-rybak/), [Alina Wróblewska](https://md.research.elamur.ai/free/en/authors/alina-wroblewska/) and Ireneusz Gawlik · **Year:** 2021 · **Venue:** Proceedings of the 8th Workshop on Balto-Slavic Natural Language Processing · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 8th Workshop on Balto-Slavic Natural Language Processing · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.bsnlp-1.1/)
- [PDF](https://aclanthology.org/2021.bsnlp-1.1.pdf)
- [arXiv 2105.01735](https://arxiv.org/abs/2105.01735)

## Summary

Training a system that can handle many Polish language tasks takes a large collection of text and a substantial amount of computation. HerBERT asks how much of that work can be reused. The authors start with [XLM-RoBERTa](https://md.research.elamur.ai/free/en/papers/conneau-2020-unsupervised-cross-lingual-representation-learning/), which has already been trained across languages, and adapt it to Polish. They also test individual choices in the training recipe. Much of the earlier work on how to train [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) had focused on English. Polish, with its fusional [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/), gives them a reason to examine those choices again.

The transfer preserves the main layers of the [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) while giving it a Polish vocabulary. A token shared by both vocabularies inherits its existing vector. When a Polish token has no direct match, the authors break it into pieces from the multilingual vocabulary and average their vectors. The system then learns from Polish text by reconstructing missing words. In controlled comparisons, this multilingual initialization made the clearest difference. Brief Polish pretraining brought the adapted system back to the range of its multilingual source and produced stronger validation results than the same amount of Polish training from random weights.

The authors also varied the amount and composition of the text, the duration of training, and two ways of changing what the system sees or predicts. A sentence-order objective gave no reliable improvement, and a strong weight on it frequently hurt. BPE-Dropout, which varies how words are split during training, also gave no statistically significant gain. The larger corpus had an advantage that reached significance in only one tested setting. Longer pretraining gave small, statistically significant gains when the authors adjusted the learning-rate schedule.

The authors released HerBERT in BASE and LARGE sizes. On the Polish KLEJ test benchmark, the average improved over the previous best result by 0.7 percentage points for BASE and 0.9 percentage points for LARGE. HerBERT also led on [part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/), while Polish RoBERTa remained ahead on [dependency parsing](https://md.research.elamur.ai/free/en/concepts/dependency-parsing/). HerBERT BASE achieved its benchmark result with a batch size of 2560 and 50k further pretraining steps, compared with a batch size of 8000 and 125k steps for Polish RoBERTa BASE. The comparison shows what an existing multilingual checkpoint can save when the goal is to build a Polish system.

## Deep dive: HerBERT: Efficiently Pretrained Transformer-based Language Model for Polish

HerBERT adapts a multilingual Transformer to Polish and tests which pretraining choices improve language understanding, tagging, and parsing. · about 31 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Why test pretraining choices in Polish?

A system built for a single language task learns from examples of that task. A system that uses pretraining first learns from a broader collection of text, then undergoes [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) for a particular job. For instance, assigning a sentiment to a review requires task-specific labels, whereas learning to recover missing material in ordinary text can use the text itself as a source of answers. The paper follows the latter route to obtain a shared starting point for several Polish tasks. Once that starting point exists, each task can adapt it to the kind of prediction it needs.

Learning representations from text before solving a specific task had a history in [natural language processing](https://md.research.elamur.ai/free/en/concepts/natural-language-processing/). The paper points to earlier work on [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/), including distributed representations of words and phrases, GloVe, and approaches that incorporate information about pieces of words. The change the authors emphasize is the move toward pretraining a general-purpose system whose parameters can be adapted across tasks. In this setting, decisions made during pretraining can carry through to applications that use quite different kinds of labels.

The authors describe Polish as fusional and contrast it with the more isolating character they attribute to English. For the training procedure, this raises a concrete question about the units the system works with. A written Polish word can carry grammatical information in its form, and the system may see that form as several pieces. A training choice that acts on those pieces can change how often the whole form is visible, what context remains when part of it is hidden, and which representations are learned together. The linguistic contrast supplies a reason to test a recipe in Polish. Establishing that morphology causes a particular result would call for a comparison across languages.

Polish already had systems such as Polbert, the first HerBERT release, and Polish RoBERTa. The paper identifies a gap between releasing a capable system and establishing which parts of its training account for its performance. A score from a complete recipe reflects the joint effect of its data, architecture, training objectives, and optimization. When those choices are compared only as part of whole systems, it is difficult to say which of them would be worth carrying into another training run. The authors make those choices the subject of controlled comparisons before training the final releases.

#### What earlier studies had varied

The authors take [RoBERTa](https://md.research.elamur.ai/free/en/papers/liu-2019-roberta-robustly-optimized-bert-pretraining/) as an important example of studying the recipe around a BERT architecture. That work, as they describe it, found value in changing the masked positions across training, using large batches, and drawing on more training text. It also found that the original Next Sentence Prediction objective could be removed. These are changes to the learning procedure, and their relevance to HerBERT is that they can be investigated with the basic architecture held steady. The surrounding research also studied how performance relates to the size of the system, its training data, and the computation used for training.

Sentence-level supervision was another point of disagreement. Next Sentence Prediction gives the system a decision about whether one segment follows another. [ALBERT](https://md.research.elamur.ai/free/en/papers/lan-2019-albert-lite-bert-self-supervised/) investigated a sentence-order objective. StructBERT framed the question as distinguishing a previous, following, or random sentence. These tasks can all be constructed from ordinary text. Their appeal is that they provide practice involving relationships beyond an individual word. Their value for another task still has to be established after fine-tuning.

The same line of inquiry applied to masked prediction. Some earlier work, such as [SpanBERT](https://md.research.elamur.ai/free/en/papers/joshi-2019-spanbert-improving-pre-training-representing/), trained on missing spans of tokens. StructBERT also considered recovering the ordering of shuffled words, and ELECTRA used a binary decision based on generated replacements. The HerBERT study narrows this set of possibilities. It uses whole-word masking throughout its experiments and tests how much weight to give a sentence-level objective alongside it. That design makes the comparison about the added sentence objective under a common masked-prediction procedure.

There was a related question about [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/), the practice of representing written forms with units that can be smaller than words. The paper discusses byte-pair encoding, WordPiece, and SentencePiece in its account of earlier tokenizers. It also cites work on weak representations for rare words as motivation for varying the way words are broken into pieces. [BPE-Dropout](https://md.research.elamur.ai/free/en/papers/provilkov-2020-bpe-dropout-simple-effective-subword/) was proposed to introduce this variation during training. The Polish experiments ask whether that variation makes a measurable difference on the tasks chosen for evaluation.

#### Why there is something to transfer

The paper describes joint training across languages as an existing route to handling languages with moderate or low resources. In its account, multilingual BERT covered 104 languages, and XLM and XLM-RoBERTa continued this line of research. Previous work reported that sharing a training system across languages could help where training resources for an individual language were relatively limited. This gave the authors a plausible source of learned parameters for their Polish system. [Multilingual and cross-lingual NLP](https://md.research.elamur.ai/free/en/topics/multilingual-nlp/)

Adapting a multilingual system to Polish raises a practical issue. A vocabulary designed to cover many languages and a vocabulary built from Polish material can represent the same character sequence with different tokens. The main Transformer layers can be copied between compatible architectures, but the input vectors belong to specific vocabulary entries. The authors draw on prior work by Arkhipov and colleagues on adapting multilingual Transformers for language-specific named entity recognition. They test whether repairing the vocabulary mismatch and continuing pretraining on Polish offers a good starting point across a much broader set of tasks.

The question is different from simply comparing a multilingual release with a Polish release. A direct comparison can tell a reader which complete system works better on an evaluation. The controlled question asks what happens when the Polish architecture, text and training schedule are shared, and the starting parameters change. That comparison is what lets the authors assess the value of reusing a checkpoint alongside the value of the other changes they investigate.

### The method, step by step

#### Assemble the Polish training text

The authors create two nested training collections. Small contains the sources they regard as highest quality. Its National Corpus of Polish, or NKJP, brings together several kinds of writing as well as transcribed conversations. Wikipedia supplies encyclopedia articles. Wolne Lektury adds public-domain books and poetry. The collection therefore has some variety even before the authors add text from outside these sources.

Large keeps the Small material and adds Polish text from webpages and subtitles. The web material comes from [CCNet](https://md.research.elamur.ai/free/en/papers/wenzek-2020-ccnet-extracting-high-quality-monolingual/), which extracts monolingual text from Common Crawl. The subtitles come from the Polish portion of a multilingual corpus of film and television subtitles. A parallel corpus contains corresponding material in several languages. Here the authors use its Polish portion for monolingual pretraining. [OpenSubtitles2016](https://md.research.elamur.ai/free/en/papers/lison-2016-opensubtitles2016-extracting-large-parallel-corpora/)

The paper describes Large as over five times the size of Small and treats the added sources as lower quality than the core material. It is therefore a comparison between realistic collections that differ in both size and content. The added sources expand the range of text and the amount of it available. They also change what contributes to any result attributed loosely to a larger corpus. The pretraining procedure can use either collection, while the final HerBERT recipe uses Large.

#### Decide how text becomes input

The system needs a vocabulary of units it can look up. The authors learn a 50k-token vocabulary using [byte-pair encoding](https://md.research.elamur.ai/free/en/papers/sennrich-2016-neural-machine-translation-rare-words/). BPE learns which adjacent pieces can be merged, allowing a sequence to become a larger vocabulary entry. When a written form lacks an entry of its own, it can still be represented by a sequence of available pieces. A token in this procedure is one of those input units. Depending on the form and the learned vocabulary, a token can cover a whole word or just part of it.

The tokenizer is trained on the annotated subset of NKJP and on Wikipedia. This stage has a narrower source selection than the final pretraining run. The selected material helps determine which units acquire their own vocabulary entries. Pretraining on the Large corpus then uses those entries to represent material from a broader set of sources. A specialist vocabulary and a larger collection of training text are therefore separate parts of the design.

With BPE-Dropout enabled, the tokenizer can skip a merge that would otherwise be applied. The authors set the probability of dropping a merge to 10%. Skipping a merge gives the system a chance to encounter a form as smaller pieces. The procedure acts on how the input is split. It uses the learned vocabulary and offers different representations of a written form across training examples. The experiment tests whether this sort of variation helps the learned representations perform later tasks.

#### Choose the architecture and move the weights

The authors use the original BERT architecture configurations. BASE has 12 layers, 12 attention heads, and a hidden dimension of 768. LARGE has 24 layers, 16 attention heads, and a hidden dimension of 1024. Here a layer is a stage of processing. Attention heads give a layer several ways to use surrounding positions when building a representation, and the hidden dimension is the width of the internal representation at a position. Each of the two released sizes has its own compatible initialization.

For the transfer, the authors begin with the weights from XLM-RoBERTa. These are the numerical parameters learned during its earlier training. The compatible layer weights can be copied directly. Word embeddings and token type embeddings need separate treatment. Word embeddings are the vectors indexed by the vocabulary. Token type embeddings provide input information about which segment a token belongs to. XLM-RoBERTa has no token type embeddings, so the authors take those from the original BERT.

The vocabulary transfer is performed entry by entry. For a token present in both vocabularies, the authors use the existing XLM-RoBERTa word embedding. For an entry unique to the target vocabulary, they split it into units that the source can represent and take the average of the corresponding embeddings. Averaging lets the target enter Polish pretraining with a vector for each entry, including an entry whose exact string had no vector of its own in the source. A direct match has the stronger guarantee that its vector is carried over as is. A vector formed from pieces is an approximation that the continuing training can revise.

The comparison condition uses the same kind of Polish system with randomly initialized weights. Random initialization supplies no learned representation from XLM-RoBERTa. By including this condition, the authors can ask how much the multilingual starting point contributes before further pretraining and how much of an advantage it retains after the same Polish pretraining budget. The original XLM-RoBERTa also serves as a reference for what happens when the source is evaluated with its own vocabulary intact.

#### Train on missing words and sentence relationships

Masked Language Modelling, abbreviated MLM, supplies the main training signal. In the authors’ version, the masked positions cover the tokens belonging to a single word. Consider a word that has been split into several pieces. With masking performed piece by piece, some of its spelling could remain visible while the system predicts the hidden piece. Masking the pieces together makes the surrounding text carry more of the information needed to recover the word. The paper draws on related masking choices in SpanBERT and [CamemBERT](https://md.research.elamur.ai/free/en/papers/martin-2019-camembert-tasty-french-language-model/).

The optional signal is the Sentence Structural Objective, abbreviated SSO. It asks the system to distinguish a preceding sentence, a following sentence, and a random sentence. The labels for this auxiliary task come from how the training examples were constructed. Masked prediction gives practice using context to infer missing tokens. SSO gives practice identifying the relationship between parts of the input. The paper tests how strongly the second activity should influence the same trainable parameters.

```
ℒ = ℒₘₗₘ(θ) + α · ℒₛₛₒ(θ)
```

ℒ is the total loss minimized during pretraining. ℒₘₗₘ is the loss for masked language modelling, and ℒₛₛₒ is the loss for the Sentence Structural Objective. The subscripts identify the two objectives. θ denotes the trainable parameters, and the parentheses show that each loss depends on those parameters. α is the weight on the sentence objective. The multiplication dot applies that weight to the SSO loss, and the plus sign combines the weighted term with the masked-prediction loss.

The authors compare α settings of 0.0, 0.1, and 1.0. At 0.0, only the masked-prediction term contributes to the loss. At 0.1, the sentence term has a smaller coefficient. At 1.0, both terms have the same coefficient. Equal coefficients specify how the two losses enter the objective. Their actual influence on an update also depends on how each loss responds to the current parameters. The final releases use 0.1.

From Polish training text to HerBERT The steps in order.

#### Set the pace of training

The standard run for the ablation study uses BASE initialized from XLM-RoBERTa and trains for 10k iterations, unless the condition calls for a change. The batch size is 2560. A batch is the group of training examples used for an update. For the standard run, the learning rate peaks at 7 · 10⁻⁴ after a warm-up of 500 iterations and follows a linear decay schedule. The learning rate controls the scale of an update. Warm-up increases it early in training, and decay reduces it as training progresses.

The final BASE and LARGE releases start from XLM-RoBERTa, use the Large corpus, and train with whole-word masking and the lightly weighted sentence objective. They use the 10% BPE merge-drop probability where BPE-Dropout is enabled. Both sizes train with a batch of 2560. The schedules diverge in length and in how the authors change the step size during the run.

For BASE, the authors use [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) to update the parameters. Its β₁ setting is 0.9 and its β₂ setting is 0.999. These control how the optimizer retains recent information about gradients and squared gradients, respectively. Its numerical stability term, ε, is 10⁻⁸. The learning rate peaks at 3 · 10⁻⁴ and decays linearly. The authors retain a warm-up of 500 iterations, which they motivate by the fact that the starting weights have already been trained. BASE pretraining runs for 50k iterations.

LARGE runs for 60k iterations. During the first 15k, the learning rate falls linearly from 3 · 10⁻⁴ to 2.5 · 10⁻⁴. When the evaluation metrics level off, the authors lower the rate to 1 · 10⁻⁴. After another 25k steps, the rate reaches 7 · 10⁻⁵ and the metrics reach another plateau. They then lower the rate to 3 · 10⁻⁵ and train for 20k steps as it decays to zero.

In that last LARGE phase, the authors turn off BPE-Dropout and the dropout inside the Transformer, citing ALBERT. The two uses of dropout act in different places. BPE-Dropout changes how a piece of text is segmented. Transformer dropout interrupts parts of the internal computation during training. The schedule for LARGE changes both along with the learning rate, so the final result represents the full schedule. The paper reports releasing the resulting HerBERT weights.

### Experiments and results

#### What the evaluation asks the system to predict

The paper uses KLEJ as its broad test of Polish language understanding. KLEJ brings together nine tasks that return a category or a numerical prediction. The tasks differ in what the system has to identify, even when the prediction format is shared. A high score means performance across this particular collection of decisions. The average is an aggregate of task scores, so interpreting it starts with understanding what the collection covers. [Evaluation and benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/)

NKJP-NER tests the classification of named entities. This puts focus on the identity and category of a mention. The CDSC tasks examine relationships between texts. CDSC-R measures semantic relatedness, while CDSC-E asks for an inference judgment. Relatedness concerns how close the meanings are. An inference judgment asks how the information in one text bears on what is asserted in another. Keeping these as separate tasks allows performance on one kind of comparison to differ from the other. [Named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/) · [Semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/)

CBD tests cyberbullying detection. The sentiment portion comprises PolEmo2.0-IN, PolEmo2.0-OUT, and AR. Each contributes its own score to the benchmark. Czy wiesz? supplies the [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/) task, and PSC supplies a text similarity task. Since KLEJ frames all its tasks as classification or regression, the question answering result measures the form of the task that KLEJ defines. The benchmark average expresses how a shared pretrained system adapts to these different targets. [Text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/) · [Sentiment and emotion](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/)

The authors complement KLEJ with tagging and parsing because a classification or regression score gives limited information about representations at individual positions. A part-of-speech tagger has to assign a grammatical category at each evaluated position. A dependency parser has to recover connections among words and label the relations those connections represent. The two tasks ask more directly about the usefulness of information associated with each word in context. They also probe different aspects of it. A grammatical category is a property assigned to a word, while a dependency annotation additionally specifies its relation to another word.

#### KLEJ test results

The comparison includes XLM-RoBERTa, the multilingual initialization source, and Polish RoBERTa, a strong Polish system. The leaderboard also listed XLM-RoBERTa-NKJP, a version adapted further on NKJP. The authors report that its average matched Polish RoBERTa’s and that its weights were unavailable for their evaluation. Polish RoBERTa therefore serves as the available comparator with the same aggregate leaderboard score as that unavailable system. Equal averages leave room for different strengths on individual tasks.

The KLEJ test results are reported from five runs, using median values. The paper gives the average across the tasks and reports that both HerBERT sizes significantly outperform the corresponding Polish RoBERTa and XLM-RoBERTa variants on that average. The improvement over the previous best test result is 0.7 percentage points for BASE and 0.9 percentage points for LARGE. Each improvement is relative to the previous result for its architecture class.

HerBERT gains over the previous best KLEJ test average by architecture size Both HerBERT sizes improve the benchmark average, with the larger gain in the LARGE comparison.

**The numbers**

| System or setting | percentage points |
| --- | --- |
| HerBERT BASE (this paper) | 0.7 |
| HerBERT LARGE | 0.9 |

On the component tasks, BASE leads on eight out of nine comparisons, counting a tie on PolEmo2.0-OUT. CDSC-R, the semantic relatedness task, is the exception. LARGE leads on seven out of nine comparisons, counting a tie on PolEmo2.0-IN. It trails the best score on CDSC-E and PSC. These task counts describe comparisons within the two architecture sizes. They answer a different question from which size gets the stronger overall average.

CDSC-E is also an exception to the usual pattern when comparing sizes within a family. HerBERT BASE does better than HerBERT LARGE on this inference task, and the authors observe the same pattern for Polish RoBERTa. XLM-RoBERTa behaves differently on that task. On the other KLEJ tasks, the authors report an advantage for the larger architectures. The benchmark evidence thus favors HerBERT LARGE on the overall average, while the inference result shows that the size ordering can depend on the prediction being evaluated.

The efficiency comparison concerns the training behind those scores. The authors characterize the Polish training as around ten times shorter than for Polish RoBERTa. Their concrete comparison for BASE is a batch size of 2560 and 50k steps for HerBERT, against 8000 and 125k steps for Polish RoBERTa. The numbers describe the update schedule and the amount of material processed per update in the corresponding runs. HerBERT enters that schedule with parameters already learned by its multilingual source. The practical result is a stronger Polish benchmark average after fewer additional training steps and with a smaller batch.

#### Part-of-speech tagging on NKJP

The tagging data come from the manually annotated subset of NKJP after conversion to the CoNLL-U format. Here the system’s grammatical labels can be compared against human annotations. The authors report test-set accuracy and F1-Score as median values across five runs. Accuracy concerns the share of correct predictions. F1 combines precision and recall, and the paper’s comparison reports improvements in both accuracy and F1 without needing to infer one from the other. [Linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/)

HerBERT BASE leads Polish RoBERTa, the runner-up, by 0.33 percentage points in test accuracy and 0.35 percentage points in test F1-Score. The reported LARGE margins are 0.09 percentage points in test accuracy and 0.12 percentage points in test F1-Score. The authors report that these improvements are statistically significant. The margins in the LARGE comparison are small, so the result is best read as a measured lead on this evaluation. The report here uses the differences the authors give in their discussion of the tagging results.

The tagging result extends the case for HerBERT beyond assigning labels or scores to the units used in KLEJ. Tagging requires the system to recover a type of grammatical information at each position. At the same time, the evidence comes from a particular annotated test set and label scheme. Its contribution is to show what the pretrained representations can support in that setting, alongside the higher-level decisions assessed in the benchmark.

#### Dependency parsing on the Polish Dependency Bank

For parsing, the authors use the Polish Dependency Bank from [Universal Dependencies](https://md.research.elamur.ai/free/en/concepts/universal-dependencies/), release 2.5. The gold-standard segmentation is preserved. This means that the evaluation supplies the reference units over which the syntactic relations are predicted. It tests the attachments and their labels under that segmentation. The reported test results are median values across three runs.

The unlabeled attachment score, UAS, asks whether a word is linked to the right syntactic head. The labeled attachment score, LAS, also requires the predicted relation to have the right label. A correct head with an incorrect relation type therefore helps UAS while failing the LAS criterion. Reporting both scores gives information about whether a difference concerns the general structure, the labeled analysis, or a combination of the two.

Alongside the Transformer systems, the parsing evaluation includes a system without pretrained embeddings and a system using static fastText embeddings from Common Crawl. A static vector is attached to a vocabulary item without being recomputed for its sentence context. The authors describe a gap of around 3 percentage points in UAS and 4 percentage points in LAS between the static fastText system and the Transformer systems. Those figures characterize the reported test comparison. They are separate from the smaller distinctions within the Transformer group.

Polish RoBERTa performs best on parsing. The LARGE Transformer systems outperform the BASE systems, and HerBERT generally comes last among the Transformer alternatives. The exception is BASE UAS, where HerBERT scores slightly ahead of XLM-RoBERTa. This pattern matters for interpreting the KLEJ and tagging results. A pretraining recipe can support very good identification of grammatical categories and still yield a weaker dependency analysis than another recipe. The paper’s broader conclusion credits HerBERT with the best results on eight of the eleven evaluated tasks. The parsing test supplies a clear qualification to that broad record.

### What the ablations show

#### How the comparisons were made

The authors use a common evaluation procedure for the ablations so that the source of a difference is easier to locate. Their outcome is an average KLEJ validation score. KLEJ has six tasks with validation sets, so the ablation outcome covers those tasks. The final test average spans all nine tasks. A value in the ablation study therefore answers how a variant fared on the available validation sets under the study’s protocol. The full benchmark result answers a broader test-set question.

The authors run each comparison five times and report the result corresponding to the median. They use Welch’s t-test at a threshold of 0.01 to assess differences between experimental variants. The observed scores indicate the direction and size of the differences. The statistical comparisons address the evidence for a difference given the variation across runs. Both matter in this study because some settings produce slightly higher reported scores while the evidence from repetitions remains inconclusive.

#### Starting weights had the clearest effect

The first comparison asks what the starting weights yield before any extra Polish pretraining. The randomly initialized BASE system, fine-tuned directly on the KLEJ tasks, scores 58.15 on the validation average. The converted system initialized from XLM-RoBERTa scores 83.15. The original XLM-RoBERTa, evaluated without conversion to the new vocabulary, scores 88.82%. Together, these results place the vocabulary-adapted initialization between a fresh start and a pretrained source that still has all its original input representations.

The authors interpret the gap from the original source as a cost of converting the tokenizer and its associated embeddings. The comparison is consistent with that explanation. A shared token can retain the original representation, while a new token initialized from an average begins with an estimate. More generally, the adapted system changes its input segmentation and receives a separate set of token type embeddings. The reported scores measure the adaptation as a whole. They give no token-level estimate of how much information is preserved by the average in cases where it is used.

The more direct test of the training recipe compares initialization schemes after 10k iterations on Large. Both schemes use a sentence-objective weight of 1.0, and the authors test the comparison both with and without BPE-Dropout. With dropout in tokenization, the transferred system scores 89.10 and the randomly initialized system scores 85.78 on the KLEJ validation average. With it disabled, their respective scores are 88.80 and 85.65. In each of these conditions, the authors report a significant advantage for multilingual initialization.

Initialization and BPE-Dropout on the KLEJ validation average after 10k steps on Large Multilingual initialization has the stronger validation score with either tokenization setting.

**The numbers**

| System or setting | KLEJ average score |
| --- | --- |
| Random initialization, BPE-Dropout off | 85.65 |
| Random initialization, BPE-Dropout on | 85.78 |
| XLM-RoBERTa initialization, BPE-Dropout off | 88.80 |
| XLM-RoBERTa initialization, BPE-Dropout on (this paper) | 89.10 |

After those updates, the authors find that the transferred variants are statistically indistinguishable from the original XLM-RoBERTa under this evaluation. This is the evidence behind their claim that the system can recover quickly after changing vocabularies. The learned starting point retains an advantage over random initialization at a common training budget. It also reaches the range of the original multilingual source on the validation tasks even though the new word embeddings and input segmentation had initially lowered the score.

These comparisons are particularly informative for a decision about short pretraining runs. If a system starts with random weights, its Polish updates first have to develop representations that a multilingual checkpoint can already supply in some form. After transfer, the same updates can adjust those representations to the Polish input and data. The experiment observes the resulting difference on tasks. It leaves open how much additional training would allow the randomly initialized system to catch up.

#### The larger collection helped under specific conditions

The size comparison trains BASE for 10k iterations on either Small or Large and varies the SSO weight and use of BPE-Dropout. Varying these accompanying choices lets the authors see whether a corpus advantage holds across several versions of the training recipe. The reported direction favors Large, but the difference is statistically significant only with an SSO weight of 1.0 and BPE-Dropout enabled. The study therefore supplies limited evidence for an advantage that carries across settings.

There is also a distinction between having access to a larger collection and running more updates. The corpus experiment gives the systems the same number of iterations. A larger collection changes the pool of examples available to the training procedure, while the batch size and iteration count still determine the structure of the run. The findings show how the two collections compare within that budget. Training for longer on each collection would answer a further question about how their value changes as more of their contents become available to the learner.

Small and Large also differ by design in the sources they include. Adding web material and subtitles can supply forms and contexts that occur less often in the core collection. It also adds text the authors judge to be lower quality. The comparison gives the joint result of increasing the collection in that particular way. It supports the authors’ decision to use Large as a plausible final setting while leaving the independent value of corpus size uncertain.

#### Sentence supervision and variable segmentation

To study the sentence objective, the authors train BASE for 10k iterations with BPE-Dropout and compare weights of 0.0, 0.1, and 1.0 across the tested setups. Enabling the sentence objective can reduce downstream task performance. The authors report significant detrimental differences in two out of three setups. The Large condition with BPE-Dropout is the one in which the adverse effect fails to reach significance. A weight of 0.1 gives the best observed scores overall, but its differences from omitting SSO are statistically inconclusive.

This is a test of whether the extra training signal transfers to the chosen tasks. It leaves open how well the system learned the actual previous, following, or random sentence decision. A system may learn useful information about that decision, yet the resulting changes in its parameters need to improve the external evaluation to justify the objective on those grounds. The paper finds evidence against the stronger use of SSO and weak evidence for any advantage at the smaller weight. It retains the small weight in the final recipe.

The BPE-Dropout comparison toggles whether the tokenizer can skip merges. In the initialization experiment, the reported averages move upward with BPE-Dropout for both the random and transferred runs. In the broader analysis, no reported dropout difference reaches statistical significance. That distinction explains how the paper can describe a favorable direction in some configurations while concluding that it found no dependable downstream gain. The setting tested uses the authors’ 10% probability and their Polish tokenizer.

One motivation for checking both starting points is that the transferred embeddings already contain information before exposure to the Polish training corpus. With random initialization the sub-word vectors have to learn from the training examples themselves. If variation in segmentation helped one starting point much more than the other, that would matter for deciding where to use it. The validation results give weak evidence for an effect under either scheme. They support a restrained conclusion about the tested settings, even though the released recipe uses BPE-Dropout during part or all of pretraining, depending on size.

#### Longer training needed a different schedule

Changing the number of iterations changes the shape of a linearly decaying learning-rate schedule. With more iterations, the rate declines over a longer period. The longer run can thus spend a different amount of its beginning at relatively large step sizes. The authors report that early attempts to extend training with the same learning rate collapsed, so they searched for a rate at which the loss after 10k steps was similar. They found that 3 · 10⁻⁴ worked best for the 50k-step schedule.

The duration comparison uses BASE on Large with BPE-Dropout. The authors test SSO weights of 1.0 and 0.1 and obtain small, statistically significant validation improvements with the longer schedule at both weights. This demonstrates a benefit from continuing the training under the adapted schedule. The extended recipe changes the learning rate along with the number of iterations, so the effect is for those changes together.

The duration result and the initialization result also apply to different decisions. The duration result says that an already adapted system could improve a little further with a longer run. The initialization result shows that, under the same short budget, the choice of starting weights can have a substantial effect on the validation average. That is why the paper emphasizes multilingual transfer when explaining the efficiency of the procedure, even though the released systems are trained for longer than the short ablation runs.

### Limitations

#### Limits the authors identify

The authors explicitly distinguish the ablation scores from the final KLEJ scores. The validation comparison covers six tasks, and the test benchmark covers nine. Those aggregates can behave differently because the evaluation examples and task coverage differ. A setting that looks strong in the short validation runs has evidence in that narrower setting. Its standing on the full test average has to come from the final evaluation.

The paper also describes a limit to its account of corpus size. A significant result appears in only the tested condition with the strong SSO weight and BPE-Dropout. Its discussion of BPE-Dropout likewise separates the direction of some score changes from the lack of statistically significant differences. For SSO the observed advantage at the small weight remains inconclusive relative to leaving it out. These qualifications are essential to reading the training recipe. A setting can be part of the joint recipe used for the release even when the experiments give only weak evidence for its independent contribution.

The authors note that XLM-RoBERTa-NKJP was unavailable to them. Its KLEJ leaderboard average equaled that of Polish RoBERTa, which gives the paper an available comparison at the same reported aggregate level. The missing system’s task-by-task scores under the authors’ evaluation procedure, as well as its performance on tagging and parsing, remain outside the direct comparisons. The paper is also clear about the outcome of the parsing test. Polish RoBERTa retains the lead there, despite HerBERT’s gains on the other evaluations.

The tokenizer conversion is another qualified result in the paper. The authors observe a drop when adapting from the original multilingual system and attribute it to the transfer retaining much of the learned information with some loss. Further Polish pretraining recovers benchmark performance to the range of the source system. The recovery concerns the measured validation average. Information that matters to other tasks or to particular classes of tokens may behave differently.

#### Limits visible in the experimental design

Most controlled comparisons are carried out with BASE, and much of that evidence comes from 10k-step runs. LARGE follows a different schedule, with several changes chosen as evaluation metrics plateau. Its final phase changes the learning rate and disables both kinds of dropout. The final scores establish the performance of that joint procedure. Isolating the effect of a specific change late in LARGE training would require matched runs in which that change alone was varied.

The same caution applies to the headline efficiency comparison. The reported number of steps and batch sizes make clear that HerBERT needs a smaller subsequent Polish training run in the comparison with Polish RoBERTa. The multilingual checkpoint itself carries the benefit of an earlier training run. From the perspective of a practitioner who has access to that checkpoint, the subsequent cost is the relevant quantity. From the perspective of accounting for all computation that produced the final weights, the cost of obtaining the checkpoint would also belong in the accounting. The reported batch sizes and iteration counts establish the former advantage without quantifying the latter total.

The paper tests one multilingual source for this procedure. The comparison shows that reusing XLM-RoBERTa is effective relative to the random starting point studied here. It gives less information about the importance of the particular multilingual training mixture, how much of the benefit comes from representations already learned from Polish, and how another multilingual checkpoint would compare. Likewise, transferring the contextual layers and repairing the vocabulary happen together. The initialization advantage does not separately estimate the contribution from copying the layers, copying exact token matches, or averaging unmatched pieces.

There is also a limit to what the difference between English and Polish can explain. The authors motivate their study by pointing to a typological difference and to the English focus of earlier work. Their experiments evaluate a bundle of choices in Polish with Polish evaluation sets. Identifying the linguistic reason that a result differs from an earlier report would require closer control over the language, data, tokenizer and evaluation procedures. The findings justify checking these choices in the language of interest. The particular cause of the cross-study difference remains open.

The tagging and parsing evaluations each use a named annotated resource. For parsing, gold-standard segmentation is already supplied. As a result, the measurements focus on assignment of grammatical categories and on syntactic attachments under the paper’s evaluation conditions. Their bearing on an end-to-end system that has to identify its own units from raw text is a further empirical question. KLEJ broadens the range of measured skills, with the scope set by its classification and regression tasks. Taken together, the evaluations give evidence for a versatile Polish starting point and also show how much the answer to “which system performs best?” depends on the task.

### What came after

Later work cites HerBERT in several areas of Polish language technology and in research on transferring systems across languages. The relationship varies by study. Some titles point to a direct continuation of the question about adapting pretrained systems. Others point to new tasks, benchmark formats, or resources. The specific outcomes reported for HerBERT concern its training procedure and its own evaluations, so the later work is best understood in terms of the questions each study takes up. A citation establishes a connection to that research. A claim that a later system reused the HerBERT weights or its vocabulary procedure would require more detail about that study’s setup.

The evaluation of Polish transfer learning with a text-to-text system takes up the broad question of what can be reused across Polish tasks in a different formulation. HerBERT starts with contextual representations and adapts them to particular evaluations. A text-to-text formulation casts tasks in terms of textual inputs and outputs. The connection is the role of a shared pretrained starting point. The change in format shifts attention to how different task outputs can be represented within one approach. [Evaluation of Transfer Learning for Polish with a Text-to-Text Model](https://md.research.elamur.ai/free/en/papers/chrabrowa-2022-evaluation-transfer-learning-polish-text/)

Work on Swedish takes up the resource question in another language. Its stated comparison examines the efficacy of English and multilingual large language systems for Swedish. The HerBERT paper asks how to make a Polish system by adapting a multilingual one. The Swedish work poses a related question about which existing systems can serve a target language, with English and multilingual alternatives as the stated focus. The connection concerns the choice of a source as a way to address a resource gap. [Bridging the Resource Gap](https://md.research.elamur.ai/free/en/papers/holmstrom-2023-bridging-resource-gap-exploring-efficacy/)

Two other citing works focus on cross-language methods for more specific predictions. ÚFAL CorPipe studies multilingual systems for [coreference resolution](https://md.research.elamur.ai/free/en/concepts/coreference-resolution/), which concerns identifying mentions that refer to the same entity. That is a different test of representations from deciding the class or relatedness of a text pair. Team JAT’s polarization detection work explicitly combines cross-lingual transfer with feature fusion. Where HerBERT’s ablation changes the source of initial weights for a general Polish system, the polarization study puts transfer in the service of a named detection task and pairs it with the combination of features. [ÚFAL CorPipe at CRAC 2022](https://md.research.elamur.ai/free/en/papers/straka-2022-fal-corpipe-crac-2022-effectivity/) · [Team JAT at SemEval-2026 Task 9](https://md.research.elamur.ai/free/en/papers/matkowska-2026-team-jat-semeval-2026-task/)

The work on Polish [information retrieval](https://md.research.elamur.ai/free/en/topics/information-retrieval/) changes what makes a representation successful. A retrieval system must order candidate texts so that relevant material can be found. PIRB builds a benchmark of dense and hybrid methods for this setting. BEIR-PL focuses on zero-shot retrieval, bringing forward the question of what a method can do on a target evaluation without training on that target task. Both continue the effort to create Polish evaluations, with a ranking decision in place of the classifications and numerical predictions in KLEJ. [PIRB](https://md.research.elamur.ai/free/en/papers/dadas-2024-pirb-comprehensive-benchmark-polish-dense/) · [BEIR-PL](https://md.research.elamur.ai/free/en/papers/wojtasik-2024-beir-pl-zero-shot-information/)

Silver Retriever turns to the retrieval of passages for Polish question answering. Finding a passage and answering a question from relevant material are distinct operations. A question answering task on an understanding benchmark gives one view of a pretrained system’s behavior. A passage retrieval study gives attention to the earlier decision about which text the answering system should receive. PL-MTEB broadens evaluation around text embeddings, the vectors used to represent pieces of text. It takes up the evaluation of Polish representations at the text level, complementing the interest in token-level representations that motivated HerBERT’s additional tagging and parsing tests. [Silver Retriever](https://md.research.elamur.ai/free/en/papers/rybak-2024-silver-retriever-advancing-neural-passage/) · [PL-MTEB](https://md.research.elamur.ai/free/en/papers/poswiata-2026-pl-mteb-polish-massive-text/)

Several citing studies define more narrowly focused material for investigating Polish. MIPD examines manipulation and intention in a corpus of Polish disinformation. The preliminary study of persuasion techniques considers Polish and Russian online news. Their task descriptions distinguish those forms of analysis from the broad sentiment and cyberbullying tasks in KLEJ. For such work, the phenomena included in the data and the judgments assigned to them shape what success means. A general Polish benchmark score gives only indirect evidence about any of these specialized distinctions. [MIPD](https://md.research.elamur.ai/free/en/papers/modzelewski-2024-mipd-exploring-manipulation-intention-novel/) · [On Experiments of Detecting Persuasion Techniques](https://md.research.elamur.ai/free/en/papers/nikolaidis-2023-experiments-detecting-persuasion-techniques-polish/)

The forePLay study creates and investigates an annotated dataset for Polish erotic discourse, extending the range of Polish language use addressed in the citing work. The Corpus of Contemporary Polish contributes a reference corpus with rich syntactic annotation. The latter is closest in subject to the token-level grammatical evaluations in HerBERT. A syntactically annotated corpus supplies analyses to study and evaluate, while the HerBERT paper supplies an attempt to learn representations that support such predictions. Alongside the retrieval and transfer studies, these corpus projects show how later work changed the data or evaluation question around Polish language technology. The result inherited from HerBERT is a concrete point of comparison about the value of multilingual initialization under a short Polish training budget. [Behind Closed Words](https://md.research.elamur.ai/free/en/papers/kolos-2025-behind-closed-words-creating-investigating/) · [The Corpus of Contemporary Polish](https://md.research.elamur.ai/free/en/papers/kieras-2026-corpus-contemporary-polish-new-reference/)

## Cite

Cite as Robert Mroczkowski, Piotr Rybak, Alina Wróblewska and Ireneusz Gawlik. 2021. HerBERT: Efficiently Pretrained Transformer-based Language Model for Polish. Proceedings of the 8th Workshop on Balto-Slavic Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. [arXiv 2105.01735](https://arxiv.org/abs/2105.01735)

```bibtex
@inproceedings{mroczkowski2021herbert,
  title = {{HerBERT: Efficiently Pretrained Transformer-based Language Model for Polish}},
  author = {Robert Mroczkowski, Piotr Rybak, Alina Wróblewska and Ireneusz Gawlik},
  booktitle = {Proceedings of the 8th Workshop on Balto-Slavic Natural Language Processing},
  year = {2021},
  eprint = {2105.01735},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.01735}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
