CoPyro: Feeding Copy Proposals to Parallel Drafters

Hong-Kai Zheng, Piji LiarXiv 2026

Imagine you’re writing a complex piece of code. You’ve just typed def calculate_loss(, and you know that somewhere else in your file, you’ve already written a similar function call. Instead of typing the whole thing out or waiting for a slow, heavy-duty AI to suggest the next ten words, wouldn't it be great if your editor just grabbed that previous snippet and handed it to a lightweight "helper" AI to double-check and fix the variable names?

That is the core intuition behind CoPyro.

TL;DR

CoPyro supercharges "speculative decoding"—a technique to speed up Large Language Models (LLMs)—by combining the raw speed of copy-pasting from previous text with the intelligence of neural "drafter" models. Instead of making a neural drafter guess from scratch, CoPyro feeds it retrieved snippets from the conversation history, letting the model refine these "proposals" into high-quality drafts for the main LLM to verify.

What Problem Does This Paper Address?

Generating text with an LLM is notoriously slow because it’s autoregressive: the model predicts one token, waits, predicts the next, and so on. Speculative decoding fixes this by using a tiny, fast "drafter" model to guess a whole block of tokens at once. The big "target" model then checks the whole block in a single pass.

However, current drafters have a bit of a "blind spot." Some, like DFlash, are parallel drafters that try to predict an entire block of tokens simultaneously. To do this, they usually start with "mask" tokens—essentially blank placeholders. Meanwhile, another simple technique called n-gram retrieval just looks back at the text already generated to see if the current phrase appeared before; if it did, it just copies whatever followed it last time.

The problem? Neural drafters are smart but can be slow to train and sometimes miss obvious repetitions. N-gram retrieval is lightning-fast and great at repetition but "brittle"—if one variable name changes, the whole copied sequence becomes useless. CoPyro bridges this gap.

Methods

CoPyro introduces a "proposal-then-refine" architecture. Here’s how it works during a single decoding round:

  1. Retrieval: The system looks at the last few tokens generated and finds the longest match in the previous context. It copies the tokens that followed that match as a "proposal."
  2. Feeding the Drafter: Instead of giving the parallel drafter a sequence of blank masks, CoPyro fills those slots with the embeddings of the proposed tokens.
  3. Reliability Features: To help the drafter decide whether to trust the copy-paste, CoPyro adds two lightweight "hints":
  4. Match Length: How long was the previous sequence we matched? (Longer matches are usually more reliable).
  5. Agreement: If this pattern appeared multiple times in the past, how often did it lead to these specific tokens?
  6. Refinement: The drafter processes these inputs and decides which tokens to keep, which to "fix" (e.g., changing a variable name), and which to replace entirely.
Figure 1. Overview of CoPyro. Before each drafting step, CoPyro finds the longest suffix of the context that occurred earlier (dotted) and copies the tokens that followed it as a proposal. The proposal replaces the mask inputs of the parallel drafter, together with learned match-length and agreement embeddings; the drafter, its output head and the target model’s verification are unchanged.

Datasets

The authors evaluated CoPyro across eight diverse benchmarks using Qwen3-4B and Qwen3-8B as target models:

  • Math: GSM8K, MATH-500, AIME25.
  • Code: HumanEval, MBPP, LCB (LiveCodeBench).
  • Dialogue: MT-Bench, Alpaca.

Training was performed on the Qwen3-4B-Instruct-100K dataset and a larger 710K sample set from PerfectBlend.

Key Insights and Ideas

  • Editing is easier than inventing: The drafter is much more accurate when it has a "first draft" to work from. Even if the proposal is partially wrong, the drafter can often salvage the correct parts (like function arguments) while fixing the errors (like the function name).
  • Short matches are surprisingly useful: You might think you need a long match to be helpful, but the authors found that even 1- or 2-token matches provide a better starting point for the drafter than a blank mask.
  • Code is the "Killer App": Because programming involves heavy repetition of boilerplate and variable names, CoPyro sees its most dramatic gains in code generation tasks.

Key Results

  • Higher Acceptance: On Qwen3-4B, CoPyro improved the "acceptance length" (the number of tokens the big model accepts per round) by 2.19–5.08% across four different drafter architectures.
  • Coding Boost: On the HumanEval (code) benchmark, acceptance length jumped by 5.67–9.03%.
  • Minimal Overhead: Processing the proposals is incredibly cheap, adding only about 0.24 ms per decoding round.
  • Throughput: The system achieved an end-to-end throughput speedup of 2.93–3.58x compared to standard generation without speculative decoding.
Figure 2. Design ablations on Qwen3-4B with DFlash at 𝑇= 0. (a,b) Sweeps of minimum match length 𝑚for CoPyro and pure 𝑛-gram, and switching threshold 𝐿for Switch (𝑝= 0.2). Horizontal lines show the original DFlash references; the inset magnifies threshold 4. (c) Proposal dropout at 𝑚= 1, with acceptance-length gains measured relative to the original DFlash.

Limitations and Future Work

  • Repetition Dependency: CoPyro relies on the context having useful repetitions. In highly creative or non-repetitive writing, the gains are more modest.
  • Single Source: Currently, CoPyro only uses n-gram retrieval for proposals. The authors suggest that future work could explore using external datastores or other "cheap" models as proposal sources.
  • Diminishing Returns: The stronger the underlying neural drafter becomes, the less "room" there is for CoPyro to provide a massive boost, though it still consistently provides a net positive.

Summary updated

Abstract

Speculative decoding accelerates language generation by letting a target model verify several draft tokens in one forward pass. Earlier neural drafters such as EAGLE extend each candidate sequence one token at a time. Recent work has turned to parallel drafters such as DFlash, which predict a whole block at once. Another approach uses n-gram retrieval to find an earlier occurrence of the current context suffix and copy the tokens that followed it directly into the draft. We introduce CoPyro, which feeds these copied tokens into a parallel drafter in place of masks. The drafter learns from context which tokens to keep and which to revise as it predicts the block in its usual forward pass. Across eight benchmarks on Qwen3-4B, CoPyro improves overall acceptance length for all four parallel drafters tested, with gains of 2.19-5.08% when trained on 100K samples. With DFlash trained on 710K samples, overall gains range from 1.08% to 2.00% across the tested model sizes and temperatures. Code generation benefits most in both settings. On Qwen3-8B, processing the proposals adds an average of 0.24 ms per decoding round in Transformers.
BibTeX
@misc{zheng2026copyro,
  author = {Hong-Kai Zheng and Piji Li},
  title = {{CoPyro: Feeding Copy Proposals to Parallel Drafters}},
  year = {2026},
  eprint = {2611.27217},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27217},
}
Figure