arXiv:2510.01336cs.CLcs.AI2025-10被引 2

用轻量级模型提前验证大模型生成,提速近两倍且不丢准确率。

HiSpec: Hierarchical Speculative Decoding for LLMs

  • 利用可提前退出的模型做中间验证,降低计算与内存开销。
  • 通过复用缓存和隐藏状态,使推理速度提升1.28倍,最高达2.01倍。
  • 适合追求高吞吐、低延迟的大模型部署场景,如实时对话系统。

推测解码通过小模型推测大模型将生成的词元,并由大模型验证。验证常成为瓶颈(例如,当3B模型为70B目标模型推测时,验证速度比生成慢4倍)。现有方法多关注加速推测,但中间验证仍存在训练开销大、内存占用高、依赖近似启发式规则导致准确率下降等问题。本文提出层级推测解码(HiSpec),利用可提前退出(EE)模型实现低开销中间验证。EE模型经过训练,可解释特定层隐藏状态,无需大幅增加计算与内存开销即可用于中间验证。为进一步提升资源效率,设计了复用键值缓存与隐藏状态的方法。为保证准确率,定期将中间验证通过的词元送至目标模型进行最终校验。在多种基准和模型上的评估显示,相比单层推测基线,HiSpec平均提升吞吐1.28倍,最高达2.01倍,且不损失准确性。

原文摘要 · Abstract (English)

Speculative decoding accelerates LLM inference by using a smaller draft model to speculate tokens that a larger target model verifies. Verification is often the bottleneck (e.g. verification is $4\times$ slower than token generation when a 3B model speculates for a 70B target model), but most prior works focus only on accelerating drafting. $\textit{``Intermediate"}$ verification reduces verification time by discarding inaccurate draft tokens early, but existing methods incur substantial training overheads in incorporating the intermediate verifier, increase the memory footprint to orchestrate the intermediate verification step, and compromise accuracy by relying on approximate heuristics. We propose $\underline{\textit{Hi}}\textit{erarchical }\underline{\textit{Spec}}\textit{ulative Decoding (HiSpec)}$, a framework for high-throughput speculative decoding that exploits $\textit{early-exit (EE) models}$ for low-overhead intermediate verification. EE models allow tokens to exit early by skipping layer traversal and are explicitly trained so that hidden states at selected layers can be interpreted, making them uniquely suited for intermediate verification without drastically increasing compute and memory overheads. To improve resource-efficiency even further, we design a methodology that enables HiSpec to re-use key-value caches and hidden states between the draft, intermediate verifier, and target models. To maintain accuracy, HiSpec periodically validates the draft tokens accepted by the intermediate verifier against the target model. Our evaluations using various representative benchmarks and models show that HiSpec improves throughput by 1.28$\times$ on average and by up to 2.01$\times$ compared to the baseline single-layer speculation without compromising accuracy.

大模型推理推测解码高效生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。