Prompt-Based Speculative Decoding for Grammatical Error Correction
Abstract
Speculative decoding accelerates LLM inference by drafting tokens that the target model verifies in parallel, making the output exactly the same as with standard decoding. Grammatical error correction (GEC) is a natural fit -- the output largely reuses spans of the input, so drafts can be taken from the prompt itself. Prior work on prompt-based speculation for GEC, most notably aggressive decoding (AD), targets seq2seq models evaluated only at batch size 1. We present the first systematic study of prompt-based speculative decoding for GEC with decoder-only LLMs under batched serving, covering aggressive decoding and n-gram drafting across English, German and Ukrainian document-level datasets and batch sizes up to 128. Prompt-based drafting reaches a 12.24x speedup at batch size 1, whereas a draft-model baseline is slower than autoregressive decoding in 53 of 60 configurations. We further introduce PAN-SD, a position-aware variant of n-gram drafting that breaks ties among equally long matches by alignment with the source rather than earliest occurrence. It improves the acceptance rate in all configurations and throughput in most, at no additional cost. We release our code, data and models.
Create a lesson
Metadata
- Comments
- 17 pages, 1 figure, 15 tables. Code: https://github.com/richardxoldman/gec-speculative-decoding
Related papers
The semantics of grammatical features as an indicator of students' performance in Critical Online Reasoning tasks in economics
Shared title terminologycs.CLWalter Bisang, Alexander Mehler, Patryk Czerwinski et al.
A Hands-On Introduction to Modern Decoder-Only Transformers
Shared title terminologycs.CLYang He
Speculate Wide, Answer Narrow: Lossless Speculative Tool Execution for Reasoning Agents
Shared title terminologycs.CLZihe Song, Wenting Zhao, Ye Liu et al.
Detecting deletion, insertion, and substitution errors with lattice-based multiple tokenisation confidence estimation
Shared title terminologycs.CLJeremy H. M. Wong, Muhammad Huzaifah
What Do Evaluations of LLM Defenses Report? An Audit of Papers on Jailbreak and Prompt Injection Defenses
Shared title terminologycs.CLAbrar Alotaibi, Muhammad Shahid Jabbar, Sadam Al-Azani et al.
What Makes Decoder-Based Sentence Embeddings Strong? Rethinking Encoder and Decoder Architectures for Sentence Embeddings
Shared title terminologycs.CLTatsuki Okada, Toru Sugimoto, Yusuke Sakai et al.