---
title: "Czert – Czech BERT-like Model for Language Representation"
description: "Czert tests whether pretraining on Czech text improves BERT and ALBERT across tasks such as sentiment analysis, tagging, and text similarity."
canonical: "https://research.elamur.ai/free/en/papers/sido-2021-czert-czech-bert-like-model/"
---
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/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/sido-2021-czert-czech-bert-like-model/)

[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/) / Czert – Czech BERT-like Model for Language Representation

# Czert – Czech BERT-like Model for Language Representation

Paper · 2021 · Jakub Sido, Ondřej Pražák, Pavel Přibáň et al.

**Authors:** [Jakub Sido](https://md.research.elamur.ai/free/en/authors/jakub-sido/), [Ondřej Pražák](https://md.research.elamur.ai/free/en/authors/ondrej-prazak/), [Pavel Přibáň](https://md.research.elamur.ai/free/en/authors/pavel-priban/), Jan Pašek, Michal Seják and [Miloslav Konopík](https://md.research.elamur.ai/free/en/authors/miloslav-konopik/) · **Year:** 2021 · **Venue:** Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.ranlp-1.149/)
- [PDF](https://aclanthology.org/2021.ranlp-1.149.pdf)

## Summary

A system that has learned from text in many languages can already be adapted to Czech. The question is how much it gains when its initial training is devoted entirely to Czech. Czert investigates that question by building two Czech [language models](https://md.research.elamur.ai/free/en/concepts/language-model/) and testing how well they adapt to several kinds of work, from recognizing names in a sentence to judging whether two headlines express similar ideas. The authors compare the new systems with multilingual alternatives that already include Czech, as well as with a system that learns each task without first studying a large collection of text.

Czert-B uses the base [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) architecture, and Czert-A uses the smaller base [ALBERT](https://md.research.elamur.ai/free/en/papers/lan-2019-albert-lite-bert-self-supervised/) architecture. Both start from randomly initialized weights and learn from approximately 36 GB of Czech text drawn from the Czech National Corpus, Wikipedia, and news sites. During pretraining, they learn to recover selected tokens and to tell whether a sentence genuinely follows another. For the second exercise, the authors create misleading pairs from within the same paragraph. A shared topic can therefore appear in both genuine and misleading pairs. The authors then use [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) to adapt each pretrained system with labeled examples for the task at hand.

The clearest gains come from Czert-B on tasks that produce a judgment about a whole input. On the Facebook [sentiment](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/) test, it reaches an F1 score of 76.55, compared with 73.87 for the strongest multilingual system in that experiment. On Czech news document classification, it reaches an F1 of 85.06, ahead of the previous score of 84.7 cited for that corpus. Results for [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/) are more mixed. SlavicBERT leads on the Czech Named Entity Corpus, and its score is close to Czert-B’s on the other entity dataset. Czert-A gains from pretraining relative to its randomly initialized counterpart, but the smaller Czech system often trails the pretrained multilingual systems.

The paper’s conclusion credits Czert-B with beating the multilingual comparisons on 9 out of 11 datasets and reports new best results on 9 datasets across the study. Those claims cover different comparisons. The entity result on the Czech Named Entity Corpus, for instance, comes from the authors’ fine-tuning of SlavicBERT. The experiments establish the performance of a Czech training recipe that changes the text collection, vocabulary, and pretraining setup together. The authors make the pretrained and task-specific versions available for research.

## Deep dive: Czert – Czech BERT-like Model for Language Representation

Czert tests whether pretraining on Czech text improves BERT and ALBERT across tasks such as sentiment analysis, tagging, and text similarity. · about 33 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 train a system specifically for Czech?

A researcher building a Czech classifier can start with a small set of labeled examples and ask it to learn both how Czech text works and how to make the required decision. Transfer learning divides that work. A system first learns representations from a large body of text through an exercise for which the answers can be produced automatically. It then learns the decision on the labeled examples. Both a task that labels each word and one that assigns labels to a document as a whole can start from the same pretrained weights.

The authors were interested in what the starting point should be. A multilingual system lets a Czech application draw on an existing investment in pretraining. Its Czech text, however, forms part of a much broader collection. The authors had access to Czech text from sources beyond Wikipedia and wanted to know whether training on that collection could produce a stronger starting point for Czech. That question matters wherever the labeled data determine which task can be learned, while the supply of raw text determines how much language material can be studied in advance.

The benchmark design makes the question more specific. A system can improve a judgment about a document while making little difference to the task of identifying a person’s name. A Czech evaluation that used only one of those outputs would offer a correspondingly narrow answer. The paper therefore compares several kinds of language processing, with individual datasets within some tasks. The point is to observe which uses of the learned representations benefit under the same broad pretraining approach.

#### From vectors for words to representations of text in context

The paper traces its approach back to [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/), numerical representations that a downstream system can use in place of raw strings. It describes earlier work in which a word receives a representation independent of the particular sentence in which it appears. This gives the next system a numerical starting point for each word. The context for deciding how that occurrence functions still has to be supplied by the system that uses the vector. The paper cites work on distributed representations, global vectors, and sub-word information in this part of its account. [Distributed Representations of Words and Phrases](https://md.research.elamur.ai/free/en/papers/mikolov-2013-distributed-representations-words-phrases-their/) · [GloVe](https://md.research.elamur.ai/free/en/concepts/glove/) · [Enriching Word Vectors with Subword Information](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/)

Contextual representations move more of that work into the initial training. The representation for a particular occurrence of a word can depend on the other words around it. The paper discusses learned translation representations and deep contextualized word representations as developments along that line. It describes the resulting vectors as features that could be passed into another system trained for a specific job. [Learned in Translation](https://md.research.elamur.ai/free/en/papers/mccann-2017-learned-translation-contextualized-word-vectors/) · [Deep Contextualized Word Representations](https://md.research.elamur.ai/free/en/papers/peters-2018-deep-contextualized-word-representations/)

BERT and related systems made it possible to adapt a large pretrained network directly to the target task. Their common architectural foundation is the [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/). In a Transformer encoder, attention lets the representation at a position draw on other positions in the input. A classifier attached to a word can thus work with information from its sentence. When a pair of sentences enters the encoder as a single input, their tokens can also inform one another’s representations. The paper presents these pretrained encoders as effective across a range of tasks and emphasizes the increase in data and computation required to build them. [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/) · [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://md.research.elamur.ai/free/en/papers/raffel-2019-exploring-limits-transfer-learning-unified/)

#### The multilingual alternatives

The Czech options discussed in the paper include multilingual BERT, called mBERT, and SlavicBERT. mBERT was trained jointly on Wikipedia material from 104 languages. Its settings largely follow base BERT, with a larger vocabulary to accommodate the multilingual input. A user can start a Czech task from weights that already reflect exposure to Czech, alongside the text used for all the other languages in its training.

SlavicBERT narrows the multilingual collection to Bulgarian, Czech, Polish, and Russian. Its training text includes Wikipedia for those languages and a large Russian news collection. Its starting weights come from mBERT, and the paper describes its architecture and training procedure as following mBERT. The two systems therefore offer distinct comparisons. One spreads training across a large range of languages. The other concentrates on a related language group while inheriting the first system’s weights. In the authors’ account, the Czech portion of the pretraining text in both cases comes from Czech Wikipedia.

The paper places Czert among efforts to train for a single language. It points to prior findings for French, Finnish, and Romanian as reasons to examine how much a dedicated Czech system could gain. It also describes work for other languages, including Dutch. The authors frame these projects as evidence that pretraining for an individual language was a practical research direction, even with the substantial resource demands of training a Transformer encoder. [CamemBERT](https://md.research.elamur.ai/free/en/papers/martin-2019-camembert-tasty-french-language-model/) · [FlauBERT](https://md.research.elamur.ai/free/en/papers/le-2019-flaubert-unsupervised-language-model-pre/) · [BERTje](https://md.research.elamur.ai/free/en/papers/de-vries-2019-bertje-dutch-bert-model/)

#### Why build a compact version as well?

The authors also consider how much can be done with fewer trainable parameters. Base BERT has 12 layers, 12 attention heads, and a hidden size of 768, with 110M parameters. The layers transform the representations in successive stages. The attention heads provide separate ways of combining information across positions, and the hidden size is the width of the vectors processed inside the encoder. The larger BERT configuration illustrates what increasing those dimensions costs. The paper describes it as having 24 layers, 16 heads, a hidden size of 1024, and 340M parameters.

ALBERT offers a way to keep the internal representations wide while reducing the number of separately learned values. Its embedding table can use vectors of size 128 and project them into the larger space used by the encoder. It also shares parameter values across layers, so successive stages use the same learned weights. Base ALBERT has 12M parameters in the paper’s comparison. Building a Czech system with each architecture lets the authors examine the larger and smaller choices under a shared Czech data recipe. It also makes pretraining itself easier to evaluate for the compact configuration, since the study includes an ALBERT system trained from scratch on the labeled tasks alone.

### The method, step by step

#### Start with text that has some continuity

Czert’s initial training uses text from the Czech National Corpus, called CsNat, a Czech Wikipedia dump, called CsWiki, and a news collection the authors crawled, called CsNews. The Czech National Corpus contributes 28.2GB and 275,314,224 sentences. The Wikipedia dump, from May 2020, contributes 0.9GB and 6,964,794 sentences. Crawled news contributes 7.8GB and 58,979,893 sentences. The paper describes the overall collection as roughly 36 GB of plain text. The national corpus supplies the largest portion, and the news source adds substantially more Czech beyond the encyclopedia articles.

The relevant unit for the sentence exercise is a continuous block. The national corpus contains blocks of up to 100 tokens and presents them in random order. A block contains at least one sentence, so sentences within the block can supply examples of genuine succession. The first sentence of the next block has no established connection to the preceding block. Respecting the block boundary keeps the automatic label tied to the order that the corpus actually preserves.

This constraint affects the sources differently. The paper describes CsNat as averaging 5.6 sentences per continuous block, of which 4.6 can on average be used to start a pair with a successor. It puts the share unable to start such a pair at approximately 18%. The corresponding shares are 6% for Wikipedia and 4% for news. The difference follows from the frequency of boundaries. Every block has a final sentence, so a collection of short blocks has more final sentences relative to its total supply of text. In the paper’s corpus table, Wikipedia averages 15.48 sentences per block and news averages 22.47.

The continuity requirement shows why the choice of text and the choice of training objective have to be considered together. A sentence at the end of a block still contains words in context. Its position limits the use the authors can make of it for genuine next-sentence examples. Similarly, a block with very little text offers few alternatives when the training procedure seeks a misleading continuation from nearby. The paper reports the sentence and pair counts separately because they measure different things about the training material.

From Czech text to a task-specific Czert system The steps in order.

#### Represent the text with subword units

The authors prepare cased and uncased versions of the corpus. The cased version preserves distinctions between capital and lower-case letters. The uncased version removes those distinctions. They use WordPiece for [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/) and train the tokenizer on the full corpus. WordPiece gives the encoder a vocabulary whose units can include entire words and pieces of words. A word represented by several pieces becomes several positions in the encoder input.

A token count in the training schedule consequently refers to positions in the encoded sequence. A short piece of prose can need more positions than its count of space-separated words would suggest. The distinction also matters when the output has one label per word. If a word was represented by several pieces, the training setup needs a consistent way to decide which of their output vectors will stand for that word. The authors use the first piece for that purpose in their token classification setup.

The vocabulary also affects where the network uses its parameters. An embedding table needs a row for each vocabulary entry. A multilingual system with a larger vocabulary can therefore have more total weights even if it uses a similar encoder. The paper’s architecture comparison lists 120K vocabulary entries and 170M parameters for each multilingual baseline. Its table puts their embedding parameters at approximately 90M. Those totals are useful for understanding the systems being compared. They do not by themselves measure how much of each network’s learned representation is helpful on Czech tasks.

#### Create supervision from the text itself

The first exercise, masked language modeling, uses the same setup as BERT. The procedure chooses some input positions and asks the encoder to identify the tokens that originally occupied them. In the BERT proportions described by the authors, 15% of input tokens are selected for prediction. Among those selected positions, 80% are masked, 10% receive a random replacement, and 10% remain unchanged. The target in each case is the original token. The percentages for the three treatments describe portions of the selected positions, while the selection percentage describes the original input.

To see what the task demands, consider the information the encoder has at one masked position. Other positions may reveal which word form fits the surrounding sentence. A random replacement at another selected position can be an ordinary token, yet predicting the original still requires using the surrounding evidence. An unchanged selected token stays visible and contributes a prediction target as well. The same classification exercise covers all of these cases. The corpus supplies the answers automatically because the procedure begins with the original text.

The second exercise, next sentence prediction, uses a binary label for a pair. In the paper’s description, sentence A is the starting sentence and sentence B is the proposed continuation. A genuine pair takes B from the position immediately after A in a continuous passage. For a negative pair, Czert takes B from the same paragraph and excludes the actual successor. Original BERT drew its random continuation from the corpus as a whole. The Czert construction makes shared subject matter a less decisive clue because the two sentences in an incorrect pair can still be about the same thing.

ALBERT ordinarily uses sentence order prediction, which changes the ordering exercise. Czert-A uses the same modified next-sentence exercise as Czert-B. This choice gives the two Czech configurations a common set of pretraining objectives. The authors report 578,158,196 sentence pairs in the resulting training dataset. That count describes examples created for training. A pair can contain sentences already counted in the individual corpus statistics.

#### Train the compact and larger encoders

Czert-A uses base ALBERT with 12M parameters. It retains the smaller embedding representation and shared layer parameters of that architecture. Among the changes from standard ALBERT in the paper are WordPiece, a batch size of 2048 in the initial training phase, and the modified next-sentence objective. Czert-B uses base BERT with 110M parameters and also starts with a batch size of 2048. The authors initialize both networks randomly. That makes their training history different from SlavicBERT’s continuation from mBERT weights.

Both Czech systems use [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) with an initial learning rate of 1e-4 and linear decay. The learning rate governs the scale of adjustments during optimization. Linear decay makes that scale decrease according to a straight-line schedule as training proceeds. In the first stage, the authors make a pass through the dataset with input sequences limited to 128 tokens. They report 300K batches for that stage. The number of steps describes updates made with batches of examples, and the sequence limit describes the amount of text each example can contain.

The later stage increases the maximum sequence length to 512, allowing the network to train with longer input contexts. Its batch size falls to 256 to fit the cluster’s memory limits, and the authors report about 50K steps at that length. Most of the setup is thus described by a short-input training stage followed by a smaller number of updates with longer sequences. The batch reduction is part of making the longer setting feasible on the hardware available to the authors.

The cluster had 16 machines and a total of 32 NVIDIA Tesla T4 cards. The authors report that Czert-A took 12 days using TensorFlow’s distributed training over gRPC. For the run described for Czert-B, the appendix reports MPI communication over an OmniPath network rated at 100Gb/s, with [Horovod](https://md.research.elamur.ai/free/en/papers/sergeev-2018-horovod-fast-easy-distributed-deep/) handling synchronization. It gives a speed of 2400ms per batch for that setup and a total training time of 8 days for Czert-B. The timings describe training runs with different communication arrangements. Parameter counts alone therefore cannot explain the time each run took.

#### Read out the representation that the task needs

The authors organize the fine-tuning tasks by the part of the input that receives an answer. For [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/) at the sequence level, the encoder produces a pooled representation that summarizes the input for a prediction head. The authors add dropout and an output layer. Dropout temporarily suppresses some activations during training. The size of the output layer and the way its scores are used depend on what the labels mean. A sentiment decision chooses a polarity, while a news document can receive several categories simultaneously.

A sentiment classifier uses softmax, which turns scores for the candidate classes into a distribution over those classes. The target is the observed polarity, and cross-entropy gives the training procedure a penalty for assigning that target low probability. A document classifier uses sigmoid outputs, so each label receives its own score. Binary cross-entropy supplies a penalty for each of those yes-or-no decisions. Documents in this setup are represented by their opening tokens up to the limit of 512. This choice gives the encoder a uniform input bound and makes the position of a topic cue in the document relevant to whether it can be used.

For judgments about sentence pairs, the two sentences enter together with the special separator token `[SEP]` between them. Because both are in the same encoder input, attention can relate tokens across the boundary. The authors use this setup for [semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/). The output layer has one unit and supplies a numerical prediction without an activation on that output. Mean squared error penalizes the squared discrepancy between the prediction and the human rating. The exercise is thus set up as prediction of a score, even though the paper puts it in the sequence-pair classification family. Its reported evaluation then examines how those predictions correlate with the ratings.

For word-level judgments, the prediction head uses the contextual vector associated with each word. The encoder also receives special input tokens such as `[CLS]` and `[SEP]`. The authors exclude their outputs from ordinary word labeling. They use the first sub-word vector when WordPiece divides a word, and they train the task-specific layer with cross-entropy. In all the tasks, newly added layers start with random weights. The pretrained encoder supplies the initial representations, and the labeled examples determine how those representations should be used and adapted.

#### Show the encoder which predicate is being analyzed

[Semantic role labeling](https://md.research.elamur.ai/free/en/concepts/semantic-role-labeling/) uses a more specialized input. The task describes the connection between a predicate and its arguments. A predicate is represented by a word, and an argument can be a word or a phrase. The label is relative to a specified predicate. A sentence may contain multiple predicates, so supplying the sentence alone would leave the intended relationship underspecified.

The authors adopt an input design inspired by the work of Shi and Lin. They tokenize the sentence with WordPiece and place a `[CLS]` token and the predicate’s token or tokens after the sentence. The appended predicate tokens keep the position identifiers of their occurrences inside the sentence. They receive different segment identifiers, which contribute a distinct embedding indicating where that copy belongs in the input arrangement. The encoder can use the copy to identify the predicate under consideration while retaining its original position information. [Simple BERT Models for Relation Extraction and Semantic Role Labeling](https://md.research.elamur.ai/free/en/papers/shi-2019-simple-bert-models-relation-extraction/)

#### Specify the choices searched during fine-tuning

The paper describes the major objectives and losses in words. Its explicit mathematical notation appears in the fine-tuning settings. For sentiment, it gives the default Adam parameters as follows.

```
β₁ = 0.9
```

Here `β₁` is the decay coefficient for the optimizer’s running average of gradients, and `0.9` is its setting in the sentiment runs. The equals sign assigns that value.

```
β₂ = 0.999
```

Here `β₂` is the decay coefficient for the running average of squared gradients, and `0.999` is its setting in those runs. The equals sign again gives the assigned value.

For multi-label document classification, the appendix describes a grid search over initial learning-rate options and over whether the rate decays after warm-up.

```
L = {2e-5, 4e-5, ..., 10e-4}
```

Here `L` is the set of learning-rate options. The braces enclose the options, the commas separate the displayed entries, and the ellipsis stands for intermediate settings. The entries use scientific notation. The equals sign defines the set with the endpoints and intermediate entries written by the authors.

```
D = {true, false}
```

Here `D` is the set of choices about decay. The braces enclose the alternatives and the comma separates them. `true` means to use linear decay after warm-up, and `false` means to maintain the maximum rate through the last step. The equals sign defines the set. In both cases, warm-up increases the rate to its maximum over 500 steps. With decay enabled, the rate reaches 0 at the end of training. The authors then use the chosen settings in repeated runs for the final document-classification comparison.

### Experiments and results

#### How to read the comparisons

The main evaluation compares Czert-B and Czert-A with mBERT, SlavicBERT, and ALBERT-r. The last system has the compact architecture and randomly initialized weights when it begins task training. It gives a point of comparison for the benefit of starting with a pretrained compact encoder. The multilingual systems, by contrast, represent existing pretrained choices for someone working on Czech. The paper also includes previously published task-specific scores where it has a comparison.

Each task has its own unit of success. The same name, F1, can refer to finding whole entities, labeling individual tokens, or assigning document categories. F1 combines precision and recall. Precision asks how much of what the system predicted was correct, and recall asks how much of the expected output it found. The score therefore depends on what is counted as an item. Correlation on a similarity dataset measures how the predicted ratings vary with human ratings. It answers a different question from the classification metrics.

Many of the result tables report a mean with a 95% confidence interval. The intervals are helpful when some of the displayed means sit very close together. The paper describes repeated training explicitly for sentiment, document classification, and similarity. The report provides individual benchmarks and metrics, so the most informative comparison is generally between systems within a particular row or dataset.

#### Named entities in two Czech datasets

[Named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/) locates spans of text that refer to named entities and predicts their types. The authors use the CoNLL version of the Czech Named Entity Corpus, or CNEC, with 4,688 training sentences, 577 development sentences, and 585 test sentences. Their other source is the Czech material from BSNLP 2019. It originally has 196 training and 302 test sentences. The authors divide the original test material into a development set of 149 sentences and a test set of 153 sentences. They convert the data to the format used for CNEC and take the entity classes for this evaluation.

The inputs are limited to 128 sub-word tokens. If the tokenized input is longer, the remaining portion becomes another example. Inputs shorter than the limit receive padding at the end. The paper reports that the limit is exceeded 44 times on CNEC and that it affects a substantial portion of BSNLP 2019. The fine-tuning schedule uses Adam at 5e-5 with linear decay, a batch size of 64, and 25 epochs. Czert-B also has a learning-rate warm-up during the first epoch.

The test measure is entity-level F1, with the outside class excluded. The score asks whether the system found an entity, which requires handling the span as a unit. On CNEC, SlavicBERT has the highest result among the systems fine-tuned by the authors, at 86.57 ± 0.12. Czert-B reaches 86.27 ± 0.12 and mBERT reaches 86.23 ± 0.21. The earlier benchmark score cited in the paper is 81.77. The paper credits its fine-tuned SlavicBERT with the new best result on this dataset.

On the adapted BSNLP 2019 test set, Czert-B reaches 86.73 ± 0.34 and SlavicBERT reaches 86.70 ± 0.37. Their means and intervals give a picture of closely matched performance. mBERT achieves 84.01 ± 1.25 on the same split. The previously reported score shown alongside them is 93.9. The compact Czech encoder gets 72.95 ± 0.23 on CNEC and 48.86 ± 0.61 on BSNLP 2019. Those scores exceed the corresponding ALBERT-r results of 34.64 ± 0.34 and 19.77 ± 0.94. The comparison between the compact systems shows the value of pretraining for this setup, while the higher scores from the larger encoders put that gain in perspective.

#### Part-of-speech labels in Czech treebanks

The paper calls the next task morphological tagging. The target it uses is the universal part of speech, or UPOS, instead of the full set of possible morphological features. [Part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/) assigns a grammatical category to a word as used in its sentence. The [Universal Dependencies](https://md.research.elamur.ai/free/en/concepts/universal-dependencies/) resources provide those labels alongside other linguistic information. The authors take the UPOS tags from files that also carry syntactic annotation and simplify the data for the token classifier.

The pooled evaluation uses the Prague Dependency Treebank 3.0, Czech Academic Corpus 2.0, Czech Legal Text Treebank 2.0, and FicTree. The dataset has 103,143 training examples, 11,326 development examples, and 12,216 test examples. The authors also evaluate the Prague Dependency Treebank on its own because they have a published figure for that benchmark. The separate partition has 68,627 training examples, 9,285 development examples, and 10,163 test examples. Fine-tuning is run with a 128-subword limit, a batch size of 64, and 13 epochs. The initial learning rate is 5e-5, with linear decay and a first-epoch warm-up for Czert-B.

The authors compute F1 over tokens and exclude the empty class. On the combined treebanks’ test data, Czert-B records 99.300 ± 0.009. SlavicBERT records 99.211 ± 0.008, and mBERT records 99.176 ± 0.006. On the Prague Dependency Treebank test data, Czert-B reaches 99.410 ± 0.006, above the earlier figure of 99.34. SlavicBERT achieves 99.318 ± 0.008 there, and mBERT achieves 99.301 ± 0.005. The scores place Czert-B first in both comparisons while showing how close the leading pretrained systems are on this target.

The compact encoder behaves differently across these two settings. Czert-A reaches 98.713 ± 0.008 on the combined data and 97.028 ± 0.023 on the Prague Dependency Treebank alone. ALBERT-r reaches 96.590 ± 0.096 and 96.410 ± 0.060, respectively. The experiment therefore finds a benefit from pretraining the compact architecture on both benchmarks, even for a word-labeling task where its supervised baseline already performs well.

#### Semantic roles as spans and as dependencies

The Czech portion of CoNLL 2009 supplies the semantic role labeling benchmark. The authors report a span F1 score and a syntax-based F1 score. The span score judges the predicted phrase boundaries and their semantic labels. The syntax-based measure uses dependency subtrees in the shared-task evaluation. A dependency tree represents grammatical links between words, and a subtree groups the words connected under a particular node. The two measures address the same broad task through different output structures. [Dependency parsing](https://md.research.elamur.ai/free/en/concepts/dependency-parsing/)

To obtain the syntax-based result for a span system, the authors project its predictions into the format of the dependency evaluation. They remove the `B-` and `I-` markers, which indicate the beginning and interior of a span, retain the dependency annotation for the scoring format, and apply the shared-task script. They describe the projection as unoptimized and explain that they wanted to avoid adding information from the gold dependency trees to the predictions. They also report a dependency-based reference and a replication of that system evaluated with gold-standard trees. A gold tree gives the reference system the dependency structure supplied by the benchmark annotation.

Czert-B produces a span F1 of 81.86 ± 0.10. The multilingual results on that measure are 79.33 ± 0.08 for SlavicBERT and 78.55 ± 0.11 for mBERT. On syntax-based F1, Czert-B reaches 91.46 ± 0.06, SlavicBERT 90.49 ± 0.04, and mBERT 90.23 ± 0.22. Czert-A scores 76.63 ± 0.13 for spans and 89.94 ± 0.05 for syntax, while ALBERT-r reaches 51.37 ± 0.42 and 80.75 ± 0.13 on the respective measures.

The dependency-based reference scores are 85.19 for the published approach and 89.52 for the replication with gold trees, on the syntax measure. Czert-B and SlavicBERT both exceed the latter figure after the projection used in the paper. That comparison concerns the common syntax evaluation. The span results compare the span systems with each other. Reading the two sets of scores separately keeps the evaluation format from being mistaken for a change in the underlying predictions.

#### Sentiment in Facebook posts and movie reviews

The authors fine-tune separately on two sentiment datasets. The Facebook dataset, FB, contains 10K posts from nine Czech Facebook pages. The classes used are positive, negative, and neutral. The authors exclude 248 examples labeled bipolar. The other dataset, CSFD, contains movie reviews. For each dataset, the authors split the examples into training, development, and test data in a way that follows the original class distribution.

The Facebook setup uses a maximum sequence length of 64 and a batch size of 32. For the movie reviews, the maximum is 512 and the batch size is 14. The authors choose settings using development F1, then train with the selected settings on the training and development data together before running the test evaluation. They repeat each experiment six times and report mean F1 with 95% confidence intervals. For each selected setting, the table for the task also lists the starting learning rate and how many epochs are used.

Sentiment systems on the Czech Facebook test set by F1 Czert-B has the highest mean F1, followed by SlavicBERT.

**The numbers**

| System or setting | F1 |
| --- | --- |
| ALBERT-r | 59.50 |
| mBERT | 71.72 |
| Czert-A | 72.47 |
| SlavicBERT | 73.87 |
| Czert-B (this paper) | 76.55 |

On Facebook, Czert-B’s mean is 76.55 ± 0.14, compared with 73.87 ± 0.50 for SlavicBERT and 71.72 ± 0.91 for mBERT. The historical result reported for the dataset is 69.4. Czert-A’s 72.47 ± 0.72 puts it ahead of mBERT’s mean while leaving SlavicBERT ahead of both. The randomly initialized compact baseline has 59.50 ± 0.47. The authors draw attention to the width of several of the intervals on this dataset and suggest that its size contributes to the variation.

On movie reviews, Czert-B achieves 84.79 ± 0.26 in the sentiment results table. That table gives 82.80 ± 0.14 for mBERT and 82.51 ± 0.14 for SlavicBERT. Czert-A reaches 79.58 ± 0.46, and ALBERT-r reaches 75.40 ± 0.18. The prior result given there is 80.5 ± 0.16. Some CSFD baseline means appear differently in the paper’s overall results table. The values here follow the task-specific table that supplies the intervals and training settings. Czert-B has the highest mean in both presentations of the movie-review results.

#### Multiple labels for news documents

The Czech Text Document Corpus v 1.0, abbreviated CTDC-1, comes from Czech News Agency documents. Its basis is nearly 12 thousand documents. Journalists assigned tags in the course of their work, and the full inventory comprises 60 categories. For evaluation, the authors follow the earlier benchmark setup using the 37 most frequent categories. A document can be associated with more than one of them, so the classifier has to make several label decisions from the same text.

The authors report F1 and the area under the receiver operating characteristic curve, abbreviated AUROC. The F1 score reflects the labels produced under a decision rule. AUROC evaluates discrimination over a range of thresholds, so it offers a view of how the underlying scores separate positive and negative cases. The two measures can therefore be read together. A stronger ranking of possible labels and a stronger set of final label decisions each support a different part of the performance claim.

Document classifiers on CTDC-1 by F1 Czert-B leads the comparison and exceeds the earlier benchmark.

**The numbers**

| System or setting | F1 |
| --- | --- |
| ALBERT-r | 72.44 |
| Czert-A | 82.27 |
| mBERT | 83.04 |
| SlavicBERT | 84.08 |
| Previous benchmark | 84.7 |
| Czert-B (this paper) | 85.06 |

The paper averages twenty training runs of 10 epochs for each configuration. Czert-B reaches 85.06 ± 0.11 in F1 and 98.00 ± 0.04 in AUROC. SlavicBERT is the strongest multilingual comparison on both metrics, with 84.08 ± 0.14 in F1 and 97.80 ± 0.06 in AUROC. mBERT reports 83.04 ± 0.16 in F1 and 97.62 ± 0.08 in AUROC. The earlier score of 84.7 is an F1 comparison. The paper’s table supplies no earlier AUROC value alongside it.

Czert-A achieves 82.27 ± 0.17 in F1 and 97.49 ± 0.07 in AUROC. ALBERT-r obtains 72.44 ± 0.22 and 94.35 ± 0.13 on those metrics. The experiment concerns prediction of the selected news categories from the portion of each article that fits the input. That is also the context for the strong AUROC values. They describe how well the systems separate the labels evaluated on CTDC-1 under this input rule.

#### Similarity in news, image descriptions, and headlines

The semantic text similarity evaluation uses pairs with human ratings. The new STS-CNA collection, created with the Czech News Agency and Charles University, has 138,556 manually rated pairs. The authors also work with two smaller sets from STS-SVOB. The image-description set has 550 training and 300 test examples. The headline set has 375 training and 200 test examples. The authors use the original text in the smaller datasets without reducing words to their dictionary forms or stems.

They report Pearson and Spearman correlation. Pearson measures how closely the numerical predictions and the human ratings vary together in a linear relationship. Spearman measures agreement in the ordering of the pairs. A system can rank examples well while putting them on a different numerical scale, so the two measures can favor different systems. The paper reports correlations from ten runs per configuration, with 95% confidence intervals. Fine-tuning settings differ between the large collection and the smaller benchmarks. For the CNA runs, for instance, the main setting uses a batch size of 50 and a learning rate of 1e-5, with a different schedule for Czert-A.

On STS-CNA, Czert-B reaches 91.89 ± 0.12 in Pearson correlation and 89.29 ± 0.17 in Spearman correlation. SlavicBERT reaches 91.38 ± 0.29 and 88.97 ± 0.09 on the respective metrics. Czert-A obtains 88.72 ± 0.25 in Pearson and 85.85 ± 0.16 in Spearman. Its randomly initialized counterpart reaches 43.18 ± 0.13 and 33.32 ± 0.11. The CNA comparison shows strong results for the pretrained systems and puts Czert-B first on both measures.

Similarity predictors on SVOB-IMG by Pearson correlation Czert-B leads the image-description comparison, including the earlier benchmark.

**The numbers**

| System or setting | Pearson correlation |
| --- | --- |
| ALBERT-r | 15.74 |
| Previous benchmark | 78.87 |
| mBERT | 79.37 |
| SlavicBERT | 79.90 |
| Czert-B (this paper) | 83.74 |

On image descriptions, Czert-B’s Pearson correlation is 83.74 ± 0.40, compared with 79.90 ± 0.81 for SlavicBERT and 78.87 for the earlier benchmark. Czert-B also has the highest mean Spearman correlation among the tested systems at 83.20 ± 0.39. SlavicBERT follows with 79.66 ± 0.73. The table for Pearson gives ALBERT-r a mean of 15.74 ± 2.99, while the overall table prints 15.73. The chart follows the dedicated correlation table.

On headlines, Czert-B records 79.83 ± 0.47 in Pearson correlation, and the previous benchmark stands at 79.99. For Spearman, mBERT records 78.83 ± 0.37, while Czert-B records 78.69 ± 0.59. Thus the image-description result supplies the clearest improvement over earlier work among the established similarity benchmarks. On headlines, the leading system depends on the measure and on whether the earlier benchmark is included.

### What the ablations show

#### What can be isolated by the comparisons

The paper has no systematic pretraining ablation, but it does compare a pretrained compact encoder with a randomly initialized counterpart and offers analyses of input length, fine-tuning stability, and performance by task.

The comparison of Czert-A with ALBERT-r is the closest the study comes to isolating a component of the training pipeline. With ALBERT-r, the supervised training has to learn the encoder weights and the task-specific head from the task examples. With Czert-A, it starts from a compact encoder that has already worked on prediction exercises using Czech text. The benefit of that starting point appears on tasks with quite different outputs. On the BSNLP 2019 split, the mean entity F1 rises from 19.77 for ALBERT-r to 48.86 for Czert-A. On the Facebook sentiment test, the corresponding means are 59.50 and 72.47. The comparison supports pretraining as a package for these tasks. It leaves the relative contribution of masking, sentence pairing, and vocabulary learning open.

The size of the supervised baseline also varies substantially by task. In the combined-treebank tagging evaluation, ALBERT-r attains 96.590 F1 and Czert-A attains 98.713. In the image-description evaluation, ALBERT-r has a Pearson correlation of 15.74 and Czert-A has 79.444 in the dedicated table. The rankings favor pretraining in both settings. The metrics and benchmarks differ, so the numbers describe different forms of dependence on the starting weights. The contrast gives a better account of ALBERT-r’s behavior than a single overall description of its performance would.

Czert-A and Czert-B share the Czech sources and the same kinds of pretraining exercise. Their comparison adds information about the architectural choices available within that recipe. Czert-B performs better across the reported tasks, while the smaller Czert-A frequently trails the multilingual encoders. This is evidence about the compact and larger configurations as actually trained. ALBERT’s smaller embedding representation and sharing across layers occur together, and the study supplies no intermediate variants that would show which architectural difference is decisive.

#### Where the larger Czech encoder gains

The paper groups outcomes by the form of the output. Its clearest results for Czert-B appear in sequence-level sentiment and document classification and in the stronger sentence-pair similarity results. Entity recognition offers two cases in which a pretrained multilingual encoder stays highly competitive. UPOS tagging gives Czert-B the leading results at a point where several systems have high F1. Semantic role labeling gives Czert-B the leading mean on both reported measures, with the result expressed differently by the span and syntax evaluations.

The authors propose the amount of Czech training text as an explanation for Czert-B’s performance. They describe the Czech material as almost 50 times larger by sentence count than the Czech text available to the multilingual systems. The comparison makes that explanation plausible, especially given that the added Czech material covers news and the national corpus as well as Wikipedia. A test of volume alone would require training comparable variants on different amounts of the same text under a shared setup. The paper’s comparisons bundle volume with source composition, vocabulary, and training history.

The new best scores also reflect the benefit of applying a strong fine-tuning setup to an existing multilingual encoder. The CNEC result comes from the authors’ version of SlavicBERT. That result helps distinguish the study’s contribution as a benchmark comparison from the narrower question of how often its newly pretrained Czert-B leads. For someone reading the aggregate claims, the system named in each row determines what the result can establish.

#### Length, learning rate, and variation between runs

The authors investigated whether increasing the maximum sequence length would improve named entity F1. BSNLP 2019 has a substantial number of inputs that reach the 128-subword limit. Longer contexts could in principle reduce the occasions on which an entity or its surrounding text falls across an input break. The paper reports that lengthening the inputs did not improve the resulting entity F1. It offers that as a finding about the tested setup and supplies the split-and-pad procedure behind the main scores.

The sentiment runs also compare initial learning rates. The appendix gives 2e-6, 2e-5, and 2.5e-5 as the settings tried. The authors report that the first two led to more stable fine-tuning, while runs beginning at 2.5e-5 more often overfit. Overfitting here refers to learning patterns in the training examples that transfer less well to held-out data. The paper gives the settings selected for the final sentiment runs. The account of comparative stability is qualitative, since it supplies no separate results table for all the learning-rate trials.

For the small similarity datasets, the authors describe the Czert systems as less prone to overfitting than the other tested systems. The repeated runs and the confidence intervals give the reader some information about variation under the chosen settings. The paper treats stability as an observation alongside the mean correlations. It also suggests a possible annotation ceiling for the headline dataset, where several competitive results are close. Establishing such a ceiling would require evidence about the ratings themselves, beyond the proximity of the systems’ scores.

### Limitations

#### Limits and qualifications raised by the authors

The next-sentence objective depends on intact transitions. The authors explicitly identify the loss of potential starting positions at block ends, especially in the national corpus. The increase in negative-pair difficulty is another design judgment. Drawing from within a paragraph is intended to make false continuations less obvious. The study evaluates the resulting encoder as part of Czert’s full recipe. It supplies no downstream comparison against a Czert variant trained with negatives from the whole corpus or with ALBERT’s usual sentence-order objective.

Hardware limits shape the training recipe. The authors cite cluster capacity in setting the batch size and lower it when they increase the maximum sequence length. The appendix’s timings describe particular implementations of distributed training. The reported communication improvement and overall runtimes are specific to those configurations. They cannot serve as a same-conditions comparison of the speed of pretraining BERT and ALBERT.

The authors qualify some benchmark outcomes with possible explanations. They suggest that the size of the Facebook dataset contributes to the broad intervals for some systems. They also suspect that annotation accuracy may limit achievable performance on the headline similarity benchmark. These are interpretations of the patterns the authors observe. The paper gives neither a sample-size study for the Facebook split nor an estimate of the upper limit imposed by the headline annotations.

The semantic role labeling comparison also depends on a choice the authors make explicit. They use a simple projection so they can score span predictions in the dependency format without optimizing the projection to exploit gold-tree structure. The resulting syntax-based figures are comparable within the scoring procedure described. They leave open how other ways of mapping between spans and dependency structures would affect the ordering or the scores.

#### Limits that follow from the evaluation design

The new systems and the multilingual baselines differ in several ways at once. Czert concentrates its training on Czech and includes different kinds of Czech text. It has its own tokenization setup and uses the authors’ local negative-sampling rule. SlavicBERT inherits weights from mBERT and uses Russian news alongside Wikipedia. The results establish the performance of those complete systems on the reported Czech evaluations. The share of the improvement attributable to monolingual training, to the amount of Czech, or to access to news and corpus material remains unresolved.

The architecture comparison has a similar scope. Czert-B’s stronger results support the choice of the larger Czech configuration for the reported tasks, given the way both systems were trained. The difference encompasses the embedding design, parameter sharing, and overall parameter count. There is also no randomly initialized base BERT in the reported baselines. The direct comparison of pretrained and randomly initialized weights therefore applies to the compact configuration. Extending it to Czert-B would require a baseline at that architecture.

The test data delimit what the task names mean. The tagging evaluation uses UPOS, so the result concerns part-of-speech labels within a broader morphological annotation resource. The adapted BSNLP comparison focuses on entity recognition with the authors’ splits and format. The document evaluation concentrates on the most frequent categories and feeds the start of each document into the encoder. Its results concern those labels and that portion of the text. The similarity scores measure agreement with the ratings of the corresponding datasets, which represent different kinds of sentence pairs.

The paper’s aggregate claims require care because its sections use different counts. The introduction gives 7 out of 10 datasets for Czert-B’s comparison with multilingual systems and describes seven new best results. The conclusion gives 9 out of 11 and reports new best results on 9 datasets, with the latter tied to the marks in the overall table. The overall table also distinguishes a previous benchmark from the best direct fine-tuning result, and there are small discrepancies between some of its means and the dedicated task tables. The reported aggregates are best read as the authors’ stated counts. The individual comparisons supply the dataset, metric, system, and earlier benchmark needed to interpret a particular result.

Finally, the study evaluates adaptation to labeled Czech tasks. A model that performs well under this protocol supplies a useful starting point when such labels are available. The benchmark design leaves cross-language transfer and performance on untested domains open. That boundary matters when following Czert into research where the target language, the source of the training labels, and the genre of the text vary independently.

### What came after

#### Language and genre as choices in pretraining

The work listed as [SlovakBERT](https://md.research.elamur.ai/free/en/papers/pikuliak-2022-slovakbert-slovak-masked-language-model/) takes up a closely related problem for Slovak. Its subject is a Slovak masked language model, so the clearest connection is to Czert’s training of a language-specific encoder through token recovery. Czert gives a Czech example of building a dedicated pretrained system and evaluating it against multilingual options. SlovakBERT carries that line of inquiry to a different language. The connection is the unit of specialization and the masked prediction objective. The citation alone leaves the use of Czert’s vocabulary, sentence pairs, and weights unspecified.

[BERTabaporu](https://md.research.elamur.ai/free/en/papers/costa-2023-bertabaporu-assessing-genre-specific-language/) examines a genre-specific language model for Portuguese natural language processing. Its question is related to Czert’s through the choice of pretraining text. Czert limits training to one language and uses several kinds of Czech writing. BERTabaporu makes genre part of the question within Portuguese. Both put attention on the relationship between the text an encoder studies in advance and the text it is expected to process. The title identifies the scope of the Portuguese work. It does not provide results or establish a transfer of Czert’s implementation.

The study asking [whether multilingual models are better](https://md.research.elamur.ai/free/en/papers/priban-2021-are-multilingual-models-better-improving/) is linked to Czert by the comparison named in its title. In Czert, that comparison depends on the task. A Czech encoder leads the sentiment experiments, while a multilingual encoder leads one of the named entity benchmarks. The later study makes the multilingual comparison its own research question. Its listing supplies no details about its benchmark, scores, or use of a particular Czert checkpoint, so the documented continuity is the question it pursues.

#### Multilingual evaluation in the legal domain

[MultiEURLEX](https://md.research.elamur.ai/free/en/papers/chalkidis-2021-multieurlex-multi-lingual-multi-label/) provides a multilingual dataset for multi-label classification of legal documents and focuses on zero-shot cross-language transfer. In such an evaluation, the system is tested for transfer to a target language without using labeled task examples in that language for training. Czert’s document classification experiment gives a related form of output, since both settings allow several labels for one document. Czert learns to assign news categories from Czech labeled data. MultiEURLEX takes the multi-label problem into legal documents and makes transfer between languages a condition of the benchmark. That change tests an ability that Czert’s Czech document experiment leaves open.

[LEXTREME](https://md.research.elamur.ai/free/en/papers/niklaus-2023-lextreme-multi-lingual-multi-task/) builds a benchmark for multiple legal language tasks across languages. Czert also uses a set of tasks to find out where the same pretrained starting point helps. But the scope of the evaluation changes. Czert keeps Czech fixed and varies the form of the task, while LEXTREME places variation in both language and task inside a legal domain. The citation connects the work to the broader evaluation of pretrained encoders. Available details specify the benchmark’s focus and leave the exact role of Czert in its experiments unspecified.

Together, these citing works carry the research question into settings where language, genre, and the availability of labels can each define the evaluation. The Slovak work addresses language-specific masked pretraining, the Portuguese work examines genre-specific training, and the legal benchmarks make multilingual coverage or transfer part of what gets measured. Czert’s contribution to that sequence is a detailed Czech comparison in which the benefit of dedicated pretraining can be examined task by task.

## Cite

Cite as Jakub Sido, Ondřej Pražák, Pavel Přibáň, Jan Pašek, Michal Seják and Miloslav Konopík. 2021. Czert – Czech BERT-like Model for Language Representation. Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021).

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{sido2021czert,
  title = {{Czert – Czech BERT-like Model for Language Representation}},
  author = {Jakub Sido, Ondřej Pražák, Pavel Přibáň, Jan Pašek, Michal Seják and Miloslav Konopík},
  booktitle = {Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021)},
  year = {2021},
  url = {https://aclanthology.org/2021.ranlp-1.149/}
}
```

> 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)
