Larger Context Window, Fewer Overcorrections: Optimizing Prompts and Batching for Minimal-Edit Grammatical Error Correction

arXiv cs.CL Papers

Summary

This paper presents an optimized prompt-based method for minimal-edit grammatical error correction that achieves state-of-the-art results by using taxonomy-based instructions, batching, and LLM-assisted prompt optimization.

arXiv:2609.10810v1 Announce Type: new Abstract: Minimal-edit Grammatical Error Correction (GEC) is a challenging task for zero- and few-shot prompted Large Language Models (LLMs), which systematically overcorrect and degrade $F_{0.5}$ by rewriting well-formed spans. While fine-tuning provides an effective solution, it imposes substantial infrastructure demands. We introduce a prompt-based approach that closes the gap to fine-tuned models through three advances in GEC prompting methodology. First, we introduce taxonomy-based instructions to enforce minimal-edit constraints with a comprehensive list of grammatical error rules, equipping the LLM with a bounded, metric-aligned scope of correctable edits, which benefits the strongest models while remaining model-dependent overall. Second, we show that batching multiple uncorrected sentences into a single input context acts as a targeted regularizer against overcorrection, systematically reducing the edit rate across diverse LLM families; we hypothesize this arises from attention dilution effect induced by the bounded capacity of self-attention scores. Finally, LLM-assisted Prompt Optimization refines these instructions. Powered by Gemini 3.1-Pro, our prompt achieves $F_{0.5}=78.32$ on the BEA-2019 test set - establishing a new prompt-based SOTA while shrinking the gap to the fine-tuned single-model SOTA (Staruch et al., 2025) to a mere $0.38$ points. Code, prompts, and outputs are publicly available.
Original Article
View Cached Full Text

Cached at: 09/11/26, 08:16 AM

