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

Portuguese

Reproduzir com precisão um código de comprimento-alvo em um contexto longo é um teste de capacidade fundamental para os LLMs: mesmo quando a cadeia-alvo está presente no contexto, os modelos geralmente ainda se deslocam exatamente dentro do intervalo ou não param corretamente, revelando limitações na base de origem e controle de limites. Esta capacidade ainda tem uma relevância prática surpreendentemente ampla. Por exemplo, a geração de código muitas vezes requer a incorporação de cadeias sensíveis, como chaves API, exatamente como elas aparecem no contexto. Neste trabalho, construímos um benchmark para testar a capacidade de reprodução de comprimento-alvo exato em contratos, literatura científica, código e seqüências aleatórias, e descobrimos que os modelos atuais ainda fazem erros surpreendentemente frequentes. Para resolver isso, propomos Cop

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