Are the Multilingual Models Better? Improving Czech Sentiment with Transformers
Paper · 2021 · Pavel Přibáň and Josef Steinberger
Summary
Can a system trained to read many languages judge Czech sentiment better than one built specifically for Czech? The answer matters when choosing how to start a text classification project and when labeled examples are scarce. Pavel Přibáň and Josef Steinberger study polarity detection, a form of sentiment analysis that assigns a text a label such as positive, negative or neutral. They compare Czech-only and multilingual Transformer encoders on movie reviews, Facebook posts and product reviews. They also test whether a classifier taught to recognize positive and negative movie reviews in one language can do the same in the other. Multilingual and cross-lingual NLP
The strongest system across all the Czech tests was XLM-R-Large. On the held-out tests with positive, negative and neutral labels, its macro F1 was 87.08 on the CSFD movie reviews, 81.70 on the FB posts and 79.81 on the Mallcz product reviews. Macro F1 gives each label equal weight, even when some labels occur much more frequently than others. The authors report new best results for all the Czech datasets. The comparison also gives a reason to consider a Czech-only encoder. Czert-B scored 79.35 on the three-class Mallcz test and came close to XLM-R-Large there, despite having a much smaller parameter count and vocabulary.
The transfer tests used positive and negative movie reviews so the labels could carry over between languages. After fine-tuning with English IMDb labels, XLM-R-Large reached 91.61 macro F1 on the binary Czech CSFD test. With Czech supervision it reached 96.00 on that test. In the reverse direction, Czech supervision produced 93.98 accuracy on the English IMDb test. Other multilingual encoders transferred less successfully, and mBERT did not converge in the Czech-to-English experiment. The results show that target-language sentiment labels can be dispensed with in this particular transfer setup. The encoder had already undergone multilingual pretraining, and both languages supplied reviews from the same broad domain.
The authors also address a problem with comparing Czech sentiment scores. Earlier studies used their own splits or cross-validation, so published scores could refer to different test examples. This study establishes common Czech training, development and test partitions, reruns older baselines on them and releases the splits alongside its code and trained checkpoints.
Deep dive: Are the Multilingual Models Better? Improving Czech Sentiment with Transformers
Czech sentiment experiments compare Czech-only and multilingual Transformers and test how well movie-review sentiment transfers between Czech and English. · about 31 minutes to read
The problem and its context
What the classifier is asked to decide
A polarity classifier reads a piece of text and assigns it to one of the available sentiment categories. The label describes the text at the level chosen by the dataset. In this paper, the unit is a movie review, a product review or a Facebook post. The Czech datasets support a task with positive, negative and neutral labels, as well as a task restricted to positive and negative examples. The paper treats these as separate classification problems. Detecting a neutral post requires a decision that never arises when every test example belongs to one of the two polar classes.
The word sentiment also covers more detailed classification schemes. Here the authors concentrate on polarity, with a single category per example. The target depends on how the dataset was labeled. In the Czech review datasets, labels come from star ratings. A system therefore learns to associate wording with a polarity category derived from a rating. In the Facebook dataset, human annotators assigned polarity to posts directly. The same classification interface can serve both cases, but correct predictions mean agreement with different sources of supervision. That distinction matters when using a result from one dataset to form expectations about another.
The paper describes a gap between the progress in English sentiment classification and the evidence available for Czech. BERT and related systems had improved English benchmarks, and Czech researchers had already tried versions of those approaches. The authors wanted to compare a broader set of available Czech and multilingual encoders under shared conditions. A multilingual encoder could make Czech classification more accurate or make it possible to use labeled English examples. Those are separate benefits, and each calls for a different experiment.
When supervision and evaluation are both in Czech, the question is which starting point produces the strongest Czech classifier. Multilingual pretraining is one possible starting point, alongside pretraining devoted to Czech. For transfer, the question is whether the task learned from labeled examples in a source language carries over to a target language. A multilingual encoder can do well on the first test with the help of Czech labels and still perform poorly on the second when they are withheld. The study evaluates both conditions so that ordinary Czech accuracy and the ability to transfer can be judged separately.
How earlier approaches represented text
The earlier English work described in the paper often relied on pretrained word embeddings such as word2vec and fastText. An embedding represents a word with a vector. A sentiment classifier can start from those vectors and train a network to combine the evidence they carry across the text. The paper describes systems that used convolutional networks, which can recognize patterns in neighboring inputs, and long short-term memory networks, which process a sequence in order. Some added attention to decide how much different parts of that sequence should contribute to the final prediction. Word2vec, fastText, Convolutional Neural Networks for Sentence Classification
The authors describe contextual word representations as another step in that development. A contextual representation can change with the surrounding text, giving a classifier access to a representation of a word as it occurs in a particular sequence. CoVe and ELMo had been applied to polarity detection, as had ULMFiT, which used a pretrained language model. The subsequent systems discussed in the paper, including BERT and RoBERTa, start with training on a large amount of unlabeled text and then adapt to a downstream task. For sentiment classification, this means the classifier begins with an encoder whose internal representations have already been shaped by a language-learning task. ELMo, BERT, RoBERTa
Earlier Czech research, as reviewed by the authors, used lexical features or bags of words with classifiers such as naïve Bayes and logistic regression. Other work combined supervised and unsupervised methods. A bag-of-words representation records features for the words in a text, and related representations can also record short sequences of words or characters. These methods can recognize useful fragments of a review without learning a contextual vector for every position. Their role in the new experiments is important because a more elaborate architecture has to earn its advantage over a classifier that can already use many informative lexical patterns.
Czech neural approaches had also moved beyond those features. Lenc and Hercig applied convolutional and recurrent networks to the same Czech datasets used here. Libovický and colleagues used a recurrent network with self-attention. Sido and Konopík explored curriculum learning with convolutional and recurrent classifiers. Lehečka and colleagues applied BERT to polarity detection with a modified pooling layer and knowledge distillation. Sido and colleagues then evaluated Czech BERT-style encoders on FB and CSFD as part of their work on Czech language representation. These studies established precedents for both the older baselines and the Czech-only encoders that Přibáň and Steinberger include.
Multilingual pretraining gave the authors a wider choice of encoders that could process Czech. The paper describes options ranging from mBERT, trained jointly on many languages, to SlavicBERT, which continued training from mBERT with a vocabulary adapted to a group of Slavic languages. The authors also had access to XLM and XLM-R. At the same time, Czech-specific pretraining offered a different use of vocabulary and training capacity. Comparing these approaches on the same task could show which available checkpoints worked best for Czech. An explanation for any advantage would require attention to other differences between the checkpoints, including size and pretraining procedure. XLM-R
Why a common split mattered
The paper identifies an obstacle to interpreting the earlier Czech scores. The datasets lacked official partitions. Some studies used 10-fold cross-validation, in which different portions of the corpus take turns as the evaluation set. Others created their own train and test partitions. Two scores from the same named dataset could thus summarize different collections of reviews or posts, and the classifiers could also have seen different quantities of training data.
That problem shaped the authors’ choice to reimplement baselines. If logistic regression and a newer encoder are trained and evaluated on shared partitions, their scores can be compared on the same held-out examples. Published numbers from earlier experiments can still provide historical context, but differences in protocol complicate direct rankings. Releasing a common split was therefore part of the experimental contribution. It created a specific set of examples against which later systems could be compared. Evaluation and benchmarks
The authors also frame Czech zero-shot sentiment transfer as a gap in prior research. By zero-shot they mean that the classifier receives no labeled target-language examples for the task in that transfer experiment. Their related-work discussion points to approaches built around multilingual translation and to other multilingual classification research. To their knowledge, Czech polarity detection had yet to be studied in this setting. The movie-review datasets gave them a way to ask the question with the same broad subject matter and a shared pair of labels in both languages.
The method, step by step
Set up the labels and partitions
The authors begin with labeled text. On the Czech datasets, they retain the positive, negative and neutral examples for the three-class task. For the binary task they restrict the examples to positive and negative. The Facebook corpus also contained 248 examples labeled bipolar. The study omits that label and its examples. These choices determine which distinctions a classifier has to learn before its architecture or training settings enter the comparison.
The Czech splits preserve the original distribution of the retained classes across training, development and testing. For CSFD and Mallcz, the paper describes an initial allocation of 80 % to training and 20 % to testing. FB starts with 70 % for training and 30 % for testing. The authors then take 10 % of the training portion for development. The larger test allocation for FB reflects its much smaller size. Its test set would have been smaller in absolute terms under the allocation used for the review datasets.
Each part serves a distinct function. The training portion supplies the examples from which the classifier learns. A development set lets the researchers compare settings and decide which training configuration to take forward. The test set is where they measure the result of that selection. In the Czech experiments, they choose settings using the development results, then train using the combined training and development data for the final evaluation. The held-out test portion therefore evaluates a classifier trained with the Czech development examples added back in after selection.
The English data enters the transfer experiments in two ways. When English is the source language, the authors create an English development set by randomly drawing 5k IMDb reviews. The other 45k reviews provide the English training data. The Czech test portion is separate from both. When Czech is the source language, the paper describes selection on the Czech CSFD development set, then evaluates transfer on the English IMDb test portion. The original IMDb partition is thus relevant when English supplies the target test. The English-to-Czech training procedure uses its own allocation of IMDb data. IMDb sentiment dataset
From labeled reviews or posts to polarity evaluation
The steps in order.
Compare starting points that can read Czech
The authors choose BERT-style encoders. An encoder takes a sequence as input and produces a set of internal representations from which a classifier can work. A full encoder–decoder system also has a component that can generate an output sequence. The paper discusses T5 and BART and their multilingual counterparts, then restricts its experiments to encoders. A polarity label can be selected directly from a vector of class scores, so the classifier needs no text generation stage. That common structure also makes it possible to describe most of the tested encoders with the same classification procedure. BART, mT5, Multilingual BART
The Czech-only pretrained encoders are Czert-B and Czert-A. Czert-B is the Czech version of BERT Base. It has 110M parameters and a 30k vocabulary. Its creators changed the pretraining batch size to 2048 and modified the next-sentence prediction objective. Czert-A is the Czech version of ALBERT. It has 12M parameters and a 30k vocabulary. Its pretraining used the same batch size as Czert-B and the modified next-sentence prediction objective in place of ALBERT’s sentence ordering objective. These are characteristics of the checkpoints that Přibáň and Steinberger start from. The sentiment experiments adapt those checkpoints with polarity labels. ALBERT
RandomALBERT serves a different purpose. It has 12M parameters and a 30k vocabulary, matching the corresponding entries for Czert-A. Its weights start from random initialization, so it reaches the sentiment task without the language training that Czert-A received. Comparing the two gives the authors a way to examine the value of pretraining in a closer architectural comparison than simply contrasting a Transformer with a recurrent network. Seven pretrained encoders appear in the Czech results, together with this randomly initialized comparator.
The multilingual group covers different approaches to sharing an encoder across languages. mBERT is a BERT Base variant trained jointly on 104 languages. It has 177M parameters and a 120k vocabulary. SlavicBERT starts from an mBERT checkpoint and continues pretraining with a modified vocabulary for Bulgarian, Czech, Polish and Russian. The paper gives the same parameter count and vocabulary size as for mBERT. An experiment comparing the two changes which languages receive further pretraining and how the vocabulary is adapted, alongside the effect of that additional training.
XLM has a 200k vocabulary, 570M parameters and support for 100 languages. The paper describes its use of byte-pair encoding and a larger shared vocabulary in adapting the BERT pretraining approach for multilingual use. XLM-R-Base and XLM-R-Large are multilingual RoBERTa variants pretrained for 100 languages. Both have a 250k vocabulary. XLM-R-Base has 270M parameters and XLM-R-Large has 559M. They offer a comparison between sizes within the same multilingual family while also giving the study alternatives to both mBERT and the Czech-specific encoders.
These starting points differ in more than the number of languages they cover. They can use different pretraining objectives, including a masked language task in which the encoder learns to recover hidden text, and objectives that require a decision about sentences. They can also split the same text into different pieces. If a larger multilingual encoder reaches a better sentiment score, that result applies to the combination of choices embodied in the checkpoint. The study uses the RandomALBERT comparison and the two sizes of XLM-R to examine narrower questions within the broader comparison.
Turn a sequence into a label
Each Transformer input passes through the tokenizer associated with its checkpoint. Subword tokenization represents text as a sequence of vocabulary entries that can include parts of words. The tokenizer determines how many positions the encoder needs to read the text. The authors inspect sequence lengths in these units, since the same review can produce different token counts under different vocabularies.
The BERT-style classifier represents the entire sequence using the position of a special token placed first in the input. The paper gives [CLS] for BERT and <s> for RoBERTa. After the sequence passes through the encoder, the authors take the last hidden representation associated with that position. With the exception of XLM, they use the representation from the pooling layer. This layer transforms the selected vector through a fully connected layer of the same width and applies a hyperbolic tangent activation. The output is the sequence representation for the classifier.
h ∈ ℝᴴ
Here h is the sequence representation and H is the hidden size, meaning the number of entries in that vector. ℝ denotes the real numbers. The superscript H specifies the dimension of the real vector space, and ∈ means that h belongs to it.
XLM uses the final hidden state at the first input position directly, with no pooling layer in between. Once that vector has been chosen, XLM uses the same kind of task-specific linear classifier as the other encoders. This detail matters when reconstructing the comparison because the system uses a shared classification rule even though the representation supplied to it is obtained a little differently.
W ∈ ℝ|C|×H
Here W denotes the matrix of learned classification weights. C is the set of available sentiment classes, and the vertical bars in |C| mean the number of elements in that set. H is the hidden size. The expression |C|×H gives the dimensions of the real matrix, with a row for each class and a column for each entry of the input representation. ∈ indicates membership in this space of matrices.
c = argmax(hWᵀ)
Here c is the predicted class from C, and = gives the rule for assigning it. h is the input’s sequence representation. Wᵀ is the transpose of the classifier’s weight matrix W, with its rows and columns interchanged. The product hWᵀ gives a score for each candidate class, and argmax returns the class associated with the highest score. The parentheses enclose the scores on which that selection operates.
The linear layer gives the encoder a supervised task. During training, the authors use cross-entropy loss, which penalizes the system when it assigns a low probability to the labeled class. They update the whole encoder as well as the classifier. The representation that reaches the classification layer can therefore change as the system learns the labeled task. The authors set dropout associated with the classification layer to 0.1. Dropout suppresses activations during training to help limit overfitting. Dropout
Set training lengths and learning rates
The paper uses a maximum input length of 64 for FB and 512 for CSFD and Mallcz. The length limit is measured in tokens, so for a Transformer it depends on the tokenizer’s division of the input. The Transformer batch size is 32 for each Czech dataset. A batch is the group of examples processed together for an update. Keeping the batch size fixed while changing the sequence limit lets the authors accommodate longer reviews without imposing the same limit on the generally shorter Facebook posts.
The Czech Transformer runs explore initial learning rates of 2e-6, 2e-5 and 2.5e-5, drawing inspiration from earlier work on adapting BERT for classification. The learning rate sets the scale of changes made during optimization. The authors use both a constant schedule and a schedule in which the rate decreases linearly. Their Transformer schedules omit warm-up, the preliminary increase in rate that the recurrent baseline uses. The paper reports settings for individual combinations of label scheme, dataset and starting checkpoint, so a result represents a setting chosen for that particular task. How to Fine-Tune BERT for Text Classification?
Training uses Adam with a weight decay modification. Adam adjusts the updates using running estimates formed from the gradients. The authors give default decay factors of 0.9 for the first-moment estimate and 0.999 for the second-moment estimate. The Transformer appendix specifies a default weight decay of 1e-2. The transfer experiments use linear learning-rate decay from 2e-6, again without warm-up. They share that schedule across directions, while the number of epochs, or passes through the training data, can differ according to the encoder and source task. Adam, Decoupled Weight Decay Regularization
Transfer uses a classifier trained to distinguish the same positive and negative classes that appear on the target test. Development performance on the source language governs the choice. In the English-to-Czech experiment, for instance, the development set says how well the trained classifier is doing on English. The selected classifier is then applied to Czech, so the Czech results measure what that source-selected configuration can do on the target. Strong English development performance is useful for source-side selection. Whether it leads to good Czech predictions is the question answered by the separate target test.
Build the older comparisons
For logistic regression, the authors reproduce the feature combination used by Habernal and colleagues. They use word unigrams and bigrams, meaning individual words and adjacent word pairs, together with character sequences ranging from 3-grams to 6-grams. Character features give the classifier access to shorter patterns within words. Logistic regression learns weights for those features in the polarity task. It consequently represents a baseline that derives its evidence from the text’s lexical patterns and the training labels. N-grams
The recurrent baseline reads a token sequence through a trainable embedding layer initialized with Czech fastText vectors. The paper describes this input as a matrix of token representations.
M ∈ ℝᵗˣᵈ
Here M is the input matrix of real values, and ∈ indicates that it belongs to the real matrix space denoted by ℝ with the displayed dimensions. t is the number of tokens. d is the size of each fastText vector, set to 300. The multiplication sign in the dimensions, displayed as ˣ, separates the row and column counts. Each token therefore supplies a row of d values.
The recurrent pipeline replaces numbers, email addresses and links with generic tokens. It uses the TokTok tokenizer and a customized Czech stemmer, which reduces words to forms intended to share a stem. The vocabulary is capped at 300,000 entries. The sequence of vectors goes through stacked bidirectional long short-term memory layers. Bidirectionality lets the system build a representation using the sequence in both directions. Dropout follows each of these layers, and a self-attention stage then lets the network weigh information within the sequence. A fully connected layer with softmax produces a probability distribution over the polarity labels.
The recurrent baseline has its own training settings. Its reported dropout after the bidirectional layers is 0.2, and 10 % of the update steps are used to raise the learning rate toward its initial value before decay. Its input lengths follow the same corpus-specific limits of 64 for FB and 512 for the review datasets. The batch size and the width of the recurrent layers vary across datasets. These details make the baseline a trained comparison in its own right. Its performance reflects a particular combination of Czech embeddings, preprocessing, sequence processing, attention and optimization.
Experiments and results
What the test sets contain
CSFD is the Czech movie-review corpus. The paper derives the labels from ratings: 0–2 stars indicate negative sentiment, 3–4 indicate neutral sentiment and 5–6 indicate positive sentiment. The retained corpus contains 91,381 reviews. Its split has 65,793 training examples, 7,311 development examples and 18,277 test examples for the three-class task. The class counts in the test set are close to one another. It includes 6,324 positive, 5,876 negative and 6,077 neutral reviews. The binary version keeps the positive and negative reviews, giving the transfer experiments an evaluation set in the same broad domain as IMDb.
FB contains posts sampled from Facebook pages, with polarity assigned by human annotators. After omitting the bipolar class, the data statistics give 9,752 examples. Of these, 6,143 are in the training partition, 683 are in development and 2,926 are in the three-class test partition. The test set contains 811 positive, 613 negative and 1,502 neutral posts. FB therefore combines fewer labeled training texts with a greater concentration in the neutral category than CSFD. Its results test performance under the posted-text annotation scheme as well as on a smaller dataset.
Mallcz contains product reviews from a Czech online shop. The authors use the labels derived from a 0-5 star scale. Reviews with 0-3 stars are negative, 4 stars are neutral and 5 stars are positive. The corpus has 145,307 examples. Its three-class test set contains 29,062 reviews, including 20,624 positive, 2,041 negative and 6,397 neutral examples. The training partition contains 104,620 texts and the development partition contains 11,625. Mallcz supplies more training examples than either other Czech dataset, alongside a strong imbalance towards positive reviews.
IMDb is a binary English movie-review corpus. Its original train and test partitions each contain 25,000 examples, split between 12,500 positive and 12,500 negative reviews in each partition. The paper gives 50,000 reviews in total. The comparison with CSFD uses a shared positive–negative decision while moving between the Czech and English corpora. The shared domain makes the transfer test easier to interpret than pairing English film reviews with Czech product reviews or social posts would have been. Differences between the two review collections are still part of the experiment.
How the scores are read
The Czech results and English-to-Czech transfer results are reported as macro F1. For each class, precision describes how often the classifier is right when it predicts that class, and recall describes how many of the examples in that class it retrieves. F1 combines precision and recall. Macro F1 gives each class’s F1 the same weight in the final score. This matters most visibly in a dataset such as Mallcz, where a score dominated by the common positive reviews could give little information about recognition of negative reviews.
The paper reports repeated runs for the neural experiments, at least five runs per experiment, and presents 95% confidence intervals for its neural Czech results. The logistic regression baseline is an exception to the repetition procedure. Each interval accompanies performance under the study’s training and evaluation setup. Results that come with wider intervals deserve particular attention when comparing systems with similar central scores. In the reverse transfer direction, the metric is accuracy, the share of test reviews assigned the correct polarity. The authors use accuracy there to match the published IMDb references.
Czech supervision across the three domains
The CSFD three-class scores give a view of the gains under shared supervision and evaluation. Logistic regression scores 79.63 and the recurrent baseline scores 79.88 ± 0.18. Czert-B reaches 84.80 ± 0.10. XLM-R-Base reaches 84.82 ± 0.10, putting the Czech-only encoder and the multilingual base version very close on this test. XLM-R-Large then reaches 87.08 ± 0.11. The visible separation in this comparison is between the large version and the other strong encoders. Multilingual pretraining is shared by variants on both sides of that separation.
Czech-trained classifiers on the three-class CSFD test set
XLM-R-Large leads, while Czert-B and XLM-R-Base are nearly tied.
The numbers
| System or setting | macro F1 |
|---|---|
| Logistic regression | 79.63 |
| LSTM | 79.88 |
| Czert-B | 84.80 |
| XLM-R-Base | 84.82 |
| XLM-R-Large (this paper) | 87.08 |
The binary CSFD test uses positive and negative movie reviews. There, XLM-R-Large obtains 96.00 ± 0.02 macro F1. Czert-B obtains 94.42 ± 0.15 and XLM-R-Base obtains 94.32 ± 0.34. Logistic regression scores 91.42, and the recurrent baseline scores 91.82 ± 0.09. This is the Czech-supervised experiment that supplies the within-encoder comparisons for English-to-Czech transfer. The paper also reports 93.80 from Lehečka and colleagues as a historical reference. That reference comes from a different test setup using the positive and negative examples of the entire CSFD corpus, so it provides context for the performance range of comparable approaches.
On FB, XLM-R-Large has a clearer advantage over the two alternatives nearest to it in the three-class scores. It reaches 81.70 ± 0.64 macro F1 on the test set, compared with 77.81 ± 0.50 for XLM-R-Base and 76.90 ± 0.38 for Czert-B. The older comparisons score 72.89 ± 0.49 for the recurrent baseline and 67.86 for logistic regression. On the binary FB test, XLM-R-Large reaches 96.05 ± 0.01. Czert-B is at 93.97 ± 0.30 and XLM-R-Base is at 93.26 ± 0.74. Since the binary task excludes the neutral posts, the scores reflect a different prediction problem on a different set of examples.
The three-class Mallcz test is the case in which the strongest Czech-only system comes closest to the overall leader. XLM-R-Large gives 79.81 ± 0.21 macro F1 and Czert-B gives 79.35 ± 0.24. The authors describe their intervals as nearly overlapping. XLM-R-Base obtains 75.43 ± 0.07. The logistic regression baseline scores 76.71, ahead of the recurrent baseline at 73.43 ± 0.12. This is a useful counterexample to treating the architectural progression as a reliable ranking in every condition. On these product reviews and labels, the character and word features of logistic regression are competitive with some of the encoders.
In the binary Mallcz task, XLM-R-Large reaches 94.37 ± 0.02 macro F1. Czert-B follows at 92.87 ± 0.15 and XLM-R-Base at 92.56 ± 0.07. Logistic regression scores 88.98, again ahead of the recurrent baseline, which gives 88.02 ± 0.24. The binary result keeps XLM-R-Large at the top while also preserving the comparison between the older baselines seen in the three-class product reviews. The findings thus support the authors’ claim that pretrained Transformers improve the best available results, with results for individual architectures depending on the dataset and training setup.
The study’s state-of-the-art claim concerns the three Czech benchmarks it evaluates. The shared partitions make the new experiments directly comparable within the study, including the test results for the reimplemented logistic regression and recurrent systems. The earlier published results are marked according to whether they used 10-fold cross-validation or a custom split. The paper’s comparison with the Czech encoder study by Sido and colleagues also examines whether selected earlier figures are broadly reproduced under the new partitions. Those checks help place the new results in context when a common historical test set is unavailable.
Transfer from English to Czech
The first transfer experiment fine-tunes multilingual encoders on English IMDb polarity labels and selects settings using English development performance. It tests them on the binary Czech CSFD partition. The Czech labels serve to score predictions. Training the polarity classifier in this experiment uses English labels. This is the meaning of zero-shot in the result, even though the multilingual encoder could already process Czech through pretraining.
XLM-R-Large obtains 95.86 ± 0.06 macro F1 on the English development set and 91.61 ± 0.06 on the Czech test. XLM-R-Base obtains 94.52 ± 0.12 on English development and 88.01 ± 0.28 on Czech testing. The XLM and mBERT source results also exceed 90 on English development, at 92.76 ± 0.34 and 93.07 ± 0.03 respectively. Their Czech test performance is much lower, at 75.37 ± 0.29 and 76.32 ± 1.13. A source classifier that recognizes English polarity at a high rate by this measure can thus still leave substantial room for improvement on Czech.
English-trained classifiers on the binary Czech CSFD test set
The XLM-R variants transfer better than XLM and mBERT, with the large variant leading.
The numbers
| System or setting | macro F1 |
|---|---|
| XLM | 75.37 |
| mBERT | 76.32 |
| XLM-R-Base | 88.01 |
| XLM-R-Large (this paper) | 91.61 |
The comparison with Czech supervision gives the transfer scores their clearest context. With Czech labels, the same XLM-R-Large checkpoint reaches 96.00 ± 0.02 macro F1 on this Czech test. The authors describe its English-trained score as about 4.4 % worse. For XLM, the Czech-supervised test score is 93.86 ± 0.18. For mBERT, it is 93.11 ± 0.29. These scores show that the weak transfer runs on Czech coexist with effective Czech learning when labels are available. The gap therefore depends strongly on the chosen encoder, even when the target dataset and polarity labels are shared.
Transfer from Czech to English
In the reverse experiment, the classifiers learn from Czech CSFD reviews and are evaluated on the IMDb test set. The paper reports selection using the Czech development data and presents both source development accuracy and target test accuracy. XLM-R-Large reaches 95.65 ± 0.17 on Czech development and 93.98 ± 0.10 on the English test. XLM-R-Base reaches 94.22 ± 0.01 on Czech development and 89.53 ± 0.15 on the English test. XLM gets 93.66 ± 0.13 on Czech development and 78.24 ± 0.46 on the English test.
Czech-trained classifiers on the binary English IMDb test set
XLM-R-Large has the highest English test accuracy among the completed transfer runs.
The numbers
| System or setting | accuracy % |
|---|---|
| XLM | 78.24 |
| XLM-R-Base | 89.53 |
| XLM-R-Large (this paper) | 93.98 |
mBERT did not converge in the reverse experiment. In this context, convergence concerns whether training settled into a usable solution under the settings the authors tried. The failure leaves no mBERT target accuracy for the chart. It is an outcome of the attempted training procedure and gives no measured English test score against which to rank the other completed runs.
The authors put 93.98 in context with prior IMDb results of 97.42 from Thongtan and Phienthrakul and 95.79 from Sun and colleagues. They describe XLM-R-Large’s result as 3.4 % below the strongest of those references. This comparison differs from the Czech one. The English-to-Czech experiment can compare XLM-R-Large with the same encoder trained on the target labels by the authors. In the reverse direction, the comparison is to published English results. The evidence that XLM-R-Large leads the completed transfer runs is direct within both directions. A numerical comparison of which direction transfers better would need to account for the different target datasets, measures and reference conditions.
What the ablations show
The comparison with random initialization
The closest comparison to a pretraining ablation uses Czert-A and RandomALBERT. Both entries specify 12M parameters and a 30k vocabulary. Czert-A begins sentiment training with Czech pretraining behind it, while RandomALBERT learns from polarity data starting from random weights. Both are trained for the downstream task. The question is how far their shared architecture can go under the reported supervision and training schedules when the language-learning stage is removed.
On the three-class CSFD test, Czert-A reaches 79.89 ± 0.60 macro F1 and RandomALBERT reaches 75.79 ± 0.18. On the three-class FB test, the corresponding scores are 73.06 ± 0.59 and 62.53 ± 0.46. The same ordering holds on the three-class Mallcz test at 76.79 ± 0.38 and 64.81 ± 0.25. RandomALBERT also trails logistic regression on each of these test sets. Under the available training conditions, the architecture supplied with random weights does not recover the performance of the version that already learned from Czech text.
The paper acknowledges one complication. RandomALBERT was trained for at most 15 epochs, and the authors say that additional training could improve it. Training from scratch and adapting a pretrained checkpoint can make different demands on the optimizer and the amount of supervision. The comparison establishes the advantage of using the pretrained checkpoint over this reported random start. It leaves open how well a scratch system would do under a longer, separately optimized training procedure.
Scaling within a multilingual family
XLM-R-Base and XLM-R-Large provide a narrower comparison than a ranking of all the encoders together. They share the listed language coverage and vocabulary size, while the parameter count rises from 270M to 559M. The larger version leads the smaller version on every Czech test and in both directions of transfer. This strengthens the case that the large configuration is responsible for part of the observed advantage within the XLM-R family. The result is particularly relevant to the title’s question: the strongest multilingual choice is consistently ahead, while the base version can trail a Czech-only encoder.
The widest comparison, between language-specific and multilingual training, cannot isolate the same property. Czert-B has 110M parameters and a 30k vocabulary. The XLM-R variants use substantially more parameters, larger vocabularies and a different pretraining family. Choosing one of these checkpoints changes multiple factors together. Czert-B’s proximity to XLM-R-Large on the three-class product reviews, and its competitiveness with XLM-R-Base on several Czech tasks, show why the authors treat it as a strong option despite the overall lead of the largest multilingual encoder they evaluate.
The XLM result further qualifies a simple size explanation. At 570M parameters, XLM has a larger listed parameter count than XLM-R-Large. Yet it is well behind XLM-R-Large in both directions of zero-shot transfer. Parameter count is informative within the closer XLM-R comparison. Across pretraining approaches, it is insufficient to predict which encoder will carry source-language sentiment into the target. The paper evaluates the resulting systems as complete checkpoints and does not decompose XLM’s transfer weakness into particular training or representation choices.
Learning rates and unstable runs
The authors report that 2e-6 worked well in many Transformer experiments. Higher learning rates tended to give weaker results or problems with convergence. That observation matters when comparing checkpoints because fine-tuning has an influence on the eventual ranking. The scores come from settings tried and selected for the tasks, with both constant rates and linear decay represented. Individual configurations can prefer a different rate. For instance, the reported three-class CSFD result for Czert-B uses an initial learning rate of 2e-5, whereas the corresponding XLM-R-Large result uses 2e-6.
The recurrent and logistic baselines supply narrower checks of their own. The authors tried TF-IDF weighting for logistic regression, a method that changes the influence of terms according to their frequency in the corpus. They report no significant improvement and retain the original feature arrangement for comparability with Habernal and colleagues. For the recurrent classifier, they vary optimization and dropout settings. Their paper reports the settings associated with the final scores, so readers can distinguish the trained recurrent comparison from a result obtained with an arbitrary configuration. TF-IDF
The paper uses confidence intervals to discuss stability. The authors associate the generally wider intervals on FB with the smaller training set and its greater susceptibility to overfitting. Several Mallcz runs are also unstable in spite of the larger corpus. On the three-class test, mBERT obtains 70.79 ± 5.74 macro F1 and SlavicBERT obtains 75.34 ± 2.54. On the binary Mallcz test, mBERT obtains 72.79 ± 3.09. These results are evidence of difficulty under particular combinations of checkpoints, corpus and settings. The authors leave the cause unresolved. Dataset size can help interpret the FB results, but it cannot on its own explain every unstable condition.
What the token and split analyses add
The token-count analysis gives a view of how the data reaches the encoder. Czert-B averages 84.5 sub-word tokens per CSFD example, 20.3 per FB example and 34.3 per Mallcz example. For mBERT, the corresponding averages are 111.6, 25.6 and 46.6. SlavicBERT’s averages are 83.6, 20.7 and 34.3. These comparisons show the role of a tokenizer in determining how much input an encoder sees as a sequence of positions. They also show why the shorter sequence budget for FB is consistent with the corpus statistics.
The review datasets include a long tail of sequences relative to the chosen limits. For Czert-B, the recorded maximum is 1000 tokens on CSFD and 1471 on Mallcz, against an input limit of 512 for both. The paper plots token distributions for representative tokenizers and uses the statistics in choosing input limits. It does not report a score comparison across lengths. The observed token counts explain the setting and show where it can matter, while the contribution of additional context to classification remains unmeasured.
The authors repeat the basic polarity experiments from Sido and colleagues with the new splits. For instance, the three-class CSFD result for Czert-B is 84.79 ± 0.26 in the earlier experiment and 84.80 ± 0.10 in the new one. On FB, the corresponding comparison is 76.55 ± 0.14 and 76.90 ± 0.38. The authors report that the repeated results do not differ significantly overall. This comparison checks continuity with earlier Czech experiments while making the new partitions available. It provides evidence about those replications. Historical scores produced with other data allocations still need to be interpreted in their original settings.
Limitations
Limits identified by the authors
The authors explicitly note that earlier Czech work is difficult to compare because of the lack of official splits and reproducible partitioning recipes. Cross-validation and custom splits can both give informative results within a study. But their scores need not estimate performance on the same distribution of examples. Reimplementing baselines and releasing partitions addresses the comparison for the new experiments. The historical claims still rely on a mixture of comparable tasks and different evaluation protocols.
An additional limit concerns training stability. The paper reports that mBERT fails to converge in the Czech-to-English experiment and that mBERT and SlavicBERT are unstable on Mallcz. The authors did not identify the reason for the Mallcz behavior. They propose a more detailed error analysis and acknowledge that more epochs might improve the randomly initialized encoder. Those points restrict how much to infer from the weak results. The reported runs show what happened under the selected training procedure and can only suggest what would happen with other schedules or training budgets.
The authors also discuss the computational attraction of a smaller encoder. Czert-B can be competitive while using fewer parameters and a much smaller vocabulary than the strongest multilingual encoder. Their appendix identifies the hardware used for Transformer fine-tuning, including NVIDIA A100 accelerators with 40GB memory each. The main comparison concerns prediction quality. It gives parameter and vocabulary sizes to contextualize the likely resource demands, with no measured latency or memory comparison from which to infer the cost of deploying each classifier.
Finally, the authors propose extending the transfer study to additional languages and domains. The reported evidence is for English and Czech movie reviews. They suggest that the strongest multilingual encoder may be capable of transferring more broadly, and present broader coverage as future work. Their study measures the task for a selected pair of languages and a selected review domain.
Limits of the experimental design
The Czech-only versus multilingual comparison ranks checkpoints that differ in multiple respects. Vocabulary, parameter count, architecture family and pretraining history all matter to the interpretation. A strong result for XLM-R-Large answers which tested starting point produced the best Czech scores. Determining the effect of multilingual pretraining in isolation would require keeping other properties fixed across language-specific and multilingual pretraining. The comparison between the two XLM-R sizes and the RandomALBERT comparison clarify parts of the picture without resolving that larger causal question.
The transfer setup removes target-language classification labels from training, while retaining prior multilingual language learning. It is evidence about transfer to Czech or English as languages already supported by the corresponding encoders. It does not establish performance on languages outside that pretraining coverage. The matching movie-review domain and compatible binary labels are also deliberate features of the setup. The study leaves open the effects of transferring across domains or using neutral labels in the target language. Its monolingual results on FB and Mallcz cannot answer those transfer questions because those runs learn directly from labels in the corresponding Czech corpora.
The reverse transfer procedure has an ambiguity in its description. The authors report selecting on the CSFD development data. Their description also covers fine-tuning with both the training and test data from Czech CSFD. The procedure therefore should not be read as using only the original Czech training partition. Whatever role the Czech source portions play, the reported reverse transfer result is evaluated on the English IMDb test set. This matters for reproducing the training recipe and for anyone trying to treat the two transfer directions as symmetric experiments.
The labeling procedures set limits on what the scores mean. On CSFD and Mallcz, polarity is a category made from a star-rating threshold. On FB it reflects annotation of the post itself, with the bipolar class omitted. Macro F1 gives the resulting classes equal influence, but it does not identify the source of a particular error. A review whose language gives a different impression from its rating still receives the rating-derived label. A high aggregate score thus establishes agreement with the designated labels across the corpus. It leaves open how well a classifier handles cases in which those labels give an incomplete account of the sentiment a reader would perceive.
The same issue applies to input length. The reported token distributions establish that some reviews exceed the selected Transformer input size. A classifier can then lose material outside its available input. The experiments do not quantify which reviews lose decisive context or whether different encoders are affected in the same way. Similarly, the paper’s aggregate comparisons offer little basis for assigning improvements to specific kinds of expressions or errors. The authors’ proposed error analysis is the part of the research agenda that would begin to explain where the stronger scores come from at the level of individual texts.
What came after
The paper closes by proposing a closer study of where polarity predictions fail, particularly where fine-tuning is unstable. The proposed analysis would shift attention from repeated aggregate scores to the examples each system gets wrong. That would give the researchers a way to distinguish disagreements associated with the data or labels from difficulties that recur with particular encoders or training conditions.
The authors also propose comparing multilingual encoders with methods that learn a linear transformation between languages’ semantic spaces. In such a comparison, the transformation would explicitly bring representations from the source and target languages into a shared space before evaluating transfer. The paper identifies this as a direction for future experiments, alongside extending the study beyond Czech and English and beyond movie reviews. Unsupervised cross-lingual mappings of word embeddings
Cite
Cite as Pavel Přibáň and Josef Steinberger. 2021. Are the Multilingual Models Better? Improving Czech Sentiment with Transformers. Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021).
@inproceedings{priban2021are,
title = {{Are the Multilingual Models Better? Improving Czech Sentiment with Transformers}},
author = {Pavel Přibáň and Josef Steinberger},
booktitle = {Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021)},
year = {2021},
url = {https://aclanthology.org/2021.ranlp-1.128/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/priban-2021-are-multilingual-models-better-improving/