NoCoLA: The Norwegian Corpus of Linguistic Acceptability

Matias Jentoft, David Samuel · DOI

Abstract

While large language models (LLMs) have significantly advanced natural language processing for Norwegian, tools to measure their underlying linguistic competence have remained scarce. This paper introduces NoCoLA, the first comprehensive benchmark for evaluating the grammatical sensitivity of Norwegian models. By leveraging a large-scale corpus of second-language learner essays, NoCoLA provides both supervised and zero-shot tasks to distinguish between a model's ability to memorize patterns and its genuine grasp of Norwegian syntax and morphology.

Introduction

The "BERT revolution" led to the development of several high-performing Norwegian models, such as NorBERT and NB-BERT. However, evaluating these models has typically relied on downstream tasks like sentiment analysis or named entity recognition. While these tasks demonstrate utility, they do not necessarily reveal whether a model possesses a "native-like" understanding of the language's grammatical rules. In English, benchmarks like the Corpus of Linguistic Acceptability (CoLA) and the Benchmark of Linguistic Minimal Pairs (BLiMP) serve as gold standards for this purpose. NoCoLA fills this gap for Bokmål, the most prevalent written standard of Norwegian, providing a rigorous framework for diagnostic linguistic evaluation.

Methodology

NoCoLA is structured into two distinct evaluation paradigms designed to probe different aspects of model performance:

1. NoCoLA$_{class}$ (Supervised Classification)

This task treats linguistic acceptability as a binary classification problem. Models are fine-tuned on a training set to predict whether a given sentence is "acceptable" or "non-acceptable." This measures how effectively a model can be adapted to the specific task of grammar checking and error detection.

2. NoCoLA$_{zero}$ (Zero-shot Diagnostic)

To measure a model's innate linguistic knowledge without task-specific fine-tuning, the researchers implemented a zero-shot diagnostic. Models are presented with a pair of sentences: one grammatically correct and one containing a single error. The model must assign a higher probability to the correct sentence. For Masked Language Models (MLMs), which do not natively calculate sentence-level probabilities, the authors utilized Pseudo-Log-Likelihood (PLL). This involves masking tokens one by one and aggregating the model's confidence scores to derive a holistic sentence score.

Dataset Composition

The benchmark is derived from the ASK Corpus, a collection of essays written by learners of Norwegian as a second language. This choice of source material offers several advantages:

  • Scale: With 144,867 sentences, NoCoLA is significantly larger than the English CoLA (approx. 10,600 sentences).
  • Natural Errors: Unlike benchmarks that rely on synthetic errors (e.g., random word swapping), NoCoLA features real-world mistakes including incorrect word order, morphology, and punctuation.
  • Granularity: Errors are categorized into ten distinct types, such as Inflection, Word Choice, Compounding, and Derivation, allowing for a detailed breakdown of model strengths and weaknesses.

Key Results and Insights

Model Performance

  • NorBERT3 Dominance: The NorBERT3 architecture (both base and large variants) achieved the highest performance on the classification task, reaching an accuracy of 82.48%.
  • The NorBERT1 Paradox: In the zero-shot diagnostic, the older NorBERT1 model performed surprisingly well, achieving 90.83% accuracy. Researchers attribute this to its training on a smaller, cleaner corpus compared to newer models trained on massive, uncurated web crawls.
  • Monolingual Advantage: Models trained specifically on Norwegian or Scandinavian data consistently outperformed massive multilingual models like mBERT or XLM-R, highlighting the importance of language-specific pre-training.

Error Sensitivity

Models demonstrated varying levels of sensitivity depending on the error type. While most models were proficient at identifying Spelling and Capitalization errors, they struggled significantly with Word Choice and Inflection. Furthermore, models trained on "uncased" data showed a predictable but marked inability to detect capitalization and punctuation errors, illustrating how pre-training configurations dictate downstream linguistic sensitivity.

Conclusion and Future Work

NoCoLA represents a significant step forward for Norwegian NLP, providing a necessary tool for diagnostic evaluation. However, the benchmark currently focuses exclusively on Bokmål and reflects the specific error distributions of L2 learners rather than native-speaker "slips" or rare theoretical phenomena. Future iterations aim to include Nynorsk and integrate NoCoLA into a broader "NorGLUE" suite to further catalyze the development of linguistically robust Norwegian AI.

Summary updated

BibTeX
@inproceedings{jentoft2023nocola,
  author = {Matias Jentoft and David Samuel},
  title = {{NoCoLA: The Norwegian Corpus of Linguistic Acceptability}},
  booktitle = {NoDaLiDa},
  year = {2023},
  url = {https://openreview.net/forum?id=AbVo42OZX2},
}
Figure