Elamur Research

Large-Scale Contextualised Language Modelling for Norwegian

Paper · 2021 · Andrey Kutuzov, Jeremy Barnes, Erik Velldal et al.

Summary

A system that has learned from text in many languages can process Norwegian, but how much does it gain from training specifically on Norwegian? The authors investigate that question for both Bokmål and Nynorsk, the official written standards. Their NorLM initiative introduces NorELMo and NorBERT, which learn representations of words in context from Norwegian news and Wikipedia. Both standards are included in training, with more Bokmål than Nynorsk. The paper also describes the software and computing setup used to train the systems and makes the resulting resources available to other researchers. The work concerns both what Norwegian language modelling can achieve and what it takes to make the resources reusable.

NorELMo and NorBERT share a pretraining corpus of 1,907,072,909 word tokens, but they turn text into contextual representations in different ways. NorELMo builds an initial representation from the characters of each word and uses recurrent processing to incorporate the surrounding text. NorBERT uses a BERT architecture with a vocabulary learned from Norwegian text. In the paper’s example, that vocabulary preserves several complete words and meaningful word parts that multilingual BERT breaks into smaller pieces. The authors train NorBERT from scratch, initially using shorter sequences and then allowing longer ones. They also compare their systems with NB-BERT, a contemporary Norwegian BERT system trained by the National Library of Norway on a much larger collection that draws heavily on historical documents.

The benchmark results depend on what the system is asked to predict. NB-BERT leads in part-of-speech tagging and named entity recognition on both written standards. It also leads in classifying review sentences as positive or negative, with a test macro F1 of 83.9, compared with 77.1 for NorBERT and 67.7 for multilingual BERT. When the task is to recover the structure of opinions within a sentence, NorBERT leads on several measures, including identifying who holds an opinion, and matches NB-BERT at 34.8 on the full sentiment graph measure. Multilingual BERT gives the highest scores on the negation benchmark. NorELMo sometimes offers a faster way to adapt to a task, particularly when the alternative involves updating all the parameters of a BERT system.

Taken together, the experiments show that training on Norwegian alone can pay off, while the ranking changes with the task, the evaluation measure and the way the pretrained representations are used. The comparisons bring several factors into view at once. NorBERT has a Norwegian vocabulary and draws on news and Wikipedia. NB-BERT uses the multilingual vocabulary and draws on a larger, differently sourced corpus. NorELMo is usually evaluated through fixed representations and a separately trained classifier. The paper establishes how these combinations perform on the benchmarks it uses, alongside a practical account of how the authors built and distributed their systems.

Deep dive: Large-Scale Contextualised Language Modelling for Norwegian

NorLM trains Norwegian ELMo and BERT on news and Wikipedia and compares them on tagging, entity recognition, sentiment analysis and negation. · about 34 minutes to read

The problem and its context

Norwegian text comes in both written standards

Before a program can recover who did something in a sentence, identify an organisation’s name or tell what a reviewer disliked, it needs a way to represent the words it sees. A contextual representation gives a word a numerical description informed by the sentence around it. The same spelling can therefore receive different representations in different sentences. A system can learn this general-purpose representation from ordinary text, then reuse it on tasks whose examples carry human labels. That is the approach the paper takes to natural language processing for Norwegian.

Norwegian presents a choice about what belongs in the training collection. Bokmål and Nynorsk are both official written standards. Bokmål is the more widely used, and the authors estimate that Nynorsk is used by 10–15% of the population. They also report a legal requirement for at least 25% of written public service information to be in Nynorsk. The standards are closely related, but some vocabulary differs substantially, even where spellings still share characters. A system trained on both can draw on material they have in common. Its experience of each standard will still depend on how much and what kind of text it sees.

The authors had grounds for combining the standards. Earlier Norwegian studies had obtained good results from joint treatment in tagging, dependency parsing and entity recognition. In dependency parsing, a system predicts grammatical links between words. In entity recognition, it finds and categorises names and related expressions. The NorLM corpus follows that joint approach, retaining the greater prevalence of Bokmål in its sources. The tagging and entity experiments later report results by standard, which makes it possible to examine how the joint training setup serves each one. The entity work the authors cite is NorNE.

The distinction between the standards matters at more than one point in the study. It affects what a system reads during pretraining, which spellings it can represent conveniently, and which labelled examples it sees when learning a task. A result for Nynorsk therefore reflects a pipeline that begins with a shared training collection and ends with a particular set of labelled sentences. The paper’s decision to report some scores separately keeps the variety of the test material visible. The review-based experiments answer different questions and do not provide the same breakdown.

What researchers could already use

One option was multilingual BERT, called mBERT in the paper. Its pretraining included Norwegian, so it gave researchers a way to use the BERT architecture even when a practical Norwegian-specific version was unavailable. It also brought Norwegian into a shared system with other languages, including a shared inventory of text pieces. The authors mention an earlier attempt at a Norwegian BERT release whose vocabulary appeared to have problems. In their account, mBERT was the usable point of comparison when the NorLM work began. The architecture and the multilingual baseline trace back to BERT.

A second option was ELMo, an approach that builds contextual representations with recurrent networks. The ElmoForManyLangs initiative had already released separate versions for Bokmål and Nynorsk. Each had been trained on 20 million words, sampled from Wikipedia and Common Crawl. The authors describe these earlier Norwegian versions as capable on grammatical tasks such as tagging and parsing, with weaker performance on tasks involving meaning. They also required the initiative’s own modified software. NorELMo addresses both points by using a larger Norwegian collection and keeping compatibility with the original ELMo implementation.

