Abstract
Recent works have proposed methods of generating synthetic data automatically for unsupervised Grammatical Error Correction (GEC). Although a large amount of synthetic data is generated at a low cost, it is unrealistic and of poor quality. The copying phenomenon of synthetic data prevents GEC models from learning the semantic knowledge of contextual language. In this paper, we design an instruction format and use the masking strategy in both an erroneous sentence and the corresponding instruction consistently to alleviate the impact of the copy phenomenon. We also propose a novel approach, InstructGEC, which integrates the knowledge of grammatical detection into GEC models with instruction tuning to address the low-quality issue. Experiments are conducted on English and Chinese GEC datasets and results demonstrate that our method outperforms state-of-the-art unsupervised GEC methods.
Introduction
Grammatical Error Correction (GEC) is a critical task in natural language processing, traditionally relying on large-scale human-annotated datasets. To mitigate the high cost of manual labeling, unsupervised GEC leverages synthetic data generated by corrupting clean text. However, this approach faces two primary challenges: the copying phenomenon and low data quality.
The copying phenomenon occurs because errors in natural language are sparse; synthetic erroneous sentences are often nearly identical to their correct counterparts. Consequently, models often learn to simply copy input tokens rather than understanding linguistic rules. Furthermore, heuristic-based error generation often produces unrealistic sentences that do not reflect human error patterns.
Methodology: InstructGEC
To address these issues, we introduce InstructGEC, a framework that treats GEC as an instruction-following task. The core idea is to provide the model with explicit hints about where and how to edit a sentence, shifting the task from open-ended generation to constrained editing.
Instruction Design and Architecture
The framework employs a two-stage process:
- Detection Stage (GED): A sequence tagging model identifies potential errors and generates a sequence of sub-instructions (e.g.,
<k>for keep,<r>for replace,<a>for add,<d>for delete). - Correction Stage (GEC): A Transformer-based Seq2Seq model receives a prompt containing the instruction sequence and the erroneous sentence.
Masking Strategy and Consistency Training
To combat the copying phenomenon, we introduce a masking strategy. During training, tokens in the erroneous sentence are randomly masked, and the corresponding instruction is set to <m>. This forces the model to rely on contextual semantics rather than direct copying from the input.
Additionally, to ensure robustness against errors in the detection stage, we utilize Consistency Training. We calculate the Jensen-Shannon (JS) divergence between the model's predictions when given "gold" (perfect) instructions versus "predicted" (noisy) instructions. This loss term encourages the model to produce consistent corrections regardless of minor inaccuracies in the detection phase.
Experimental Results
We evaluated InstructGEC on major English (CoNLL-2014, BEA-2019) and Chinese (NLPCC 2018, MuCGEC) benchmarks. The models were trained exclusively on synthetic data (3.4M pairs for Chinese and 9M pairs for English).
Performance on English Benchmarks
As shown in the table below, InstructGEC achieves state-of-the-art performance for unsupervised methods. When combined with the BIFI (Break-It-Fix-It) framework, our method reached an $F_{0.5}$ score of 57.14 on the CoNLL-2014 test set, significantly outperforming standard BART and GPT-2 baselines.
Performance on Chinese Benchmarks
On the NLPCC 2018 test set, InstructGEC achieved an $F_{0.5}$ of 33.31, surpassing the previous SOTA unsupervised model, GECToR (31.08). Ablation studies confirmed that the masking strategy is vital, contributing approximately 1.16 points to the final $F_{0.5}$ score by forcing the model to attend to semantics.
Conclusion
InstructGEC demonstrates that instruction tuning and strategic masking can effectively overcome the limitations of synthetic data in unsupervised GEC. By bridging the gap between error detection and correction, the framework enables models to learn deeper linguistic patterns, leading to significant performance gains across multiple languages. Future work will focus on improving the interpretability of corrections and refining the instruction generation process.
Summary updated