# Optimizing Prompts and Batching for Minimal-Edit Grammatical Error Correction
Source: [https://arxiv.org/html/2609.10810](https://arxiv.org/html/2609.10810)
## Larger Context Window, Fewer Overcorrections: Optimizing Prompts and Batching for Minimal\-Edit Grammatical Error CorrectionThanks:Accepted for publication at EMNLP 2026 \(Findings\)\.

Kateryna Karpo††thanks:First author\.Artem ChernodubAffiliation:Zendeskkateryna\.karpo@ucu\.edu\.uaa\.chernodub@gmail\.com

###### Abstract

Minimal\-edit Grammatical Error Correction \(GEC\) is a challenging task for zero\- and few\-shot prompted Large Language Models \(LLMs\), which systematically overcorrect and degradeF0\.5F\_\{0\.5\}by rewriting well\-formed spans\. While fine\-tuning provides an effective solution, it imposes substantial infrastructure demands\. We introduce a prompt\-based approach that closes the gap to fine\-tuned models through three advances in GEC prompting methodology\. First, we introduce taxonomy\-based instructions to enforce minimal\-edit constraints with a comprehensive list of grammatical error rules, equipping the LLM with a bounded, metric\-aligned scope of correctable edits, which benefits the strongest models while remaining model\-dependent overall\. Second, we show that batching multiple uncorrected sentences into a single input context acts as a targeted regularizer against overcorrection, systematically reducing the edit rate across diverse LLM families; we hypothesize this arises from attention dilution effect induced by the bounded capacity of self\-attention scores\. Finally, LLM\-assisted Prompt Optimization refines these instructions\. Powered by Gemini 3\.1\-Pro, our prompt achievesF0\.5=78\.32F\_\{0\.5\}=78\.32on the BEA\-2019 test set — establishing a new prompt\-based SOTA while shrinking the gap to the fine\-tuned single\-model SOTA\([Staruch et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib40)\)to a mere0\.380\.38points\. Code, prompts, and outputs are publicly available\.111This work was conducted as part of Kateryna Karpo’s M\.Sc\. thesis at the Ukrainian Catholic University, Faculty of Applied Sciences\.222[https://github\.com/katerynkarpo/llm\-en\-gec](https://github.com/katerynkarpo/llm-en-gec)

## 1Introduction

Grammatical Error Correction \(GEC\) has two evaluation paradigms\([Bryant et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib4)\)\. Fluency\-oriented correction permits extensive lexical substitution and stylistic restructuring to produce native\-sounding text\([Napoles et al\., 2017](https://arxiv.org/html/2609.10810#bib.bib30)\)\. Minimal\-edit correction instead addresses grammatical, spelling, and punctuation errors while preserving the original phrasing\([Leacock et al\., 2014](https://arxiv.org/html/2609.10810#bib.bib21)\)\. Such minimal, targeted corrections are essential in educational applications, where the goal is to guide learners in revising their own errors while preserving intent\([Nicholls, 2003](https://arxiv.org/html/2609.10810#bib.bib32)\), and controlling LLMs to produce them remains difficult\([Vajjala et al\., 2026](https://arxiv.org/html/2609.10810#bib.bib47)\)\.

Earlier work on minimal\-edit GEC relied on supervised fine\-tuning of sequence taggers\([Awasthi et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib3);[Omelianchuk et al\., 2020](https://arxiv.org/html/2609.10810#bib.bib33);[Tarnavskyi et al\., 2022](https://arxiv.org/html/2609.10810#bib.bib44)\)and sequence\-to\-sequence models\([Junczys\-Dowmunt et al\., 2018](https://arxiv.org/html/2609.10810#bib.bib17);[Grundkiewicz et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib14);[Kiyono et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib20);[Rothe et al\., 2021](https://arxiv.org/html/2609.10810#bib.bib39)\)\. Both approaches face recall bottlenecks: taggers are bound by finite edit spaces, while sequence\-to\-sequence cross\-attention induces a copying bias\. Their conservative span\-local bias still aligns naturally with the precision\-weightedF0\.5F\_\{0\.5\}objective and sets a strict behavioral baseline for prompt\-based methods\.

[Alikaniotis and Raheja \(2019\)](https://arxiv.org/html/2609.10810#bib.bib2)demonstrated that early GPT models could perform GEC without task\-specific training\. With the rise of instruction\-tuned, decoder\-only LLMs\([Ouyang et al\., 2022](https://arxiv.org/html/2609.10810#bib.bib35)\)such as ChatGPT, zero\- and few\-shot prompting became a widely adopted paradigm for text editing without task\-specific fine\-tuning\. Out\-of\-the\-box prompted LLMs rapidly reached state\-of\-the\-art results on tasks that reward free\-form rewriting, such as fluency GEC\([Loem et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib27)\)and text simplification\([Vadlamannati and Şahin, 2023](https://arxiv.org/html/2609.10810#bib.bib46)\)\. Applied to minimal\-edit GEC with vanilla instructions \(e\.g\.,‘‘Correct the grammatical errors’’\), the same models systematically overcorrect in both zero\- and few\-shot settings\([Fang et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib11);[Coyne et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib8)\), rewriting well\-formed spans with synonym swaps, stylistic polishing, or clause rephrasings that add no actual value\.

Recent prompt\-based efforts on minimal\-edit GEC explored richer prompting strategies, from error\-pattern\-aware in\-context example selection\([Tang et al\., 2024](https://arxiv.org/html/2609.10810#bib.bib43);[Li et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib22)\)to detection\-before\-correction prompting\([Li and Wang, 2024](https://arxiv.org/html/2609.10810#bib.bib23)\)and automatic prompt optimization\([Chernodub et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib7)\)\. Even so, prompt\-based systems still lag behind the supervised state of the art, so the mainstream route to enforcing the minimal\-edit constraint remains infrastructure\-heavy fine\-tuning:[Omelianchuk et al\. \(2024\)](https://arxiv.org/html/2609.10810#bib.bib34)adapt LLaMA\-2 to reduce overcorrection,[Liang et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib24)align the pretraining objective with the minimal\-edit principle through edit\-wise preference optimization for LLaMA2 and Mistral\-v0\.1, and[Staruch et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib40)set the current single\-model state of the art on BEA\-2019 \(F0\.5=78\.70F\_\{0\.5\}=78\.70\) by fine\-tuning Gemma 2 with a schedule that progressively raises the share of unedited examples, reversing earlier sequence\-to\-sequence pipelines that filtered out error\-free sentences\([Junczys\-Dowmunt et al\., 2018](https://arxiv.org/html/2609.10810#bib.bib17);[Grundkiewicz et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib14)\)\.

We aim to close the gap between fine\-tuned GEC systems and prompt\-based, API\-accessed LLMs, which matters for individuals and organizations that cannot afford fine\-tuning of open\-source LLMs due to engineering or regulatory constraints\. Our hypothesis is that the increased instruction\-following capabilities of the latest LLMs are already sufficient to respect the minimal\-edit GEC constraints without the need of weight updates\. Recent results support this, but also expose its limit: with a declarative minimal\-edit instructions, Claude Sonnet 4\.5 reachesF0\.5=64\.91F\_\{0\.5\}=64\.91on the BEA\-2019 test set\([Türker and Eryiğit, 2026](https://arxiv.org/html/2609.10810#bib.bib45)\), yet still trails the fine\-tuned single\-model SOTA by13\.7913\.79points\. We believe the declarative style is one of the reasons: it states a goal without saying which edits are admissible\. Our taxonomy\-based instructions supply that missing specification, bounding the edit space to the 25 metric\-aligned ERRANT categories\([Bryant et al\., 2017](https://arxiv.org/html/2609.10810#bib.bib5)\)\. Once instructions reach this level of quality, we search for model\-specific instruction refinements via LLM\-assisted prompt optimization\. Last but not least, we introduced batching to reduce latency and cost\([Cheng et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib6)\), but unexpectedly yielded consistent quality improvements for minimal\-edit GEC, motivating our systematic study of how batch size affects edit rates and correction quality\. We evaluate our approach on six commercial LLMs and one open\-weight model across two minimal\-edit benchmarks\.

Our primary contributions are:

1\. We set a new state of the art for prompt\-based minimal\-edit GEC\. With Gemini 3\.1\-Pro and our best prompt[A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4), we achieveF0\.5=78\.32F\_\{0\.5\}=78\.32on the BEA\-2019 test set, the first time an out\-of\-the\-box prompted LLM has closed the gap to the best fine\-tuned single model\([Staruch et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib40)\)to a mere0\.380\.38F0\.5F\_\{0\.5\}points\. We also report a competitiveF0\.5=67\.08F\_\{0\.5\}=67\.08on the CoNLL\-2014 test set\.

2\. We introduce taxonomy\-based GEC instructions layered on a minimal\-edit baseline to provide a bounded, metric\-aligned scope of edits that constrains the strongest models productively and acts as noise for the others\. Defining errors via a concrete list addresses the limitations of both the vague “grammatical error” framing of vanilla GEC prompts and declarative “minimal edit” instructions that ask for conservative rewriting without explaining how to do so\.

3\. We identify batching as a targeted regularizer against overcorrection: packing multiple sentences into a single context reduces the word\-level edit rate and consistently improvesF0\.5F\_\{0\.5\}scores\. We hypothesize this stems from an attention dilution effect induced by the bounded capacity of self\-attention scores\.

4\. We apply LLM\-assisted Prompt Optimization, implemented as a reusable Claude Code agentic skill[2](https://arxiv.org/html/2609.10810#footnote2), on top of taxonomy\-based instructions and batching\. The agent iteratively clusters dev\-set errors and greedily adopts prompt revisions that improve theF0\.5F\_\{0\.5\}score\.

## 2Related Work

The tendency of generative LLMs to overcorrect was recognized early, shifting the focus of prompt\-based GEC toward finding the right wording and structure to enforce the minimal\-edit constraint\. Early evaluations by[Fang et al\. \(2023\)](https://arxiv.org/html/2609.10810#bib.bib11)and[Coyne et al\. \(2023\)](https://arxiv.org/html/2609.10810#bib.bib8)relied on declarative prompts that asked models to maximize source preservation\.[Loem et al\. \(2023\)](https://arxiv.org/html/2609.10810#bib.bib27)then showed that prompt wording alone steers GPT between minimal\-edit and fluency\-edit regimes, a finding[Davis et al\. \(2024\)](https://arxiv.org/html/2609.10810#bib.bib10)extend to open\-source LLMs, and out\-of\-the\-box LLM performance also varies sharply with writer proficiency\([Zeng et al\., 2024](https://arxiv.org/html/2609.10810#bib.bib51)\)and across languages\([Katinskaia and Yangarber, 2024](https://arxiv.org/html/2609.10810#bib.bib19)\), factors that earlier fine\-tuned systems handled by adapting the GEC model to the writer’s proficiency level and first language\([Nadejde and Tetreault, 2019](https://arxiv.org/html/2609.10810#bib.bib29)\)\. More recent efforts to reduce overcorrection move beyond basic instructions:[Li and Wang \(2024\)](https://arxiv.org/html/2609.10810#bib.bib23)introduce a two\-step detection\-correction architecture,[Tang et al\. \(2024\)](https://arxiv.org/html/2609.10810#bib.bib43)propose ungrammatical\-syntax\-based in\-context example selection, and[Goto et al\. \(2026\)](https://arxiv.org/html/2609.10810#bib.bib13)aggregate multiple decodings via edit\-level majority voting\.[Türker and Eryiğit \(2026\)](https://arxiv.org/html/2609.10810#bib.bib45)report the strongest zero\-shot prompted results so far with declarative minimal\-edit instructions, structurally close to our minimal\-edits zero\-shot prompt \([A\.2](https://arxiv.org/html/2609.10810#A1.SS2)\); introducing the taxonomy \([A\.4](https://arxiv.org/html/2609.10810#A1.SS4)\) is what distinguishes our instructions\. This minimal\-edits \+ taxonomy design is adapted from our prior work on Ukrainian\([Karpo and Chernodub, 2026](https://arxiv.org/html/2609.10810#bib.bib18)\), evaluated on the UNLP 2023 shared task benchmark\([Syvokon and Romanyshyn, 2023](https://arxiv.org/html/2609.10810#bib.bib42)\), built on the UA\-GEC corpus\([Syvokon et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib41)\)\. Rather than relying on multi\-step pipelines or inference\-time voting, we constrain the editing scope natively through GEC taxonomy\-based instructions\.

Prior work treats batching purely as an inference\-throughput optimization\([Cheng et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib6)\), in GEC as well\([Masciolini et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib28)\)\. In the broader LLM literature, expanding the input context is typically associated with quality degradation driven by attention dilution, including “lost in the middle” effects and reasoning failures\([Qin et al\., 2022](https://arxiv.org/html/2609.10810#bib.bib37);[Liu et al\., 2024](https://arxiv.org/html/2609.10810#bib.bib26);[Liu et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib25)\)\. To our knowledge, no earlier work uses the input batch as a targeted regularizer to actively reduce overcorrection in minimal\-edit GEC\.

Automatic Prompt Optimization \(APO\) has emerged as a popular alternative to manual prompt engineering, where an LLM iteratively rewrites the instruction it executes\([Ramnath et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib38)\)\. Within GEC,[Chernodub et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib7)apply this paradigm to GPT\-4o, treating the prompt as a learnable list of instructions inferred and refined automatically\. Our procedure is instead a semi\-automatic Claude Code skill that rewrites the entire prompt under user feedback at each iteration\.

## 3Proposed Method

We present a prompt\-based minimal\-edit GEC framework combining GEC taxonomy\-grounded prompts and batched inference, further refined via LLM\-assisted Prompt Optimization\.

##### Prompting strategies\.

We evaluate five manually engineered prompts \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)–[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), varying whether few\-shot examples and the 25 ERRANT error categories are included\. The strongest one, “minimal\-edits few\-shot \+ taxonomy” \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), is then optimized separately for medium\-capacity models \(Section[4](https://arxiv.org/html/2609.10810#S4)\), yielding three LLM\-optimized prompt variants tailored to specific model families \(OpenAI GPT, Anthropic Claude, Google Gemini\), as well as the open\-weight Qwen3\-8B model\.

1. 1\.Vanilla zero\-shot prompt\(Appendix[A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\): a generic instruction to fix grammatical and spelling errors, adapted from[Coyne et al\. \(2023\)](https://arxiv.org/html/2609.10810#bib.bib8), with no further constraints and no examples:‘‘Reply with a corrected version of the input sentence with all grammatical and spelling errors fixed\. If there are no errors, reply with a copy of the original sentence\.’’
2. 2\.Minimal\-edits zero\-shot prompt\(Appendix[A\.2](https://arxiv.org/html/2609.10810#A1.SS2)\): declares the minimal\-edit constraint directly \(‘‘Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\.’’\), plus a short rule list banning paraphrasing, fluency improvements, and stylistic changes, aligned with[Loem et al\. \(2023\)](https://arxiv.org/html/2609.10810#bib.bib27)and[Davis et al\. \(2024\)](https://arxiv.org/html/2609.10810#bib.bib10)\. No grammatical error categories are enumerated, so the model is left to decide what counts as an error\.
3. 3\.Minimal\-edits few\-shot prompt\(Appendix[A\.3](https://arxiv.org/html/2609.10810#A1.SS3)\): keeps the minimal\-edit constraint and rule list of prompt \([A\.2](https://arxiv.org/html/2609.10810#A1.SS2)\) and adds 8 source/target correction pairs sampled from the BEA\-2019 train split, presented as a flat list of demonstrations without taxonomic grouping or category labels\.
4. 4\.Minimal\-edits zero\-shot \+ taxonomy prompt\(Appendix[A\.4](https://arxiv.org/html/2609.10810#A1.SS4)\): supplements the minimal\-edit constraint with the 25 ERRANT error categories\([Bryant et al\., 2017](https://arxiv.org/html/2609.10810#bib.bib5), Table 2\)to provide explicit taxonomic guidance, addressing the ambiguity left by prompt \([A\.2](https://arxiv.org/html/2609.10810#A1.SS2)\)\. The 25 categories are grouped into word\-level, mechanical, and other classes; each is listed with its ERRANT label, a short gloss, and an illustrative substitution, e\.g\.‘‘6\. DET: Wrong/missing/extra determiner \(the→\\toa,∅→\\emptyset\\tothe, the→∅\\to\\emptyset\)’’,‘‘20\. PUNCT: Punctuation errors \(\!→\\to\., missing commas, extra periods\)’’\. Any edit outside these 25 categories is by construction off\-task, and the prompt declares this explicitly\.
5. 5\.Minimal\-edits few\-shot \+ taxonomy prompt\(Appendix[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\): augments prompt \([A\.4](https://arxiv.org/html/2609.10810#A1.SS4)\) with 8 source/target correction pairs sampled from the BEA\-2019 train split\.
6. 6\.Minimal\-edits few\-shot \+ taxonomy \+ optimized prompt\([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)–[A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\): a refinement of prompt[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)produced by an LLM\-assisted Prompt Optimization for each model family\.

![Refer to caption](https://arxiv.org/html/2609.10810v1/figures/prompt_token_counts.png)Figure 1:Prompt length in cl100k\_base tokens333[https://github\.com/openai/tiktoken](https://github.com/openai/tiktoken)\. Manual prompts \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)–[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\) grow progressively longer as constraints and examples are added\. In contrast, optimized prompts \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)–[A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\) yields mixed lengths, either significantly compressing or further expanding the longest manual baseline\.
##### Batching\.

We use the same prompts in two modes\. The single\-sentence mode sets<input\_text\>to one source sentence and processes the input one sentence at a time \(we refer these cases asB=1B=1\)\. The batched mode, which we advocate as the default for deploying minimal\-edit GEC with prompted LLMs, sets<input\_text\>to a numbered, newline\-separated list ofBBsentencess1,…,sBs\_\{1\},\\dots,s\_\{B\}drawn from the input stream; the model returns the numbered list of corrected sentences, and we split it back to the source one\-to\-one before metric\-based evaluation\. Inference pipeline details are in Appendix[B](https://arxiv.org/html/2609.10810#A2)\.

##### LLM\-assisted Prompt Optimization\.

To refine the prompts, we introduce a human\-in\-the\-loop prompt optimization process using Claude Opus 4\.6\. Unlike fully autonomous APO frameworks[Ramnath et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib38);[Agrawal et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib1), our agent periodically requires researcher guidance, so we classify the approach as LLM\-assisted rather than fully automatic\.

Starting from Prompt[A\.5](https://arxiv.org/html/2609.10810#A1.SS5), the agent iteratively refines instructions on the BEA\-2019 dev split using a rule\-driven greedy search\. Each step isolates variables to ensure attributable performance deltas:

1. 1\.Diagnostic Critique:The agent uses ERRANT to isolate metrics by linguistic category and inspects sentence\-level errors to generate a targeted natural language diagnosis, mirroring error\-driven textual gradients and multi\-aspect critiques in recent APO literature[Pryzant et al\. \(2023\)](https://arxiv.org/html/2609.10810#bib.bib36);[He et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib15);[Yuksekgonul et al\. \(2024\)](https://arxiv.org/html/2609.10810#bib.bib50)\.
2. 2\.Targeted Proposal:The agent proposes exactly one change per iteration, either a specific negative constraint \(a “do not change” rule\) or a targeted exemplar\. Unlike methods relying on broad search trees or complex mutations[Wang et al\. \(2024\)](https://arxiv.org/html/2609.10810#bib.bib48);[Ramnath et al\. \(2025\)](https://arxiv.org/html/2609.10810#bib.bib38), we enforce high\-precision, human\-readable heuristic additions targeting specific GEC categories based on ERRANT definitions\.
3. 3\.Greedy Validation:The edit is adopted only if it strictly improves the overall devF0\.5F\_\{0\.5\}score and the targeted GEC category moves in the predicted direction\.

The loop runs until gains plateau\. The optimizer Claude Skill’s full code is in Appendix[C](https://arxiv.org/html/2609.10810#A3)\.

Qualitative analysis of optimized prompts\.Compared with the shared starting point[A\.5](https://arxiv.org/html/2609.10810#A1.SS5), the optimizer reshaped the instruction in a markedly model\-dependent way\. For GPT\-4\.1\-mini \([A\.6\.2](https://arxiv.org/html/2609.10810#A1.SS6.SSS2)\) it discarded the taxonomy in favour of two narrowly scoped rules on comma splices and tense consistency in past narratives, each qualified by explicit exclusions and a leave\-it\-alone default, keeping the demonstrations and compressing the prompt from1,1221\{,\}122to920920tokens\. For Claude Sonnet 4\.6 \([A\.6\.3](https://arxiv.org/html/2609.10810#A1.SS6.SSS3)\) it kept the 25 categories and the demonstrations intact and added two punctuation rule\-blocks that enumerate their trigger lexicons \(subordinators and connectors for sentence\-initial commas, pronouns and demonstratives for comma splices\) plus hard conditions under which the rule must not fire\. For Gemini 3\-Flash \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\) it replaced the taxonomy with a plain\-language list of what to fix and what to leave alone that prunes the open\-ended lexical\-choice categories, restricted punctuation to a short whitelist, and supplied five rule\-scoped examples, one deliberately requiring no edit\. For the open\-weight Qwen3\-8B \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)\) it was far more conservative: the taxonomy and the eight demonstrations both survive, wording changes are limited to a no\-markup output rule and an introductory\-comma rule, and the largest gain came from delivery, re\-packaging the demonstrations as a user/assistant chat exchange\.

Despite this divergence, the three proprietary\-model runs converged on the same policy: precision\-first constraints aimed at the categories with the largest residual dev\-set error, generic demonstrations kept except for Gemini’s rule\-scoped replacements, the taxonomy treated as optional rather than essential, and most recall\-seeking proposals rejected at validation\. The Qwen3\-8B run shares only the precision\-first focus: the taxonomy and demonstrations still help this smaller open\-weight model, so both survive untouched\. Figure[3](https://arxiv.org/html/2609.10810#footnote3)shows how prompt length grows across all our nine prompts \(five manual and four LLM\-optimized variants\)\.

## 4Experimental setup

##### Datasets and metrics\.

For development, we use the restricted track of the BEA\-2019 Shared Task\([Bryant et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib4)\), comprising the Write & Improve and LOCNESS corpora: the official train split \(34,308 sentences\) for prompt engineering and few\-shot sampling, and the dev split \(4,384 sentences\) for batching investigation and ablation studies\. Final evaluations are performed on the CoNLL\-2014 test set\([Ng et al\., 2014](https://arxiv.org/html/2609.10810#bib.bib31)\)\(1,312 sentences\) using theM2M^\{2\}scorer\([Dahlmeier and Ng, 2012](https://arxiv.org/html/2609.10810#bib.bib9)\)and on the BEA\-2019 test set \(4,477 sentences\) via CodaBench444[https://www\.codabench\.org/competitions/10960/](https://www.codabench.org/competitions/10960/)using ERRANT v3\.0\.0555The platform migrated to ERRANT v3\.0\.0 due to deprecated dependencies; score differences from legacy v2\.0\.0 are negligible\.\. Both benchmarks use precision\-weightedF0\.5F\_\{0\.5\}as the main metric\. Local evaluations are computed with thegec\-metricslibrary\([Goto et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib12)\)\.666[https://github\.com/gotutiyan/gec\-metrics](https://github.com/gotutiyan/gec-metrics)

##### Models\.

We focus on commercial LLMs to bring prompt\-based GEC to parity with fine\-tuned models, serving users who cannot host open\-weight alternatives for engineering or regulatory reasons; open\-weight models can be fine\-tuned directly, so prompt optimization matters less for them\. We also report the open\-weight Qwen3\-8B\([Yang et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib49)\)as a reproducible baseline\.

We evaluate six API\-accessed commercial LLMs from three providers \(OpenAI, Anthropic, Google\), grouped into capability tiers to isolate the effect of model tier from that of prompting and batching\. Thehigh\-capacity tiercontains the strongest current offering of each provider: GPT\-5\.4 \(gpt\-5\.4\-2026\-03\-05\), Claude Opus 4\.6 \(claude\-opus\-4\.6\), and Gemini 3\.1\-Pro \(gemini\-3\.1\-pro\-preview\)\. Themedium\-capacity tiercontains a faster, lower\-cost counterpart: GPT\-4\.1\-mini \(gpt\-4\.1\-mini\-2025\-04\-14\), Claude Sonnet 4\.6 \(claude\-sonnet\-4\.6\), and Gemini 3\-Flash \(gemini\-3\-flash\-preview\)\.777We report exact snapshot identifiers wherever providers expose them; Anthropic and Google currently do not, so we record the latest preview alias used at submission time\.888Inference\-time parameters differ across providers\. We set temperature 0 where available, default reasoning effort for Claude,mediumeffort for GPT\-5\.4, andthinkingLevel: lowfor all Gemini models\.

##### Inference pipeline\.

All seven models are accessed through a single LiteLLM router using Structured Outputs: every call returns a JSON object validated against a strict Pydantic schema, which removes free\-form post\-processing and makes the sentence\-to\-prediction mapping bijective\. The schema, the provider\-agnosticresponse\_formatenvelope, and the recovery path for providers that reject strict JSON schema are presented in Appendix[B](https://arxiv.org/html/2609.10810#A2)\.

## 5Experiments

### 5\.1Prompting strategies

Table 1:Evaluation of prompting strategies on BEA\-2019 dev\. Precision, recall, andF0\.5F\_\{0\.5\}scores for the five manual prompts \(ZS = zero\-shot, FS = few\-shot\) across all seven models, evaluated at batch sizeB=1B\{=\}1\. Per\-model best metrics across prompts are bolded\.##### Setup\.

We evaluate the five manually engineered prompts from Section[3](https://arxiv.org/html/2609.10810#S3.SS0.SSS0.Px1)on the BEA\-2019 dev split at batch sizeB=1B\{=\}1\. Precision, recall, andF0\.5F\_\{0\.5\}scores across our prompts are reported in Table[1](https://arxiv.org/html/2609.10810#S5.T1)\.

##### Results\.

The vanilla zero\-shot prompt \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\) shows a classic overcorrection pattern across all models, with high recall but consistently poor precision \(often below45\.045\.0\)\. Imposing a minimal\-edits constraint \([A\.2](https://arxiv.org/html/2609.10810#A1.SS2)\) yields the largest gain, boostingF0\.5F\_\{0\.5\}by\+1\.1\+1\.1to\+10\.9\+10\.9points for all models except Claude Opus 4\.6, where it is nearly neutral, but at the cost of a66to2222point drop in recall\.

To recover this lost recall, we extend the minimal\-edits strategy with in\-context examples and the ERRANT taxonomy\. Few\-shot prompting \([A\.3](https://arxiv.org/html/2609.10810#A1.SS3)\) restores part of the lost recall for six of the seven models and liftsF0\.5F\_\{0\.5\}by an additional\+1\.3\+1\.3to\+3\.0\+3\.0points across most models\. The taxonomy’s contribution, added on top of the few\-shot examples, is model\-dependent rather than uniformly helpful\. It improves two of the three high\-capacity models, Claude Opus 4\.6 and Gemini 3\.1\-Pro, and degrades the remaining four commercial models, including the high\-capacity GPT\-5\.4\. The taxonomy thus acts as a regularizer of the permissible edit space only for the strongest models, which appear to read it as a strict constraint on admissible edits, and as noise for the others\. The open\-weight Qwen3\-8B follows the same qualitative pattern: the minimal\-edits constraint trades recall for precision, and few\-shot examples yield its bestF0\.5F\_\{0\.5\}\(48\.9848\.98\), while the taxonomy provides no benefit\. Its best score trails all six commercial models, consistent with its much smaller scale\.

While the optimal prompt structure varies across models, the absolute highestF0\.5F\_\{0\.5\}scores come from pairing our strongest models with the minimal\-edits few\-shot \+ taxonomy prompt \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), peaking at59\.2859\.28for Claude Opus 4\.6 and57\.5457\.54for Gemini 3\.1\-Pro\. Given its top\-end performance, we adopt this prompt for the batching experiments in Section[5\.2](https://arxiv.org/html/2609.10810#S5.SS2)and as the foundation for LLM\-assisted Prompt Optimization in Section[5\.3](https://arxiv.org/html/2609.10810#S5.SS3)\.

### 5\.2Batching Effect

![Refer to caption](https://arxiv.org/html/2609.10810v1/figures/batching_combined_best_prompt.png)Figure 2:Edit\-count distributions \(top row\) and GEC metrics \(bottom row\) across batch sizes on BEA\-2019 dev under our best performing manual prompt: Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)Top row: per\-sentence word\-level edit counts as a function of the batch sizeBB\. As the batch sizeBBgrows, the general tendency is to shift mass into the 0\-edit bucket \(green\), with the largest relative reductions in the 6\+ tail \(red\) and the 3–5 bucket \(orange\)\. Bottom row: Precision \(blue circles\), Recall \(orange squares\), andF0\.5F\_\{0\.5\}\(green triangles\) on the left axis, and the Scribendi score on the right axis \(brown dashed diamonds\), as a function of the batch sizeBB\. Open rings mark the per\-model Precision, Recall,F0\.5F\_\{0\.5\}, and Scribendi maxima\. See more results in Appendix[D](https://arxiv.org/html/2609.10810#A4)\.##### Setup\.

We vary batch sizesB∈\{1,2,5,15,30,60,120\}B\\in\\\{1,2,5,15,30,60,120\\\}on the BEA\-2019 dev using the minimal\-edits few\-shot \+ taxonomy prompt \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)\. We report per\-sentence edit counts and standard GEC metrics alongside the Scribendi fluency score\([Islam and Magnani, 2021](https://arxiv.org/html/2609.10810#bib.bib16)\)\.999Computed with Gemma 2 9B as the scoring LM following the MultiGEC\-2025 protocol\([Masciolini et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib28)\)\.

##### Results\.

Scaling the batch sizeBBinduces a systematic behavioral shift in Qwen3\-8B and the three high\-capacity models, suggesting that batching acts as a targeted regularizer at the per\-sentence level \(Figure[2](https://arxiv.org/html/2609.10810#S5.F2), top row\)\. AsBBgrows, probability mass moves steadily into the 0\-edit bucket while the heavy\-edit tail \(≥6\\geq 6edits\) shrinks, suppressing the extreme rewrites typically associated with stylistic or hallucinated output\. The shift is most pronounced for the open\-weight Qwen3\-8B, whose share of untouched sentences nearly doubles from43\.8%43\.8\\%atB=1B\{=\}1to80\.7%80\.7\\%atB=120B\{=\}120, and more moderate for the high\-capacity models \(e\.g\.,33\.8%33\.8\\%to50\.5%50\.5\\%for Gemini 3\.1\-Pro\)\.

This conservative shift is mirrored in the standard GEC metrics \(Figure[2](https://arxiv.org/html/2609.10810#S5.F2), bottom row\)\. Precision rises with the batch size for all four models, peaking at the largest batches, while recall moves in the opposite direction\. Claude Opus 4\.6, for instance, reaches the highest precision of the sweep,70\.0270\.02atB=60B\{=\}60\. BecauseF0\.5F\_\{0\.5\}weights precision heavily, the two trends largely offset each other for the three high\-capacity models, producing a flat profile with a shallow optimum at the moderate batch sizeB=15B\{=\}15; for Qwen3\-8B the optimum comes earlier, atB=5B\{=\}5\.

Batching also carries a qualitative cost, captured by the reference\-less Scribendi fluency score\. For all four models, the score peaks at single\-sentence prompting \(B=1B\{=\}1\) and declines nearly monotonically as the batch size grows: in a strictly minimal\-edit setting, large batches heavily discourage overcorrection, so the models leave progressively more disfluencies intact\.

The three medium\-capacity models largely follow the same trends, with theirF0\.5F\_\{0\.5\}optima shifted toward larger batches \(B=30B\{=\}30toB=60B\{=\}60\); complete per\-model curves and numerical results for all seven models are provided in Appendix[D](https://arxiv.org/html/2609.10810#A4)\(Figure[5](https://arxiv.org/html/2609.10810#A4.F5), Tables[4](https://arxiv.org/html/2609.10810#A4.T4)and[5](https://arxiv.org/html/2609.10810#A4.T5)\)\. The batching effect thus generalizes across capacity tiers\.

Hypothesis: Batching limits the attention budget\.While internal LLM dynamics remain opaque, we conjecture that this conservative shift is driven by anattention dilutioneffect\. Because the self\-attention softmax enforces a normalization constraint, packing independent sentences into a single prompt limits the attention budget per token\. At batch sizeB=1B=1, models have enough focus to perform stylistic rewrites; as batch sizeBBgrows, a flattened attention distribution forces the model to prioritize, pivoting away from adjustments and committing to core grammatical errors where the error signal remains salient\.

Practical implications of batching\.The quality\-optimal batch size for the three high\-capacity models isB=15B=15\(Figure[2](https://arxiv.org/html/2609.10810#S5.F2)\)\. Such a batch is a realistic unit of work: a single A4 page holds roughly 20 to 40 sentences, and proofreading services, learner\-platform analytics, and corpus\-cleaning pipelines routinely submit many independent sentences per request\.

For genuinely single\-sentence requests, a promising direction is to pad the target sentence with auxiliary erroneous sentences whose corrections are discarded, analogous to few\-shot demonstrations but without reference outputs, which would make the gain observed atB=15B=15available even when only one sentence needs corrections\.

### 5\.3LLM\-assisted Prompt Optimization

Table 2:Evaluation of optimized prompts across different models on the BEA\-2019 development set\.Each prompt is specifically optimized using one model and subsequently evaluated on all four models without further modification, at the batch size given in theBBcolumn\. The highest Precision, Recall, andF0\.5F\_\{0\.5\}values within each column are highlighted in bold\. Instances of native evaluation, indicating that the prompt is tested on its respective tuning model, are indicated with†across all metrics\.##### Setup\.

Initializing with our comprehensive minimal\-edits few\-shot \+ taxonomy prompt \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), we obtain four model family\-specific prompts optimized for the open\-weight Qwen3\-8B \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)\), OpenAI GPT \([A\.6\.2](https://arxiv.org/html/2609.10810#A1.SS6.SSS2)\), Anthropic Claude \([A\.6\.3](https://arxiv.org/html/2609.10810#A1.SS6.SSS3)\), and Google Gemini \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\)\. We restricted the tuning phase to the open\-weight and medium\-capacity models because of budget limitations\. The prompt selection was done based onF0\.5F\_\{0\.5\}performance on the BEA\-2019 dev after assessing approximately one hundred candidates per model\. As a sanity check of robustness, we evaluate each optimized prompt not only on its tuning model but on all four models: Table[2](https://arxiv.org/html/2609.10810#S5.T2)details their performance at a batch size ofB=15B=15; the Qwen3\-8B\-optimized prompt \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)\) is optimized and evaluated atB=5B=5, the batch size at which Qwen3\-8B performs best \(Figure[2](https://arxiv.org/html/2609.10810#S5.F2)\)\.

##### Results\.

The optimization procedure enhances performance considerably: as anticipated, the gains are largest under native evaluation, where the prompt was selected on the same model, yet they often transfer effectively to other architectures\. For instance, the prompt optimized for Claude Sonnet 4\.6 \([A\.6\.3](https://arxiv.org/html/2609.10810#A1.SS6.SSS3)\) increases theF0\.5F\_\{0\.5\}score on the GPT\-4\.1\-mini model from55\.8055\.80to56\.9756\.97and elevates the Gemini performance from55\.2355\.23to58\.2258\.22\. Similarly, the Gemini\-optimized instruction \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\) improves the Claude model score from57\.5657\.56to58\.3658\.36\. The open\-weight Qwen3\-8B follows the same native\-is\-best pattern: its own optimized prompt \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)\) raises itsF0\.5F\_\{0\.5\}from50\.7450\.74to52\.2852\.28, whereas the prompts tuned for the proprietary models transfer poorly to it, with the Gemini\-optimized prompt \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\) collapsing its recall and droppingF0\.5F\_\{0\.5\}to23\.6423\.64\. Since native evaluation remains optimal despite this positive transfer, in Section[5\.4](https://arxiv.org/html/2609.10810#S5.SS4)we pair each medium\-capacity optimized prompt with its high\-capacity sibling from the same model family, leaving a deeper study of cross\-family transferability to future work\.

### 5\.4Final Evaluations

CoNLL\-2014 testBEA\-2019 testPromptModel𝐁\\mathbf\{B\}Prec\.Rec\.𝐅0\.5\\mathbf\{F\_\{0\.5\}\}Prec\.Rec\.𝐅0\.5\\mathbf\{F\_\{0\.5\}\}Single\-system SOTAFine\-tuned, EPO\([Liang et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib24)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/mistral.png)Mistral \(7B\)–76\.7152\.5670\.2678\.1668\.0775\.91Fine\-tuned, Training Schedule\([Staruch et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib40)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/gemma.png)Gemma 2 \(27B\)–77\.3847\.8868\.8982\.2867\.0378\.70LLM\-prompted baselines3\-/1\-shot CoT\([Fang et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib11)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-3\.5\-Turbo\-0301–51\.362\.453\.234\.669\.738\.416\-shot\([Loem et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib27)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-3\.5 text\-davinci\-003–––57\.06––57\.412\-shot\([Coyne et al\., 2023](https://arxiv.org/html/2609.10810#bib.bib8)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-4\-0314––––––52\.791\-shot\([Davis et al\., 2024](https://arxiv.org/html/2609.10810#bib.bib10)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-3\.5\-Turbo\-0613–––57\.2–––0\-shot\([Chernodub et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib7)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-4o––––––59\.400\-shot minimal\-edit\([Türker and Eryiğit, 2026](https://arxiv.org/html/2609.10810#bib.bib45)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/claude.png)Claude Sonnet 4\.5–69\.1459\.8267\.0563\.4871\.3364\.914\-shot\([Goto et al\., 2026](https://arxiv.org/html/2609.10810#bib.bib13)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/qwen.png)Qwen3\-8B \(majority voting on 8 runs\)––––73\.853\.768\.7Our resultsVanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/qwen.png)Qwen3\-8B154\.1149\.4953\.1254\.1165\.8556\.11Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)571\.5428\.5254\.9573\.8550\.6467\.65Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)\)571\.7435\.8359\.7672\.1458\.2168\.84Vanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-4\.1\-mini150\.7457\.9152\.0354\.1773\.2157\.14Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)6074\.2445\.3065\.8376\.1464\.8773\.59Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.2](https://arxiv.org/html/2609.10810#A1.SS6.SSS2)\)6074\.3043\.6665\.1576\.7064\.2473\.83Vanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/claude.png)Claude Sonnet 4\.6153\.4757\.8754\.3059\.6172\.0561\.74Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)6073\.1244\.4364\.7576\.1364\.6273\.51Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.3](https://arxiv.org/html/2609.10810#A1.SS6.SSS3)\)6072\.5144\.3764\.3577\.3265\.3674\.59Vanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/gemini.png)Gemini 3 Flash146\.5259\.9248\.7051\.9973\.2255\.19Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)3062\.0356\.8360\.9167\.6573\.3168\.71Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\)3070\.4849\.3164\.9174\.9468\.9873\.67Vanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/openai.png)GPT\-5\.4145\.8260\.5648\.1751\.3773\.6854\.68Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)1569\.2049\.1763\.9974\.8567\.7373\.31Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.2](https://arxiv.org/html/2609.10810#A1.SS6.SSS2)\)1572\.6347\.1065\.5377\.6263\.6574\.36Vanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/claude.png)Claude Opus 4\.6162\.5754\.5060\.7768\.7771\.3369\.27Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)1574\.7645\.0566\.0478\.5863\.9475\.14Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.3](https://arxiv.org/html/2609.10810#A1.SS6.SSS3)\)1574\.9044\.2765\.8080\.7264\.0576\.73Vanilla zero\-shot \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\)![[Uncaptioned image]](https://arxiv.org/html/2609.10810v1/figures/icons/gemini.png)Gemini 3\.1\-Pro145\.9460\.8148\.3053\.3273\.8156\.45Minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)1566\.7250\.1762\.5974\.1368\.2472\.87Minimal\-edits few\-shot \+ taxonomy \+ optimized \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\)1576\.2045\.3667\.0882\.2965\.6678\.32Table 3:Final evaluations on CoNLL\-2014 test and BEA\-2019 test\.Precision, recall, andF0\.5F\_\{0\.5\}on all considered models under three prompt configurations: vanilla zero\-shot at batch sizeB=1B\{=\}1, minimal\-edits few\-shot \+ taxonomy at the per\-model dev\-optimal batch size \(Figure[2](https://arxiv.org/html/2609.10810#S5.F2)\), and its optimized variant at the same per\-model batch size\. Within each group, the best precision, recall, andF0\.5F\_\{0\.5\}per dataset are bolded\.##### Experimental Setup\.

We evaluate three prompt configurations on the held out CoNLL 2014 and BEA 2019 test sets across all considered models\. Configurations include a vanilla zero\-shot prompt \([A\.1](https://arxiv.org/html/2609.10810#A1.SS1)\) atB=1B\{=\}1, a minimal edits few\-shot \+ taxonomy prompt \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), and its model\-specific optimized variants \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)–[A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\), both evaluated at each model’s dev\-optimal batch size \(selected byF0\.5F\_\{0\.5\}on the BEA\-2019 dev split\)\. Table[3](https://arxiv.org/html/2609.10810#S5.T3)contextualizes performance of our models against leading prompted and fine\-tuned baselines\.

##### Results\.

Empirical results show that batched inference coupled with strict taxonomy constraints jointly help to mitigate the overcorrection\. Vanilla configurations universally exhibit high recall but poor precision\. Introducing taxonomy rules and batched generation restricts extraneous edits, substantially shifting performance toward the precision weightedF0\.5F\_\{0\.5\}metric\. Notably, Gemini 3\.1\-Pro improves its BEA\-2019 precision by20\.8120\.81points upon adding these joint constraints \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), yielding a16\.416\.4pointF0\.5F\_\{0\.5\}gain\. The medium capacity tier exhibits similar absoluteF0\.5F\_\{0\.5\}improvements of over1616points for GPT\-4\.1\-mini and roughly1313points for Gemini 3 Flash, confirming that structural framing consistently aids precision recovery\.

LLM assisted prompt optimization provides additional model\-specific advantages\. The prompt optimized for Gemini 3\.1\-Pro \([A\.6\.4](https://arxiv.org/html/2609.10810#A1.SS6.SSS4)\) establishes a new state of the art for prompt\-based GEC, outperforming the strongest prompted baseline\([Goto et al\., 2026](https://arxiv.org/html/2609.10810#bib.bib13)\)by nearly1010F0\.5F\_\{0\.5\}points on BEA\-2019\. Crucially, this framework achieves parity with state\-of\-the\-art fine\-tuned paradigms\. Our optimal high\-capacity configuration matches the precision of the leading fine\-tuned model\([Staruch et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib40)\)on BEA\-2019 \(82\.2982\.29vs\.82\.2882\.28\) and trails by a marginal0\.380\.38F0\.5F\_\{0\.5\}points, effectively tying the current fine\-tuned SOTA\. Furthermore, on BEA\-2019 our optimized medium\-capacity models surpass all existing prompted baselines, demonstrating the efficiency of structured constraints\. The zero\-shot minimal\-edit prompt of[Türker and Eryiğit \(2026\)](https://arxiv.org/html/2609.10810#bib.bib45)on Claude Sonnet 4\.5 closely resembles our baseline \([A\.2](https://arxiv.org/html/2609.10810#A1.SS2)\); on Claude Sonnet 4\.6, adding few\-shot examples, taxonomy, batching, and prompt optimization raisesF0\.5F\_\{0\.5\}to74\.5974\.59on BEA\-2019,9\.689\.68points above their result\.

The open\-weight Qwen3\-8B follows the same pattern at a smaller scale: its optimized prompt \([A\.6\.1](https://arxiv.org/html/2609.10810#A1.SS6.SSS1)\) atB=5B\{=\}5reachesF0\.5=68\.84F\_\{0\.5\}=68\.84on BEA\-2019 test, a12\.7312\.73\-point gain over its vanilla zero\-shot configuration that edges out the strongest Qwen\-based prompted baseline\([Goto et al\., 2026](https://arxiv.org/html/2609.10810#bib.bib13)\)\(68\.768\.7\) without any self\-ensembling: a single run matches the quality that the baseline obtains by majority voting over 8 runs\.

At the same time, we observe a cross domain generalization gap on the CoNLL\-2014 set for two of the three medium\-capacity models: prompt optimization lowersF0\.5F\_\{0\.5\}by0\.680\.68points for GPT\-4\.1\-mini and by0\.400\.40points for Claude Sonnet 4\.6\.

## 6Conclusion

We present a prompt\-based framework for minimal\-edit GEC that bridges the gap between off\-the\-shelf LLM prompting and state\-of\-the\-art fine\-tuned single systems\. Its core technique, batched inference layered on minimal\-edit instructions, acts as a targeted regularizer against overcorrection, systematically reducing the edit rate across diverse LLM families, while simultaneously lowering inference cost and latency\. The taxonomy component, by contrast, proves model\-dependent: it constrains the edit space productively only for the strongest models, a finding that motivates our final component, per\-model prompt optimization\.

We evaluate our approach on six commercial and one open\-weight LLM across two minimal\-edit benchmarks\. The resulting prompts set a new state of the art for prompt\-based minimal\-edit GEC: with Gemini 3\.1\-Pro we reachF0\.5=78\.32F\_\{0\.5\}=78\.32on the BEA\-2019 test set, within0\.380\.38points of the best fine\-tuned single model — to our knowledge, the first purely prompt\-based system to reach parity with the fine\-tuned state of the art in GEC — alongside a competitiveF0\.5=67\.08F\_\{0\.5\}=67\.08on CoNLL\-2014\.

These results show that careful prompt design and context management let general\-purpose LLMs perform minimal\-edit GEC at fine\-tuned quality without the computational overhead of fine\-tuning, albeit at the cost of a conservative editing style that may limit fluency\-oriented rewriting\. This makes high\-quality GEC practical for settings where fine\-tuned models cannot be deployed for resource or regulatory reasons\. Our framework[2](https://arxiv.org/html/2609.10810#footnote2)can also generate high\-quality synthetic training data for fine\-tuning GEC models\.

## Limitations

Our study has several limitations that frame the scope of its conclusions and motivate concrete avenues for future work\.

1. 1\.While the BEA\-2019\([Bryant et al\., 2019](https://arxiv.org/html/2609.10810#bib.bib4)\)test set is held\-out on CodaBench platform101010[https://www\.codabench\.org/competitions/10960/](https://www.codabench.org/competitions/10960/), its public train and dev splits, along with the fully public CoNLL\-2014\([Ng et al\., 2014](https://arxiv.org/html/2609.10810#bib.bib31)\)dataset, may have been encountered by commercial LLMs during pretraining\. Exposure to these specific domains and annotation styles could still inflate performance\. Consequently, our results may establish strong prompt\-based baselines rather than strict measures of generalization to completely unseen text\.
2. 2\.We rely mostly on commercial APIs, making weights, training data, and inference stacks opaque, and leaving us vulnerable to silent provider updates\. Furthermore, due to costs, each configuration is evaluated only once without reporting variance, meaning exact reproducibility is not strictly guaranteed and broader systematic comparisons with open\-weight models, beyond our single open\-weight baseline, are left to future work\.
3. 3\.Our LLM\-assisted Prompt Optimization \(Section[3](https://arxiv.org/html/2609.10810#S3.SS0.SSS0.Px3)\) tunes prompts only on medium\-capacity tier models \(GPT\-4\.1\-mini, Claude Sonnet 4\.6, Gemini 3 Flash\) and the open\-weight Qwen3\-8B due to budget constraints, and does not tune on the high\-capacity siblings \(GPT\-5\.4, Claude Opus 4\.6, Gemini 3\.1\-Pro\)\. This leaves open the question of whether optimization on high\-capacity models would yield similar or superior prompts, and how these might transfer across model families\.
4. 4\.Evaluations are restricted to English learner essays\. It remains unclear how our taxonomy instructions and batching transfer to morphologically richer languages, lower\-resource settings, professional editing, or fluency\-oriented benchmarks like JFLEG\([Napoles et al\., 2017](https://arxiv.org/html/2609.10810#bib.bib30)\)\.
5. 5\.We optimize and evaluate primarily on precision\-weightedF0\.5F\_\{0\.5\}computed by ERRANT and theM2M^\{2\}scorer\. While this aligns with minimal\-edit goals, it does not capture fluency or stylistic improvements beyond the reference\-free Scribendi score used in the batching analysis \(Section[5\.2](https://arxiv.org/html/2609.10810#S5.SS2)\)\. We omit human evaluation and GLEU scores, so our findings represent only a precision\-weighted slice of GEC performance\.
6. 6\.The claim that batching regularizes via self\-attention dilution \(Section[5\.2](https://arxiv.org/html/2609.10810#S5.SS2)\) is an empirical conjecture based on systematic trends across batch sizes\. Confirming this rigorously requires controlled probes on open\-weight models, which we do not perform\.
7. 7\.Some of our LLM\-optimized prompts are significantly longer \(Figure[3](https://arxiv.org/html/2609.10810#footnote3)\), increasing inference token costs and latency\. Additionally, real\-world deployment involves topical streams rather than the shuffled independent sentences used in our analysis, which could alter attention dynamics and introduce unquantified generation failures in the structured response\.

## Ethical Considerations

We disclose that ChatGPT, Claude, Gemini, and Grammarly were used for drafting, editing, and proofreading\. All AI\-generated text was reviewed by the authors, who take full responsibility for the final content\.

## References

- Agrawal et al\. \(2025\)Lakshya A Agrawal, Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl\-Ong, Arnav Singhvi, Herumb Shandilya, Michael J Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alexandros G\. Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, and Omar Khattab\. 2025\.[Gepa: Reflective prompt evolution can outperform reinforcement learning](https://arxiv.org/abs/2507.19457)\.*Preprint*, arXiv:2507\.19457\.
- Alikaniotis and Raheja \(2019\)Dimitris Alikaniotis and Vipul Raheja\. 2019\.[The unreasonable effectiveness of transformer language models in grammatical error correction](https://doi.org/10.18653/v1/W19-4412)\.In*Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications*, pages 127–133, Florence, Italy\. Association for Computational Linguistics\.
- Awasthi et al\. \(2019\)Abhijeet Awasthi, Sunita Sarawagi, Rasna Goyal, Sabyasachi Ghosh, and Vihari Piratla\. 2019\.[Parallel iterative edit models for local sequence transduction](https://doi.org/10.18653/v1/D19-1435)\.In*Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing \(EMNLP\-IJCNLP\)*, pages 4260–4270, Hong Kong, China\. Association for Computational Linguistics\.
- Bryant et al\. \(2019\)Christopher Bryant, Mariano Felice, Øistein E\. Andersen, and Ted Briscoe\. 2019\.[The BEA\-2019 shared task on grammatical error correction](https://doi.org/10.18653/v1/W19-4406)\.In*Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications*, pages 52–75, Florence, Italy\. Association for Computational Linguistics\.
- Bryant et al\. \(2017\)Christopher Bryant, Mariano Felice, and Ted Briscoe\. 2017\.[Automatic annotation and evaluation of error types for grammatical error correction](https://doi.org/10.18653/v1/P17-1074)\.In*Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\)*, pages 793–805, Vancouver, Canada\. Association for Computational Linguistics\.
- Cheng et al\. \(2023\)Zhoujun Cheng, Jungo Kasai, and Tao Yu\. 2023\.[Batch prompting: Efficient inference with large language model APIs](https://doi.org/10.18653/v1/2023.emnlp-industry.74)\.In*Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: Industry Track*, pages 792–810, Singapore\. Association for Computational Linguistics\.
- Chernodub et al\. \(2025\)Artem Chernodub, Aman Saini, Yejin Huh, Vivek Kulkarni, and Vipul Raheja\. 2025\.[APIO: Automatic prompt induction and optimization for grammatical error correction and text simplification](https://aclanthology.org/2025.ranlp-1.28/)\.In*Proceedings of the 15th International Conference on Recent Advances in Natural Language Processing \- Natural Language Processing in the Generative AI Era*, pages 234–239, Varna, Bulgaria\. INCOMA Ltd\., Shoumen, Bulgaria\.
- Coyne et al\. \(2023\)Steven Coyne, Keisuke Sakaguchi, Diana Galvan\-Sosa, Michael Zock, and Kentaro Inui\. 2023\.[Analyzing the performance of GPT\-3\.5 and GPT\-4 in grammatical error correction](https://arxiv.org/abs/2303.14342)\.*arXiv preprint arXiv:2303\.14342*\.
- Dahlmeier and Ng \(2012\)Daniel Dahlmeier and Hwee Tou Ng\. 2012\.[Better evaluation for grammatical error correction](https://aclanthology.org/N12-1067/)\.In*Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*, pages 568–572, Montréal, Canada\. Association for Computational Linguistics\.
- Davis et al\. \(2024\)Christopher Davis, Andrew Caines, Øistein E\. Andersen, Shiva Taslimipoor, Helen Yannakoudakis, Zheng Yuan, Christopher Bryant, Marek Rei, and Paula Buttery\. 2024\.[Prompting open\-source and commercial language models for grammatical error correction of English learner text](https://doi.org/10.18653/v1/2024.findings-acl.711)\.In*Findings of the Association for Computational Linguistics: ACL 2024*, pages 11952–11967, Bangkok, Thailand\. Association for Computational Linguistics\.
- Fang et al\. \(2023\)Tao Fang, Shu Yang, Kaixin Lan, Derek F Wong, Jinpeng Hu, Lidia S Chao, and Yue Zhang\. 2023\.[Is ChatGPT a highly fluent grammatical error correction system? A comprehensive evaluation](https://arxiv.org/abs/2304.01746)\.In*arXiv preprint arXiv:2304\.01746*\.
- Goto et al\. \(2025\)Takumi Goto, Yusuke Sakai, and Taro Watanabe\. 2025\.[gec\-metrics: A unified library for grammatical error correction evaluation](https://doi.org/10.18653/v1/2025.acl-demo.50)\.In*Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 3: System Demonstrations\)*, pages 524–534, Vienna, Austria\. Association for Computational Linguistics\.
- Goto et al\. \(2026\)Takumi Goto, Yusuke Sakai, and Taro Watanabe\. 2026\.[Edit\-level majority voting mitigates over\-correction in LLM\-based grammatical error correction](https://doi.org/10.18653/v1/2026.bea-1.60)\.In*Proceedings of the 21st Workshop on Innovative Use of NLP for Building Educational Applications \(BEA 2026\)*, pages 899–913, San Diego, California, USA\. Association for Computational Linguistics\.
- Grundkiewicz et al\. \(2019\)Roman Grundkiewicz, Marcin Junczys\-Dowmunt, and Kenneth Heafield\. 2019\.[Neural grammatical error correction systems with unsupervised pre\-training on synthetic data](https://doi.org/10.18653/v1/W19-4427)\.In*Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications*, pages 252–263, Florence, Italy\. Association for Computational Linguistics\.
- He et al\. \(2025\)Han He, Qianchu Liu, Lei Xu, Chaitanya Shivade, Yi Zhang, Sundararajan Srinivasan, and Katrin Kirchhoff\. 2025\.[Crispo: Multi\-aspect critique\-suggestion\-guided automatic prompt optimization for text generation](https://arxiv.org/abs/2410.02748)\.*arXiv preprint arXiv:2410\.02748*\.
- Islam and Magnani \(2021\)Md Asadul Islam and Enrico Magnani\. 2021\.[Is this the end of the gold standard? a straightforward reference\-less grammatical error correction metric](https://doi.org/10.18653/v1/2021.emnlp-main.239)\.In*Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing*, pages 3009–3015, Online and Punta Cana, Dominican Republic\. Association for Computational Linguistics\.
- Junczys\-Dowmunt et al\. \(2018\)Marcin Junczys\-Dowmunt, Roman Grundkiewicz, Shubha Guha, and Kenneth Heafield\. 2018\.[Approaching neural grammatical error correction as a low\-resource machine translation task](https://doi.org/10.18653/v1/N18-1055)\.In*Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 \(Long Papers\)*, pages 595–606, New Orleans, Louisiana\. Association for Computational Linguistics\.
- Karpo and Chernodub \(2026\)Kateryna Karpo and Artem Chernodub\. 2026\.[How far can prompting go for minimal\-edit Ukrainian grammatical error correction?](https://aclanthology.org/2026.unlp-1.13/)In*Proceedings of the Fifth Ukrainian Natural Language Processing Conference \(UNLP 2026\)*, pages 136–154, Lviv, Ukraine\. Association for Computational Linguistics\.
- Katinskaia and Yangarber \(2024\)Anisia Katinskaia and Roman Yangarber\. 2024\.[GPT\-3\.5 for grammatical error correction](https://aclanthology.org/2024.lrec-main.692/)\.In*Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation \(LREC\-COLING 2024\)*, pages 7831–7843, Torino, Italia\. ELRA and ICCL\.
- Kiyono et al\. \(2019\)Shun Kiyono, Jun Suzuki, Masato Mita, Tomoya Mizumoto, and Kentaro Inui\. 2019\.[An empirical study of incorporating pseudo data into grammatical error correction](https://doi.org/10.18653/v1/D19-1119)\.In*Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing \(EMNLP\-IJCNLP\)*, pages 1236–1242, Hong Kong, China\. Association for Computational Linguistics\.
- Leacock et al\. \(2014\)Claudia Leacock, Martin Chodorow, Michael Gamon, and Joel Tetreault\. 2014\.[*Automated Grammatical Error Detection for Language Learners, Second Edition*](https://doi.org/10.1007/978-3-031-02153-4)\.Synthesis Lectures on Human Language Technologies\. Springer Cham\.
- Li et al\. \(2025\)Wei Li, Wen Luo, Guangyue Peng, and Houfeng Wang\. 2025\.[Explanation based in\-context demonstrations retrieval for multilingual grammatical error correction](https://doi.org/10.18653/v1/2025.naacl-long.251)\.In*Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\)*, pages 4881–4897, Albuquerque, New Mexico\. Association for Computational Linguistics\.
- Li and Wang \(2024\)Wei Li and Houfeng Wang\. 2024\.[Detection\-correction structure via general language model for grammatical error correction](https://doi.org/10.18653/v1/2024.acl-long.96)\.In*Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\)*, pages 1748–1763, Bangkok, Thailand\. Association for Computational Linguistics\.
- Liang et al\. \(2025\)Jiehao Liang, Haihui Yang, Shiping Gao, and Xiaojun Quan\. 2025\.[Edit\-wise preference optimization for grammatical error correction](https://aclanthology.org/2025.coling-main.229/)\.In*Proceedings of the 31st International Conference on Computational Linguistics*, pages 3401–3414, Abu Dhabi, UAE\. Association for Computational Linguistics\.
- Liu et al\. \(2023\)Bingbin Liu, Jordan T\. Ash, Surbhi Goel, Akshay Krishnamurthy, and Cyril Zhang\. 2023\.[Exposing attention glitches with flip\-flop language modeling](https://arxiv.org/abs/2306.00946)\.In*Advances in Neural Information Processing Systems 36 \(NeurIPS 2023\)*\.
- Liu et al\. \(2024\)Nelson F\. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang\. 2024\.[Lost in the middle: How language models use long contexts](https://doi.org/10.1162/tacl_a_00638)\.*Transactions of the Association for Computational Linguistics*, 12:157–173\.
- Loem et al\. \(2023\)Mengsay Loem, Masahiro Kaneko, Sho Takase, and Naoaki Okazaki\. 2023\.[Exploring effectiveness of GPT\-3 in grammatical error correction: A study on performance and controllability in prompt\-based methods](https://doi.org/10.18653/v1/2023.bea-1.18)\.In*Proceedings of the 18th Workshop on Innovative Use of NLP for Building Educational Applications \(BEA 2023\)*, pages 205–219, Toronto, Canada\. Association for Computational Linguistics\.
- Masciolini et al\. \(2025\)Arianna Masciolini, Andrew Caines, Orphée De Clercq, Joni Kruijsbergen, Murathan Kurfalı, Ricardo Muñoz Sánchez, Elena Volodina, and Robert Östling\. 2025\.[The MultiGEC\-2025 shared task on multilingual grammatical error correction at NLP4CALL](https://aclanthology.org/2025.nlp4call-1.1/)\.In*Proceedings of the 14th Workshop on Natural Language Processing for Computer Assisted Language Learning*, pages 1–33, Tallinn, Estonia\. University of Tartu Library\.
- Nadejde and Tetreault \(2019\)Maria Nadejde and Joel Tetreault\. 2019\.[Personalizing grammatical error correction: Adaptation to proficiency level and L1](https://doi.org/10.18653/v1/D19-5504)\.In*Proceedings of the 5th Workshop on Noisy User\-generated Text \(W\-NUT 2019\)*, pages 27–33, Hong Kong, China\. Association for Computational Linguistics\.
- Napoles et al\. \(2017\)Courtney Napoles, Keisuke Sakaguchi, and Joel Tetreault\. 2017\.[JFLEG: A fluency corpus and benchmark for grammatical error correction](https://aclanthology.org/E17-2037/)\.In*Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers*, pages 229–234, Valencia, Spain\. Association for Computational Linguistics\.
- Ng et al\. \(2014\)Hwee Tou Ng, Siew Mei Wu, Ted Briscoe, Christian Hadiwinoto, Raymond Hendy Susanto, and Christopher Bryant\. 2014\.[The CoNLL\-2014 shared task on grammatical error correction](https://doi.org/10.3115/v1/W14-1701)\.In*Proceedings of the Eighteenth Conference on Computational Natural Language Learning: Shared Task*, pages 1–14, Baltimore, Maryland\. Association for Computational Linguistics\.
- Nicholls \(2003\)Diane Nicholls\. 2003\.The Cambridge Learner Corpus: Error coding and analysis for lexicography and ELT\.In*Proceedings of the Corpus Linguistics Conference*, pages 572–581\.
- Omelianchuk et al\. \(2020\)Kostiantyn Omelianchuk, Vitaliy Atrasevych, Artem Chernodub, and Oleksandr Skurzhanskyi\. 2020\.[GECToR – grammatical error correction: Tag, not rewrite](https://doi.org/10.18653/v1/2020.bea-1.16)\.In*Proceedings of the Fifteenth Workshop on Innovative Use of NLP for Building Educational Applications*, pages 163–170, Seattle, WA, USA → Online\. Association for Computational Linguistics\.
- Omelianchuk et al\. \(2024\)Kostiantyn Omelianchuk, Andrii Liubonko, Oleksandr Skurzhanskyi, Artem Chernodub, Oleksandr Korniienko, and Igor Samokhin\. 2024\.[Pillars of grammatical error correction: Comprehensive inspection of contemporary approaches in the era of large language models](https://aclanthology.org/2024.bea-1.3/)\.In*Proceedings of the 19th Workshop on Innovative Use of NLP for Building Educational Applications \(BEA 2024\)*, pages 17–33, Mexico City, Mexico\. Association for Computational Linguistics\.
- Ouyang et al\. \(2022\)Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al\. 2022\.[Training language models to follow instructions with human feedback](https://proceedings.neurips.cc/paper_files/paper/2022/file/b1efde53be364a73914f58805a001731-Paper-Conference.pdf)\.In*Advances in Neural Information Processing Systems*, volume 35, pages 27730–27744\.
- Pryzant et al\. \(2023\)Reid Pryzant, Dan Iter, Jerry Li, Yin Lee, Chenguang Zhu, and Michael Zeng\. 2023\.[Automatic prompt optimization with “gradient descent” and beam search](https://doi.org/10.18653/v1/2023.emnlp-main.494)\.In*Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing*, pages 7957–7968, Singapore\. Association for Computational Linguistics\.
- Qin et al\. \(2022\)Zhen Qin, Xiaodong Han, Weixuan Sun, Dongxu Li, Lingpeng Kong, Nick Barnes, and Yiran Zhong\. 2022\.[The devil in linear transformer](https://doi.org/10.18653/v1/2022.emnlp-main.473)\.In*Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing*, pages 7025–7041, Abu Dhabi, United Arab Emirates\. Association for Computational Linguistics\.
- Ramnath et al\. \(2025\)Kiran Ramnath, Kang Zhou, Sheng Guan, Soumya Smruti Mishra, Xuan Qi, Zhengyuan Shen, Shuai Wang, Sangmin Woo, Sullam Jeoung, Yawei Wang, Haozhu Wang, Han Ding, Yuzhe Lu, Zhichao Xu, Yun Zhou, Balasubramaniam Srinivasan, Qiaojing Yan, Yueyan Chen, Haibo Ding, and 2 others\. 2025\.[A systematic survey of automatic prompt optimization techniques](https://doi.org/10.18653/v1/2025.emnlp-main.1681)\.In*Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*, pages 33078–33110, Suzhou, China\. Association for Computational Linguistics\.
- Rothe et al\. \(2021\)Sascha Rothe, Jonathan Mallinson, Eric Malmi, Sebastian Krause, and Aliaksei Severyn\. 2021\.[A simple recipe for multilingual grammatical error correction](https://doi.org/10.18653/v1/2021.acl-short.89)\.In*Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing \(Volume 2: Short Papers\)*, pages 702–707, Online\. Association for Computational Linguistics\.
- Staruch et al\. \(2025\)Ryszard Staruch, Filip Gralinski, and Daniel Dzienisiewicz\. 2025\.[Adapting LLMs for minimal\-edit grammatical error correction](https://doi.org/10.18653/v1/2025.bea-1.9)\.In*Proceedings of the 20th Workshop on Innovative Use of NLP for Building Educational Applications \(BEA 2025\)*, pages 118–128, Vienna, Austria\. Association for Computational Linguistics\.
- Syvokon et al\. \(2023\)Oleksiy Syvokon, Olena Nahorna, Pavlo Kuchmiichuk, and Nastasiia Osidach\. 2023\.[UA\-GEC: Grammatical error correction and fluency corpus for the Ukrainian language](https://doi.org/10.18653/v1/2023.unlp-1.12)\.In*Proceedings of the Second Ukrainian Natural Language Processing Workshop \(UNLP\)*, pages 96–102, Dubrovnik, Croatia\. Association for Computational Linguistics\.
- Syvokon and Romanyshyn \(2023\)Oleksiy Syvokon and Mariana Romanyshyn\. 2023\.[The UNLP 2023 shared task on grammatical error correction for Ukrainian](https://doi.org/10.18653/v1/2023.unlp-1.16)\.In*Proceedings of the Second Ukrainian Natural Language Processing Workshop \(UNLP\)*, pages 132–137, Dubrovnik, Croatia\. Association for Computational Linguistics\.
- Tang et al\. \(2024\)Chenming Tang, Fanyi Qu, and Yunfang Wu\. 2024\.[Ungrammatical\-syntax\-based in\-context example selection for grammatical error correction](https://doi.org/10.18653/v1/2024.naacl-long.99)\.In*Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies \(Volume 1: Long Papers\)*, pages 1758–1770, Mexico City, Mexico\. Association for Computational Linguistics\.
- Tarnavskyi et al\. \(2022\)Maksym Tarnavskyi, Artem Chernodub, and Kostiantyn Omelianchuk\. 2022\.[Ensembling and knowledge distilling of large sequence taggers for grammatical error correction](https://doi.org/10.18653/v1/2022.acl-long.266)\.In*Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\)*, pages 3842–3852, Dublin, Ireland\. Association for Computational Linguistics\.
- Türker and Eryiğit \(2026\)Tolgahan Türker and Gülşen Eryiğit\. 2026\.[Instruction\-following LLMs for grammatical error correction: Analyzing neutral\-anchored instructional sensitivity across editing modes](https://doi.org/10.18653/v1/2026.bea-1.17)\.In*Proceedings of the 21st Workshop on Innovative Use of NLP for Building Educational Applications \(BEA 2026\)*, pages 234–247, San Diego, California, USA\. Association for Computational Linguistics\.
- Vadlamannati and Şahin \(2023\)Subhadra Vadlamannati and Gözde Şahin\. 2023\.[Metric\-based in\-context learning: A case study in text simplification](https://doi.org/10.18653/v1/2023.inlg-main.18)\.In*Proceedings of the 16th International Natural Language Generation Conference*, pages 253–268, Prague, Czechia\. Association for Computational Linguistics\.
- Vajjala et al\. \(2026\)Sowmya Vajjala, Bashar Alhafni, Stefano Banno, Kaushal Kumar Maurya, and Ekaterina Kochmar\. 2026\.[Opportunities and challenges of LLMs in education: An NLP perspective](https://doi.org/10.18653/v1/2026.bea-1.26)\.In*Proceedings of the 21st Workshop on Innovative Use of NLP for Building Educational Applications \(BEA 2026\)*, pages 368–404, San Diego, California, USA\. Association for Computational Linguistics\.
- Wang et al\. \(2024\)Xinyuan Wang, Chenxi Li, Zhen Wang, Fan Bai, Haotian Luo, Jiayou Zhang, Nebojsa Jojic, Eric P\. Xing, and Zhiting Hu\. 2024\.[Promptagent: Strategic planning with language models enables expert\-level prompt optimization](https://openreview.net/forum?id=22pyNMuIoa)\.In*The Twelfth International Conference on Learning Representations*\.
- Yang et al\. \(2025\)An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Junyang Lin, Jingren Zhou, et al\. 2025\.[Qwen3 technical report](https://arxiv.org/abs/2505.09388)\.*Preprint*, arXiv:2505\.09388\.
- Yuksekgonul et al\. \(2024\)Mert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu, Zhi Huang, Carlos Guestrin, and James Zou\. 2024\.[Textgrad: Automatic “differentiation” via text](http://arxiv.org/abs/2406.07496)\.*arXiv preprint arXiv:2406\.07496*\.
- Zeng et al\. \(2024\)Min Zeng, Jiexin Kuang, Mengyang Qiu, Jayoung Song, and Jungyeul Park\. 2024\.[Evaluating prompting strategies for grammatical error correction based on language proficiency](https://aclanthology.org/2024.lrec-main.569/)\.In*Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation \(LREC\-COLING 2024\)*, pages 6426–6430, Torino, Italia\. ELRA and ICCL\.

## Appendix APrompts

Below we list all prompts used in our experiments\. The placeholder<input\_text\>is replaced with the input sentence \(or the batched block of sentences\) at inference time\. All prompts target English minimal\-edit GEC\.

### A\.1Vanilla zero\-shot prompt

Reply with a corrected version of the input sentence with all grammatical and spelling errors fixed\. If there are no errors, reply with a copy of the original sentence\.

### A\.2Minimal\-edits zero\-shot prompt

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- Do NOT make stylistic changes \- If no errors exist, return the original sentence unchanged

### A\.3Minimal\-edits few\-shot prompt

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- Do NOT make stylistic changes \- If no errors exist, return the original sentence unchanged Few\-shot examples from BEA train: Follow the same input\-to\-correction style\. Do not copy these examples; use them only as guidance\. Example 1: Input: Alison put on her coat, close the door and went to his parents house by car\. Correction: Alison put on her coat, closed the door and went to her parents ’ house by car\. Example 2: Input: we can see the number of the projected sales of jeans of Jack&Jones Co\. will be at 450 thousands of pairs in next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\. about 300 thousands of pairs\.Then the number of Jack&Jones Co\. will drop to 250 thousands of pairs in Feb next year\. Correction: we can see the number of projected sales of jeans of Jack&Jones Co\. will be at 450 thousand pairs next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\.; about 300 thousand pairs\. Then the number of Jack&Jones Co\. will drop to 250 thousand pairs in Feb next year\. Example 3: Input: The girl is 18 years old and men \(as it later turns out\) are vampires and they have over 100 years\. Correction: The girl is 18 years old and the men \(as it later turns out\) are vampires and they are over 100 years old\. Example 4: Input: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Correction: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Example 5: Input: The need of export and import items has increased in the last 10 years consequently the life of the people has raised in faster respond\. Correction: The need for exporting and importing items has increased in the last 10 years\. Consequently, the life of the people has been raised in rapid response\. Example 6: Input: In conclusion, it’s very important to learn the concept than saying something stupid\.\.\.\. Correction: In conclusion, it’s more important to learn the concept than say saying something stupid\.\.\.\. Example 7: Input: Abortion is an immoral act that people make as everyone has a chance to survive and nobody has the right to decide for anyone life\. Correction: Abortion is an immoral act that people perform as everyone has the chance to survive and nobody has the right to decide about anyone’s life\. Example 8: Input: Hi John: Correction: Hi John:

### A\.4Minimal\-edits zero\-shot \+ taxonomy prompt

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. Focus on these 25 error types: WORD\-LEVEL ERRORS: 1\. ADJ: Wrong adjective choice \(big→\\towide\) 2\. ADJ:FORM: Adjective form errors \- comparatives/superlatives \(goodest→\\tobest, more easy→\\toeasier\) 3\. ADV: Wrong adverb choice \(speedily→\\toquickly\) 4\. CONJ: Wrong conjunction \(and→\\tobut\) 5\. CONTR: Contraction errors \(n’t→\\tonot\) 6\. DET: Wrong/missing/extra determiner \(the→\\toa,∅→\\emptyset\\tothe, the→∅\\to\\emptyset\) 7\. NOUN: Wrong noun choice \(person→\\topeople\) 8\. NOUN:INFL: Count\-mass noun errors \(informations→\\toinformation\) 9\. NOUN:NUM: Noun number agreement \(cat→\\tocats\) 10\. NOUN:POSS: Noun possessive errors \(friends→\\tofriend’s\) 11\. PART: Wrong particle \(look in→\\tolook at\) 12\. PREP: Wrong/missing/extra preposition \(of→\\toat,∅→\\emptyset\\toat, at→∅\\to\\emptyset\) 13\. PRON: Wrong pronoun \(ours→\\toourselves\) 14\. VERB: Wrong verb choice \(ambulate→\\towalk\) 15\. VERB:FORM: Verb form errors \- infinitive/gerund/participle \(to eat→\\toeating, dancing→\\todanced\) 16\. VERB:INFL: Verb inflection errors \(getted→\\togot, fliped→\\toflipped\) 17\. VERB:SVA: Subject\-verb agreement \(\(He\) have→\\to\(He\) has\) 18\. VERB:TENSE: Verb tense errors including modals and passive \(eats→\\toate, eats→\\tocan eat, eats→\\towas eaten\) MECHANICAL ERRORS: 19\. ORTH: Orthography \- capitalization/whitespace \(Bestfriend→\\tobest friend, THIS→\\tothis\) 20\. PUNCT: Punctuation errors \(\!→\\to\., missing commas, extra periods\) 21\. SPELL: Spelling errors \(genectic→\\togenetic, color→\\tocolour\) 22\. WO: Word order errors \(only can→\\tocan only\) OTHER: 23\. MORPH: Morphology \- same lemma, different part of speech \(quick\[adj\]→\\toquickly\[adv\]\) 24\. OTHER: Complex errors requiring minimal paraphrasing 25\. UNK: Leave unchanged if error is unclear RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- Do NOT make stylistic changes \- If no errors exist, return the original sentence unchanged

### A\.5Minimal\-edits few\-shot \+ taxonomy prompt

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. Focus on these 25 error types: WORD\-LEVEL ERRORS: 1\. ADJ: Wrong adjective choice \(big→\\towide\) 2\. ADJ:FORM: Adjective form errors \- comparatives/superlatives \(goodest→\\tobest, more easy→\\toeasier\) 3\. ADV: Wrong adverb choice \(speedily→\\toquickly\) 4\. CONJ: Wrong conjunction \(and→\\tobut\) 5\. CONTR: Contraction errors \(n’t→\\tonot\) 6\. DET: Wrong/missing/extra determiner \(the→\\toa,∅→\\emptyset\\tothe, the→∅\\to\\emptyset\) 7\. NOUN: Wrong noun choice \(person→\\topeople\) 8\. NOUN:INFL: Count\-mass noun errors \(informations→\\toinformation\) 9\. NOUN:NUM: Noun number agreement \(cat→\\tocats\) 10\. NOUN:POSS: Noun possessive errors \(friends→\\tofriend’s\) 11\. PART: Wrong particle \(look in→\\tolook at\) 12\. PREP: Wrong/missing/extra preposition \(of→\\toat,∅→\\emptyset\\toat, at→∅\\to\\emptyset\) 13\. PRON: Wrong pronoun \(ours→\\toourselves\) 14\. VERB: Wrong verb choice \(ambulate→\\towalk\) 15\. VERB:FORM: Verb form errors \- infinitive/gerund/participle \(to eat→\\toeating, dancing→\\todanced\) 16\. VERB:INFL: Verb inflection errors \(getted→\\togot, fliped→\\toflipped\) 17\. VERB:SVA: Subject\-verb agreement \(\(He\) have→\\to\(He\) has\) 18\. VERB:TENSE: Verb tense errors including modals and passive \(eats→\\toate, eats→\\tocan eat, eats→\\towas eaten\) MECHANICAL ERRORS: 19\. ORTH: Orthography \- capitalization/whitespace \(Bestfriend→\\tobest friend, THIS→\\tothis\) 20\. PUNCT: Punctuation errors \(\!→\\to\., missing commas, extra periods\) 21\. SPELL: Spelling errors \(genectic→\\togenetic, color→\\tocolour\) 22\. WO: Word order errors \(only can→\\tocan only\) OTHER: 23\. MORPH: Morphology \- same lemma, different part of speech \(quick\[adj\]→\\toquickly\[adv\]\) 24\. OTHER: Complex errors requiring minimal paraphrasing 25\. UNK: Leave unchanged if error is unclear RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- Do NOT make stylistic changes \- If no errors exist, return the original sentence unchanged Few\-shot examples from BEA train: Follow the same input\-to\-correction style\. Do not copy these examples; use them only as guidance\. Example 1: Input: Alison put on her coat, close the door and went to his parents house by car\. Correction: Alison put on her coat, closed the door and went to her parents ’ house by car\. Example 2: Input: we can see the number of the projected sales of jeans of Jack&Jones Co\. will be at 450 thousands of pairs in next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\. about 300 thousands of pairs\.Then the number of Jack&Jones Co\. will drop to 250 thousands of pairs in Feb next year\. Correction: we can see the number of projected sales of jeans of Jack&Jones Co\. will be at 450 thousand pairs next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\.; about 300 thousand pairs\. Then the number of Jack&Jones Co\. will drop to 250 thousand pairs in Feb next year\. Example 3: Input: The girl is 18 years old and men \(as it later turns out\) are vampires and they have over 100 years\. Correction: The girl is 18 years old and the men \(as it later turns out\) are vampires and they are over 100 years old\. Example 4: Input: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Correction: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Example 5: Input: The need of export and import items has increased in the last 10 years consequently the life of the people has raised in faster respond\. Correction: The need for exporting and importing items has increased in the last 10 years\. Consequently, the life of the people has been raised in rapid response\. Example 6: Input: In conclusion, it’s very important to learn the concept than saying something stupid\.\.\.\. Correction: In conclusion, it’s more important to learn the concept than say saying something stupid\.\.\.\. Example 7: Input: Abortion is an immoral act that people make as everyone has a chance to survive and nobody has the right to decide for anyone life\. Correction: Abortion is an immoral act that people perform as everyone has the chance to survive and nobody has the right to decide about anyone’s life\. Example 8: Input: Hi John: Correction: Hi John:

### A\.6Minimal\-edits few\-shot \+ taxonomy \+ optimized

#### A\.6\.1Minimal\-edits few\-shot \+ taxonomy \+ optimized for Qwen3\-8B

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. Focus on these 25 error types: WORD\-LEVEL ERRORS: 1\. ADJ: Wrong adjective choice \(big→\\towide\) 2\. ADJ:FORM: Adjective form errors \- comparatives/superlatives \(goodest→\\tobest, more easy→\\toeasier\) 3\. ADV: Wrong adverb choice \(speedily→\\toquickly\) 4\. CONJ: Wrong conjunction \(and→\\tobut\) 5\. CONTR: Contraction errors \(n’t→\\tonot\) 6\. DET: Wrong/missing/extra determiner \(the→\\toa,∅→\\emptyset\\tothe, the→∅\\to\\emptyset\) 7\. NOUN: Wrong noun choice \(person→\\topeople\) 8\. NOUN:INFL: Count\-mass noun errors \(informations→\\toinformation\) 9\. NOUN:NUM: Noun number agreement \(cat→\\tocats\) 10\. NOUN:POSS: Noun possessive errors \(friends→\\tofriend’s\) 11\. PART: Wrong particle \(look in→\\tolook at\) 12\. PREP: Wrong/missing/extra preposition \(of→\\toat,∅→\\emptyset\\toat, at→∅\\to\\emptyset\) 13\. PRON: Wrong pronoun \(ours→\\toourselves\) 14\. VERB: Wrong verb choice \(ambulate→\\towalk\) 15\. VERB:FORM: Verb form errors \- infinitive/gerund/participle \(to eat→\\toeating, dancing→\\todanced\) 16\. VERB:INFL: Verb inflection errors \(getted→\\togot, fliped→\\toflipped\) 17\. VERB:SVA: Subject\-verb agreement \(\(He\) have→\\to\(He\) has\) 18\. VERB:TENSE: Verb tense errors including modals and passive \(eats→\\toate, eats→\\tocan eat, eats→\\towas eaten\) MECHANICAL ERRORS: 19\. ORTH: Orthography \- capitalization/whitespace \(Bestfriend→\\tobest friend, THIS→\\tothis\) 20\. PUNCT: Punctuation errors \(\!→\\to\., missing commas, extra periods\) 21\. SPELL: Spelling errors \(genectic→\\togenetic, color→\\tocolour\) 22\. WO: Word order errors \(only can→\\tocan only\) OTHER: 23\. MORPH: Morphology \- same lemma, different part of speech \(quick\[adj\]→\\toquickly\[adv\]\) 24\. OTHER: Complex errors requiring minimal paraphrasing 25\. UNK: Leave unchanged if error is unclear RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- If no errors exist, return the original sentence unchanged \- Output plain text only: NEVER use Markdown or any markup in the output \- no \*\*bold\*\*, no \*italics\*, no backticks\. Return the corrected sentence exactly as plain text \- PUNCT: when a sentence starts with an introductory word, phrase or clause, insert the missing comma after it \(However\-\>However, \| Also\-\>Also, \| Nowadays\-\>Nowadays, \| Finally, So, Luckily, Unfortunately, Today, Instead, Actually, For example, In my opinion, One day, The next day, Before that, As a rule, To summarise, Once upon a time, and time/place openers like ’About 40 years ago’ or ’In a car’\) Correct each numbered text independently\. Return only the corrected texts in the same numbered format, one per line\. \#\#\# Example \#\#\# Texts to correct: Sentence 1: Alison put on her coat, close the door and went to his parents house by car\. Sentence 2: we can see the number of the projected sales of jeans of Jack&Jones Co\. will be at 450 thousands of pairs in next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\. about 300 thousands of pairs\.Then the number of Jack&Jones Co\. will drop to 250 thousands of pairs in Feb next year\. Sentence 3: The girl is 18 years old and men \(as it later turns out\) are vampires and they have over 100 years\. Sentence 4: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Sentence 5: The need of export and import items has increased in the last 10 years consequently the life of the people has raised in faster respond\. Sentence 6: In conclusion, it’s very important to learn the concept than saying something stupid\.\.\.\. Sentence 7: Abortion is an immoral act that people make as everyone has a chance to survive and nobody has the right to decide for anyone life\. Sentence 8: Hi John: \#\#\# Corrected texts: Sentence 1: Alison put on her coat, closed the door and went to her parents ’ house by car\. Sentence 2: we can see the number of projected sales of jeans of Jack&Jones Co\. will be at 450 thousand pairs next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\.; about 300 thousand pairs\. Then the number of Jack&Jones Co\. will drop to 250 thousand pairs in Feb next year\. Sentence 3: The girl is 18 years old and the men \(as it later turns out\) are vampires and they are over 100 years old\. Sentence 4: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Sentence 5: The need for exporting and importing items has increased in the last 10 years\. Consequently, the life of the people has been raised in rapid response\. Sentence 6: In conclusion, it’s more important to learn the concept than say saying something stupid\.\.\.\. Sentence 7: Abortion is an immoral act that people perform as everyone has the chance to survive and nobody has the right to decide about anyone’s life\. Sentence 8: Hi John: \#\#\# Texts to correct: \{\} \#\#\# Corrected texts:

#### A\.6\.2Minimal\-edits few\-shot \+ taxonomy \+ optimized for GPT\-4\.1\-mini

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- Do NOT make stylistic changes \- Comma\-splice fix: when a comma joins TWO COMPLETE INDEPENDENT CLAUSES \(each with its own subject \+ finite verb\), replace the comma with a period and capitalize the next word\. ONLY apply when the second clause clearly starts with a subject pronoun \(I, We, They, He, She, It\) followed by its own verb\. ‘I was tired , I went home’→\\to‘I was tired \. I went home’ ‘We waited , they arrived late’→\\to‘We waited \. They arrived late’ ‘I followed them , I learned a lot’→\\to‘I followed them \. I learned a lot’ Do NOT apply when the second part is a dependent clause, fragment, or list continuation\. When in doubt, leave the comma alone\. \- Past\-narrative tense consistency: when a clause is clearly set in the past \(signaled by an earlier finite past\-tense verb in the same sentence \-\-\- was, were, did, said, went, came, told, started, entered, etc\., OR a past\-time adverbial \-\-\- ‘yesterday’, ‘last <time\>’, ‘<N\> years ago’, ‘when I was <X\>’\), AND a later verb in the same sentence is in present tense referring to the SAME past event, change that verb to its simple\-past form\. ‘After many years he still dream to become a hero’→\\to‘\.\.\. still dreamt \.\.\.’ ‘He entered the university because he thinks it is good’→\\to‘\.\.\. thought it was good’ ‘When I was a child , I play with toys’→\\to‘\.\.\. I played with toys’ Do NOT apply when the present\-tense verb expresses a general truth interjected in the past narrative \(‘I learned that water boils at 100 degrees’\)\. When in doubt, leave the verb alone\. \- If no errors exist, return the original sentence unchanged Few\-shot examples from BEA train: Follow the same input\-to\-correction style\. Do not copy these examples; use them only as guidance\. Example 1: Input: Yours sincerely Correction: Yours sincerely Example 2: Input: I’d love to hear from you and maybe we can make some plans to meet up\. Correction: I’d love to hear from you and maybe we can make some plans to meet up\. Example 3: Input: Although the maintenance cost of car is quite expensive, it does not stop people from using cars since convenience matters to them the most and not money\. Correction: Although the maintenance cost of car is quite expensive, it does not stop people from using cars, since convenience matters to them the most and not money\. Example 4: Input: I studied in Kuwait schools, after that I joined Damascus university, the faculty of human medicine, I graduated from it in 2008 with very good grade, then I got the Master’s degree in laboratory medicine from the same university \(Ministry of Higher Education\) in 2013 with Excellent grade\. Correction: I studied in Kuwaiti schools\. After that I went to Damascus university, the faculty of human medicine\. I graduated from it in 2008 with a very good grade, then I got the Master’s degree in laboratory medicine from the same university \(Ministry of Higher Education\) in 2013 with an Excellent grade\. Example 5: Input: The female respondents are more fond of reading books that the male ones\. Correction: The female respondents are more fond of reading books than the male ones\. Example 6: Input: I was gardening since the beginning of the morning, when the postman arrived\. Correction: I had been gardening since the beginning of the morning, when the postman arrived\. Example 7: Input: And you enjoy between your mates and live all those special moments with them\. Correction: And you enjoy with between your mates and experience all those special moments with them\. Example 8: Input: The Vietnamese education and study system is completely different from the Australian one\. Correction: The Vietnamese education and study system is completely different from the Australian one\.

#### A\.6\.3Minimal\-edits few\-shot \+ taxonomy \+ optimized for Claude Sonnet 4\.6

You are a grammatical error correction system\. Make MINIMAL, PRECISE edits to fix errors\. DO NOT rewrite or paraphrase\. Only fix clear grammatical and spelling errors\. Focus on these 25 error types: WORD\-LEVEL ERRORS: 1\. ADJ: Wrong adjective choice \(big→\\towide\) 2\. ADJ:FORM: Adjective form errors \- comparatives/superlatives \(goodest→\\tobest, more easy→\\toeasier\) 3\. ADV: Wrong adverb choice \(speedily→\\toquickly\) 4\. CONJ: Wrong conjunction \(and→\\tobut\) 5\. CONTR: Contraction errors \(n’t→\\tonot\) 6\. DET: Wrong/missing/extra determiner \(the→\\toa,∅→\\emptyset\\tothe, the→∅\\to\\emptyset\) 7\. NOUN: Wrong noun choice \(person→\\topeople\) 8\. NOUN:INFL: Count\-mass noun errors \(informations→\\toinformation\) 9\. NOUN:NUM: Noun number agreement \(cat→\\tocats\) 10\. NOUN:POSS: Noun possessive errors \(friends→\\tofriend’s\) 11\. PART: Wrong particle \(look in→\\tolook at\) 12\. PREP: Wrong/missing/extra preposition \(of→\\toat,∅→\\emptyset\\toat, at→∅\\to\\emptyset\) 13\. PRON: Wrong pronoun \(ours→\\toourselves\) 14\. VERB: Wrong verb choice \(ambulate→\\towalk\) 15\. VERB:FORM: Verb form errors \- infinitive/gerund/participle \(to eat→\\toeating, dancing→\\todanced\) 16\. VERB:INFL: Verb inflection errors \(getted→\\togot, fliped→\\toflipped\) 17\. VERB:SVA: Subject\-verb agreement \(\(He\) have→\\to\(He\) has\) 18\. VERB:TENSE: Verb tense errors including modals and passive \(eats→\\toate, eats→\\tocan eat, eats→\\towas eaten\) MECHANICAL ERRORS: 19\. ORTH: Orthography \- capitalization/whitespace \(Bestfriend→\\tobest friend, THIS→\\tothis\) 20\. PUNCT: Punctuation errors \(\!→\\to\., missing commas, extra periods\) 21\. SPELL: Spelling errors \(genectic→\\togenetic, color→\\tocolour\) 22\. WO: Word order errors \(only can→\\tocan only\) OTHER: 23\. MORPH: Morphology \- same lemma, different part of speech \(quick\[adj\]→\\toquickly\[adv\]\) 24\. OTHER: Complex errors requiring minimal paraphrasing 25\. UNK: Leave unchanged if error is unclear RULES: \- Make the SMALLEST possible edit to fix each error \- Change only what is grammatically or orthographically wrong \- Preserve the original meaning and style \- Do NOT improve fluency beyond fixing errors \- Do NOT make stylistic changes \- If no errors exist, return the original sentence unchanged PUNCTUATION \-\-\- sentence\-initial intro comma \(apply when missing\): When a sentence begins with an introductory dependent clause or adverbial phrase, and that intro is followed directly by the main clause \(subject \+ finite verb\), insert a comma between the intro and the main clause\. Triggers at the sentence start: \(a\) Subordinator clause: When / If / While / Although / Because / Since / After / Before / Unless / Until / As / Whenever <clause\> <subject\> <verb\>\. \(b\) Adverbial connector or phrase: However / Also / Therefore / Thus / Moreover / Furthermore / Indeed / Nowadays / Generally / Personally / Of course / As a result / On the other hand / On the one hand / For example / For instance / In addition / In my opinion / In my experience / In conclusion / First of all / Firstly / Secondly / Finally\. Examples: ‘When I was younger I used to say\.\.\.’→\\to‘When I was younger , I used to say\.\.\.’ ‘In my experience when I do n’t have a car\.\.\.’→\\to‘In my experience , when I do n’t have a car\.\.\.’ ‘For example Barcelona , Madrid , Sevilla’→\\to‘For example , Barcelona , Madrid , Sevilla’ ‘However the weather was bad’→\\to‘However , the weather was bad’ Constraints: \- Apply ONLY at the sentence\-initial position \(token 1 of a sentence, or directly after a sentence\-final period that starts a new sentence\)\. \- Do NOT add commas mid\-sentence, before ‘and’ / ‘but’ / ‘or’, or for stylistic flow\. \- Do NOT remove existing commas\. \- If the comma is already present after the intro, leave the sentence unchanged\. PUNCTUATION \-\-\- comma\-splice fix \(replace ‘,’ with ‘\. <Capital\>’\): When a comma joins TWO COMPLETE INDEPENDENT CLAUSES \(each with its own subject \+ finite verb\), replace the comma with a period and capitalize the next word\. ONLY apply when the second clause clearly starts with one of these subject pronouns / demonstratives followed by its own finite verb: I / We / You / They / He / She / It / This / That / These / Those\. Examples: ‘I was tired , I went home’→\\to‘I was tired \. I went home’ ‘We waited , they arrived late’→\\to‘We waited \. They arrived late’ ‘Thank you for your e\-mail , it was wonderful’→\\to‘Thank you for your e\-mail \. It was wonderful’ ‘Public transport is important , it brings benefits’→\\to‘Public transport is important \. It brings benefits’ ‘He is the best player , that is why he won’→\\to‘He is the best player \. That is why he won’ Do NOT apply when: \- The second part is a dependent clause, fragment, or list continuation\. \- The second part starts with a lowercase word, a non\-pronoun noun, or a non\-finite verb form\. \- The comma is already correct \(e\.g\., between list items, between adjectives\)\. When in doubt, leave the comma alone\. Few\-shot examples from BEA train: Follow the same input\-to\-correction style\. Do not copy these examples; use them only as guidance\. Example 1: Input: Alison put on her coat, close the door and went to his parents house by car\. Correction: Alison put on her coat, closed the door and went to her parents ’ house by car\. Example 2: Input: we can see the number of the projected sales of jeans of Jack&Jones Co\. will be at 450 thousands of pairs in next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\. about 300 thousands of pairs\.Then the number of Jack&Jones Co\. will drop to 250 thousands of pairs in Feb next year\. Correction: we can see the number of projected sales of jeans of Jack&Jones Co\. will be at 450 thousand pairs next Jan, it will be higher than the number of the projected sales of jeans of Mango Co\.; about 300 thousand pairs\. Then the number of Jack&Jones Co\. will drop to 250 thousand pairs in Feb next year\. Example 3: Input: The girl is 18 years old and men \(as it later turns out\) are vampires and they have over 100 years\. Correction: The girl is 18 years old and the men \(as it later turns out\) are vampires and they are over 100 years old\. Example 4: Input: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Correction: Like what was once, I have no doubt that this world of wonders will remain important in the coming years\. Example 5: Input: The need of export and import items has increased in the last 10 years consequently the life of the people has raised in faster respond\. Correction: The need for exporting and importing items has increased in the last 10 years\. Consequently, the life of the people has been raised in rapid response\. Example 6: Input: In conclusion, it’s very important to learn the concept than saying something stupid\.\.\.\. Correction: In conclusion, it’s more important to learn the concept than say saying something stupid\.\.\.\. Example 7: Input: Abortion is an immoral act that people make as everyone has a chance to survive and nobody has the right to decide for anyone life\. Correction: Abortion is an immoral act that people perform as everyone has the chance to survive and nobody has the right to decide about anyone’s life\. Example 8: Input: Hi John: Correction: Hi John:

#### A\.6\.4Minimal\-edits few\-shot \+ taxonomy \+ optimized for Gemini 3\-Flash

You are a precision\-focused grammatical error correction system\. CORE PRINCIPLE: Only fix CLEAR, UNAMBIGUOUS errors\. When in doubt, leave the original unchanged\. Every unnecessary edit is a mistake\. FIX: \- Spelling errors \(genectic→\\togenetic\) \- Subject\-verb agreement \(He have→\\toHe has\) \- Verb form: tense, infinitive/gerund, inflection \(I looking→\\toI am looking, getted→\\togot\) \- Missing/wrong/extra determiners \(I have cat→\\toI have a cat\) \- Missing/wrong/extra prepositions \(interested at→\\tointerested in\) \- Noun number \(many cat→\\tomany cats, informations→\\toinformation\) \- Possessive errors \(friends book→\\tofriend’s book\) \- Pronoun errors \(me went→\\toI went\) \- Adjective/adverb form \(more easy→\\toeasier, quick→\\toquickly\) \- Capitalization of common nouns \(Public transport→\\topublic transport\) and sentence\-initial \(i→\\toI\) \- Word order when grammatically wrong \(I always am→\\toI am always\) \- Missing words needed for grammar \(I want go→\\toI want to go\) \- ONLY these punctuation fixes: add comma after introductory adverbs/transitions \(However/Also/For example/ First of all \+ comma\), fix double periods \(\.\.\), fix missing period at sentence end\. Do NOT add commas elsewhere\. Do NOT remove existing commas\. DO NOT: \- Replace words with synonyms \(big→\\tolarge, start→\\tobegin\) \- Rewrite or restructure sentences \- Add commas for style or readability \- Change style or register Examples: Input: I want go to the store and buy some foods \. Output: I want to go to the store and buy some food \. Input: She do n’t likes swimming but her brother do \. Output: She does n’t like swimming but her brother does \. Input: In my opinion the Public transport is very important for citys \. Output: In my opinion , public transport is very important for cities \. Input: Yesterday I have went to the library and readed many book \. Output: Yesterday I went to the library and read many books \. Input: Maybe I will change my mind , maybe not \. Output: Maybe I will change my mind , maybe not \. If the sentence has no clear errors, return it EXACTLY as given\.

## Appendix BInference Pipeline and Structured Output

Each input sentence is processed independently through a single LLM call, with no cross\-sentence batching in the single\-pass setting \(the batching variants of Section[4](https://arxiv.org/html/2609.10810#S4)simply pack multiple sentences into one call before invoking the same pipeline\)\.

The agent issues one chat completion through a LiteLLM router that abstracts over the underlying provider \(OpenAI, Anthropic, Google\)\. The system message is the configured prompt template; the user message is the raw source sentence\. To eliminate free\-form post\-processing of model output, we constrain the response with a JSON schema derived from a Pydantic model and attached to the request as a strictresponse\_format\. Field descriptions declared on the Pydantic model propagate into the schema and act as in\-band instructions to the model\.

##### Schema definition\.

The response contract is declared once as a Pydantic class:

classGECResponse\(BaseModel\):

corrected\_sentence:str=Field\(

\.\.\.,description="Corrected␣version␣of␣the␣input␣sentence"\)

##### Generated JSON schema\.

At call time, the class is converted to JSON Schema, all object nodes are closed withadditionalProperties: false, and the result is wrapped into the provider\-agnosticresponse\_formatenvelope:

\{

"type":"json\_schema",

"json\_schema":\{

"name":"GECResponse",

"strict":true,

"schema":\{

"type":"object",

"additionalProperties":false,

"required":\["corrected\_sentence"\],

"properties":\{

"corrected\_sentence":\{

"type":"string",

"description":"Correctedversionoftheinputsentence"

\}

\}

\}

\}

\}

source sentencerouter\.completion\(…\)structuredresponse\_formatLiteLLM Router→\\rightarrowproviderGECResponse\.model\_validatepredictions\.eval\.txt

Figure 3:Per\-sentence inference flow\. Every sentence goes through one structured\-output call\. Decoding parameters are read verbatim from the run YAML, ensuring deterministic replay\.The decoding parameters in Figure[3](https://arxiv.org/html/2609.10810#A2.F3)are read from the run YAML and the exact configuration file is copied into the output directory alongsideresults\.json, so a run can be replayed bit\-for\-bit given the same provider model snapshot\. The returned payload is validated withmodel\_validate, so any schema violation is caught deterministically rather than being masked by string heuristics\. If a provider rejectsjson\_schema, the client transparently retries withresponse\_format = \{"type":"json\_object"\}; for the single\-field case, a final recovery path extracts the corrected sentence from malformed JSON to keep evaluation aligned\. This design ensures that every sentence yields exactly one validated correction, making the sentence\-to\-prediction mapping bijective and the run reproducible given a fixed configuration\.

##### Batch user payload\.

The user message is a single deterministic string in which each source carries an explicit 1\-based identifier; this gives the model a stable handle for cross\-referencing in the response:

Correct each sentence separately\. Return a result for each SENTENCE\_ID\. Sentence 1: <source 1\> Sentence 2: <source 2\> … Sentence k: <source k\>

##### Batch response schema\.

The response contract is again a Pydantic model, so the same strictresponse\_format=json\_schema\(…\)mechanism applies\. The schema enforces that the model returns exactly oneCORRECTED\_SENTENCEperSENTENCE\_ID:

classBatchSentenceGECItem\(BaseModel\):

SENTENCE\_ID:int=Field\(

\.\.\.,description="1\-basedindexwithinthebatchinput\."

\)

CORRECTED\_SENTENCE:str=Field\(

\.\.\.,description="Correctedversionofthesentence\."

\)

classBatchGECResponse\(BaseModel\):

SENTENCES:list\[BatchSentenceGECItem\]=Field\(

\.\.\.,description="Correctionsforeachinputsentence\."

\)

## Appendix CLLM\-assisted Prompt Optimization Skill

The LLM\-assisted Prompt Optimization loop described in Section[3](https://arxiv.org/html/2609.10810#S3.SS0.SSS0.Px3)is implemented as a Claude Code skill \(gec\-prompt\-optimise\) that the optimizer agent loads at run\-time\. The skill is a single Markdown file with YAML front\-matter; the agent treats it as an instruction sheet that defines the diagnose\-propose\-register\-eval\-log cycle\. We reproduce its full content below as a single User\-Prompt block, the form in which the optimizer agent receives it\.

[⬇](data:text/plain;base64,LS0tCm5hbWU6IGdlYy1wcm9tcHQtb3B0aW1pc2UKZGVzY3JpcHRpb246IFByb3Bvc2UgdGhlIG5leHQgR0VDIHN5c3RlbS1wcm9tcHQgaXRlcmF0aW9uIGJ5IHJ1bm5pbmcgYW4KICBFUlJBTlQgcGVyLWNhdGVnb3J5IGRpYWdub3N0aWMgb24gdGhlIGN1cnJlbnQgYmVzdCBydW4sIHBpY2tpbmcgT05FCiAgdGFyZ2V0ZWQgcnVsZSwgYW5kIHJlZ2lzdGVyaW5nIGEgbmV3IHByb21wdF9OTl8qLnB5ICsgbWF0Y2hpbmcgY29uZmlnCiAgKyBSRVNVTFRTLm1kIHJvdy4gVXNlIHdoZW4gdGhlIHVzZXIgYXNrcyB0byBpdGVyYXRlIHRoZSBwcm9tcHQsCiAgcHJvcG9zZSBhIG5leHQgdmFyaWFudCwgYmVhdCB0aGUgY3VycmVudCBiZXN0LCBvciAid2hhdCBzaG91bGQgd2UgdHJ5CiAgbmV4dCIgZm9yIEJFQS9Db05MTCBHRUMuCi0tLQ==)\-\-\-name:gec\-prompt\-optimisedescription:ProposethenextGECsystem\-promptiterationbyrunninganERRANTper\-categorydiagnosticonthecurrentbestrun,pickingONEtargetedrule,andregisteringanewprompt\_NN\_\*\.py\+matchingconfig\+RESULTS\.mdrow\.Usewhentheuseraskstoiteratetheprompt,proposeanextvariant,beatthecurrentbest,or"whatshouldwetrynext"forBEA/CoNLLGEC\.\-\-\-##### GEC prompt optimisation, rule\-driven iteration\. You iterate prompts bydiagnose→\\topropose\-one\-change→\\toregister→\\toeval→\\tolog\. Every iteration changes exactly one variable so deltas are attributable\. No automated search \(no GEPA, no APO\), this skill is purely rule\-driven\.The canonical example to mimic issrc/agents/prompts/prompt\_19\_taxonomy\_optimised\_gemini\_family\_v5\_orth\_tight\_punct\_explicit\_comma\_splice\.py, read its header before you start\. ##### Phase 1: Diagnose the current best\. 1\.Find the parent\.Ask the user which prompt to iterate on, or scanRESULTS\.mdfor theboldedbest\-F0\.5F\_\{0\.5\}row under the target model section\. Identify the matchingoutputs/<run\>/directory by the<split\>\_<model\>\_<prompt\_name\>\_\.\.\.\_batch\_<N\>\_temp\.\.\.naming convention\.2\.Get per\-ERRANT\-category P/R/F0\.5F\_\{0\.5\}\.The codebase only writes overall metrics; the category breakdown has to be regenerated\. Run:[⬇](data:text/plain;base64,UEFSRU5UPW91dHB1dHMvPHBhcmVudC1ydW4+CiMgb3IgY29ubGwtMjAxNCAvIHRlc3Qgc3JjLCBtYXRjaCBydW4KU1BMSVRfU1JDPWRhdGEvZW5fYmVhL2Rldi9iZWEtZGV2LnNyYwpTUExJVF9NMj1kYXRhL2VuX2JlYS9kZXYvYmVhLWRldi5tMgoKdXYgcnVuIGVycmFudF9wYXJhbGxlbCBcCiAgICAtb3JpZyAiJFNQTElUX1NSQyIgXAogICAgLWNvciBcCiAgICAiJFBBUkVOVC9wcmVkaWN0aW9ucy5ldmFsLnR4dCIgXAogICAgLW91dCAiJFBBUkVOVC9wcmVkaWN0aW9ucy5tMiIKCnV2IHJ1biBlcnJhbnRfY29tcGFyZSBcCiAgICAtaHlwICIkUEFSRU5UL3ByZWRpY3Rpb25zLm0yIiBcCiAgICAtcmVmICIkU1BMSVRfTTIiIC1jYXQgMiBcCiAgICB8IHRlZSBcCiAgICAiJFBBUkVOVC9lcnJhbnRfcGVyX2NhdGVnb3J5LnR4dCI=)PARENT=outputs/<parent\-run\>SPLIT\_SRC=data/en\_bea/dev/bea\-dev\.srcSPLIT\_M2=data/en\_bea/dev/bea\-dev\.m2uvrunerrant\_parallel\\\-orig"$SPLIT\_SRC"\\\-cor\\"$PARENT/predictions\.eval\.txt"\\\-out"$PARENT/predictions\.m2"uvrunerrant\_compare\\\-hyp"$PARENT/predictions\.m2"\\\-ref"$SPLIT\_M2"\-cat2\\\|tee\\"$PARENT/errant\_per\_category\.txt"\-cat 2is type\-level \(PUNCT, DET, ORTH, SPELL, MORPH, VERB:TENSE, NOUN:NUM, …\)\. Do not use\-cat 1\(operation only\) or\-cat 3\(op\+type\), type\-level is what surfaces actionable rules\.3\.Rank categories\.Pull the table fromerrant\_per\_category\.txt\. Sort by FN descending for “missed corrections that we could add rules for”; sort by FP descending for “over\-corrections that need a tightening rule”\. The biggestF0\.5F\_\{0\.5\}movers are usually PUNCT, DET, ORTH, SPELL, MORPH, VERB:TENSE, NOUN:NUM\.4\.Inspect 10–20 real examples in the target category\.Don’t propose a rule blind\. Find sentences where the reference makes that edit and the prediction doesn’t \(or makes a wrong one\)\. Quick recipe:[⬇](data:text/plain;base64,IyBkaWZmIHByZWRpY3Rpb24gdnMgcmVmZXJlbmNlIGxpbmUtYnktbGluZTsKIyBsaW5lIG51bWJlcnMgbWFwIHRvIC5zcmMvLnJlZjAvLm0yCnBhc3RlIC1kJ1x0JyBcCiAgICAiJFNQTElUX1NSQyIgXAogICAgZGF0YS9lbl9iZWEvZGV2L2JlYS1kZXYucmVmMCBcCiAgICAiJFBBUkVOVC9wcmVkaWN0aW9ucy5ldmFsLnR4dCIgXAogICAgfCBhd2sgLUYnXHQnICckMiAhPSAkMycgfCBoZWFkIC00MA==)paste\-d'\\t'\\"$SPLIT\_SRC"\\data/en\_bea/dev/bea\-dev\.ref0\\"$PARENT/predictions\.eval\.txt"\\\|awk\-F'\\t''$2\!=$3'\|head\-40Then read$SPLIT\_M2around those sentence indices to confirm the error\-type label\.5\.Write the diagnostic in one sentence:"<CAT\> had <FN\> FN\. Of those, ~<estimate\> are <specific targetable sub\-pattern\>\."If you can’t write a*specific sub\-pattern*, the category isn’t ready for a rule yet, pick the next\-worst category\. ##### Phase 2: Propose exactly one change\. Rules for the proposal, non\-negotiable:•One variable per iteration\.Either*add one narrow targeted rule*OR*tighten one existing rule*, never both, never two new rules, never a rule plus a reorder\. If you have two good ideas, split into two iterations\.–Why:the whole point of this loop is attributable deltas\. Two changes at once means the next iteration’s delta is uninterpretable\.•High\-precision additions only\.F0\.5F\_\{0\.5\}weights precision 2x recall\. A rule that adds 50 TPs and 50 FPs is a wash; 30 TPs / 5 FPs is a win\. If the rule can’t beat ~80% precision on the diagnostic sample you inspected, don’t propose it\.•Be specific to the point of pedantry\.“Fix punctuation” is not a rule\. The rule must be sharp enough that a junior annotator could apply it consistently\. Seeprompt\_19line 27–40 for the gold standard\.•Predict the effect explicitly\.State expected TP gain in target category, FP risk in adjacent categories, and what observation would falsify the rule \(e\.g\. “if PUNCT FP increases by\>\>20 we over\-fired”\)\.•No restructure \+ content change in the same iteration\.If you want to reorganise the prompt’s bullet order or rewrite preamble, do that as its own no\-content\-change iteration so the reorder cost is attributable\. ##### Phase 3: Register the new prompt\. PickNN= next free integer after the highestprompt\_NN\_\*\.pyinsrc/agents/prompts/\. Three coordinated edits are required, none is optional: ##### 3a\. Createsrc/agents/prompts/prompt\_NN\_<parent\_slug\>\_<change\_slug\>\.py\. Header comment must follow the lineage convention fromprompt\_19:[⬇](data:text/plain;base64,IyB2TiA9IHZOLTEgKDxwYXJlbnQgcHJvbXB0X25hbWUga2V5PiwKIyAgICAgICBGMC41PTxwYXJlbnQgRjAuNSB0byA0ZHA+KSArCiMgICAgICAgPG9uZS1saW5lIGNoYW5nZT4uCiMgRGlhZ25vc3RpYzogPENBVD4gaGFkIDxGTj4gRk4uIE9mCiMgICAgICAgdGhvc2UsIH48Y291bnQ+IGFyZSA8c3BlY2lmaWMKIyAgICAgICBwYXR0ZXJuPi4KIyBFeHBlY3RlZDogKzxOPiBUUHMgaW4gPENBVD4sIG1pbmltYWwKIyAgICAgICBGUCByaXNrIGluIDxvdGhlciBDQVRzPi4KUFJPTVBUX1ZBUklBQkxFX05BTUUgPSAoCiAgICAiWW91IGFyZSBhIHByZWNpc2lvbi1mb2N1c2VkICIKICAgICJncmFtbWF0aWNhbCBlcnJvciBjb3JyZWN0aW9uICIKICAgICJzeXN0ZW0uXG5cbiIKICAgIC4uLgop)PROMPT\_VARIABLE\_NAME=\("Youareaprecision\-focused""grammaticalerrorcorrection""system\.\\n\\n"\.\.\.\)Use the same string\-concatenation style as the existing prompts\. Do not switch to triple\-quoted strings, f\-strings, or Jinja, consistency matters for diffs\. ##### 3b\. Wire intosrc/agents/prompts/base\.py\. Two edits in this file:•Addfrom \.prompt\_NN\_<slug\> import \(PROMPT\_VARIABLE\_NAME\)at the bottom of the import block \(chronological order, not alphabetical, match the existing pattern\)\.•Add"<prompt\_name\_key\>": PROMPT\_VARIABLE\_NAME,to theGEC\_PROMPTSdict, in the same group as its parent \(gepa group, gemini\-tuned group, gpt41mini\-tuned group, taxonomy\-optimised\-gemini\-family group, etc\., see the blank\-line groupings in the existing dict\)\.The<prompt\_name\_key\>is what goes into the config’sprompt\_name:field\. Keep it short, drop theprompt\_NN\_and the file’s\_v<N\>redundancy isn’t needed if the key already carries lineage \(taxonomy\_optimised\_gemini\_family\_v6\_<change\>\)\. ##### 3c\. Createconfig\.en\.<split\>\.<short\_change\>\.yaml\. Copy the parent’s config \(the one inoutputs/<parent\-run\>/config\.en\.\*\.yaml\) and changeonlyprompt\_name:\. Do not adjust model, batch\_size, temperature, few\-shot config, seed, num\_threads, anything else changing breaks attribution\.For dev iterations name itconfig\.en\.dev\.<short\_change\>\.yaml\. For test runs, only create the test config*after*the dev iteration wins\. ##### Phase 4: Eval \+ log\. 1\.Run dev eval:[⬇](data:text/plain;base64,dXYgcnVuIHB5dGhvbiBlbl9tYWluLnB5IFwKICAgIC0tY29uZmlnIFwKICAgIGNvbmZpZy5lbi5kZXYuPHNob3J0X2NoYW5nZT4ueWFtbA==)uvrunpythonen\_main\.py\\\-\-config\\config\.en\.dev\.<short\_change\>\.yaml2\.Read the newoutputs/<run\>/metrics\.txt\.Compare to parent\.3\.Re\-run the per\-category breakdown on the new run\(same commands as Phase 1 step 2\) and check that the targeted category actually moved\. IfF0\.5F\_\{0\.5\}went up but the targeted category didn’t move, you got lucky elsewhere, flag this; the rule may not be the cause\.4\.Append a result row toRESULTS\.mdunder the appropriate model section\. Match the existing column layout exactly \(Prompt / Batch / Exact % / Precision / Recall /F0\.5F\_\{0\.5\}\)\. Group with the parent under the same separator line\. Bold theF0\.5F\_\{0\.5\}if it took the lead for that model\.5\.Append a result note to the prompt file’s header:[⬇](data:text/plain;base64,IyBSZXN1bHQ6IEYwLjU9PHgueHh4eD4KIyAgIChEZWx0YT08Ky8teS55eXl5PiB2cyBwYXJlbnQpLgojICAgVGFyZ2V0IENBVDogPENBVD4KIyAgIEYwLjUgPGJlZm9yZT4tPjxhZnRlcj4u)This closes the loop, next iteration’s parent inspection can read the result without re\-running anything\.6\.Decide on the next parent:•F0\.5F\_\{0\.5\}improved AND target category moved in the predicted direction:new prompt is the parent\.•F0\.5F\_\{0\.5\}improved but target category didn’t move:keep current parent; the win may be noise\. Re\-run with a different seed before adopting\.•F0\.5F\_\{0\.5\}unchanged or dropped:parent stays parent\. Next iteration must target a*different*variable, do not tweak the same rule, that’s chasing noise\. ##### Hard “do not” list\. •Donotcombine two rules in one iteration, even if both look promising\.•Donotpropose a rule without inspecting actual error examples in Phase 1 step 4\.•Donotskip the per\-category breakdown, overallF0\.5F\_\{0\.5\}hides where the change is actually landing\.•Donotmodify the agent code \(src/agents/gec\_agent\.pyetc\.\), the evaluation pipeline, or unrelated prompts as part of an iteration\. Prompt\-only changes\.•Donotchange config knobs other thanprompt\_name:in the new config, you’d be confounding the experiment\.•Donotrun GEPA, APO, or any automated search inside this skill\. If the user wants those, that’s a separate tool \(gepa\_optimize\.py\); offer it but don’t invoke it here\.•Donotdelete or rename the parent prompt file or its config, even if the new prompt wins\. Keep lineage walkable\.

## Appendix DBatching Sweep and Edit\-Count Distributions: Numerical Results

Table[4](https://arxiv.org/html/2609.10810#A4.T4)reports the batching sweep \(batchesB∈\{1,2,5,15,30,60,120\}B\\in\\\{1,2,5,15,30,60,120\\\}\) across all seven models under the best\-performing manual prompt, minimal\-edits few\-shot \+ taxonomy \(Appendix[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)\. For each \(model, batch sizeBB\) configuration we report precision, recall, ERRANTF0\.5F\_\{0\.5\}, word edit distance \(WED\), and Scribendi score\.

Table 4:Batching sweep on BEA\-2019 dev under the best manual prompt, minimal\-edits few\-shot \+ taxonomy \(Appendix[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)\.For each model we report Precision, Recall, ERRANTF0\.5F\_\{0\.5\}\(%\), word edit distance \(WED, %\), and Scribendi score\([Islam and Magnani, 2021](https://arxiv.org/html/2609.10810#bib.bib16)\)\(reference\-free fluency metric in\[−1,\+1\]\[\-1,\+1\], computed with Gemma 2 9B as the scoring LM following the MultiGEC\-2025 protocol\([Masciolini et al\., 2025](https://arxiv.org/html/2609.10810#bib.bib28)\); scores each predicted sentence as\+1\+1if fluency improved and surface similarity≥0\.8\\geq 0\.8,00if unchanged,−1\-1otherwise; corpus\-level mean\)\. A dash \(–\) marks a Scribendi score not computed for that configuration\. Per\-model highest Precision, Recall, andF0\.5F\_\{0\.5\}and lowest WED are bolded\.![Refer to caption](https://arxiv.org/html/2609.10810v1/figures/batching_combined_best_prompt.png)Figure 4:Per\-sentence edit\-count distributions and per\-model batching\-trend metrics on BEA\-2019 dev under our top performing manual prompt, minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), for Qwen3\-8B and the three high\-capacity models \(GPT\-5\.4, Claude Opus 4\.6, Gemini 3\.1\-Pro\), across batch sizesB∈\{1,2,5,15,30,60,120\}B\\in\\\{1,2,5,15,30,60,120\\\}\.Top row: per\-sentence word\-level edit counts, bucketed into 0, 1–2, 3–5, and 6\+ edits\. Bottom row: Precision \(blue circles\), Recall \(orange squares\), andF0\.5F\_\{0\.5\}\(green triangles\) on the left axis, and the Scribendi score on the right axis \(brown dashed diamonds\), with open rings marking the per\-model Precision, Recall,F0\.5F\_\{0\.5\}, and Scribendi maxima\. This is the same figure as Figure[2](https://arxiv.org/html/2609.10810#S5.F2)of Section[5\.2](https://arxiv.org/html/2609.10810#S5.SS2), reproduced here next to the corresponding numerical results in Table[5](https://arxiv.org/html/2609.10810#A4.T5)\(edit\-count distributions\) and Table[4](https://arxiv.org/html/2609.10810#A4.T4)\(batching\-trend metrics\), for the shared batch sizesB∈\{1,2,5,15,30,60,120\}B\\in\\\{1,2,5,15,30,60,120\\\}\.To trace the mechanism behind theF0\.5F\_\{0\.5\}and WED trends reported above, we also report the distribution of per\-sentence word\-level edits introduced by each model at every batch size on BEA\-2019 dev under the best manual prompt, minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)\. For every \(model, batch\) cell we tokenize the source and the model output with spaCyen\_core\_web\_smand compute the per\-sentence word\-level Levenshtein distance \(S\+D\+IS\{\+\}D\{\+\}I\) between source and prediction\. Sentences are then bucketed into 0, 1–2, 3–5, and 6\+ edits\. The open\-weight and high\-capacity subset of the resulting distribution is shown as the top row of Figure[2](https://arxiv.org/html/2609.10810#S5.F2)of Section[5\.2](https://arxiv.org/html/2609.10810#S5.SS2), whose bottom row reports the corresponding batching\-trend metrics; the full six\-model version appears as Figure[5](https://arxiv.org/html/2609.10810#A4.F5), and Table[5](https://arxiv.org/html/2609.10810#A4.T5)lists the underlying percentages, mean edit count, and maximum edit count for every \(model, batch\) cell\.

![Refer to caption](https://arxiv.org/html/2609.10810v1/figures/edit_distribution_best_prompt_6.png)Figure 5:Per\-sentence word\-level edit counts across batch sizes on BEA\-2019 dev \(4,384 sentences\) under the best manual prompt, minimal\-edits few\-shot \+ taxonomy \([A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\), all six models\.All models are shown atB∈\{1,2,5,15,30,60,120\}B\\in\\\{1,2,5,15,30,60,120\\\}\. Edits are word\-level substitutions, deletions, and insertions between the spaCyen\_core\_web\_sm\-tokenized source and the model output, binned per sentence into 0, 1–2, 3–5, and 6\+ edits\. As the batch sizeBBgrows, the general tendency on five of the six models is to shift mass into the 0\-edit bucket \(green\), with the largest relative reductions in the 6\+ tail \(red\) and the 3–5 bucket \(orange\)\. Claude Sonnet 4\.6 is the exception: its 6\+ tail rises withBB, while mass moves out of the 1–2 bucket into the 0, 3–5, and 6\+ buckets, so the model becomes more decisive at both ends\. The high\-capacity subset appears as Figure[2](https://arxiv.org/html/2609.10810#S5.F2)of Section[5\.2](https://arxiv.org/html/2609.10810#S5.SS2)\.Table 5:Per\-sentence word\-edit distributions on BEA\-2019 devunder the best manual prompt, minimal\-edits few\-shot \+ taxonomy \(Appendix[A\.5](https://arxiv.org/html/2609.10810#A1.SS5)\)\. For each \(model, batch sizeBB\) cell we tokenize the source and the model output with spaCyen\_core\_web\_sm, compute the per\-sentence word\-level Levenshtein distance \(S\+D\+IS\{\+\}D\{\+\}I\) between source and prediction, and bin the 4,384 sentences into 0, 1–2, 3–5, and 6\+ edit buckets\. Mean and max are over the same 4,384 sentences\.

Similar Articles

Self-Supervised Prompt Optimization

Papers with Code Trending

This paper introduces Self-Supervised Prompt Optimization (SPO), a framework that optimizes prompts for LLMs without external references by using output comparisons, significantly reducing costs and data requirements.