arXiv:2502.20704cs.AI2025-02ACL被引 10

让大模型生成更快:通过可控偏差实现速度与质量的灵活权衡

Fuzzy Speculative Decoding for a Tunable Accuracy-Runtime Tradeoff

  • 基于目标模型与草稿模型分布差异,动态决定是否采纳候选词
  • 相比传统方法快5词/秒以上,准确率仅下降约2%
  • 可无缝集成现有加速技术,支持用户按需调节速度与质量

推测解码(SD)要求候选词与目标模型分布严格一致,虽保证生成质量但限制了加速效果,且无法让用户以小幅误差换取更高速度。为此,我们提出模糊推测解码(FSD),通过允许目标模型与草稿模型分布间存在可控偏差,实现生成质量与推理速度的灵活权衡。在多个基准测试中,FSD在仅造成约2%绝对准确率下降的情况下,实现了超过5词/秒的运行时提升;在多数场景下,甚至能以超过2词/秒的速度优势达到与SD相当的准确率,表明分布等价并非维持性能的必要条件。此外,FSD可无缝集成至现有SD扩展中,我们将其应用于EAGLE-2,显著提升了该扩展效率,并引入可调的质量-速度权衡机制。

原文摘要 · Abstract (English)

Speculative Decoding (SD) enforces strict distributional equivalence to the target model when accepting candidate tokens. While it maintains the target model's generation quality, this strict equivalence limits the speedup achievable by SD and prevents users from trading deviations from the target distribution in exchange for further inference speed gains. To address these limitations, we introduce Fuzzy Speculative Decoding (FSD) - a decoding algorithm that generalizes SD by accepting candidate tokens based on the divergences between the target and draft model distributions. By allowing for controlled divergence from the target model, FSD enables users to flexibly trade generation quality for inference speed. Across several benchmarks, our method is able to achieve significant runtime improvements of over 5 tokens per second faster than SD at only an approximate 2% absolute reduction in benchmark accuracy. In many cases, FSD is even able to match SD benchmark accuracy at over 2 tokens per second faster, demonstrating that distributional equivalence is not necessary to maintain target model performance. Furthermore, FSD can be seamlessly integrated into existing SD extensions; we demonstrate this by applying FSD to EAGLE-2, greatly enhancing this existing extension's efficiency while allowing it to leverage FSD's tunable quality-speed trade-off.

推理加速生成质量模糊解码

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