The wider field had already begun building dedicated systems for individual languages. The paper situates NorLM alongside efforts for Finnish, Dutch, Vietnamese and Swedish, among others. The Finnish project matters especially because its training setup furnished much of the starting point for NorBERT. That relationship is about how the authors organised and ran training. NorBERT itself learned from Norwegian text, starting from scratch. The relevant predecessor is FinBERT.

The contemporaneous NB-BERT project gave the authors a different kind of comparison. Developed through the National Library of Norway’s NoTraM initiative, NB-BERT is also a cased BERT Base system for Norwegian. Its Colossal Norwegian Corpus was reported to contain close to 18,5 billion words, or 109.1 GB of text. Much of that material came from historical sources converted into text by optical character recognition. The authors point to possible transcription noise in such a collection. They also note that NB-BERT retained the multilingual BERT vocabulary, while NorBERT learned a vocabulary from Norwegian. The comparison thus spans distinct choices about source material, scale and text segmentation within Norwegian pretraining.

These alternatives make the underlying research question more specific. A Norwegian team could already choose between representations learned across languages and representations learned for Norwegian. The NorLM paper asks how different choices fare when brought to a set of concrete tasks. It also describes a way for teams to build and distribute their own systems, a concern that becomes important when pretraining requires sustained access to specialised hardware. Pretrained resources let a researcher start at the task stage. A reproducible training environment gives researchers a way to revisit the earlier decisions about which text to collect and how to process it.

The method, step by step

Prepare a shared Norwegian corpus

The authors start with running text in Bokmål and Nynorsk. Running text preserves the order in which sentences occur, so the training procedure can use the original sequence of a document. Norsk Aviskorpus, abbreviated NAK, supplies 1.7 billion words of news from 1998 to 2019 and contains material in both standards. The Bokmål Wikipedia dump from September 2020 supplies 160 million words. The Nynorsk dump from the same month supplies 40 million words. The authors report 1,907,072,909 word tokens and 202,802,665 sentences in the resulting corpus. A word token is a particular occurrence in the text, so a word that appears repeatedly contributes each time it occurs.

The news material and the Wikipedia dumps need different preparation. The team extracts the Wikipedia text with the Gensim segment wiki script. Some news material needs detokenisation, which restores running text from text that has already been divided into tokens. The authors also convert news text to UTF-8 where necessary, giving the processing software a consistent character encoding. Stanza then finds sentence boundaries in the assembled text.

There is a further distinction between a sentence boundary and a document boundary. For one of BERT’s training objectives, consecutive sentences need to come from the same stretch of text. The authors leave blank lines between documents and between sections of Wikipedia articles so that the training procedure respects those breaks. Without this step, two sentences that happen to be adjacent in the stored corpus could be treated as a continuation even when they came from different documents. The blank lines preserve information about the source structure that ordinary sentence segmentation would leave implicit.

At this point, the authors have a corpus that can serve both architectures. Keeping the sources shared gives the NorELMo and NorBERT efforts a common basis, while their treatment of words and sentences diverges. The word count describes the prepared corpus. It is separate from the number of pieces that a BERT tokenizer produces, which depends on the vocabulary and on how frequently words have to be split. That distinction recurs in the training schedule, where sequence lengths limit the input to the network and corpus counts describe the amount of text available.

From Norwegian source text to downstream evaluation

The steps in order.

From Norwegian source text to downstream evaluationStep 1: Collect newspaper text and both Wikipedia editions1. Collect newspaper text and both Wikipedia editionsStep 2: Recover running text and segment it into sentences2. Recover running text and segment it into sentencesStep 3: Mark document and Wikipedia section boundaries3. Mark document and Wikipedia section boundariesStep 4: Prepare recurrent word prediction and Norwegian WordPieces4. Prepare recurrent word prediction and Norwegian WordPiecesStep 5: Pretrain NorELMo and NorBERT on the shared corpus5. Pretrain NorELMo and NorBERT on the shared corpusStep 6: Adapt representations to annotated Norwegian tasks6. Adapt representations to annotated Norwegian tasksStep 7: Compare predictions with the benchmark annotations7. Compare predictions with the benchmark annotations

Train NorELMo to represent words in context

NorELMo follows ELMo’s recurrent design. The first stage takes a word’s characters and produces an initial vector, a numerical representation of that word. The paper identifies this stage as a convolutional neural network. At this point the representation belongs to the input string itself. The later recurrent stages incorporate context by processing words in sequence. Because the architecture works in both directions, the representation supplied for a word can reflect material on either side. A downstream classifier receives a vector whose values depend on the word’s surroundings as well as its spelling.

The authors train NorELMo 30 and NorELMo 100 from scratch. The first uses the 30,000 most frequent words as its prediction vocabulary, and the second uses 100,000. Here the vocabulary specifies which word identities the system is trained to predict. The character network can still make an input representation for an arbitrary word string. For instance, a classifier can receive a contextual vector for a spelling outside the prediction vocabulary because the input side works from characters. The vocabulary cutoff changes the supervision available during pretraining, while the character-based input remains available in both versions.

The motivation for trying different cutoffs is that a larger set of prediction targets exposes the system to training on less frequent words. The authors suggest that this may come at a cost to its treatment of more common words. This is a hypothesis about the balance of training signals. The downstream experiments provide a way to see whether the two vocabularies lead to different task scores, though the scores alone cannot identify which frequency bands account for the differences.

