Grammarly applies adversarial GAN framework to grammatical error correction for more contextually appropriate rewrites
Neural machine translation-based GEC models optimized for n-gram or edit-based metrics can produce grammatically correct text that is semantically inconsistent with the original input, meaning high n-gram precision does not guarantee high-quality corrections.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · Erroneous sentence input
A potentially erroneous sentence is taken as input to be transformed into its corrected version.
Adversarially trained models (RNN-Adv and Transformer-Adv) using the proposed GAN framework consistently achieved better results on standard GEC evaluation datasets, with the sentence-pair discriminator leading to much better performance compared with the conventional single-sentence discriminator.
What failed first
A conventional single-sentence real-versus-fake discriminator struggled to differentiate between a ground-truth correction and a generated sentence that either omitted intended corrections or altered the semantics of the source.