H-Spec: Parallel Speculative Decoding Without a Drafter-Side KV Cache
作者: Weifan Jiang, Krishna Teja Chitty-Venkata, Megan Flynn, Reed Meyerson, Zhenting Qi, Tianyu Wu, Eldar Kurtic, Minlan Yu, Alexandre Marques
分类: cs.LG
发布日期: 2026-09-21
备注: 22 pages, 12 figures
💡 一句话要点
提出H-Spec以解决KV缓存开销问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 推测解码 KV缓存 并行推理 大型语言模型 高并发处理 内存优化 模型加速
📋 核心要点
- 现有的推测解码方法在高并发情况下,KV缓存的开销显著增加,影响推理效率。
- H-Spec通过混合目标上下文注入的方法,结合直接重用目标KV和最后输入位置的目标隐藏状态,消除了对单独KV缓存的需求。
- 在多个实验中,H-Spec在接受长度和延迟速度上均显著优于现有最佳基线,且在并发服务下表现出更高的吞吐量。
📝 摘要(中文)
论文提出了一种名为H-Spec的并行推测解码方法,旨在加速大型语言模型的推理过程。现有的推测解码方法在每个输入位置都需要使用单独的KV缓存,这导致了内存和KV写入的开销。H-Spec通过混合目标上下文注入的方法,避免了对单独KV缓存的需求,同时保持了推测质量。实验结果表明,H-Spec在多个目标模型和任务上,相较于最佳基线在平均接受长度上提升了5.0%至13.3%,并在单批次的延迟速度上提升了5.3%至12.6%。
🔬 方法详解
问题定义:论文要解决的问题是现有推测解码方法在高并发情况下的KV缓存开销问题。现有方法需要在每个输入位置使用单独的KV缓存,导致内存和写入开销随并发增加而增加。
核心思路:H-Spec的核心思路是通过混合目标上下文注入的方法,结合直接重用目标KV和最后输入位置的目标隐藏状态,避免了对单独KV缓存的需求,同时保持推测质量。
技术框架:H-Spec的整体架构包括两个主要模块:Mamba模块和注意力模块。Mamba模块使用投影的最后一个目标隐藏状态进行初始化,而注意力模块则在原地重用目标KV。
关键创新:H-Spec的关键创新在于其混合目标上下文注入方法,能够在不需要单独KV缓存的情况下,保持推测质量和并行性。这与现有方法的本质区别在于不再依赖于每个输入位置的KV缓存。
关键设计:H-Spec的设计中,Mamba模块和注意力模块的结合使得模型能够在保持高效性的同时,减少内存使用。具体的参数设置和损失函数设计在论文中进行了详细描述。
🖼️ 关键图片
📊 实验亮点
在实验中,H-Spec在多个目标模型和任务上,相较于最佳基线在平均接受长度上提升了5.0%至13.3%,并在单批次的延迟速度上提升了5.3%至12.6%。此外,在并发服务下,H-Spec表现出更高的吞吐量和更低的KV缓存利用率。
🎯 应用场景
H-Spec的研究成果在大型语言模型的推理加速方面具有广泛的应用潜力,尤其是在需要高并发处理的场景,如实时对话系统、在线翻译和智能客服等。该方法的高效性和低内存占用将推动更多实际应用的落地。
📄 摘要(原文)
Speculative decoding losslessly accelerates large language model inference by having a lightweight draft model predict future tokens for verification by the target model. Recent block diffusion drafters further reduce drafting latency by predicting multiple tokens in parallel. However, existing block drafters project target hidden states at every input position into a separate drafter-side KV cache, incurring per-request memory and KV-write overhead that grow with concurrency; directly reusing target KVs in place removes this cache but fails to sustain draft quality throughout the block. We propose a hybrid target-context injection method that complements direct target KV reuse with target hidden states only at the last input position, requiring no separate drafter-side KV cache. Building on this design, we propose H-Spec, a hybrid Mamba-attention parallel drafter that consumes the two target-context sources through complementary modules. Mamba modules are initialized with projected last-token target hidden states, while attention modules reuse target KVs in place. Despite its recurrent formulation, Mamba's parallel scan allows H-Spec to preserve block-parallel drafting. Across three target models and diverse tasks, H-Spec improves over the best baseline by 5.0--13.3% in mean accepted length and 5.3--12.6% in batch-size-1 inter-token latency speedup. Under concurrent serving, H-Spec consistently achieves higher throughput while maintaining lower KV cache utilization than baselines across evaluated concurrency levels.