Both versions train for 3 epochs, where an epoch is a pass through the training data, with a batch size of 192. The batch size describes how many examples are grouped together for an update. The team starts with the original ELMo training code and adapts it to newer versions of TensorFlow. It keeps the default settings apart from reducing the dimensionality of the long short-term memory network, or LSTM, from 4,096 to 2,048. The dimension determines the size of the recurrent state used to carry information through the sequence. The authors say their experience suggested that this reduction rarely changed performance. They report about 100 hours of pretraining per version on four NVIDIA P100 GPUs.

The release includes the vocabularies and two forms of the trained parameters. TensorFlow checkpoints retain a form suitable for further training, while files in the Hierarchical Data Format support using the trained system to produce representations. The authors report compatibility with the original ELMo implementation and with their simple elmo Python library. They also provide ELMoViz to explore the Norwegian representations. These pieces make different levels of use possible, from examining the outputs to training a classifier or continuing to update the pretrained parameters.

Learn a vocabulary from Norwegian text

NorBERT handles word forms through subword tokenization. A sub-word tokenizer can give a frequent word its own entry and divide other words into pieces drawn from the vocabulary. A word occurrence can therefore occupy several positions in the sequence. The placement of the breaks determines which character sequences the system sees as units. An inventory learned for Norwegian has a chance to allocate more entries to useful Norwegian forms and word parts.

NorBERT’s WordPiece vocabulary is case-sensitive and preserves accented characters. It contains 30,000 entries, compared with 120,000 in the multilingual inventory used by mBERT and NB-BERT. The authors learn the inventory from raw text without first separating punctuation from words. They use SentencePiece and the Tokenizers library, then convert the resulting inventory to BERT’s WordPiece format. This setup accepts raw text as input. It also leaves several thousand unused entries that future users can assign to task-specific items when adapting the system. The paper cites the work on which its use of SentencePiece draws.

The paper illustrates what the vocabulary changes with a sentence about giving women’s football in Kristiansand a boost. NorBERT retains gjengen, håper and løft as whole units. The multilingual vocabulary splits those words. For kvinnefotballen, NorBERT keeps kvinne and fotball together as separate pieces, followed by the ending. The multilingual tokenizer breaks the compound more finely, even separating off single letters in places. In the printed example, a ## prefix flags a piece that continues the preceding word. The difference can be read directly in the boundaries, particularly where Norwegian speakers can recognise the parts of the compound.

The example captures the authors’ interest in morphology, the structure of words and their parts. A boundary that coincides with a recognisable component can be easier to interpret in a linguistic study. The example also retains a useful complication. NorBERT divides some forms too, including etterlengtet. The design goal is better coverage of Norwegian with the available inventory, and the illustration lets readers see how that can look in an individual sentence. It does not establish the frequency of such differences over the full corpus.

NorELMo 30 and NorBERT both use an inventory of 30,000 entries, but the counts refer to different objects. NorELMo 30 uses its inventory to choose whole-word prediction targets and builds inputs from characters. NorBERT’s inventory determines the pieces supplied to the network as input. This matters for reading the experiments. Changing the cutoff between the two NorELMo versions tests how many whole words receive prediction supervision. Comparing the BERT systems brings in differences in the units from which their input sequences are built.

Train NorBERT on short sequences, then longer ones

NorBERT follows the cased BERT Base configuration, using 12 layers with a hidden size of 768. The hidden size gives the dimension of the internal representation at each sequence position. The layers successively transform those representations. BERT’s architecture uses attention, which allows the representation at a position to draw on other positions in the input. The architecture is the Transformer.

The authors use the standard masked language and next-sentence prediction objectives. Masked prediction withholds some input pieces and trains the system to recover them from context. Next-sentence prediction trains it to judge whether a proposed continuation follows the preceding material. This second objective is where the preserved corpus ordering and the recorded breaks between documents and Wikipedia sections matter. The optimiser, which determines how each training update changes the parameters based on the loss, is LAMB.

NorBERT training on the Saga supercomputer typically runs across 4 compute nodes and 16 NVIDIA P100 GPUs. Each device handles a local batch, and the global batch is the collection those devices process for a training step. In the first phase the maximum sequence length is 128, and each device handles a batch of 48. The paper gives the global batch calculation as follows.

48 × 16 = 768

The value 48 is the batch size per GPU in the short-sequence phase. The value 16 is the number of GPUs in the calculation. The multiplication sign × combines the local batch size with the device count. The equals sign = gives the resulting global batch of 768 examples. Counting that batch in sentences, the authors describe roughly 265,000 training steps as an epoch. They run 3 epochs for 795,000 training steps in this phase.

The second phase raises the maximum sequence length to 512 and reduces the batch per GPU to 8. A longer sequence can contain more context in an individual training example, and the smaller local batch changes how many examples contribute to an update. The paper gives this calculation for the longer-sequence phase.

8 × 16 = 128

Here 8 is the batch size per GPU, and 16 again denotes the device count. The × sign multiplies those quantities, and = gives the global batch size of 128 examples. This use of 128 describes the number of examples in a global batch. In the first phase, the same value describes the maximum length of an input sequence. The authors follow the original BERT setup in aiming to present about 1/9 as many sentences in the second phase as in the first. Their schedule calls for about 68 million sentence presentations in the longer phase and a further 531,000 training steps.

The reported wall-clock duration is roughly 3 weeks, or more than 500 hours. That is elapsed training time with many devices working in parallel. In the discussion of computing requirements, the authors describe the cumulative device usage as close to a full year on a GPU. These are distinct descriptions of the computational commitment. Parallelism shortens the time a researcher waits for a run while still consuming time on every participating device.

The paper plots the training loss separately for the two phases. A loss curve tracks the objectives the system is being trained to optimise. It gives a record of how pretraining progressed under each configuration. The paper notes a pause on December 25 and 26 while the team addressed a problem with mixed precision, a way of using different numerical precisions within training. The loss plots document the run that produced NorBERT. The later test scores measure how its representations transfer to annotated tasks.

