Evidence-Gated Grammar Correction for Advanced Language Learners

Large language models asked to fix learner writing make two opposite mistakes. With advanced writers they rewrite phrasing that was already fine. With harder semantic errors they leave wrong phrases untouched because the phrase looks grammatical. We propose a single fix for both. Before any edit is accepted, the system looks up how the original phrase and the proposed replacement are actually used in a reference collection of real writing. That collection is built from native essays and from corrected learner essays labelled by proficiency level. An edit survives only if the evidence shows the original is unusual and the replacement is attested. Separately, a spike in how surprising a phrase is to a language model triggers the same lookup, which can then propose an edit the generator missed. Put simply, the system first finds out whether people who write well actually say the phrase, and only then changes it.

This matters because grammatical error correction (automatically rewriting a learner's sentence into a correct one) is moving from supervised translation-style systems to general chat models, and those models fail precisely on the writers who most need to be left alone. Evaluating Prompting Strategies for Grammatical Error Correction Based on Language Proficiency tested GPT-2 and GPT-3.5 across Common European Framework of Reference (CEFR) levels A, B and C on the Write & Improve corpus. It found overcorrection that is worst for level-C writers, with recall outrunning precision. The same study found that fixed few-shot prompts and fine-tuning did not remove the effect. A tool that rewrites an advanced student's correct sentence teaches them something false.

Core Claim

Retrieval in learner-text correction should serve as attestation evidence for each individual edit, not as background knowledge for the generator. The lookup should be calibrated to the writer's proficiency level, and model surprisal should decide when to look. Concretely, we claim this edit-level gate raises precision on level-C and native essays from Write & Improve plus the LOCNESS native corpus (W&I+LOCNESS) at little cost in recall. We further claim it beats a surprisal-only filter at matched recall, which would show that retrieved usage evidence carries information beyond what the model's own probabilities contain.

Relation to Prior Work

The closest existing system is KAGEC, introduced in Search if you don't know! Knowledge-Augmented Korean Grammatical Error Correction with Large Language Models. It has an LLM extract suspect phrases, retrieves their definitions from the Standard Korean Dictionary, and prepends those definitions before generating a correction. This lifted ChatGPT from 47.57 to 58.11 BLEU on sentence-component ("Element") errors, and Llama2-70B from 52.17 to 64.54 BLEU on auxiliary-predicate errors, on the K-NCT benchmark. KAGEC motivates our work, because it shows that external evidence cures under-correction. It also constrains our work: Llama2-13B degraded when given the retrieved definitions, a sign that long injected context hurts smaller models. Our design differs on three axes. First, we retrieve attested usage from real writing rather than dictionary headwords. Second, retrieval acts after generation, as a per-edit keep-or-drop decision, rather than as a long context block before generation. Third, the reference collection is filtered by the writer's CEFR level. The proficiency-prompting study above supplies the failure mode we target, and it rules out static few-shot prompting as a cure.

Two learner-corpus papers supply the trigger signal. Modeling Chinese L2 Writing Development: The LLM-Surprisal Perspective shows that surprisal falls as proficiency rises on the TOCFL Chinese learner essays. Surprisal is the negative log-probability a language model assigns to each token given what came before. Automated Classification of Written Proficiency Levels on the CEFR-Scale through Complexity Contours and RNNs shows that proficiency is visible in how lexical and n-gram frequency measures fluctuate within a text. Its sequence model reached 75.4% CEFR accuracy on the EF-Cambridge Open Language Database (EFCAMDAT), versus 66.1% for text averages. We reuse the surprisal idea locally, flagging spans whose surprisal is high relative to the writer's own text, as the "when to retrieve" signal.

On the retrieval side, RaDIO decides when to retrieve with a hallucination detector trained on hidden states. It builds queries from attention weights and TF-IDF term-importance scores. That approach detects factual mismatches against Wikipedia and has no notion of idiomatic or grammatical divergence. We keep its lesson that naive last-k-token queries retrieve junk, and we replace its factual trigger with a fluency trigger.

Finally, Automated Essay Scoring Using Discourse External Knowledge adds external linguistic features to essay scoring, reaching an average quadratic weighted kappa (QWK, an agreement score between machine and human grades) of 0.74 on the ASAP essay dataset. It produces scores, not edits. We cite it only to mark that our contribution is on the generative side.

Research Program

The system has four parts. The first is a generator, any LLM prompted for correction, which proposes edits. These are aligned into span-level edits with the ERRANT toolkit, which extracts and classifies the individual changes between an original sentence and its correction.

The second is a reference index built from three sources. We index the corrected target side of the W&I+LOCNESS training essays, keyed by CEFR level, together with the LOCNESS native essays and the CEFR-labelled EFCAMDAT texts. All development and test essays are strictly excluded.

The third is a retriever. It queries an n-gram inverted index for the original span and the proposed span, each in a small context window, and then re-ranks the hits with dense sentence embeddings. Exact lexical matching is the point here, since attestation is a question about specific word sequences.

The fourth is a gate that keeps an edit when the evidence favours it. For original span $o$, proposed span $c$ and writer level $\ell$, let $n_\ell(x)$ be the smoothed count of retrieved context-matched occurrences of span $x$ in the native portion plus the portion at level $\ell$ or above. The gate keeps the edit when

$$ g(o,c) = \log \frac{n_\ell(c)+\alpha}{n_\ell(o)+\alpha} + \beta\, \Delta s(o,c) > \tau, $$

Here $\Delta s(o,c)$ is the drop in language-model surprisal from $o$ to $c$, $\alpha$ is a smoothing constant, and $\beta$ and $\tau$ are tuned on development data. Setting the count term to zero recovers a surprisal-only filter. This is exactly the ablation that tests whether retrieval adds anything.

A recall path covers the under-correction side. When a span's surprisal exceeds the writer's own median by a tuned margin and the generator proposed no edit there, the retriever pulls the nearest attested alternatives. The generator is then asked once, with only those few short snippets, whether to replace the span. Keeping injected context to a handful of short attestation snippets is our response to the small-model degradation KAGEC observed. We will test it directly at two model sizes.

The level $\ell$ comes from the dataset label at evaluation time. To check that the method does not depend on gold labels, we also run with a level predicted by a contour-style classifier trained on EFCAMDAT.

Baselines

The naive reference point is the same generator with zero-shot prompting and no gate, evaluated on the same W&I+LOCNESS development essays split by level A, B, C and native. This shows how much overcorrection there is to remove. Beating it means higher ERRANT F0.5 and higher precision on C and native. F0.5 is the precision-weighted F-score used in the BEA-2019 shared task.

The proficiency-prompting baseline follows Evaluating Prompting Strategies for Grammatical Error Correction Based on Language Proficiency: 4-shot prompting with fixed exemplars, which that paper found beats zero-shot on F0.5. We add the writer's CEFR level and an instruction to make minimal edits. No reported numerical result for this baseline was found on Lacuna; the file reports only directional findings. We rerun it ourselves with the same generator.

The retrieval-of-examples baseline replaces fixed exemplars with the k most similar training sentences and their corrections, drawn from the same index and filtered by level. This is the standard way to use a corpus with an LLM and the most direct competitor to our use of the same data. It gets the same index, the same embedding model and the same number of tuned hyperparameters as our gate.

The strongest existing method is a supervised GEC system of the BEA-2019 kind. The CUED's Grammatical Error Correction Systems for BEA-2019 reports an ERRANT score of 34.58 on the BEA-2019 development set in the low-resource track. In the restricted track its best ensemble reached an ERRANT score of 47.34 and an M2 score of 58.90 on CoNLL-2014. Back-translation contributed 8.44 points. The BEA-2019 Shared Task on Grammatical Error Correction names UEDIN-MS and Kakao&Brain as top systems, but no numbers are reported in the file. We will train or obtain a supervised sequence-to-sequence corrector on the same W&I, FCE, Lang-8 and NUCLE training data and report it per level. We also apply our gate on top of it, since the gate is model-agnostic. Beating it means either higher per-level F0.5 with the LLM generator, or a gain when the gate is stacked on the supervised system.

The key ablation is the surprisal-only gate, with $n_\ell$ removed and $\beta$ and $\tau$ retuned. It gets an identical tuning budget. We also run level-blind retrieval, using the whole index regardless of $\ell$, to isolate proficiency calibration.

Why not just…?

Why not just retrieve similar corrected sentences as few-shot examples? This is the most natural alternative, and it is a real threat, because it uses exactly the same corpus. Our argument is that nearest-neighbour examples show the model how to edit, which plausibly pushes it toward more editing. Our gate instead asks whether this specific edit is supported. The retrieval-of-examples baseline above settles the question directly. If it matches our precision on level-C essays at equal recall, edit-level gating is not worth its extra pipeline, and we will say so.

Why not just filter edits by language-model surprisal, with no retrieval? A strong language model already approximates "is this phrase attested." The surprisal-only ablation is therefore the decisive test of the whole proposal. We expect retrieval to help where the model's probabilities are miscalibrated toward simplified or textbook phrasing. That is the overcorrection pattern on advanced writers that Evaluating Prompting Strategies for Grammatical Error Correction Based on Language Proficiency describes. If the surprisal-only gate matches ours at matched recall, the contribution reduces to "surprisal filtering fixes overcorrection." That would still be a useful finding, but it is not a retrieval result.

Why not just tell the model the writer's level and ask for minimal edits? This costs nothing, so it is included in the proficiency-prompting baseline. The prior study's finding that prompting variants did not remove level-C overcorrection suggests instructions alone are insufficient. We do not take that as settled, because it tested older models, and we rerun the comparison.

Why not just use a fine-tuned supervised corrector? Supervised systems are conservative by design and may already avoid overcorrection. Against that, The CUED's Grammatical Error Correction Systems for BEA-2019 needed millions of synthetic sentences to perform well. They also do not transfer cheaply to new languages, as K-NCT illustrates. Stacking the gate on the supervised system tells us whether the evidence it adds is complementary or redundant.

Proposed Experiments

The main evaluation is ERRANT precision, recall and F0.5 on the W&I+LOCNESS development essays, reported separately for levels A, B, C and native. We pay particular attention to the false-positive edit rate on native text, where every edit is by definition an overcorrection. The decisive check is a precision–recall curve on levels C and native, traced by sweeping $\tau$ for our gate and the threshold for the surprisal-only gate. Retrieval must lie strictly above surprisal-only across the operating range. On level A, by contrast, we expect little gain from the gate and some recall gain from the surprisal-triggered recall path. We break down error types into content-word and function-word errors, since The BEA-2019 Shared Task on Grammatical Error Correction identifies content words as the persistent weakness.

To test the capacity ceiling, every condition runs with a small and a large open model. The prediction is that our short-snippet gate does not degrade the small model, whereas KAGEC-style definition injection does.

For transfer, we build a Korean index from the corrected side of K-NCT training pairs. We compare against KAGEC's reported Element (58.11 BLEU, ChatGPT) and Auxiliary Predicate (64.54 BLEU, Llama2-70B) results under the same metric, while noting that K-NCT has no CEFR labels, so only the level-blind variant applies there.

A last control repeats the main runs with predicted rather than gold CEFR levels. This checks that the gains survive realistic deployment.