Encoder-Decoder Models Can Benefit from Pre-trained Masked Language Models in Grammatical Error Correction

Masahiro Kaneko, Masato Mita, Shun Kiyono, Jun Suzuki, Kentaro Inui

Abstract

This research investigates the optimal integration of pre-trained Masked Language Models (MLMs), such as BERT, into Encoder-Decoder architectures for Grammatical Error Correction (GEC). The study identifies two major obstacles: catastrophic forgetting during task-specific initialization and the distribution gap between BERT's clean pre-training data and the noisy text produced by language learners. The authors propose fine-tuning BERT on a Grammatical Error Detection (GED) task before using it as a feature provider, a method that effectively bridges this gap and achieves state-of-the-art results.

Introduction

Grammatical Error Correction (GEC) is typically treated as a sequence-to-sequence translation task. While Encoder-Decoder (EncDec) models are the industry standard, researchers have struggled to fully exploit pre-trained models like BERT. Two hurdles persist:

  1. Catastrophic Forgetting: Initializing a GEC model with BERT weights (BERT-init) often leads to the model "overwriting" general linguistic knowledge with task-specific patterns.
  2. The Distribution Gap: BERT is trained on clean corpora (e.g., Wikipedia), whereas GEC inputs are inherently noisy. Standard feature extraction (BERT-fuse) fails because BERT has not been adapted to recognize learner errors.

Methodology

The researchers compared three primary strategies for incorporating BERT into a Transformer-based EncDec model:

  • BERT-init: Initializing the GEC encoder with pre-trained BERT weights.
  • BERT-fuse: Using pre-trained BERT as a fixed feature extractor, fused via an additional attention mechanism.
  • BERT-fuse GED (Proposed): Fine-tuning BERT on a Grammatical Error Detection (GED) task—labeling words as "correct" or "incorrect"—prior to using it as a feature provider for the GEC model.
Technical specifications and hyperparameters for the GEC and GED models used in the study.

Analysis: Bridging the Distribution Gap

The core insight of the BERT-fuse GED approach is that detection informs correction. By teaching BERT to locate errors first, it provides richer features for the correction model.

Visual analysis using t-SNE (Figure 1) confirms this shift. While vanilla BERT clusters words by their identity (e.g., all instances of "the" are grouped together), the GED-fine-tuned BERT creates distinct clusters based on whether a word is used correctly or incorrectly. This proves the model has successfully learned to represent grammatical context rather than just lexical identity.

t-SNE visualization comparing vanilla BERT (a) and GED fine-tuned BERT (b). Note how fine-tuning allows the model to cluster tokens by correctness.

Key Results

The proposed BERT-fuse GED method achieved state-of-the-art (SOTA) performance across standard benchmarks:

  • BEA-test: Achieved an $F_{0.5}$ of 70.2 (with ensemble and pseudo-data).
  • CoNLL-2014: Achieved an $F_{0.5}$ of 65.0.
  • Performance Gains: On the BEA-test (single model, no pseudo-data), BERT-fuse GED reached an $F_{0.5}$ of 54.8, significantly outperforming the baseline (49.6) and standard BERT-init (52.4).

Limitations and Future Work

Despite its success, the fusion method introduces significant computational overhead during both training and inference. Furthermore, while the GED step mitigates the distribution gap, the authors suggest that future research should explore more efficient regularization techniques to make BERT-init more robust or investigate if these benefits extend to other architectures like RoBERTa or ELECTRA.

Summary updated

BibTeX
@inproceedings{kaneko2020encoder,
  author = {Masahiro Kaneko and Masato Mita and Shun Kiyono and Jun Suzuki and Kentaro Inui},
  title = {{Encoder-Decoder Models Can Benefit from Pre-trained Masked Language Models in Grammatical Error Correction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.391},
}
Figure