Abstract
Grammatical Error Correction (GEC) is typically framed as a sequence-to-sequence translation task. However, standard models trained with cross-entropy loss often struggle to capture the stylistic nuances of fluent writing, instead over-optimizing for simple n-gram overlaps. This paper introduces Adversarial-GEC, a framework that employs Generative Adversarial Networks (GANs) to learn a more sophisticated reward function. By utilizing a sentence-pair discriminator and policy gradient optimization, the proposed system achieves significant performance improvements over standard Neural Machine Translation (NMT) baselines across multiple industry-standard benchmarks.
Introduction
Traditional GEC systems treat the correction process as "translating" erroneous text into fluent English. While effective, these models often fail to understand why a specific correction is superior. Most existing systems minimize cross-entropy loss, which essentially forces the model to mimic a specific human editor's word choices. This approach is a limited proxy for the true goal: producing sentences that are grammatically correct, meaning-preserving, and lexically natural.
To address this, researchers from Grammarly propose using an adversarial framework. Instead of relying on rigid, hand-crafted metrics like $M^2$ or GLEU, they train a model to distinguish between human-level corrections and machine-generated ones, effectively creating a learnable reward function that captures the "latent nuances" of good writing.
The Adversarial-GEC Framework
The system consists of two primary components: a Generator ($G$) and a Discriminator ($D$).
- The Generator ($G$): A Seq2Seq model (Transformer or RNN) that takes an incorrect sentence as input and generates a corrected version.
- The Discriminator ($D$): Unlike standard GAN discriminators that evaluate a single output, this is a sentence-pair classifier. It evaluates the pair of (Incorrect Sentence, Corrected Sentence). This context is crucial; it ensures the discriminator judges whether the correction is appropriate for the specific errors present in the source, rather than just checking if the output is a valid English sentence.
- Adversarial Training via Policy Gradients: Since text generation involves discrete token selection, standard backpropagation is not applicable. The authors use the REINFORCE algorithm, where the discriminator's output serves as a reward signal to update the generator's policy.
- Training Stability: To mitigate the inherent instability of GANs, the authors implemented interleaved training (alternating between adversarial and MLE updates) and used a moving average of historical rewards as a baseline to reduce variance.
Experimental Results
The models were evaluated on the FCE, CoNLL-14, and BEA-19 benchmarks. The results demonstrate that the adversarial signal consistently improves performance over standard NMT baselines.
As shown in the results table, the Transformer-based Adversarial-GEC model achieved an $F_{0.5}$ score of 50.04 on the FCE dataset, a significant jump from the 47.30 baseline. Similar gains were observed across other datasets, with the system reaching 49.13 $F_{0.5}$ on BEA-19. Notably, the RNN-based adversarial model showed substantial improvements in precision, suggesting that the discriminator's feedback is particularly effective at preventing "hallucinated" or erroneous edits.
Key Insights
- Contextual Discrimination: Experiments revealed that a single-sentence discriminator performs poorly because it lacks the context of the original error. The sentence-pair formulation is essential for maintaining semantic consistency.
- The "Goldilocks" Discriminator: The authors found that the discriminator's strength must be carefully balanced. If the discriminator is too accurate (e.g., >90%), its feedback becomes too harsh for the generator to learn from. An accuracy range of 0.7 to 0.75 was found to be the "sweet spot" for effective pre-training.
- Beyond N-grams: By learning a reward function, the model can optimize for fluency and grammaticality in ways that rigid metrics like BLEU or $M^2$ cannot capture.
Conclusion
Adversarial-GEC demonstrates that GANs can be effectively applied to the GEC task to move beyond the limitations of cross-entropy loss. While training remains sensitive to hyperparameters, the framework provides a path toward models that better understand the nuances of human language. Future work may involve integrating larger pre-trained architectures like BERT or GPT to provide even more sophisticated feedback.
Summary updated