arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.02337cs.LG
收藏

SpecPV:通过部分验证改进长上下文生成的自我推测解码

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

School of Computer Science and Technology, Xi'an Jiaotong University, Xi'an, China(计算机科学与技术学院,西安交通大学,西安,中国)

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

AI总结:

SpecPV通过部分验证和周期性完整验证提升长上下文生成效率,实现6倍解码加速

摘要:

随着代码生成、深度推理和长文档理解等任务的需求增长,长上下文生成已成为大型语言模型(LLMs)的关键能力。推测解码是加速生成最直接有效的方法之一。它遵循草案-验证范式,其中轻量级草案模型提出多个候选标记,目标模型进行验证。然而,我们发现随着上下文长度的增长,验证成为主要瓶颈。为了进一步加速长上下文生成中的推测解码,我们引入了SpecPV,一种自我推测解码方法,通过部分键值状态(KV)实现快速验证,并定期应用完整验证以消除累积误差。我们验证了SpecPV在多个长上下文基准和模型上的表现,包括LLaMA-3.1-8B-Instruct和Qwen3系列。实验结果表明,SpecPV在标准自回归解码上实现了高达6倍的解码加速,伴随轻微的降级。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