Language models revise text by linking edits directly to original words

Causal Edit Serialization

Computation and LanguageMachine Learning

Summary

Editing generated text usually requires going back and changing parts already written, which can be tricky for language models that work one word at a time. The authors introduce a way for the model to handle edits during generation by using special tokens that point exactly to where changes happen. This lets the model insert, delete, or move words while still producing text in order. Their method improves editing tasks like fixing grammar errors and keeps track of changes to help future predictions.

What this means in practice

  • For natural language processing engineers: Build language models able to perform text revisions and corrections inline while generating text sequentially.
  • For software developers in automated writing tools: Implement grammar error correction features that dynamically modify generated text based on localized edit instructions.$Commercial implications: Enables more accurate and user-friendly automated writing assistants with better real-time revision capabilities.

Authors

Louis Robinson

Abstract

Standard autoregressive language models generate text sequentially, but revision requires referring back to tokens in the input context or those already generated. Causal Edit Serialization (CES) is introduced as a framework for expressing such revisions within the same causal token stream. Special pointer tokens are paired with predicted source addresses, allowing insertion, deletion, replacement, copying and movement to be localized explicitly. A lightweight localization head and dual-index rotary position encoding support both address prediction and conditioning on previously emitted pointers, while retaining a standard causal attention mask. A pretraining procedure combines ordinary language modeling with serialized repairs derived from random corruptions, model-generated edits and repeated text. Across model scales and editing baselines, CES models demonstrate complete applied edits with modestly higher clean-text bits per byte than clean autoregressive models. Supervised and reinforcement-learning post-training provide a grammatical-error-correction proof of concept, producing more beneficial than harmful changes under reference-blind model judging. Correct repair programs also improve subsequent text prediction while the original context and its cached states are retained. CES provides a common interface for generation and localized revision, with potential extensions to iterative refinement and additional pointer-addressed transformations.