Make the environment reusable

To run distributed training, the team uses NVIDIA’s BERT implementation, following the Finnish project’s example. The authors make small changes, mainly for compatibility with newer TensorFlow releases. Their NorBERT repository includes the patches and utilities for preparing data, training and evaluating the system, as well as the training logs. These resources complement the pretrained parameters by showing how the reported run was carried out.

The broader NorLM setup uses EasyBuild to automate software installation. The process compiles tools with hardware-specific optimisations and selects libraries for the numerical calculations and for communication among compute nodes. Communication matters because the training run is spread across devices that must work together on each update. The authors describe the environment as modular so that a team can provision it on a different suitable cluster as well as use the installations already in place on Saga in Norway and Puhti in Finland.

The pretrained resources are distributed through the Nordic Language Processing Laboratory’s Vectors Repository, with NorBERT also made available through Hugging Face Transformers. The platform installations and the downloadable releases serve related needs. A researcher who wants contextual representations for a benchmark can start from a released system. A group that wants to repeat pretraining with different text needs the build environment, training implementation and data preparation steps as well. The study documents both routes because the ability to experiment with new corpora is part of NorLM’s purpose.

Experiments and results

How the comparisons are organised

The evaluation covers word-level, sentence-level and structured predictions. The Norwegian Dependency Treebank supplies part-of-speech labels. NorNE adds entity annotations to the same underlying treebank material. The sentiment and negation tasks draw on annotated reviews through the NoReC datasets. Because these tasks use different kinds of answers, they also need different scoring rules. Predicting a word’s grammatical category can be scored by accuracy over tokens. Recovering an entity can require matching its type and complete span. Recovering an opinion graph adds relationships among several spans.

The paper gives train, development and test counts in sentences. For tagging and entity recognition, the Bokmål splits contain 15,696 training sentences, 2,409 development sentences and 1,939 test sentences. The corresponding Nynorsk counts are 14,174, 1,890 and 1,511. The shared counts reflect the use of the treebank for both tasks. The annotations and criteria for success differ. The training split provides examples with answers, the development split supports choices such as which checkpoint to keep, and the test split supplies the held-out scores.

Fine-grained sentiment and negation each use splits of 8,543 training sentences, 1,531 development sentences and 1,272 test sentences in the paper’s dataset table. The derived sentence-level sentiment dataset has 2,675 training sentences, 516 development sentences and 417 test sentences. Here the difference in size arises from the construction of the binary task. The authors retain sentences that can receive a positive or negative label and remove those with mixed sentiment or none. The resulting benchmark tests polarity decisions on this subset of review sentences.

Across the benchmarks, the authors compare NorBERT with mBERT and NB-BERT, and include both NorELMo versions. Certain tasks have an additional point of reference suited to that task. For tagging it is Stanza. For extracting the spans in fine-grained sentiment it is an earlier system that uses pretrained fastText vectors. These comparisons have different scopes. An earlier span extraction system can tell the reader how much the newer representations help on those span scores, while comparison of full graphs requires systems that predict relationships too.

Grammatical categories in Bokmål and Nynorsk

Part-of-speech tagging assigns a grammatical category to each word, such as noun or verb. The data are from release 2.7 of Universal Dependencies, whose tag inventory provides the categories predicted on the Norwegian Dependency Treebank. The authors put a linear layer on top of BERT’s final token representations, then use a softmax, which turns a set of label scores into probabilities. This setup gives the classifier a prediction at each position. The authors update the pretrained BERT parameters as well as the added classification layer. This form of task adaptation is fine-tuning.

Each BERT run trains for 20 epochs with batches of 8, a learning rate of 2e-5, and inputs capped at length 256. The learning rate governs the size of parameter updates. The team retains the checkpoint that performs best on the development set. In the NorELMo runs, the contextual embeddings feed a separate neural classifier. It has a hidden layer of size 128, a rectified linear activation and dropout, which temporarily omits some activations during training. The pretrained ELMo parameters stay fixed, and the paper reports a fixed random seed for the tagging setup. Accuracy counts the proportion of token labels that agree with the annotation.

Part-of-speech accuracy on the Bokmål Norwegian Dependency Treebank test set

NB-BERT leads and NorBERT gives the next highest accuracy.

Part-of-speech accuracy on the Bokmål Norwegian Dependency Treebank test setStanza: 98.3Stanza98.3NorELMo 30: 98.1NorELMo 3098.1NorELMo 100: 98.0NorELMo 10098.0mBERT: 98.0mBERT98.0NB-BERT (this paper): 98.7NB-BERT (this paper)98.7NorBERT: 98.5NorBERT98.5
The numbers
System or settingaccuracy %
Stanza98.3
NorELMo 3098.1
NorELMo 10098.0
mBERT98.0
NB-BERT (this paper)98.7
NorBERT98.5

The Bokmål figures put both Norwegian BERT systems above the multilingual baseline, with Stanza between them and the other systems. On the Nynorsk test set, NB-BERT reaches 98.3 and NorBERT reaches 98.0. Stanza and mBERT each score 97.9, and the two NorELMo runs each score 97.4. The ordering is broadly similar across standards, although the positions of Stanza and mBERT relative to the NorELMo variants change. The table gives a fairly narrow range of test accuracies within each standard.

