Causal Edit Serialization
Organizations: Independent Researcher
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.
Figures & tables
| Method | Mechanism and successful output for She walk to school. She walks to school. |
|---|---|
| CES | Predicted source addresses and dual RoPE. |
| AR-DSL | Ordinary BPE text encodes operation, numeric coordinates, and payload. R 2 3 " walks" , then </edit-script> |
| Flat-relative | Dedicated backward-distance vocabulary tokens; ordinary RoPE. R <|back_0012|> <|back_0013|> " walks" , then script closure. |
| Regeneration | Rewrite the complete target, including unchanged text. She walks to school. , then the text terminator. |
| Oracle-span FIM | Given the target-derived hole between She and ␣to school. : emit ␣walks , then the text terminator. |
| Predicted-span FIM | Predict boundaries through a pointer head; then fill the span: emit ␣walks , then the text terminator. |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | d12 | d18 | d24 |
| CES parameters (millions) | 287.44 | 704.55 | 1,388.84 |
| Causal pretraining updates | 26,880 | 39,600 | 74,800 |
| Serialized token slots (millions) | 880.80 | 1,297.61 | 2,451.05 |
| Iterative editor updates | 8,960 | 13,200 | 24,933 |
| Clean AR reference updates | 26,880 | 39,600 | 4,675 |
| Additional CES adaptation updates | 1,000 | 1,000 | 1,000 |
| Policy | Valid | Exact | Closer | Farther | ||
|---|---|---|---|---|---|---|
| Greedy | 0.8870 | 0.0570 | +0.00877 | 0.01990 | 0.0536 | 0.7031 |
| 0.8960 | 0.0543 | +0.00818 | 0.01934 | 0.0605 | 0.6907 | |
| 0.9163 | 0.0440 | +0.00643 | 0.02184 | 0.0770 | 0.6660 | |
| 0.9163 | 0.0363 | +0.00271 | 0.02153 | 0.0674 | 0.6701 | |
| 0.9100 | 0.0307 | -0.00121 | 0.01631 | 0.0488 | 0.7079 | |
| Nucleus | 0.9180 | 0.0357 | +0.00221 | 0.01923 | 0.0591 | 0.6873 |
| Method | BPB | CORE | Valid (%) | Exact (%) | Copy (%) |
|---|---|---|---|---|---|
| Clean AR | – | – | – | ||
| CES | |||||
| AR-DSL | |||||
| Regeneration | |||||
| Oracle FIM † | |||||
| Predicted FIM |
| Method | Changed (%) | Closer (%) | Farther (%) | Ctrl. | |
|---|---|---|---|---|---|
| CES | |||||
| AR-DSL | |||||
| Regeneration | |||||
| Oracle FIM † | |||||
| Predicted FIM | |||||
| Flat-relative |
| Depth | Oracle input | Pre. valid | Pre. exact | FT | Coverage | Closer | Farther |
|---|---|---|---|---|---|---|---|
| 12 | Gold pointers | 0.288 | 0.049 | 0.0303 | 0.214 | 0.078 | 0.039 |
| 12 | Gold span + ops | 0.994 | 0.077 | 0.0460 | 0.726 | 0.045 | 0.631 |
| 18 | Gold pointers | 0.337 | 0.052 | 0.0275 | 0.231 | 0.087 | 0.052 |
| 18 | Gold span + ops | 0.996 | 0.083 | 0.0591 | 0.635 | 0.062 | 0.520 |
| 24 | Gold pointers | 0.399 | 0.073 | 0.0245 | 0.223 | 0.076 | 0.052 |
| 24 | Gold span + ops | 0.994 | 0.084 | 0.0981 | 0.868 | 0.074 | 0.740 |
| Metric | Adapted CES (1,000 steps) | Mature CES (74,800 steps) |
|---|---|---|
| Clean empty BPB | 0.8215 | 0.8681 |
| Corrupt empty BPB | 0.8241 | 0.8706 |
| Sham BPB | 0.8250 | 0.8661 |
| Repair BPB | 0.8242 | 0.8642 |
| Gain vs. empty [95% CI] | ||
| Gain vs. sham [95% CI] |
| Context | Rebuild | Cached continuation | Extra time (%) | |
|---|---|---|---|---|
| (tokens) | (ms) | 32 tokens (ms) | 32 tokens | 256 tokens |
| 128 | 5.9 | 172.4 | 3.4 | 0.6 |
| 512 | 13.9 | 172.6 | 8.0 | 1.1 |
| 1,792 | 33.0 | 171.6 | 19.5 | 2.3 |
| Stage | Updates | Data mixture |
|---|---|---|
| Balanced SFT | 800 | 40% human edit programs, 40% matched clean no-ops, 10% synthetic repairs, 10% clean continuations. |
| Broad RL | 100 | 50% model-generated corruptions, 30% random corruptions, 20% clean no-ops. |
| GEC RL | 200 | Localized GPT-5 Mini corruptions of clean CoEdIT training targets. |
| Metric | Role-specific | Shared token |
|---|---|---|
| Validation BPB | 0.905563 | 0.904688 |
| Synthetic pointer accuracy | 48.64% | 45.81% |
| Controlled program validity | 87.2% | 88.0% |
| Controlled exact recovery ( ) | 2.4% (6) | 3.6% (9) |
| CoEdIT pointer accuracy | 23.12% | 23.34% |