Byte-Level Grammatical Error Correction Using Synthetic and Curated Corpora

Svanhvít Lilja Ingólfsdóttir, Petur Orri Ragnarsson, Haukur Páll Jónsson, Haukur Barri Símonarson, Vilhjalmur Thorsteinsson, Vésteinn Snæbjarnarson

Introduction

Grammatical Error Correction (GEC) is a critical task in natural language processing, aimed at automatically rectifying orthographic, syntactic, and semantic errors. While subword tokenization has become the standard for modern Transformer-based models, it introduces a significant "noisy input" problem. In subword-based systems, a single character typo can drastically alter the tokenization of a word, leading to model confusion and "hallucinated" corrections. This challenge is particularly acute in morphologically rich languages like Icelandic, where a single lemma can manifest in dozens of inflected forms.

The Challenge of Icelandic GEC

Icelandic presents a unique set of difficulties for GEC. Its complex morphology means that nouns can have up to 16 forms and adjectives over 50, requiring models to understand deep grammatical relationships rather than just surface-level patterns. Furthermore, as a low-resource language, Icelandic lacks the massive volumes of human-annotated error corpora required to train state-of-the-art neural models from scratch. Existing subword models often struggle with rare inflections or the highly irregular "noisy" text produced by children, language learners, or individuals with dyslexia.

Methodology

To address these challenges, researchers evaluated three distinct Transformer-based architectures:

  1. mBART-ENIS: A subword-level model specifically pretrained on Icelandic and English data.
  2. mT5: A standard multilingual subword-level model.
  3. ByT5: A byte-level model that processes text as a sequence of UTF-8 bytes, bypassing the fixed-vocabulary constraints of subword tokenization.
Overview of the GEC pipeline including error generation, training stages, and inference.

The training strategy employed a two-stage "warm start" approach. Initially, models were pretrained on a massive synthetic corpus of 35 million parallel sentences. This synthetic data was generated by injecting 14 specific types of noise—ranging from simple character drops and swaps to complex linguistic errors like "dativitis" (incorrect dative case usage) and mood errors—into clean text from the Icelandic Gigaword Corpus (IGC). In the second stage, the models were fine-tuned on high-quality, human-curated data to capture the nuances of real-world errors.

Experimental Setup

The models were evaluated using the GLEU score, a standard metric for GEC. The primary evaluation was conducted on the IceEC (Icelandic Error Corpus), which contains approximately 64,000 sentences from student essays, news articles, and Wikipedia edits. To test the models' robustness across different demographics, the researchers also utilized specialized subsets:

  • L2 Learners: 6.3k sentences from language learners.
  • Dyslexic Writers: 1.4k sentences.
  • Children: 2k sentences.
  • News Test Set: 163 manually verified sentences from professional news outlets.

Key Results

The experimental results demonstrated a clear advantage for byte-level modeling. ByT5 emerged as the top performer across nearly all test scenarios.

Detailed performance metrics (GLEU) across various curated and synthetic datasets.

On the general IceEC.test set, ByT5 achieved a GLEU of 87.4, surpassing the best subword-level model (mBART at 86.5). The performance gap was even more pronounced on noisier datasets. For text written by individuals with dyslexia, ByT5 scored 54.9 compared to mBART's 50.8. Similarly, for L2 learners, ByT5 outperformed mBART by a margin of 2.0 GLEU points (59.6 vs 57.6).

Qualitative analysis revealed that ByT5 is more "conservative" in its corrections. While subword models often hallucinate common words when faced with unknown typos, ByT5's character-level awareness allows it to preserve the original meaning while fixing the orthography. Furthermore, ByT5 showed superior handling of complex Icelandic grammatical challenges, such as noun-case and verb-mood errors, which are often obscured by subword boundaries.

Discussion and Limitations

Despite its performance advantages, byte-level modeling introduces a significant computational trade-off. ByT5 is approximately 2.3x slower at inference than subword-based models like mT5. This latency stems from the fact that byte sequences are substantially longer than subword sequences, increasing the number of operations required per sentence. This poses a challenge for real-time deployment in applications like word processors or mobile keyboards.

Additionally, while the results are compelling for Icelandic, further research is needed to determine if these benefits translate to non-Latin scripts or logographic languages. Future work will focus on optimizing the inference speed of byte-level architectures and expanding synthetic error generation to cover a broader range of linguistic phenomena.

Conclusion

This research highlights the potential of byte-level architectures for GEC in morphologically complex and low-resource languages. By moving beyond the subword, models like ByT5 can better capture the internal structure of words and remain robust in the face of significant input noise, providing a more reliable foundation for automated writing assistance in Icelandic.

Summary updated

BibTeX
@inproceedings{ingolfsdottir2023byte,
  author = {Svanhvít Lilja Ingólfsdóttir and Petur Orri Ragnarsson and Haukur Páll Jónsson and Haukur Barri Símonarson and Vilhjalmur Thorsteinsson and Vésteinn Snæbjarnarson},
  title = {{Byte-Level Grammatical Error Correction Using Synthetic and Curated Corpora}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.402},
}
Figure