The cost of task adaptation varies much more visibly. The Bokmål POS runs take 8 minutes for each NorELMo version and 238 minutes for NorBERT. The analogous BERT runs take 244 minutes for NB-BERT and 245 minutes for mBERT. Those times describe what was done for the tagging benchmark. They compare extracting fixed features and training a classifier with updating a full pretrained BERT system for the task. The numbers let the reader consider the accuracy and the work required to reach it together.

The paper also plots training and development accuracy by epoch for Nynorsk tagging. This is a view of how the task learners progress as they see more of the labelled data. It complements the test table, which compresses each run into the result selected through the development set. Looking at the learning curves and the task timing answers different questions. A curve shows how the measured score changes through adaptation, while the timing records how long the reported procedure takes.

Entity types and exact boundaries

The entity task asks a system to mark names and name-derived expressions in the NorNE test sentences. Its 8 categories distinguish people, organisations, locations, products, events and nominals derived from names, and distinguish geopolitical entities used in a location sense from those used in an organisation sense. This last distinction makes the task sensitive to context. A name associated with a territory and the same name used for a political body can require different labels.

The classifiers use BIO encoding, which distinguishes the beginning of an entity, a continuation inside it and positions outside entities. This makes a span a sequence of token decisions. In the BERT setup, the authors fine-tune on NorNE using early stopping, a schedule of 20 epochs and a batch size of 32. In the NorELMo setup, they average the representations contributed by all 3 layers for each token and train the same type of classifier used for part-of-speech tagging. They again use early stopping, with 20 epochs and a batch size of 32. The pretrained ELMo representations stay fixed.

The metric is strict micro F1. Precision reflects how many predicted entities match the annotation, and recall reflects how many annotated entities the system recovers. F1 balances precision and recall. Micro averaging pools the entity decisions before calculating the score, and a match requires the correct type and exact span boundaries. If a system finds part of a longer name, or gets the full boundary but labels a location as an organisation, it misses the strict match. The authors use evaluation code from SemEval’13 Task 9.

Strict micro F1 on the Bokmål NorNE test set

NB-BERT leads, and every Norwegian system in the comparison scores above multilingual BERT.

Strict micro F1 on the Bokmål NorNE test setNorELMo 30: 79.9NorELMo 3079.9NorELMo 100: 81.3NorELMo 10081.3mBERT: 78.8mBERT78.8NB-BERT (this paper): 90.2NB-BERT (this paper)90.2NorBERT: 85.5NorBERT85.5
The numbers
System or settingmicro F1
NorELMo 3079.9
NorELMo 10081.3
mBERT78.8
NB-BERT (this paper)90.2
NorBERT85.5

NB-BERT also leads on the Nynorsk NorNE test set with 88.6, followed by NorBERT at 82.8. The multilingual baseline scores 81.7, above NorELMo 30 at 75.6 and NorELMo 100 at 75.1. This changes the interpretation of the Bokmål chart. Training on Norwegian goes with a higher Bokmål score for all the dedicated systems in the comparison. On Nynorsk, multilingual BERT with fine-tuning performs better than either of the two fixed NorELMo alternatives.

Bokmål timings, measured on 1 NVIDIA P100 GPU, range from 2 minutes for either NorELMo run to 14 minutes for mBERT. NorBERT takes 9 minutes and NB-BERT takes 11. The authors attribute the shorter NorBERT run relative to NB-BERT to the smaller vocabulary and the resulting difference in parameter count. Both run for the same number of epochs in this comparison. The ELMo timings again concern a smaller adaptation job, because the system supplies features to a classifier without updating its pretrained recurrent parameters.

The structure of an opinion in a review

Fine-grained sentiment asks more than whether a sentence conveys approval or disapproval. It asks which words express the opinion, who holds it, what it concerns and whether the polarity is positive or negative. NoReC fine supplies this information for part of the Norwegian Review Corpus, including the relationships that connect the annotated elements. An output can contain a well-identified target and still misrepresent the opinion if it attaches that target to the wrong expression. The evaluation therefore includes measures for the parts and for the structures that join them.

The authors build a graph prediction system for this task. At each token, the parser combines a word embedding, a part-of-speech embedding, a lemma embedding and a character representation produced by an LSTM. A lemma is the dictionary form under which related inflected forms can be grouped. The parser appends a contextual embedding from the pretrained system under comparison. It then predicts the sentiment graph from the resulting representations. The experiments run for 100 epochs and retain the best checkpoint according to development F1. The graph-parsing approach draws on Dozat and Manning.

Several scores describe the output. Holder, target and expression F1 evaluate span extraction at the token level. Targeted F1 requires an exact target span together with the correct polarity. Unlabelled F1 measures the agreement of the predicted connections with the annotation, while labelled F1 also considers the connection labels. The sentiment graph scores assess the whole opinion structure. SF1 includes polarity, while NSF1 assesses the structure without it.

For graph scoring, the paper describes matching the predicted and reference structures and weighting the overlap in their holder, target and expression spans. For precision, the share of correctly predicted tokens in a span is measured against the predicted span. For recall, it is measured against the reference span. The overlap contributions are averaged over the spans, and empty holders and targets are permitted. This gives the metric a way to reflect partial span agreement inside a structured comparison. A span score, a link score and a full graph score can therefore prefer different systems even on the same review sentences.

For the earlier span extraction baseline, fastText vectors trained on NoWaC initialise the embeddings, and a bidirectional LSTM is paired with conditional random field inference. The recurrent network supplies a representation that draws on the sentence in both directions. The inference layer assigns a sequence of labels. The baseline identifies spans and has reported scores only for those measures, so it belongs in the extraction part of the comparison. The paper reports the contextual systems’ fine-grained sentiment scores as averages over 5 runs with set random seeds.

