arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.16487cs.CLcs.LG
收藏

推测解码:利用推测执行加速序列到序列生成

Speculative Decoding: Exploiting Speculative Execution for Accelerating Seq2seq Generation

Peking University(北京大学);Microsoft Research Asia(微软亚洲研究院)

Heming Xia, Tao Ge, Peiyi Wang, Si-Qing Chen, Furu Wei, Zhifang Sui

AI总结:

本文提出推测解码SpecDec,通过Spec-Drafter高效起草和Spec-Verification可靠验证,在保持生成质量的同时将Transformer解码加速约5倍,并展示了额外实用优势。

摘要:

我们首次提出推测解码(SpecDec),正式研究利用推测执行思想来加速自回归(AR)解码。推测解码具有两项创新:Spec-Drafter——一个独立模型,专门针对高效且准确的草稿生成进行优化;以及Spec-Verification——一种在解码范式中高效验证草稿token的可靠方法。在包括机器翻译和抽象式摘要在内的多种序列到序列任务上的实验结果表明,我们的方法在流行的Transformer架构上可实现约5倍的加速,同时生成质量与束搜索解码相当,刷新了此前认为“先起草后验证”范式仅能带来1.4倍至2倍加速的印象。除了显著的加速效果外,我们还展示了SpecDec的3个额外优势,揭示了其在现实应用中加速生成模型的实用价值。我们的模型和代码可在https://github.com/hemingkx/SpecDec获取。

英文摘要:

We propose Speculative Decoding (SpecDec), for the first time ever, to formally study exploiting the idea of speculative execution to accelerate autoregressive (AR) decoding. Speculative Decoding has two innovations: Spec-Drafter -- an independent model specially optimized for efficient and accurate drafting -- and Spec-Verification -- a reliable method for verifying the drafted tokens efficiently in the decoding paradigm. Experimental results on various seq2seq tasks including machine translation and abstractive summarization show our approach can achieve around $5\times$ speedup for the popular Transformer architectures with comparable generation quality to beam search decoding, refreshing the impression that the draft-then-verify paradigm introduces only $1.4\times$$\sim$$2\times$ speedup. In addition to the remarkable speedup, we also demonstrate 3 additional advantages of SpecDec, revealing its practical value for accelerating generative models in real-world applications. Our models and codes are available at https://github.com/hemingkx/SpecDec.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