SpecPV: Improving Self-Speculative Decoding for Long-Context Generation via Partial Verification

Zhendong Tan, Xingjun Zhang, Chaoyi Hu, Junjie Peng, Kun Xia · OpenReview

Abstract

Growing demands from tasks like code generation, deep reasoning, and long-document understanding have made long-context generation a crucial capability for large language models (LLMs). Speculative decoding is one of the most direct and effective approaches for accelerating generation. It follows a draft-verify paradigm, where a lightweight draft model proposes several candidate tokens and the target model verifies them. However, we find that as the context length grows, verification becomes the dominant bottleneck. To further accelerate speculative decoding in long-context generation, we introduce SpecPV, a self-speculative decoding approach that performs fast verification using partial key-value states (KV) and periodically applies full verification to eliminate accumulated errors. We validate SpecPV across multiple long-context benchmarks and models, including LLaMA-3.1-8B-Instruct and Qwen3-series. Experimental results show that SpecPV achieves up to 6x decoding speedup over standard autoregressive decoding with minor degradation.

Introduction: The Verification Bottleneck

As Large Language Models (LLMs) evolve toward massive context windows (128K+ tokens), generating long responses becomes increasingly slow. A common acceleration technique is speculative decoding, where a small "draft" model predicts several tokens that a larger "target" model then verifies in parallel.

However, research reveals a critical limitation: as context length increases, the verification step becomes the primary bottleneck. In long-context scenarios, the target model must process a massive Key-Value (KV) cache, which can account for up to 80% of total decoding time. This overhead is particularly severe on consumer-grade hardware where GPU memory constraints force slow data transfers between the CPU and GPU.

Figure 1: Breakdown of decoding time showing that verification time grows significantly with context length, becoming the dominant overhead.

Methodology: Partial Verification (SpecPV)

To address this, we introduce SpecPV (Partial Verification). Instead of processing the entire KV cache for every verification step, SpecPV utilizes a sparse "Partial KV Cache" composed of four essential components:

  1. Sink Tokens: The initial tokens of a prompt, necessary for attention stability.
  2. Retrieval Tokens: Semantically relevant previous blocks selected via a scoring mechanism.
  3. Local Tokens: A sliding window of the most recent context.
  4. Spec Buffer: Temporary storage for tokens currently under verification.

Periodic Rectification

Because partial verification can lead to error accumulation (drift), SpecPV incorporates a Periodic Full Verification step. This "refresh" mechanism recalculates exact states, clears accumulated errors, and updates the retrieval tokens within the partial cache, ensuring high output quality while maintaining speed.

Figure 3: Overview of verification strategies: (a) standard full verification, (b) proposed partial verification, and (c) the integrated full verification with partial refresh.

Experimental Evaluation

SpecPV was evaluated across diverse long-context benchmarks, including LongBench v1 & v2, PG-19 (story continuation), and summarization tasks (GovReport, QMSum). The framework was tested on multiple model families, including LLaMA-3.1-8B and the Qwen3 series (4B to 14B).

Key Results

  • Significant Acceleration: SpecPV achieved up to a 6x speedup over standard autoregressive decoding and a 2x speedup over existing speculative methods like EAGLE-3 at 60K context lengths.
  • Quality Preservation: On summarization tasks, SpecPV maintained ROUGE-L scores remarkably close to full-cache generation. Even with a limited 4096-token partial budget, the model remained semantically accurate.
  • Hardware Efficiency: By keeping the Partial KV Cache on the GPU and offloading the Full KV Cache to System RAM, SpecPV minimizes slow PCIe data transfers, making it ideal for consumer hardware like the RTX 4090.

Conclusion and Future Work

SpecPV effectively mitigates the verification bottleneck in long-context LLM generation. While highly effective, the method shows some sensitivity to hyperparameters like cache budget and refresh intervals. Future work will focus on more sophisticated retrieval strategies to better capture fine-grained details during the partial verification phase without sacrificing the massive speed gains achieved.

Summary updated

BibTeX
@misc{tan2025specpv,
  author = {Zhendong Tan and Xingjun Zhang and Chaoyi Hu and Junjie Peng and Kun Xia},
  title = {{SpecPV: Improving Self-Speculative Decoding for Long-Context Generation via Partial Verification}},
  year = {2025},
  eprint = {2512.02337},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.02337},
}
Figure