Holder extraction F1 on the NoReC fine test split

NorBERT leads, and every system using contextual representations improves on the earlier extraction baseline.

Holder extraction F1 on the NoReC fine test splitEarlier span extraction baseline: 42.4Earlier span extraction baseline42.4NorELMo 30: 55.1NorELMo 3055.1NorELMo 100: 58.8NorELMo 10058.8mBERT: 57.1mBERT57.1NB-BERT: 61.3NB-BERT61.3NorBERT (this paper): 63.0NorBERT (this paper)63.0
The numbers
System or settingtoken-level F1
Earlier span extraction baseline42.4
NorELMo 3055.1
NorELMo 10058.8
mBERT57.1
NB-BERT61.3
NorBERT (this paper)63.0

The earlier baseline scores 31.3 on target F1 and 31.3 on expression F1. NorBERT reaches 56.4 on target F1 and 58.1 on expression F1, leading the reported systems on both. It also leads in the parser’s unlabelled and labelled scores, at 50.5 and 42.2 respectively. Across those measures, the result favours NorBERT over the other BERT systems and over the fixed representations from NorELMo. These scores concern the words that make up spans and the connections the parser proposes among them.

The rankings change when the evaluation combines outputs under other criteria. NorELMo 30 leads in Targeted F1 at 37.9, followed by NorELMo 100 at 37.1 and NorBERT at 36.9. NorELMo 100 leads in non-polar graph F1 with 41.5, while NorBERT scores 41.0 and NorELMo 30 scores 40.9. On the full sentiment graph score, NorBERT and NB-BERT both reach 34.8. NorELMo 30 gives 34.5, NorELMo 100 gives 34.2 and mBERT gives 31.7. Finding holders, targets and expressions is consequently only part of the challenge that the full graph measure captures.

The paper also notes that the runtimes for the contextual representations here are similar across ELMo and BERT. NorBERT’s reported runtime is 438 minutes, compared with 434 for NorELMo 100 and 404 for NB-BERT. The parser uses the pretrained vectors as features without fine-tuning the underlying systems. The runtime contrast seen in tagging and entity recognition thus depends on the way representations are adapted, as well as on the architecture supplying them.

A positive or negative decision for a whole sentence

The binary sentiment task uses NoReC sentence, the dataset derived by combining the fine-grained annotations at sentence level. The authors remove sentences that contain both polarities or lack a sentiment label. The remaining examples each provide a positive or negative decision. This setup discards the need to locate individual opinion spans and connect them in a graph. It evaluates whether the polarity of the selected review sentence can be recovered as a whole.

For the BERT systems, the authors take the final-layer representation of the special [CLS] input position and send it to a softmax classifier. [CLS] serves here as the representation of the complete input sentence. They fine-tune as in the part-of-speech task, train for 20 epochs and use the development set to select the checkpoint. For NorELMo, they supply top-layer token embeddings to a bidirectional LSTM and use global max pooling. The pooling operation takes the largest activation for each feature across the sentence, producing a single vector for classification.

The paper reports macro F1 on the NoReC sentence test split. In this case, the score gives the positive and negative classes equal weight by averaging their F1 scores. NB-BERT leads with 83.9. NorBERT scores 77.1, each NorELMo version scores 75.0, and mBERT scores 67.7. The authors also plot F1 by epoch on the training and development data for this task. The test figures describe the selected systems’ polarity predictions, while the curves show how those learners approached their development performance.

NB-BERT’s result here is particularly informative alongside the fine-grained experiment. Its best macro F1 concerns whether the sentence belongs to the positive or negative class. NorBERT’s leads on span and parsing measures concern finding the participants, expressions and relations within a sentence. Some data have a common origin, but the predictions and scoring rules ask for different information. The result for whole-sentence polarity therefore has a different interpretation from the full graph tie.

Finding negation and its scope

NoReC neg adds annotations of negation cues and their scopes to the review material used for NoReC fine. A cue signals negation. Its scope is the part of the sentence whose interpretation falls under that cue. A system can identify the signal and still assign the scope incorrectly, for instance by including words the annotation places outside it. The authors reuse the graph-based approach with contextual representations added to the parser’s features. As in fine-grained sentiment, the pretrained systems are kept fixed.

The paper uses the measures from the *SEM 2012 negation shared task. CUE is cue-level F1, ST scores scope at the individual token level, and FN measures full negation, combining the cue and its scope. The separate measures distinguish locating a cue from recovering the material affected by it. The results are averaged over 5 runs.

On the NoReC neg evaluation, mBERT leads at 92.8 CUE, 84.0 ST and 65.9 FN. NorBERT scores 92.1 CUE, 83.6 ST and 65.5 FN. NorELMo 100 also reaches 65.5 FN, with 92.2 CUE and 81.3 ST. NB-BERT gets 92.4 CUE, 83.1 ST and 63.5 FN, while NorELMo 30 gets 91.7 CUE, 80.6 ST and 63.8 FN. The cue scores are close across systems. The scope and full negation metrics reveal differences that cue detection alone would obscure, including the fact that the ranking of NB-BERT and NorELMo 100 changes between scope token F1 and full negation F1.

What the ablations show

Changing the NorELMo prediction vocabulary

The paper offers a vocabulary-size comparison within NorELMo and several comparisons across complete systems. It contains no controlled ablation that independently varies the size and composition of the BERT training corpus, its input vocabulary or its training schedule. The two NorELMo variants provide the closest comparison to changing one design choice. They use the same Norwegian sources and the same reported architecture and training settings, with a different cutoff for the words used as prediction targets.

