arXiv:2506.03700cs.CL2025-06ICML被引 6

通过自适应中间层生成,提升大模型解码速度且不改变模型

AdaDecode: Accelerating LLM Decoding with Adaptive Layer Parallelism

  • 根据置信度动态在中间层生成令牌,提前启动后续计算
  • 实测最高提速1.73倍,解码吞吐量显著提升
  • 无需额外模型或参数修改,输出与标准解码一致

大语言模型在长文本生成任务中,解码效率成为关键瓶颈:自回归解码因逐个生成令牌而存在固有串行性,难以充分利用现代硬件的并行能力。现有方法如推测解码依赖辅助‘草稿’模型,增加内存开销;层跳过可能因缓存缺失导致输出偏差。本文提出AdaDecode,无需额外模型或修改原模型参数,即可加速解码并保证输出一致性。其核心思想是:当模型在某层达到足够置信度时,可准确预测多数令牌,此时提前生成并立即启动下个令牌计算。早期预测的剩余层计算被延迟,并与后续令牌并行执行,最大化硬件利用率,降低延迟。最终验证步骤确保早期预测结果与标准自回归解码一致。跨多种生成任务的实验表明,AdaDecode在保持输出一致性的同时,解码吞吐量持续提升,最高达1.73倍加速。

原文摘要 · Abstract (English)

Large language models (LLMs) are increasingly used for long-content generation (e.g., long Chain-of-Thought reasoning) where decoding efficiency becomes a critical bottleneck: Autoregressive decoding is inherently limited by its sequential token generation process, where each token must be generated before the next can be processed. This sequential dependency restricts the ability to fully leverage modern hardware's parallel processing capabilities. Existing methods like speculative decoding and layer skipping offer potential speedups but have notable drawbacks: speculative decoding relies on an auxiliary "drafter" model, which can be challenging to acquire and increases memory overhead, while layer skipping may introduce discrepancies in the outputs due to the missing key-value cache at skipped layers. In this work, we propose AdaDecode, which accelerates LLM decoding without requiring auxiliary models or changes to the original model parameters, while ensuring output consistency. AdaDecode leverages the insight that many tokens can accurately be generated at intermediate layers, as further layers often do not significantly alter predictions once the model reaches a certain confidence. By adaptively generating tokens at intermediate layers when confidence is high, AdaDecode enables the next token's computation to begin immediately. The remaining layer computations for early-predicted tokens are deferred and executed in parallel with subsequent tokens when needed, maximizing hardware utilization and reducing decoding latency. A final verification step ensures that early predictions match the results of standard autoregressive decoding, preserving output parity. Experiments across diverse generation tasks shows that AdaDecode consistently achieves superior decoding throughput with up to 1.73x speedup, while guaranteeing output parity with standard autoregressive decoding.

大模型推理加速解码自适应并行

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