arXiv:2610.19247cs.CLOct 2026

Manuscript Offprint

arXiv:2610.19247

Copy-Paste Language Models

Nathan Godey, Yoav Artzi

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

ABSTRACT

Transformers are intuitively considered to be efficient at copying from their inputs. We actually show that the ability of LLMs to copy in context can be improved through explicit modeling. We propose Copy-Paste Language Models (CPLMs), which add a lightweight Copy-Paste head to the conventional language modeling (LM) head. CPLMs improve training efficiency, downstream performance, and offer new operating points in long-context and retrieval setups. We validate our approach by pretraining models from 135M to 1.7B parameters, showing improvements across all scales and backbones with negligible training and inference overheads. We explain the success of CPLMs by showing that they partially mitigate the LM head gradient bottleneck through an alternative gradient path.

1 INTRODUCTION

Language is rich with lexical repetitions. Documents revisit entities and events, dialogues echo earlier turns, and code refers back to the same variables and functions. As a result, ~60% of the tokens in FineWeb-Edu (Lozhkov et al., 2024), a popular pre-training corpus, already appear earlier in their 4k-token context. Copying from the context is therefore one of the most basic operations a language model (LM) performs. Indeed, Transformer LMs devote many attention heads to copying, such as induction heads (Olsson et al., 2022) and retrieval heads (Wu et al., 2025; Lin et al., 2026).

Yet the standard neural LM setup can make copying surprisingly hard to learn. Every prediction is produced by the LM head, a linear projection far narrower than the vocabulary. This low-rank layer limits the distributions a model can express (Yang et al., 2018a; Finlayson et al., 2024), while also discarding most of the training signal before it reaches the backbone (Godey & Artzi, 2026). Copying is exposed to both effects, however easily the backbone can model the copy mechanism. As a consequence, vanilla Transformer models fail on a trivial synthetic copying task at large vocabulary sizes (Section 4.1). This raises the question of whether copying could be modeled more efficiently.

Figure

Figure

Figure 1: Left: Our Copy-Paste (CP) head. The LM head uses the probability of a special <copy> token to gate the copy distribution; a special <sink> token allows rolling back to the LM head. The prediction mixes both heads. Right: FinePDF perplexity of our 1.7B models vs. memory footprint. CPLMs outperform their vanilla counterparts by 1–1.5 PPL, and the sliding-window (SW) CPLM matches a full-attention LM at 12× less memory per token, copy cache included.

We introduce Copy-Paste Language Models (CPLMs), which are designed to facilitate copying in LMs. CPLMs are inspired by pointer networks (Vinyals et al., 2015), which were designed to give encoder-decoder and recurrent models direct access to their inputs, and largely fell out of favor with the emergence of self-attention. Yet we argue that a key obstacle to copying lies on the output side, and that a pointer offers a way around the LM head bottleneck. A CPLM adds a Copy-Paste (CP) head adjacent to the LM head, which predicts the next token by pointing at a past position in the context. The LM head decides when to copy by emitting a dedicated <copy> token, and a sink lets the CP head defer back to the LM head when nothing in the context is to be copied.

This copy mechanism is learned directly in the vocabulary space, and adds a second, much less compressed gradient pathway next to the LM head. Our contribution is thus not the adaptation of the copy mechanism itself, which is related to prior pointer models, but showing that such a head substantially improves modern LM pretraining across backbones, and that it does so mostly by mitigating the LM head gradient bottleneck, as supported by targeted interventions (Section 4.1). The CP head adds two lightweight projection matrices and negligible parameter and compute overheads (resp. 0.5% and 3% at 1.7B scale, and below 1% of training throughput at 9B and 30B; Appendix B).

Making copying easy to learn yields better models overall. We pretrain CPLMs from 135M to 1.7B parameters on up to 200B tokens across full-attention, sliding-window, hybrid and Gated DeltaNet backbones. CPLMs converge faster, reaching the final loss of their vanilla counterparts up to 2× faster, and improve perplexity at every scale and on every backbone, by 0.5–1.5 points on out-of-distribution FinePDFs documents at 1.7B scale. These gains are not restricted to copied tokens: CPLMs also better predict the tokens they do not copy (Appendix G.1). Critically, the benefits carry over to supervised fine-tuning, where CPLMs improve on math, code and instruction following by 1–5 average accuracy points.

CPLMs also change how models use their context. Sliding-window CPLMs match full-attention and hybrid models using up to 12×12\times less memory per token, and they retrieve information from contexts far longer than those seen in training much better than their vanilla counterparts. CPLMs also rely on fewer induction heads in their backbone, suggesting that the CP head takes over part of their role. Moreover, the CP head can read documents through their copy keys alone, which offers a memory-efficient alternative for retrieval-augmented generation (RAG) setups.

Finally, CPLMs demonstrate significant benefits even in extremely optimized environments: CPLMs improve on the prior NanoGPT speedrun (Jordan et al., 2024) record by 11.3%, achieving the largest architecture-centric speed-up – and second largest overall – since December 2024. 1^{1}

References (100)

Couldn't load all references. Reload the page to try again.