The larger cutoff helps Bokmål entity recognition under the reported setup, where NorELMo 100 reaches 81.3 strict micro F1 and NorELMo 30 reaches 79.9. On Nynorsk the smaller cutoff is slightly ahead, at 75.6 against 75.1. The fixed character-based input gives both versions a way to represent words they were never asked to predict as whole-word targets. The scores thus concern the effect of the target inventory on learned representations. They do not indicate that the system with the smaller vocabulary could not accept particular names.

Fine-grained sentiment supplies another example of a metric-specific effect. The larger inventory does better on holders and on the non-polar graph score, while the smaller inventory scores higher on Targeted F1 and the full sentiment graph. The variants tie in sentence-level sentiment on the reported macro F1. In negation, NorELMo 100 improves on NorELMo 30 across the reported cue, scope and full scores. Together, these outcomes show how the vocabulary choice can favour different uses of the pretrained information. The paper provides no separate error counts for frequent and infrequent words with which to test the authors’ proposed explanation about frequency.

Comparing the treatment of Norwegian text

The tokenization example examines a tangible difference between NorBERT and the BERT systems that use the multilingual vocabulary. Under NorBERT, some words stay whole that the other vocabulary divides. Its split of kvinnefotballen also follows recognisable word structure more closely. This is direct evidence about how those inventories handle the selected sentence. It helps explain the authors’ preference for a Norwegian vocabulary when the representations are used in linguistically oriented work.

The example and the task scores support different claims. The segmentation shows a difference in inputs. The task benchmarks show how the complete trained systems perform. NB-BERT leads on the entity and sentence sentiment benchmarks while using the multilingual vocabulary. NorBERT leads on several fine-grained sentiment measures with its own vocabulary. The experiments do not include a pair of otherwise identical BERT runs trained with the two inventories. They leave open how much a segmentation change alone would move any one score.

The same point applies to training text. NorBERT and NB-BERT put contrasting corpus choices into the benchmark. NorBERT learns from news and Wikipedia, whereas the larger NB-BERT collection draws heavily on historical sources. NorBERT performs strongly on several graph and span measures, and NB-BERT leads on several other tasks. These comparisons demonstrate that the system with the larger reported training corpus does not lead on every evaluation. They give the authors grounds to discuss data volume and potential transcription noise as explanations to investigate. They do not provide an estimate of the independent effect of either.

The multilingual comparison is also more informative when read by output type. Across the negation measures, mBERT does best in spite of its weaker results on several other tasks. The authors hypothesise that structural similarities in negation across some of its pretraining languages may help. The experiment tests no change to the language mixture, so the structural explanation remains a hypothesis. The result itself establishes that multilingual pretraining is competitive for this review-based cue and scope evaluation, even with a different ordering on tasks such as polarity classification.

Relating adaptation scores to adaptation cost

The paper’s timing analyses show two kinds of use for contextual representations. In tagging and entity recognition, the NorELMo variants provide fixed embeddings to small classifiers. The BERT variants update their pretrained parameters for the task. The NorELMo route adapts faster in those comparisons. On sentiment graphs and negation, the parser uses fixed pretrained representations regardless of their source, and the reported timings are much closer. This is an observed difference between evaluation pipelines. The study does not train the same ELMo and BERT systems both with and without fine-tuning on the same tasks.

The authors connect this distinction to the Nynorsk entity results. They suggest that fine-tuning gave mBERT a way to adapt to Nynorsk that the frozen NorELMo representations lacked. On Bokmål, where NorELMo’s training data were presumably more representative, those fixed representations compete more favourably. The comparison is compatible with that interpretation. Architecture, training corpus and the freedom to update pretrained parameters still vary together, so the reported scores do not identify a single cause for the change between standards.

Finally, the paper’s training plots provide analyses at two different levels. The NorBERT loss plots show the course of pretraining before and after switching to the longer-sequence phase. The downstream plots show training and development behaviour for Nynorsk tagging and sentence-level polarity. They give readers a view of optimisation and checkpoint selection within the runs the authors carried out. Estimating the contribution of the second pretraining phase would require benchmark results from a comparable run or checkpoint that stopped after the short-sequence phase. The paper reports the performance of the completed system.

Limitations

Limits identified by the authors

The joint corpus includes less Nynorsk than Bokmål. The authors present this as a reflection of the text available in ordinary use and treat separately trained Bokmål and Nynorsk BERT systems as future work. The choice gives the study one shared pretraining setup, while leaving the effects of balancing the standards or training on them independently unresolved. The authors also plan to explore more training epochs and raise the possibility of multilingual pretraining restricted to Scandinavian languages. The reported experiments provide no scores for those proposed settings.

The authors identify computing and software engineering as limits on what can be tried in practice. A single NorBERT run occupies multiple nodes for an extended period, and the team had to address a mixed-precision problem during the run. Their reproducible environment and practice of releasing pretrained parameters reduce the need for others to repeat that effort. The paper also calls for coordination because producing large pretrained resources makes substantial demands on shared computing infrastructure. It gives device counts and elapsed training times. It provides no measured energy or emissions figures with which to quantify the environmental cost.

The paper marks an explicit limit on the comparison with the earlier fine-grained sentiment work. That work extracts spans, so its results apply to holders, targets and expressions. There are no corresponding scores from that baseline for the newer system’s targeted, attachment or complete graph decisions. The increase on holder extraction, for example, is a comparison on holder extraction. The graph scores have to be interpreted using the systems for which the authors provide graph predictions.

Limits visible in the experimental setup

