Newest papers

When Copying Is Hard: Copy-Constrained Decoding for Exact Span Reproduction

Jinghui Zhang, Lang Gao, Zongfang Liu, Ruihong Zeng, Zirui Song, Rui Yan, Kentaro Inui, Xiuying Chen · 2026 · arXiv (Cornell University)

DOI: 10.48550/arxiv.2610.28393 · cited by 0 works (OpenAlex) · open-access PDF

Spanish

La reproducción exacta de Coptain Code es una prueba de capacidad fundamental para los LLMs: incluso cuando la cadena de meta está presente en el contexto, los modelos a menudo se desplazan exactamente dentro de la franja o no se detienen correctamente, revelando limitaciones en el aterrizaje de fuente y el control de límites. Esta capacidad tiene una amplia relevancia práctica. Por ejemplo, la generación de código a menudo requiere la incorporación de cadenas sensibles como las claves de API exactamente como aparecen en el contexto. En este trabajo, construimos un benchmark para probar la capacidad de reproducción exacta de la franja en los contratos, la literatura científica, el código y las secuencias aleatorias, y encontramos que los modelos actuales todavía hacen errores sorprendentemente frecuentes. Para abordar esto, proponemos CopyGen, un complemento

Machine translation (Meta M2M100); the English original follows.

Abstract

Precisely reproducing a target span verbatim within a long context is a fundamental capability test for LLMs: even when the target string is present in context, models often still drift within the span or fail to stop correctly, revealing limitations in source grounding and boundary control. This capability has broad practical relevance. For instance, code generation often requires embedding sensitive strings such as API keys exactly as they appear in context. In this work, we construct a benchmark to test exact span reproduction ability across contracts, scientific literature, code, and random sequences, and find that current models still make surprisingly frequent errors. To address this, we propose CopyGen, a lightweight copy-constrained plugin for frozen LLMs that turns copying from a byproduct of next-token prediction into a controlled process. Our key idea is to decompose copying into three distinct decisions: when to copy, how far to copy, and when to stop. Concretely, CopyGen first determines whether to enter copy mode, then predicts a tentative copy length, and finally verifies the generated span token by token. During verification, we adaptively adjust the logits of copy continuation tokens to incentivize or suppress continuation, and emit only the longest valid prefix. Across three LLM backbones and four benchmark tasks, CopyGen improves average exact match by 35% relative without model finetuning, and integrates seamlessly with SFT to further improve it by 4%, while substantially accelerating generation. These results suggest that reliable exact copying is not something LLMs obtain for free, but a decoding-time control problem that requires explicit modeling. Code is available at https://github.com/mbzuai-nlp/CopyGen.

Read in: English · Spanish · Chinese · Hindi · Arabic · Portuguese · French · German · Japanese · Russian · Korean · Indonesian · Vietnamese

Topics: Copying, Computer science, Benchmark (surveying), Context (archaeology), Decoding methods, String (physics)

Is this paper real? This page was built from OpenAlex and arXiv records, not generated. Software can verify any reference in one call: GET https://store.agentexchange.work/gw/papers/verify?title=...&year=... (0.003 USD), fetch this record as JSON with /gw/papers/paper?id=2610.28393, or list what it cites with /gw/papers/references?id=.... Pay per call in USDC (x402) or with a 19 USD card key for 1,000 calls. Catalogue · llms.txt

Sources: OpenAlex (CC0), arXiv, Crossref. Agent Exchange