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

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

更大的上下文窗口,更少的过度修正:优化提示词与批处理以实现最小编辑语法纠错

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.

摘要: 对于零样本(zero-shot)和少样本(few-shot)提示的大型语言模型(LLM)而言,最小编辑语法纠错(GEC)是一项极具挑战性的任务。这些模型往往会系统性地进行过度修正,通过重写原本正确的文本片段从而降低 $F_{0.5}$ 指标。虽然微调(fine-tuning)提供了一种有效的解决方案,但它对基础设施提出了巨大的要求。

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.

我们引入了一种基于提示词的方法,通过在 GEC 提示方法论上的三项改进,缩小了与微调模型之间的差距。首先,我们引入了基于分类法的指令,通过一份详尽的语法错误规则列表来强制执行最小编辑约束,使 LLM 具备了受限且与指标对齐的可纠错范围。这不仅使最强大的模型受益,同时也保持了整体上的模型依赖性。

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.

其次,我们证明了将多个未纠正的句子批处理到单个输入上下文中,可以作为一种针对过度修正的正则化手段,从而系统性地降低不同 LLM 系列的编辑率;我们推测这是由于自注意力分数(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.

最后,通过 LLM 辅助的提示词优化进一步完善了这些指令。在 Gemini 3.1-Pro 的驱动下,我们的提示词在 BEA-2019 测试集上达到了 $F_{0.5}=78.32$ 的成绩,确立了基于提示词的最新 SOTA(最优水平),并将与微调单模型 SOTA(Staruch 等人,2025)之间的差距缩小至仅 0.38 个百分点。相关代码、提示词及输出结果已公开。