---
title: "KLEJ — paper by Rybak et al. (2020) — summary and ideas"
description: "KLEJ brings Polish language understanding tasks into one benchmark and shows where HerBERT and multilingual systems perform best."
canonical: "https://research.elamur.ai/free/en/papers/rybak-2020-klej-comprehensive-benchmark-polish-language/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **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/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/) · [OCR](https://md.ocr.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/rybak-2020-klej-comprehensive-benchmark-polish-language/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/) / KLEJ: Comprehensive Benchmark for Polish Language Understanding

# KLEJ: Comprehensive Benchmark for Polish Language Understanding

Paper · 2020 · Piotr Rybak, Robert Mroczkowski, Janusz Tracz et al.

**Authors:** [Piotr Rybak](https://md.research.elamur.ai/free/en/authors/piotr-rybak/), [Robert Mroczkowski](https://md.research.elamur.ai/free/en/authors/robert-mroczkowski/), Janusz Tracz and [Ireneusz Gawlik](https://md.research.elamur.ai/free/en/authors/ireneusz-gawlik/) · **Year:** 2020 · **Venue:** Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**58** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3021457404) · [Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics](https://aclanthology.org/volumes/2020.acl-main/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2020.acl-main.111/)
- [PDF](https://aclanthology.org/2020.acl-main.111.pdf)
- [DOI 10.18653/v1/2020.acl-main.111](https://doi.org/10.18653/v1/2020.acl-main.111)
- [arXiv 2005.00630](https://arxiv.org/abs/2005.00630)
- [OpenAlex](https://openalex.org/W3021457404)

Citations: OpenAlex, 2026-10-14.

## Summary

How can researchers tell whether a system that reads Polish is broadly useful if each study tests it on different material? The authors introduce KLEJ to make those comparisons possible. It brings nine tasks into a common evaluation scheme and provides an online leaderboard. The examples include image captions, Twitter messages, consumer reviews, Wikipedia material, news summaries, and sentences from the National Corpus of Polish. Most tasks have less than 10k training examples. The authors chose relatively small training sets so that the benchmark would reward systems that can reuse what they learned from other text. That choice puts transfer at the center of the paper’s approach to [natural language understanding](https://md.research.elamur.ai/free/en/concepts/natural-language-understanding/).

Most of the material comes from existing datasets. KLEJ adapts it so that each example calls for either a category or a numerical prediction. A sentence from the national corpus can be assigned a named-entity category, for instance, and a pair of captions can receive a score for how closely their meanings are related. Other tasks ask whether one sentence follows from another, whether a tweet contains cyberbullying, whether a proposed answer is correct, or whether news summaries written in different ways refer to the same article. KLEJ also tests sentiment on familiar and unfamiliar review domains using the same training data. For Allegro Reviews, the authors collect a new set of 12k marketplace reviews and ask systems to predict the rating from the review text.

The authors also introduce HerBERT, a Polish [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) trained on several collections of text, with web material making up a large share. HerBERT earns the highest average across KLEJ and leads on cyberbullying detection and both of the familiar- and unfamiliar-domain sentiment tasks. It also has the smallest gap between those two sentiment results. Other Transformer systems do better on judging Wikipedia answers and matching news summaries. The recurrent baselines show how much prior training can matter even within a different architecture. Their average rises from 63.0 with embeddings learned from scratch to 67.7 with fastText and 76.6 with contextual ELMo representations.

The individual scores explain why the authors built a suite in the first place. Slavic-BERT beats multilingual BERT on seven of the nine tasks, but multilingual BERT does better on the Wikipedia question task. The authors point to differences in pretraining material as one possible reason for this pattern. The experiments also vary in such factors as vocabulary and training history, so they cannot isolate the effect of the corpus. HerBERT’s overall lead and the other systems’ strengths on particular tasks make the leaderboard a starting point for comparison. The task scores show what that comparison actually measures.

## Deep dive: KLEJ: Comprehensive Benchmark for Polish Language Understanding

KLEJ brings Polish language understanding tasks into one benchmark and shows where HerBERT and multilingual systems perform best. · about 36 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 Polish needed a common test

The paper starts from a change in how language systems were being built. Instead of learning everything from the labeled examples for a single task, researchers could first learn general representations from a large collection of text. They could then adapt those representations using a smaller set of examples for sentiment, inference, or another application. This practice, called [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/), makes it possible to start several tasks from the same pretrained system. The authors identify ELMo, ULMFiT, and BERT as important examples of that shift and describe the rapid development of new systems based on the Transformer.

A common starting point changes what an evaluation needs to show. A strong result on sentiment gives evidence about the particular sentiment task, but a general-purpose representation is supposed to support more than that. Researchers need to know whether the same starting point also works when the output concerns the relation between sentences, the category of a name in context, or the correctness of an answer. If each study chooses its own tasks, data partitions, and evaluation procedures, it is difficult to know how much of a published advantage will survive a change of test. A benchmark makes the comparison more informative by asking different systems to solve the same prediction problems under the same scoring rules. KLEJ applies that principle to Polish within the broader practice of [evaluation and benchmarking](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/).

The authors saw a gap between the pace of work on English and Chinese and the resources available for other languages. In Polish, there were datasets for individual problems and a venue for shared tasks. What researchers lacked was an agreed collection that made those problems easy to run and compare together. The authors’ response was partly a matter of data selection and partly a matter of interface. They needed tasks varied enough to give a meaningful picture of comprehension, and they needed a common way to specify what a system receives and what it must produce. The public leaderboard gives comparisons a place to accumulate after the initial experiments. The data design governs what those comparisons can establish.

#### What the earlier benchmarks contributed

SentEval was one precedent. As the authors describe it, SentEval evaluates sentence embeddings, which are numerical representations of sentences. Its tasks take such a representation for one sentence or separate representations for a pair of sentences, then require a category or a numerical prediction. Alongside seventeen established evaluation tasks, it supplies ten probes for investigating which linguistic properties the representations encode. The distinction matters because a representation can retain a particular kind of information without being equally helpful for every downstream use. SentEval offered a reusable toolkit for running experiments. The authors identify a public leaderboard as an additional facility that a benchmark can provide. SentEval

The Natural Language Decathlon tackled a different interface problem. It assembled ten existing tasks that ranged across activities such as translation, semantic parsing, and summarization. The designers converted them to a common question-answering format. The point of this conversion was that tasks with outwardly different outputs could all be presented in a shared form. KLEJ takes the same general problem of standardization seriously while choosing class labels and scalar scores as its common outputs. [The Natural Language Decathlon](https://md.research.elamur.ai/free/en/papers/mccann-2018-natural-language-decathlon-multitask-learning/)

GLUE supplied the closest precedent. It chose nine existing tasks, with differences in what they ask, how much training material they offer, and where the texts come from. Some tasks use a different domain at evaluation time from the one seen during training. A system that relies on cues peculiar to the training domain will then face a different distribution of expressions and topics. For the KLEJ authors, GLUE showed how selecting tasks and making them available through an online platform could turn datasets created for separate purposes into a shared research instrument. Its task mix also gave the Polish effort a way to make transfer visible through the design of the evaluation itself. [GLUE](https://md.research.elamur.ai/free/en/papers/wang-2018-glue-multi-task-benchmark-analysis/)

The paper discusses cross-language evaluations as well. XNLI used professionally translated material from the Multi-Genre Natural Language Inference corpus, with translations into 14 languages. XQuAD extended question-answering material from SQuAD through translation into 10 languages. These projects addressed the need for comparable evaluation across languages, but neither offered Polish coverage in the setup the authors describe. KLEJ pursued a different kind of breadth by bringing together Polish material from distinct sources and applications, including a Polish caption corpus whose designers took inspiration from an existing sentence-pair task. [Multi-Genre Natural Language Inference](https://md.research.elamur.ai/free/en/papers/williams-2018-broad-coverage-challenge-corpus-sentence/) · [XQuAD](https://md.research.elamur.ai/free/en/papers/artetxe-2020-cross-lingual-transferability-monolingual-representations/)

#### What was already available in Polish

There were Polish precedents for both probing and shared evaluation. One study made a Polish version of the SentEval probes. The KLEJ authors regard it as most directly suited to questions about which linguistic properties sentence embeddings preserve. PolEval, meanwhile, organized an annual set of competitions. Across its first three editions it assembled 11 tasks and drew over 40 teams. That activity supplied a range of evaluation material, but the tasks lacked a common interface. KLEJ imports the PolEval cyberbullying task directly because it already has a prediction format suitable for the suite.

The authors also discuss an earlier Polish benchmark with sentiment, topic classification, and a translation of SICK, a dataset for relatedness and entailment. That effort showed that there was enough material to assemble a collection of evaluations. KLEJ uses the same underlying sentiment resource for a more demanding setup and draws its relatedness and entailment examples from a corpus built for Polish. The authors judged topic classification too easy for the collection they wanted. They also made room for inputs longer than isolated sentences. Full reviews and news summaries bring different demands because the evidence relevant to a prediction can be distributed across the input.

These precedents explain the shape of the benchmark. A collection can be coherent even when it asks different substantive questions, as long as it defines the inputs, outputs, and scores clearly enough for a researcher to run them together. KLEJ treats the choice of genres and task formats as part of the scientific design. It also includes problems for which the labeled training examples are a limited source of knowledge. The benchmark can then reveal whether the representations learned earlier carry over to unfamiliar text and objectives.

### The method, step by step

#### From a source corpus to a prediction task

The authors begin with material that already has useful structure. A corpus may have entity spans, pairs of captions with human judgments, reviews with sentiment labels, or articles with summaries. They decide what prediction can be made from that structure. A classification task asks for a label from a fixed set. A regression task asks for a numerical estimate, such as a score for relatedness. Most KLEJ tasks are instances of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/). The two regression tasks use different metrics because one cares about ordering and the other about errors in rating prediction.

The next decisions concern which examples to include and how to divide them. Training examples supply labeled material for adaptation. Development examples support choices made during training or evaluation preparation. Test examples are reserved for assessing the resulting system. What counts as a meaningful separation depends on the task. Reviews from a new domain provide a different test from fresh reviews about familiar kinds of services. A split that holds out named entities asks a different question from one that merely holds out sentences. KLEJ uses these distinctions to determine what prior exposure is allowed to help.

How KLEJ turns Polish text into benchmark scores The steps in order.

The shared technical interface leaves room for substantial differences in how the data is made. Cyberbullying detection already supplies examples that need little adaptation. The question and summary tasks require the authors to construct pairs whose wording makes incorrect candidates plausible. The entity annotations have to be converted from information about particular spans into a label for an entire sentence. Each transformation brings a richer resource into a common format, and each determines which part of the original resource the resulting test measures.

#### Turning entity annotations into sentence labels

NKJP-NER starts from the human-annotated portion of the National Corpus of Polish. The source subset contains 85k sentences drawn from a larger collection intended to represent contemporary Polish. Traditional [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/) involves identifying the text that forms an entity mention and assigning a type to it. In KLEJ, the output is a sentence label indicating the kind of entity present, with a separate category for sentences without an entity. This makes the output compatible with the classification interface.

The authors first discard sentences that contain entities of different types. Those sentences could require more than one type label under a sentence-level formulation. They then arrange the training, development, and test sets so that an individual named entity occurs in only one partition. A test sentence therefore cannot be solved simply by recalling the category assigned to that same entity in training. The system can still learn contextual cues and patterns in names. Holding out entities is what makes those cues useful in a way that repeating the same names across partitions would make harder to judge.

The authors also reduce the number of examples in the person-name category, merge the categories for dates and times, and sample sentences with no annotation for the noEntity class. These choices give a final dataset of 20k sentences and six classes. Accuracy measures the fraction of sentences assigned the correct category. The evaluated prediction is the sentence’s class, so a correct decision earns credit without requiring the system to mark the span where the evidence appears.

#### Asking two questions about the same caption pairs

The Compositional Distributional Semantics Corpus supplies pairs of sentences from image captions. Its source images span 46 thematic groups. Human annotators provide judgments about how closely the sentences are related and whether one follows from the other. KLEJ uses these judgments in separate tasks. This makes it possible to test [semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/) and inference with the same kind of input while holding the outputs to different standards.

CDSC-R asks for a relatedness score on a scale from 0 to 5. The lower endpoint means that the sentences are unrelated, and the higher endpoint indicates close relatedness. Each target averages the judgments of three annotators. The use of Spearman correlation means that the evaluation compares the ranking of predictions with the ranking of human scores. A system can rank two pairs in the right order even if its numerical estimates differ from the scores the annotators assigned. For this task, an ordering that follows human judgments is what the metric rewards.

CDSC-E begins by treating one sentence as the premise and the other as the hypothesis. The system predicts entailment when the premise implies the hypothesis, contradiction when it conflicts with it, and neutral when the premise leaves the hypothesis unresolved. Direction matters here. A broad description may be implied by a more specific one without also implying the missing details of the specific description. Relatedness and entailment can therefore give different answers about a pair. KLEJ uses accuracy for CDSC-E, following the earlier evaluation cited by the authors. Neutral is the most common label, which affects how much information that accuracy can convey about performance on the other categories.

#### Testing sentiment with and without a domain change

CBD takes a Twitter message and predicts whether it contains cyberbullying. The authors reuse the task from PolEval’s 2019 edition with its original scoring approach. The F1 score combines precision, which asks how many predicted positive cases were correct, with recall, which asks how many of the actual positive cases were identified. This gives credit for finding cases of cyberbullying while making false alarms matter to the score.

PolEmo2.0 offers a more explicit way to examine the relationship between the training and test texts. Its source material contains over 8000 consumer reviews from medicine, hotels, products, and universities. About 85% of the reviews come from the medicine and hotel domains. The source corpus has human annotations for both full reviews and their component sentences. KLEJ uses the review-level labels. The possible decisions are positive, negative, neutral, and ambiguous. This is a fixed-category task in [sentiment analysis](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/).

PolEmo2.0-IN and PolEmo2.0-OUT share the medicine and hotel training data. For IN, the evaluation stays in those domains. For OUT, it moves to product and university reviews. The category vocabulary remains applicable across the two settings, while the subjects and ways of expressing judgments can change. Keeping the training material fixed gives the paper a basis for asking whether a system’s performance holds up when the test reviews are about different things.

The available held-out samples for the two out-of-domain categories originally contained 50 reviews each. To make the OUT evaluation larger, the authors repurpose 900 reviews from the original out-of-domain training material and construct new development and test partitions. They describe the resulting OUT task as comprising 1000 reviews and compare its scale with the in-domain test dataset of 1400 reviews. The 1000 figure describes the OUT collection created through the new split. IN uses accuracy for review labels, and comparing IN and OUT puts the same kind of prediction under two domain conditions.

#### Selecting plausible answers to Wikipedia questions

Czy wiesz? starts from almost 5k question-answer pairs drawn from the Polish Wikipedia feature of that name. Wikipedia contributors wrote questions and associated them with relevant articles. For a previous question-answering experiment, the dataset creators evaluated responses to 1.5k questions. For each, they took the top 10 outputs of their system and annotated whether the answers were correct. Those judgments make it possible to reuse actual candidate answers for a task with both positives and negatives.

The original annotators also selected relevant contiguous passages from positive responses for 250 questions. The KLEJ authors continue this process by manually shortening the remaining positive examples to relevant material. They then use those passages as correct answers. The KLEJ prediction concerns the correctness of an answer already paired with the question. Locating an article, extracting an answer, and writing one would each require a different evaluation. Here the benchmark assesses the decision about the candidate in a [question-answering](https://md.research.elamur.ai/free/en/concepts/question-answering/) setting.

Incorrect candidates vary in usefulness as test examples. An answer with little vocabulary in common with the question might be easy to reject. The authors use overlap among tokens produced by byte-pair encoding, or BPE, to find incorrect candidates whose wording more closely resembles the wording of the question. BPE splits text into recurring units that can include pieces of words. Overlap can therefore reflect some shared word material even where full word forms differ. The authors use it as a measure for selecting examples. A human judgment about answer correctness continues to supply the label. [Subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/) · [Byte-pair encoding for text](https://md.research.elamur.ai/free/en/papers/sennrich-2016-neural-machine-translation-rare-words/)

For each question, the authors keep the four incorrect candidates with the highest overlap, dropping any that fall below a cutoff.

```
τ = 0.3
```

The symbol τ is the minimum similarity threshold for retaining a negative answer at this stage. The value 0.3 belongs to the BPE overlap used in candidate selection. It is a property of the constructed dataset instead of a threshold a submitted system has to use for its correctness predictions.

The authors find that negative answers tend to be considerably longer than positive answers. A classifier could then treat length as an indirect label. To reduce that cue, they select more relevant portions of the incorrect answers. Their score for this selection uses overlap and penalizes candidates that contain more sentences.

```
sim̂_BPE = sim_BPE / 1.2^(#sents)
```

The symbol sim̂_BPE denotes the BPE overlap score after the sentence-count adjustment. The right-hand term sim_BPE is the unadjusted similarity between the question and a candidate passage. The slash means division. The exponent #sents is the number of sentences in that passage, and 1.2 is the base raised to that exponent. At equal overlap, a passage with more sentences has a larger denominator and receives a lower adjusted score. This lets the selection procedure prefer a shorter passage when it retains relevant wording. The benchmark uses F1 for the final predictions because correct and incorrect examples are unevenly represented.

#### Making news-summary pairs difficult to judge by wording

The Polish Summaries Corpus (PSC) provides summaries of 569 news articles. Each article received five separate extractive summaries, with each annotator selecting about 5% of the original text. An extractive summary consists of selected text from the article. For a subset of 154 articles, the corpus adds five abstractive summaries apiece. An abstractive summary can convey the article’s content without being assembled from copied passages. KLEJ uses the connection to the source article to assign labels to pairs formed from the two summary styles.

For a positive pair, the authors take an extractive summary and select the two least similar abstractive summaries written for the same article. Similarity here means BPE token overlap, as in the answer-selection procedure. Choosing from the low-overlap end of the candidates makes positives less predictable from common wording. The link to the same article supplies the positive label even if the two annotators highlight different aspects of the story.

For negative pairs, the authors start with an extractive summary and seek the two most similar abstractive summaries from other articles. They drop negatives below a separate overlap threshold.

```
τ = 0.15
```

Here τ is the cutoff for keeping a candidate negative pair in PSC. The value 0.15 refers to overlap between summaries and is used in constructing the benchmark examples. Two texts from different articles can share a subject or vocabulary and remain a negative pair under the benchmark’s definition.

The authors further restrict how often the same articles can be paired. The procedure allows at most one negative example for each pair of source articles, rather than repeatedly contrasting two stories through different summaries. The resulting dataset contains around 4k examples. The training and test split is randomized according to the source article of the extractive summary. This keeps extracts from the same article on the same side of the split. F1 measures the system’s decisions about whether the summaries belong to the same article. The construction puts similar wording and shared provenance in deliberate tension, which makes the task more demanding than grouping summaries by common terms alone.

#### Treating marketplace ratings as ordered predictions

Allegro Reviews, or AR, is the new dataset collected for KLEJ. It contains 12k reviews from the Allegro marketplace. Each review has at least 50 words and an associated customer rating, on a scale from one for a negative review to five for a positive one. The review is the input, and the rating is the prediction target. The ratings are ordered, so the authors choose a measure that takes the distance between a prediction and its target into account. A small miss just above or below the true rating has a different cost from predicting the opposite end of the scale.

The authors rescale ratings so the endpoints are zero and one. They compute mean absolute error within each true rating class and then take the unweighted average over the classes. The absolute error is the distance between one predicted value and its target, regardless of which is higher. Averaging within classes first gives each rating class equal influence in the final error even when some ratings occur more often. The authors call the resulting class-averaged error wMAE and transform it into a score.

```
1 − wMAE
```

The symbol wMAE is the macro-average of the class-specific mean absolute errors on the rescaled ratings. The constant 1 is the upper endpoint of the rescaled target range. The minus sign subtracts the error from that endpoint so that a lower error yields a higher benchmark score, in the same direction as accuracy and F1. The transformation preserves the ranking by error in reverse order. It retains a distinction between near and distant misses that would disappear if each rating were scored solely as correct or incorrect.

#### Preparing HerBERT’s reading material

The paper makes two distinct uses of corpora. The labeled collections supply the benchmark tasks. The pretraining corpora give HerBERT text from which to learn before it sees labels for those tasks. The authors could use the annotated NKJP material for the entity benchmark, but copyright constraints prevented using the full national corpus for HerBERT pretraining. They assembled a larger, less representative collection from other sources and retained a publicly available part of the national corpus for learning the tokenizer.

Polish Wikipedia contributes encyclopedic prose. The paper compares its size of 260M words with 3700M words for English Wikipedia to explain the difference in available material. The authors use the extraction procedure associated with XLM to clean the Polish dump. They retain capitalization and diacritics. Thus the cleaned text still distinguishes written forms that would have been merged by lowercasing or by removing Polish diacritical marks.

Wolne Lektury supplies literature, both works originally written in Polish and translations into Polish. The repository has over 5k books. The predominance of works from the 19th or 20th century makes it a useful source of edited prose with a different period and register from contemporary reviews. Open Subtitles contributes conversational material from films and television. It offers many short lines, and the authors note that the quality of community-supplied translations can vary. [OpenSubtitles2016](https://md.research.elamur.ai/free/en/papers/lison-2016-opensubtitles2016-extracting-large-parallel-corpora/)

Much of the web material comes from the Polish portion of OSCAR, which organizes text from Common Crawl by language and removes duplicates. The authors use OSCAR texts longer than 100 words. They also include over 30k Allegro articles, among them shopping guides and product-oriented writing. The paper describes these articles as the smallest of the pretraining corpora. They supply edited text in a domain of interest to the authors. Allegro Articles is a source of pretraining text, whereas Allegro Reviews supplies the rated examples for a benchmark task.

#### Learning to predict masked Polish text

The authors learn HerBERT’s BPE segmentation using Wolne Lektury and the public subset of NKJP. They select those sources for their perceived text quality and cap the vocabulary at 50k tokens. A learned vocabulary establishes which recurring sequences will be represented as units when the various pretraining corpora are segmented. It can therefore be trained on a narrower set of sources than the system subsequently reads. Learning segmentation from a public subset of NKJP is compatible with excluding the full national corpus from HerBERT’s pretraining material.

After tokenization, the authors discard documents shorter than 20 tokens and use segments of at most 512 tokens. They generally preserve document coherence by leaving short pieces separate. Filling every segment with fragments from unrelated sources would create abrupt topic changes within a training example. The exception is subtitle material, where the authors join consecutive portions of dialogue to form longer documents. The rationale is that those short fragments can supply context for each other. The paper reports a slight downstream advantage for the preprocessing setup as a whole over simply taking all available data.

HerBERT uses the BERT base architecture, with 12 layers, 12 attention heads, and a hidden dimension of 768. Its bidirectional encoder can use context on either side of the part of the text it is trying to recover. The training objective is masked language prediction. Some input tokens are hidden, and the system learns to recover them from the surrounding text. The authors select words for masking and hide all tokens corresponding to each selected word. If segmentation divides a word into several pieces, exposing one of those pieces could give away part of the answer. Whole-word masking removes that clue. [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/)

Masking is dynamic in HerBERT. The positions to hide can change when training revisits the same material. A document can consequently supply different prediction problems on different encounters. The authors take this choice from RoBERTa. They omit the next-sentence prediction objective, which in the original BERT training scheme asks about the relationship between consecutive inputs. Their reasoning draws on earlier studies discussed in the paper that found little downstream benefit from that additional objective. HerBERT’s objective concentrates on recovering hidden content. [RoBERTa](https://md.research.elamur.ai/free/en/papers/liu-2019-roberta-robustly-optimized-bert-pretraining/) · [XLNet](https://md.research.elamur.ai/free/en/papers/yang-2019-xlnet-generalized-autoregressive-pretraining-language/)

The optimizer is Adam. Its first-moment decay parameter β₁ is 0.9, its second-moment decay parameter β₂ is 0.999, and the small numerical stabilizer ε is 10⁻⁸. The learning rate governs how large the parameter updates can be. It rises over the first 500 steps, reaches 10⁻⁴, and declines linearly thereafter. Pretraining uses a batch size of 570 examples per update and runs for 180k steps. The authors report that the run was still showing room for progress when it ended. [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/)

### Experiments and results

#### Building a comparison from different starting points

The evaluation includes a simple reference that samples targets from the training set. Such a predictor gets information from the observed targets, but its decision for a particular example is independent of the meaning of that example. The text-based comparisons range from a recurrent encoder with embeddings learned from scratch to recurrent systems supplied with pretrained representations and Transformer systems with multilingual or Polish pretraining. The range gives the authors two comparisons of interest. They can look at what externally learned representations contribute within the recurrent family, and they can compare the profiles of systems that underwent different large-scale pretraining.

The recurrent starting point is a bidirectional long short-term memory encoder, or BiLSTM. It processes a sequence in both directions. The architecture has two layers with 1024 hidden units and 300-dimensional word embeddings. Max pooling takes the maximum value along the input sequence for each feature to form the representation supplied to a task-specific predictor. The predictor is a multilayer perceptron with a hidden layer of dimension 512. The common encoder gives the tasks a place to share what they learn, and the separate predictors let each task produce the output it requires.

Recurrent training has a joint stage followed by individual adaptation. In the first stage, the encoder and the task predictors learn across KLEJ. Progress is tracked by taking the macro average of the task metrics. In the usual second stage, the encoder is frozen and each predictor is adjusted for its own task. Both stages begin at a learning rate of 10⁻⁴ and decrease it linearly to 10⁻⁵. The batch size is 128, with 64 used for the ELMo version. When a task has no development set, the authors set aside 10% of its training examples for validation. The recurrent experiments use jiant, and the reported performance is the median of 5 runs.

The simplest BiLSTM learns its word embeddings without starting from external pretrained vectors. The fastText variant starts from Polish vectors learned from Common Crawl and Wikipedia. This changes what the recurrent system knows when it begins learning the benchmark tasks. ELMo instead supplies representations that depend on the sentence context. Under fastText, an initial word representation provides a reusable account of the word across occurrences. ELMo can give different representations to the same form depending on the words around it. The authors use publicly available Polish ELMo weights. [Word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/) · [fastText](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/) · [ELMo](https://md.research.elamur.ai/free/en/papers/peters-2018-deep-contextualized-word-representations/)

The Transformer comparisons begin with multilingual BERT, XLM-17, and Slavic-BERT. Multilingual BERT is the cased version trained on Wikipedia in 104 languages, including Polish. Its shared WordPiece vocabulary has 110k entries. Its original objectives include both masked prediction and next-sentence prediction. XLM-17 also reads Wikipedia during pretraining, covering 17 languages. Its vocabulary was learned after undersampling the most common languages to bring their representation closer to that of languages with fewer tokens. It also omits next-sentence prediction and uses a larger architecture. The paper lists 16 versus 12 for both layer count and attention-head count, 1280 versus 768 for hidden size, and 200k versus 110k for vocabulary size, with XLM’s configuration first in each comparison.

Slavic-BERT starts from multilingual BERT weights and continues training for Polish, Czech, Russian, and Bulgarian. Its further training includes Russian news as well as Wikipedia. This is a case of adaptation from a broader multilingual starting point to a smaller group of languages, with a change in corpus composition at the same time. HerBERT provides the Polish-specific comparison. It has a dedicated vocabulary and the mixture of literary, encyclopedic, conversational, and web material described earlier. [Slavic-BERT](https://md.research.elamur.ai/free/en/papers/arkhipov-2019-tuning-multilingual-transformers-language-specific/)

For the Transformer evaluation, adaptation is separate for each task. The stated schedule uses 4 epochs, a batch size of 32, and a 100 iteration warm-up before the linear decay from a learning rate of 2 × 10⁻⁵. The Adam settings are β₁ at 0.9, β₂ at 0.999, and ε at 10⁻⁸. These settings describe downstream adaptation, which has a different batch size and schedule from the original HerBERT pretraining. The authors use the Transformers software package and again summarize performance with the median of 5 runs. The benchmark compares what the systems can do after adaptation to labeled Polish tasks. [Transformers](https://md.research.elamur.ai/free/en/papers/wolf-2020-transformers-state-art-natural-language/)

#### What the average tells us

The paper computes an average across the task scores to give an overview of performance. The average combines outcomes from different metrics. Accuracy describes how often a category decision is right, F1 reflects the balance between finding positives and avoiding false alarms, and Spearman correlation assesses ranking. The Allegro Reviews score reflects class-balanced distances from the recorded ratings. Transforming the rating error makes higher values favorable across the benchmark. Averaging then gives each task a role in the headline result, even though its individual score has to be read according to the underlying metric.

The recurrent baselines show a progression as the source of the word representations changes. The BiLSTM whose embeddings are learned from scratch has an average of 63.0. Initialization with fastText brings that average to 67.7. The ELMo version reaches 76.6. These are averages across KLEJ, so they summarize different kinds of predictions. The strongest recurrent configuration can also be competitive on individual tasks. The paper reports that a fine-tuned ELMo configuration earns the best score on two of them. Every tested Transformer system nonetheless averages above every recurrent baseline.

Recurrent baselines by average score across KLEJ tasks The BiLSTM using contextual ELMo representations has the highest average among the recurrent baselines shown.

**The numbers**

| System or setting | KLEJ average score |
| --- | --- |
| BiLSTM learned from scratch | 63.0 |
| BiLSTM with fastText | 67.7 |
| BiLSTM with ELMo (this paper) | 76.6 |

HerBERT has the highest reported average across the full comparison. Its individual leads are in CBD, measured by F1, and PolEmo2.0-IN and PolEmo2.0-OUT, which test sentiment classification. These results cover two kinds of online text and two versions of the review-domain evaluation. HerBERT also has the smallest gap between its scores on the two PolEmo settings. The authors interpret that gap together with its task leads as evidence that the sentiment predictor carries over comparatively well from the medicine and hotel training material to the product and university reviews.

Czy wiesz? and PSC show a different ordering. The other Transformer systems are stronger than HerBERT on the Wikipedia answer task, and the authors also identify the news-summary comparison as a relative weakness for HerBERT. The latter result concerns decisions about paired summaries, so it speaks to how well a system matches them to a common source under the benchmark’s candidate construction. It has no bearing on the quality of summaries a system would write. Similarly, the Wikipedia F1 results concern recognition of correct answers among the selected pairs.

The comparison within the multilingual group also depends on the task. Slavic-BERT exceeds multilingual BERT on seven of the nine evaluations. On Czy wiesz?, both multilingual BERT and XLM-17 score higher than Slavic-BERT. The overall pattern is one of different strengths under different evaluation conditions. The average identifies the strongest general showing in the reported experiments. A researcher interested in one kind of input or decision can use the individual metrics and splits to see whether that ordering holds for the relevant task.

### What the ablations show

#### What changes when the recurrent encoder gets pretrained representations

The paper contains targeted comparisons of embeddings and ELMo adaptation, alongside comparisons among pretrained systems whose design differences are harder to separate. The closest comparison to changing a single ingredient is the baseline BiLSTM versus the version initialized with fastText. The base encoder and the joint task-learning setup are shared, while the word vectors have a different starting point. The higher average with fastText supports the claim that access to Polish text before benchmark training helps this recurrent setup. Both systems have opportunities to share information across tasks in the joint stage. The contrast is between learning the initial word representations from the benchmark training process and beginning with vectors learned from a larger external corpus.

The ELMo comparison also favors pretrained representations, with contextual information now part of what is supplied to the recurrent system. The authors investigate variants of downstream training in which the recurrent sentence encoder can be updated while the embedding weights stay fixed. They also try adding attention between words across the inputs for sentence-pair tasks. That mechanism allows information from one sentence to inform the representation used in comparing it with the other. The paper’s account establishes competitive performance for the ELMo family, including task-leading results for a fine-tuned configuration. It does not isolate a numerical contribution for attention, contextualization, and the adaptation regime separately. Each is a plausible contributor to results produced by the configurations in which it was used.

#### What the domain comparison can separate

The two PolEmo tasks share their training reviews and sentiment labels. Their intended change is the domain of the evaluation material. This makes them a more focused comparison than choosing an arbitrary pair of KLEJ tasks with different inputs and metrics. The score gap gives information about transfer away from medicine and hotels within this particular sentiment resource. A small gap would be hard to interpret in isolation because similarly weak performance in both settings could also produce one. HerBERT’s lead in both settings makes its small gap informative in a more specific sense. It carries a strong in-domain result into the product and university material, relative to the other systems evaluated.

The paper also compares patterns across tasks and pretraining sources. HerBERT and the ELMo systems draw heavily on web-crawled language. The authors note their strengths on tasks with online text, including tweets and consumer reviews. The Wikipedia-oriented Transformer systems have an advantage on the question-answer pairs drawn from Polish Wikipedia. Seeing the source of the test material line up with a source used during pretraining makes domain exposure a credible explanation. The experiment does not hold other aspects of pretraining fixed, so the alignment supports a hypothesis about domain match. It does not quantify the benefit obtained from any particular corpus.

#### What remains entangled in the Transformer comparison

Slavic-BERT’s record against multilingual BERT is consistent with the authors’ suggestion that concentrating on fewer languages can help Polish. But the systems also differ in tokenization, training history, and exposure to Russian news. Slavic-BERT inherits multilingual BERT’s weights and receives further training. Its gains could be attributable to that continuation, to the change in vocabulary, to its new text, or to interactions among them. The authors explicitly say that a detailed ablation would be needed to decide which changes are responsible. Slavic-BERT’s weaker Wikipedia answer result also shows that the overall pattern of improvements does not describe every task.

The paper reports a slight downstream benefit from HerBERT’s preprocessing setup compared with using all the available material. That comparison concerns the setup as a bundle. Short-document filtering, the decision to preserve coherent segments, and the treatment of subtitles serve different purposes, and the paper gives no isolated effect size for each. The same evidential distinction applies to whole-word masking, dynamic masking, and the omission of next-sentence prediction. The authors explain those choices and give precedents for them. The benchmark results measure the trained system produced by the combined choices.

### Limitations

#### Limits identified by the authors

KLEJ is designed to measure predictive performance. The authors single out efficiency as the main aspect left out of the benchmark. Its rankings do not incorporate how much text a system needed to learn from, how fast it runs, or how many parameters it uses. Those quantities matter if the comparison is intended to answer whether a system is practical under a given resource budget. The paper raises the possibility of further evaluations with explicit efficiency requirements. Its own results address the quality of the submitted predictions under the scoring scheme.

The authors also treat the benchmark average as an overview. Tasks differ in difficulty and the metrics have distinct meanings. Consequently, an average can bring results together for a quick comparison while leaving open why a particular system leads. HerBERT’s overall result provides evidence of broad competitiveness across KLEJ. Its results on the Wikipedia and news-summary tasks qualify claims that it offers the strongest approach to every kind of Polish text.

The authors identify limitations of the pretraining collection. Copyright restrictions kept the full National Corpus of Polish out of it, and they describe the alternative collection as less representative. Wolne Lektury includes a substantial amount of older writing, while subtitles represent fragmented conversational language and can vary in translation quality. These sources expand coverage while bringing different selection effects. The authors’ description of the HerBERT run also leaves its eventual performance open. They saw no saturation at 180k training steps, so the reported comparison concerns the system at the stage of training they evaluated.

#### What the construction of the tasks leaves open

The common interface makes the tasks easier to compare by narrowing their outputs. NKJP-NER asks for a category for a sentence. A high score gives evidence that the system can infer the category, potentially from the entity and its context. It does not directly show how well the system locates names in unrestricted text or handles a sentence with entities of several types. The authors’ entity-disjoint split increases the difficulty of the adapted task, while the decision to remove mixed-type sentences limits the range of cases under evaluation. Both choices matter when relating the benchmark to ordinary entity recognition.

Czy wiesz? begins after candidate answers have been supplied, and its negatives are chosen in part because their words or word pieces overlap with the question. A high score shows skill at judging answers under that construction. It cannot establish how well a system would retrieve the article that contains the answer, or how it would behave on candidates generated by a different search procedure. Shortening the negatives reduces an apparent length cue, but it does not demonstrate that every cue introduced by the selection procedure has been eliminated. The distribution of examples reflects both Wikipedia and the way KLEJ builds the pairs.

PSC similarly defines correctness through article identity. Two summaries of the same article can emphasize different details. Summaries of different articles can describe closely related events. The pair label settles which examples count as positive for the benchmark, even in cases where a general judgment of similarity would be less clear. The paper describes the split using the article underlying the extractive summary. That grouping gives a definite guarantee about extracts. It does not by itself establish that every article used on the abstractive side is confined to the same partition or that every underlying news event is disjoint across training and test.

Other limits come from the choice of scoring. For CDSC-E, neutral labels are frequent, so an accuracy score leaves open how well the less frequent entailment and contradiction cases are handled. For CDSC-R, the target averages human judgments and the metric measures ranking. Good rank correlation tells us that the system tends to order the pairs as the human scores do. It does not demonstrate that the system can match those scores in absolute terms or represent disagreements between annotators. In AR, the class-balanced error establishes how close predictions are to the recorded ratings, with each rating class receiving equal weight. Its interpretation depends on accepting those ratings as the target for review sentiment.

PolEmo2.0-OUT supplies a particular domain shift. The training inputs are medicine and hotel reviews, and the changed evaluation concerns product and university reviews. Other transitions might pose different linguistic problems. An advantage in this setup gives evidence for transfer across these review sources. It cannot on its own establish robustness to unrelated shifts, such as changes in genre or in the labels people use to express judgments. This is an example of a meaningful test whose interpretation becomes stronger when its boundaries are kept explicit.

#### What the system rankings cannot decide

The evaluation ranks the systems as trained and tested in the paper. It does not disentangle benefits from architecture, corpus, tokenizer, training history, and downstream adaptation across the full comparison. When two systems enter with different histories, equal downstream schedules give them comparable treatment at that stage. They cannot retroactively match their budgets or what they encountered in pretraining. Similarly, taking the median of several runs limits the influence of an unusually strong or weak run, while leaving uncertainty about the size and stability of particular leads unless run-to-run variation is also examined.

The intended breadth of KLEJ is breadth within the chosen tasks. Several distinguishable abilities have been put under the same evaluation framework, but each task still asks a bounded question. The absence of a system that leads everywhere supports the authors’ conclusion that the collection offered meaningful room for further comparison. It does not define a threshold at which Polish comprehension in general would be considered solved. The most interpretable claims name the kind of text, the prediction, and the metric that produced the observed result.

### What came after

#### Continuing work on Polish representations

The later HerBERT paper carries forward the Polish Transformer introduced alongside KLEJ. Its stated focus is efficient pretraining, bringing the process of developing the Polish system into the foreground. In the benchmark paper, HerBERT serves as a substantive entry in the shared comparison, and efficiency is identified as a dimension the leaderboard leaves open. The follow-up’s focus connects those two threads. The name and research direction establish the continuation, while the original KLEJ experiment remains the evidence for the task results reported here. [HerBERT](https://md.research.elamur.ai/free/en/papers/mroczkowski-2021-herbert-efficiently-pretrained-transformer-based/)

Another Polish study asks how transfer works in a text-to-text setting. That is a different way of presenting a range of language tasks through a common interface. KLEJ provides a category or number as the expected output for each input. A text-to-text approach frames both the input and the response as text. The connection is the question of what knowledge a shared pretrained system can bring to multiple Polish tasks, even when the form of its required answers changes. [Evaluation of Transfer Learning for Polish with a Text-to-Text Model](https://md.research.elamur.ai/free/en/papers/chrabrowa-2022-evaluation-transfer-learning-polish-text/)

PL-MTEB directs the benchmark idea toward Polish text embeddings. An embedding evaluation concerns the usefulness of the numerical representation derived from a text. That connects to one of the distinctions in KLEJ’s experiments, where fastText and ELMo supply different kinds of representation to a recurrent predictor. KLEJ measures complete task predictions after training or adaptation. A benchmark centered on embeddings puts the representation itself at the center of the comparison. [PL-MTEB](https://md.research.elamur.ai/free/en/papers/poswiata-2026-pl-mteb-polish-massive-text/)

BEIR-PL addresses zero-shot [information retrieval](https://md.research.elamur.ai/free/en/topics/information-retrieval/), which asks how well a system can find relevant material without task-specific training for the target evaluation. The retrieval objective brings back a stage that KLEJ’s Wikipedia task leaves outside its scoring. KLEJ presents a specific question with a candidate answer and asks whether the answer is right. Retrieval evaluates the ability to surface relevant items from a collection in the first place. The two benchmark designs put measurements at different stages of moving from a question to useful evidence. [BEIR-PL](https://md.research.elamur.ai/free/en/papers/wojtasik-2024-beir-pl-zero-shot-information/)

#### Building comparable evaluations for other languages

ScandEval takes up the benchmark problem for Scandinavian natural language processing. Its scope is regional, while KLEJ concentrates on Polish. Their connection is the need for a common evaluation that directly represents the languages of interest. A benchmark organized this way can give language coverage and task selection explicit roles in a comparison. The citation connects the work to KLEJ’s precedent for constructing a shared evaluation around a language that earlier general-purpose suites did not cover. [ScandEval](https://md.research.elamur.ai/free/en/papers/nielsen-2023-scandeval-benchmark-scandinavian-natural-language/)

Superlim takes up Swedish language understanding. Its stated purpose is close to KLEJ’s because both make a named language the focus of a benchmark for understanding text. KLEJ’s design shows what such a project has to specify to make its scores interpretable, including the prediction expected from each example and the relationship between training and test material. The scope of Superlim establishes the corresponding evaluation direction for Swedish. [Superlim](https://md.research.elamur.ai/free/en/papers/berdicevskis-2023-superlim-swedish-language-understanding-evaluation/)

Mukayese takes Turkish natural language processing as its focus. Together with the Scandinavian and Swedish projects, it illustrates the reach of the problem KLEJ identified. A research community needs a shared way to evaluate systems on the language and applications that concern it. The titles and citation relationships establish that common direction across the projects. They do not specify which KLEJ tasks, if any, were adapted or which scoring rules the later benchmarks used. [Mukayese](https://md.research.elamur.ai/free/en/papers/safaya-2022-mukayese-turkish-nlp-strikes-back/)

#### Defining narrower tasks and corpora

Several citing works concentrate on specific forms of Polish online or public discourse. BAN-PL concerns banned harmful and offensive content from Wykop.pl. KLEJ’s CBD task concerns cyberbullying on Twitter. The relation is one of domain and target definition. Each project makes a specific source of online language and a particular category of interest central to the data. A result on one of these categories would leave open how a system handles the other because the content source and the criterion for inclusion differ. [BAN-PL](https://md.research.elamur.ai/free/en/papers/kolos-2024-ban-pl-polish-dataset-banned/)

MIPD introduces a Polish disinformation corpus that puts manipulation and intention at the center of the research question. The Electoral Agitation Dataset concentrates on language connected to a Polish election. Both concern specific phenomena in public communication. They extend the range of questions for which a Polish corpus is available, beyond the labels supplied by KLEJ’s sentiment or cyberbullying tasks. The documented connection is the citation of KLEJ by work defining its own objects of study, with distinct subject matter in each case. [MIPD](https://md.research.elamur.ai/free/en/papers/modzelewski-2024-mipd-exploring-manipulation-intention-novel/) · [Electoral Agitation Dataset](https://md.research.elamur.ai/free/en/papers/baran-2022-electoral-agitation-dataset-use-case/)

The forePLay work concerns an annotated dataset of Polish erotic discourse. Its stated contribution is the creation and investigation of material from a particular register. KLEJ assembles substantially different genres so that its score cannot be determined by success on a single text source. forePLay’s focus gives a specific register the attention that a broad suite can give only to the material it includes. Those are different ways to make the source of language an explicit part of the research. [forePLay](https://md.research.elamur.ai/free/en/papers/kolos-2025-behind-closed-words-creating-investigating/)

The Śmigiel dataset lays groundwork for detecting machine-generated text in Polish. This widens the range of Polish classification problems represented by the citing work. The target concerns how the text was produced. In KLEJ, typical targets concern something expressed in the text, such as sentiment, or the relation between texts, such as whether an answer fits a question. Shared classification machinery can accommodate both kinds of task, while the labels determine what evidence a successful prediction provides. [Śmigiel Dataset](https://md.research.elamur.ai/free/en/papers/strebeyko-2026-smigiel-dataset-laying-foundations-investigating/)

The later benchmark for real-world knowledge injection asks about memorization in bidirectional language systems. KLEJ uses a Polish bidirectional encoder and includes tasks for which knowledge beyond a small labeled set can help. Its results still concern downstream predictions. A benchmark expressly about knowledge injection asks a more focused question about what happens to particular information made available to a system. The citing relationship places the work in a related line of evaluation, while the question stated in its title identifies a different claim to test. [A Benchmark for Real-world Knowledge Injection](https://md.research.elamur.ai/free/en/papers/zhang-2026-bidirectional-lms-are-better-knowledge/)

## Cite

Cite as Piotr Rybak, Robert Mroczkowski, Janusz Tracz and Ireneusz Gawlik. 2020. KLEJ: Comprehensive Benchmark for Polish Language Understanding. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2020.acl-main.111](https://doi.org/10.18653/v1/2020.acl-main.111) · [arXiv 2005.00630](https://arxiv.org/abs/2005.00630)

```bibtex
@inproceedings{rybak2020klej,
  title = {{KLEJ: Comprehensive Benchmark for Polish Language Understanding}},
  author = {Piotr Rybak, Robert Mroczkowski, Janusz Tracz and Ireneusz Gawlik},
  booktitle = {Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.111},
  eprint = {2005.00630},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2020.acl-main.111}
}
```

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