mlsanityData to 14 Oct 2026

CopySpec: Accelerating LLMs with Speculative Copy-and-Paste Without Compromising Quality

arXiv 2502.08923 ↗First posted 13 Feb 2025cs.CL cs.AI cs.LGcited by 6

On the map: Efficient LLM inference and serving → Speculative decoding

Abstract (arXiv)

We introduce CopySpec, a simple yet effective technique to tackle the inefficiencies LLMs face when generating responses that closely resemble previous outputs or responses that can be verbatim extracted from context. CopySpec identifies repeated sequences in the model's chat history or context and speculates that the same tokens will follow, enabling seamless copying without compromising output quality and without requiring additional GPU memory. To evaluate the effectiveness of our approach, we conducted experiments using seven LLMs and five datasets: MT-Bench, CNN/DM, GSM8K, HumanEval, and our newly created dataset, MT-Redundant. MT-Redundant, introduced in this paper, transforms the second turn of MT-Bench into a request for variations of the first turn's answer, simulating real-world scenarios where users request modifications to prior responses. Our results demonstrate significant speed-ups: up to 2.35x on CNN/DM, 3.08x on the second turn of select MT-Redundant categories, and 2.66x on the third turn of GSM8K's self-correction tasks. Importantly, we show that CopySpec integrates seamlessly with speculative decoding, yielding an average 49% additional speed-up over speculative decoding for the second turn of MT-Redundant across all eight categories. While LLMs, even with speculative decoding, suffer from slower inference as context size grows, CopySpec leverages larger contexts to accelerate inference, making it a faster complementary solution. Our code and dataset are publicly available at https://github.com/RazvanDu/CopySpec.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Speculative decoding, one of 12 directions in Efficient LLM inference and serving. Builds on 34 of its 53 references that are in the map. First posted on arXiv 13 Feb 2025.

Builds on

34 of 53 references.

Closest ancestors · 12

Same direction, newest first

  1. 2024PLD+: Accelerating LLM inference by leveraging Language Model Artifacts2 Dec
  2. 2024SAM Decoding: Speculative Decoding via Suffix Automaton16 Nov
  3. 2024SpecHub: Provable Acceleration to Multi-Draft Speculative Decoding8 Nov
  4. 2024EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees24 Jun
  5. 2024Hardware-Aware Parallel Prompt Decoding for Memory-Efficient Acceleration of LLM Inference28 May
  6. 2024Break the Sequential Dependency of LLM Inference Using Lookahead Decoding3 Feb
  7. 2024EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty26 Jan
  8. 2024Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads19 Jan
  9. 2023REST: Retrieval-Based Speculative Decoding14 Nov
  10. 2023DistillSpec: Improving Speculative Decoding via Knowledge Distillation12 Oct
  11. 2023SpecInfer: Accelerating Generative Large Language Model Serving with Tree-based Speculative Inference and Verification16 May
  12. 2022Fast Inference from Transformers via Speculative Decoding30 Nov

Other references · 22

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  3. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  6. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  7. 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,292
  8. 2015Pointer Networkscited by 895
  9. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  10. 2022Efficient Training of Language Models to Fill in the Middlecited by 255
  11. 2016Incorporating Copying Mechanism in Sequence-to-Sequence Learningcited by 218
  12. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
10 more
  1. 2024CodeGemma: Open Code Models Based on Gemmacited by 150
  2. 2021How much do language models copy from their training data? Evaluating linguistic novelty in text generation using RAVENcited by 124
  3. 2023SPEED: Speculative Pipelined Execution for Efficient Decodingcited by 47
  4. 2024Turning Trash into Treasure: Accelerating Inference of Large Language Models with Token Recyclingcited by 47
  5. 2025MMDocIR: Benchmarking Multimodal Retrieval for Long Documentscited by 43
  6. 2023Predictive Pipelined Decoding: A Compute-Latency Trade-off for Exact LLM Decodingcited by 40
  7. 2024Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Taskscited by 25
  8. 2023FiLM: Fill-in Language Models for Any-Order Generationcited by 13
  9. 2024Adaptive Draft-Verification for Efficient Large Language Model Decodingcited by 9
  10. 2024Accelerating the inference of string generation-based chemical reaction models for industrial applicationscited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 3.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023The False Promise of Imitating Proprietary LLMs
  2. 2026Recovering Diversity Without Losing Alignment: A DPO Recipe for Post-Trained LLMs
  3. 2024Direct Alignment of Draft Model for Speculative Decoding with Chat-Fine-Tuned LLMs
  4. 2026RENDER: Controlling Reader-Facing Evidence in LLM Memory Evaluation
  5. 2026Test-Time Augmentation for LLMs: When Input Diversity Beats Output Diversity at Matched Compute
  6. 2024Evaluating Very Long-Term Conversational Memory of LLM Agents
  7. 2026Copy-as-Decode: Grammar-Constrained Parallel Prefill for LLM Editing
  8. 2024Rewriting Conversational Utterances with Instructed Large Language Models