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

CREATORZiyang Liu
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE102298
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.18170

Browse the full library · About the Tower of Babel