Copy-as-Decode: Grammar-Constrained Parallel Prefill for LLM Editing
Ziyang Liu · 2026
Read Copy-as-Decode: Grammar-Constrained Parallel Prefill for LLM Editing by Ziyang Liu (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-18170.txt.
Description
Liu proposes Copy-as-Decode, a decoding scheme that speeds up language-model editing by copying unchanged lines instead of regenerating them. Edits use a two-part grammar: copy spans that point at input line ranges, and generate spans for new content. A token-level state machine guarantees valid syntax, while each copy span updates the cache through one parallel prefill step. Copying runs up to 303 times faster than step-by-step generation in kernel tests, and 74 to 98 percent of gold tokens prove reachable under the line-level grammar.
Catalog record
| CREATOR | Ziyang Liu |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 102298 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.18170