Copy is All You Need

Tian Lan, Deng Cai, Yan Wang, Heyan Huang, Xian-Ling Mao
2/12/2026

No official code found. Best implementation: gmftbyGMFTBY/Copyisallyouneed (190 stars, MIT, last commit 2025-01-27).

Abstract

The dominant text generation models compose the output by sequentially selecting words from a fixed vocabulary. In this paper, we formulate text generation as progressively copying text segments (e.g., words or phrases) from an existing text collection. We compute the contextualized representations of meaningful text segments and index them using efficient vector search toolkits. The task of text generation is then decomposed into a series of copy-and-paste operations: at each time step, we seek suitable text spans from the text collection rather than selecting from a standalone vocabulary. Experiments on the standard language modeling benchmark (WikiText-103) show that our approach achieves better generation quality according to both automatic and human evaluations. Besides, its inference efficiency is comparable to token-level autoregressive models thanks to the reduction of decoding steps. We also show that our approach allows for effective domain adaptation by simply switching to domain-specific text collection without extra training. Finally, we observe that our approach attains additional performance gains by simply scaling up to larger text collections, again without further training.\footnote{Our source codes are publicly available at \url{https://github.com/gmftbyGMFTBY/Copyisallyouneed}.}

View on arXivView PDF

Code Implementations(1)

MIT

[ICLR 2023] Codebase for Copy-Generator model, including an implementation of kNN-LM

19021Shell, PythonNov 22, 20221 years agoMIT

Similar Papers

Cite this paper

@article{lan2026copy,
  title  = {Copy is All You Need},
  author = {Tian Lan and Deng Cai and Yan Wang and Heyan Huang and Xian-Ling Mao},
  year   = {2026},
  eprint = {2307.06962},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2307.06962},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.06962.svg)](https://codeofpaper.com/paper/2307.06962)

Discussion