Automatical sampling with heterogeneous corpora for grammatical error correction

Simeng Zhu, Jianjian Liu, Ying Li, Zhengtao YuComplex 2024

Abstract: Thanks to the strong representation capability of the pre-trained language models, supervised grammatical error correction has achieved promising performance. However, traditional model training depends significantly on the large scale of similar distributed samples. The model performance decreases sharply once the distributions of training and testing data are inconsistent. To address this issue, we propose an automatic sampling approach to effectively select high-quality samples from different corpora and filter out irrelevant or harmful ones. Concretely, we first provide a detailed analysis of error type and sentence length distributions on all datasets. Second, our corpus weighting approach is exploited to yield different weights for each sample automatically based on analysis results, thus emphasizing beneficial samples and ignoring the noisy ones. Finally, we enhance typical Seq2Seq and Seq2Edit grammatical error correction models with pre-trained language models and design a model ensemble algorithm for integrating the advantages of heterogeneous models and weighted samples. Experiments on the benchmark datasets demonstrate that the proper utilization of different corpora is extremely helpful in enhancing the accuracy of grammatical error correction. The detailed analysis gains more insights into the effect of different corpus weighting strategies.

Introduction

Grammatical Error Correction (GEC) is the task of automatically detecting and fixing errors like word choice, order, redundancy, and missing words. While modern pre-trained language models have made GEC quite effective, they suffer from a major bottleneck: data inconsistency.

Most GEC models are trained on massive, "off-the-shelf" corpora. However, the distribution of errors and sentence lengths in these training sets often differs wildly from the actual test data (the "distributional shift"). Simply merging all available data can introduce noise or "harmful samples" that confuse the model, leading to a sharp drop in performance when the model encounters real-world text.

Data Analysis and the Distributional Shift

To address this, the authors first conducted a detailed analysis of error types and sentence length distributions across multiple datasets, including HSK, Lang8, Baidu, ASR, and YACLC.

Figure 4: Sentence length distribution across different GEC corpora, highlighting the significant variance between datasets.

As shown in Figure 4, sentence length distributions vary significantly across corpora. The analysis also revealed that datasets like HSK and Lang8 closely match the error patterns of benchmark test sets, while others (like ASR-generated data) are much noisier. Aligning the training weights to match the cause of errors in the test set is crucial for performance.

Proposed Methodology

The proposed framework addresses data inconsistency through a three-pronged approach involving automatic sampling and a heterogeneous model ensemble.

Figure 1: Overview of the proposed GEC framework, featuring automatic sampling with heterogeneous corpora and a heterogeneous model ensemble.

1. Automatic Sampling & Weighting

Instead of treating all training samples equally, the researchers categorized corpora into three tiers:

  • High-quality (e.g., HSK, Lang8): Assigned high weights ($w \ge 1$) and used for fine-tuning.
  • Pseudo data (e.g., Baidu, ASR): Assigned normal weights ($0.5 \le w \le 1$) and used for pre-training.
  • Noise data (e.g., YACLC'): Assigned low weights ($w \le 0.5$) to minimize interference while still providing regularization.

2. Heterogeneous Model Ensemble

The system enhances two different types of GEC architectures:

  • Seq2Seq (BART-enhanced): Treats GEC as a translation task. It has high correction power but is slower.
  • Seq2Edit (StructBERT-enhanced): Treats GEC as a sequence labeling/editing task. It is faster and better at precise error detection.

These models are combined into a 6-model ensemble using a voting strategy to capture the complementary strengths of both architectures.

Key Results and Insights

The proposed method achieved new state-of-the-art (SOTA) performance on major benchmarks:

  • NLPCC2018: Reached an $F_{0.5}$ score of 46.61, outperforming previous SOTA models like SynGEC (45.32).
  • MuCGEC: Reached an $F_{0.5}$ score of 48.84, a significant jump over previous benchmarks (46.51).

Noise can be a Teacher: Interestingly, the authors found that "noise data" (correct sentences labeled as noise) is actually helpful. It helps the model learn "right-right" pairs, which reduces over-correction—a common problem where GEC models "fix" perfectly fine sentences.

Limitations and Future Work

While effective, running an ensemble of six large pre-trained models is computationally expensive. Future work might look into distilling this ensemble knowledge into a single, more efficient model. Additionally, the authors suggest that Large Language Models (LLMs) could be used in the future to perform even more sophisticated data filtering and high-quality synthetic data generation.

Summary updated

BibTeX
@inproceedings{zhu2024automatical,
  author = {Simeng Zhu and Jianjian Liu and Ying Li and Zhengtao Yu},
  title = {{Automatical sampling with heterogeneous corpora for grammatical error correction}},
  booktitle = {Complex},
  year = {2024},
  doi = {10.1007/s40747-024-01653-3},
}
Figure