arXiv:2410.18351cs.CLcs.LG2024-10被引 22

用熵值动态停止生成,让大模型推理更快更稳。

AdaEDL: Early Draft Stopping for Speculative Decoding of Large Language Models via an Entropy-based Lower Bound on Token Acceptance Probability

  • 根据生成词的概率熵估算接受率下界,动态决定何时停止草案生成。
  • 在多种场景下比固定长度方案快10%-57%,高温采样时仍稳定有效。
  • 无需训练,可直接接入现有大模型系统,适合追求高效推理的开发者。

推测解码是一种突破现代大语言模型自回归限制的高效技术,通过使用更快速的草稿模型生成候选词元,并行验证以提升平均推理速度,同时保持准确率。草稿长度是每轮生成的词元数量,通常作为静态超参数设定,依赖于词元接受率统计。但固定长度在草稿成本高、接受率方差大的情况下表现不佳。本文提出无训练、无参数的自适应熵基草稿长度(AdaEDL)方法,通过当前草稿输出概率分布的熵,近似估计词元接受率的下界,实现草稿生成过程的早期终止。实验表明,AdaEDL在多种设置和数据集上均比静态草稿长度方案提速10%-57%,优于其他无训练停止策略最高达10%。同时,在高采样温度场景下更具鲁棒性。由于无需训练,可无缝集成至各类预训练大模型系统中。

原文摘要 · Abstract (English)

Speculative decoding is a powerful technique that attempts to circumvent the autoregressive constraint of modern Large Language Models (LLMs). The aim of speculative decoding techniques is to improve the average inference time of a large, target model without sacrificing its accuracy, by using a more efficient draft model to propose draft tokens which are then verified in parallel. The number of draft tokens produced in each drafting round is referred to as the draft length and is often a static hyperparameter chosen based on the acceptance rate statistics of the draft tokens. However, setting a static draft length can negatively impact performance, especially in scenarios where drafting is expensive and there is a high variance in the number of tokens accepted. Adaptive Entropy-based Draft Length (AdaEDL) is a simple, training and parameter-free criteria which allows for early stopping of the token drafting process by approximating a lower bound on the expected acceptance probability of the drafted token based on the currently observed entropy of the drafted logits. We show that AdaEDL consistently outperforms static draft-length speculative decoding by 10%-57% as well as other training-free draft-stopping techniques by upto 10% in a variety of settings and datasets. At the same time, we show that AdaEDL is more robust than these techniques and preserves performance in high-sampling-temperature scenarios. Since it is training-free, in contrast to techniques that rely on the training of dataset-specific draft-stopping predictors, AdaEDL can seamlessly be integrated into a variety of pre-existing LLM systems.

推理加速推测解码动态控制大模型

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