The BERT comparison varies several properties at once. NorBERT and NB-BERT differ in the amount and sources of their training text and in their vocabularies. The paper associates historical optical character recognition with some likely noise, but supplies no measured noise rate or experiment that takes the same corpus and changes only its transcription quality. Better results on particular tasks therefore support a claim about the systems as trained. A causal claim that cleaner text explains those results would require a more controlled comparison.

The evaluations for language variety are also uneven by task. The authors report separate Bokmål and Nynorsk tagging and entity results. The sentiment and negation results are given for the review benchmarks without that split. It would take additional data or a breakdown of the existing evaluations to tell whether an advantage on a review task was shared across both standards. The explicit breakdowns support a more precise analysis for tagging and entity recognition than the paper can offer for the review tasks.

The labels and extraction rules determine where these findings apply. The binary sentiment benchmark includes review sentences that can be treated as positive or negative. The reported macro F1 concerns that task. A system deployed on all review sentences would also encounter material with mixed or absent sentiment, which was filtered out when this benchmark was created. Fine-grained sentiment covers some different aspects of the source material because it keeps separate opinion elements and their links, but uses its own target representation and scoring procedure.

The comparisons give point estimates and, for the fine-grained sentiment and negation results, averages across runs. The tables do not provide dispersion estimates alongside those averages. Close results can therefore be read as close reported scores, with limited information about how consistently the ordering would recur. Similarly, the POS table reports token accuracy under a fixed seed. It does not show whether changes are concentrated in a grammatical category or distributed across the tag inventory.

In a few places the numeric tables qualify the surrounding narrative. The prose description of the POS gains over mBERT does not agree with the tabulated accuracies, so the individual accuracies are the appropriate figures to report. For fine-grained sentiment, the table records a tie between NorBERT and NB-BERT on SF1 and shows NorELMo leading on Targeted F1 and NSF1. Reading the measures separately gives a more precise account of where each system leads than reducing the results to a single ranking.

Finally, the reported times are measurements of specific procedures and hardware. Short NorELMo adaptation runs for tagging and entity recognition show the cost of the authors’ fixed-feature approach on those tasks. Fine-tuning a BERT system includes a different amount of parameter updating, and the graph tasks narrow the timing contrast by using frozen representations throughout. The paper supports a practical comparison of those reported recipes. It leaves questions about how the same architectures would compare under matched adaptation procedures or different deployment conditions.

What came after

The later citations range from reusable benchmarks and pretrained language resources to studies of individual annotation tasks. Their bibliographic descriptions establish the topics of the work and its citation of NorLM. The specific roles of NorELMo, NorBERT or the benchmark results in those studies remain unspecified. The titles support connections to parts of the original research question, with different levels of detail for each work.

ScandEval (2023) takes up benchmarking for Scandinavian natural language processing. Its scope connects to NorLM’s use of multiple tasks and to the authors’ stated interest in extending evaluation across Nordic languages. NorLM presents a Norwegian comparison in which the ordering changes between entity recognition, sentiment and negation. The later work’s title places benchmarking itself at the centre of a wider Scandinavian effort. The citation does not specify which Norwegian datasets or results it uses.

A Family of Pretrained Transformer Language Models for Russian (2024) cites NorLM in work on pretrained Transformers for Russian. The connection is at the level of developing language-specific resources. NorLM puts that approach into practice for Norwegian and gives an account of data preparation, vocabulary design and distributed training. The Russian work’s title establishes that it develops a family of pretrained systems. It does not establish that it adopts NorBERT’s vocabulary procedure, software environment or evaluation setup.

NARC (2022) concerns a Norwegian corpus for anaphora resolution, the task of identifying what a referring expression points back to. Its Norwegian scope places it alongside the annotated resources used in NorLM, while its prediction target is different. NorNE asks where an entity mention starts and ends and what type it has. Anaphora resolution asks how references are connected. NARC’s citation connects NorLM to work on another Norwegian task. The available description does not say which pretrained representations, if any, are used to score that corpus.

Entity-Level Sentiment Analysis with Sentence Relevance Detection (2026) addresses a distinction also visible in NorLM’s sentiment experiments. The original paper separates the polarity of an entire review sentence from opinions directed at particular targets within it. The later title couples sentiment about entities with identifying relevant sentences. That describes a task in which the relation between a sentence and an entity matters to the sentiment judgement. The citation establishes the connection to NorLM, while the description leaves the choice of representations, data and evaluation unspecified.

BRAGD (2026) studies constrained multi-label part-of-speech tagging for Faroese. It returns to the grammatical tagging task in another language and explicitly puts constraints and multiple labels in the prediction setup. The NorLM tagging experiment predicts Universal Dependencies categories for Norwegian tokens and reports accuracy separately for Bokmål and Nynorsk. BRAGD’s title supplies a different language and output setup. The citation alone does not identify whether the NorLM experiments furnished a baseline, a methodological precedent or broader context.

A further citation is indexed as thapa-2025-development-pre-trained-transformer-based. Its short entry gives no task, language or account of how the research draws on NorLM, so the specific use cannot be described.

Cite

Cite as Andrey Kutuzov, Jeremy Barnes, Erik Velldal, Lilja Øvrelid and Stephan Oepen. 2021. Large-Scale Contextualised Language Modelling for Norwegian. Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa).

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

@inproceedings{kutuzov2021large,
  title = {{Large-Scale Contextualised Language Modelling for Norwegian}},
  author = {Andrey Kutuzov, Jeremy Barnes, Erik Velldal, Lilja Øvrelid and Stephan Oepen},
  booktitle = {Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa)},
  year = {2021},
  url = {https://aclanthology.org/2021.nodalida-main.4/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/kutuzov-2021-large-scale-contextualised-language-modelling/