arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.01318cs.CL
收藏

利用推测采样加速大语言模型解码

Accelerating Large Language Model Decoding with Speculative Sampling

DeepMind(深度思维)

Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, John Jumper

摘要:

我们提出了推测采样,一种算法,用于加速Transformer解码,使多个令牌的生成,从每个Transformer调用。我们的算法依赖于这样的观察,即由更快但功能更弱的草稿模型生成的短延续的并行评分的延迟与从更大的目标模型中采样单个令牌的延迟相当。这是结合了一种新的修改拒绝采样方案,保留了硬件数值内的目标模型的分布。我们用Chinchilla(一个700亿参数的语言模型)对推测性采样进行基准测试,在分布式设置中实现了2- 2.5倍的解码加速,而不影响样本质量或对模型本身进行修改。

英文摘要:

We present speculative sampling, an algorithm for accelerating transformer decoding by enabling the generation of multiple tokens from each transformer call. Our algorithm relies on the observation that the latency of parallel scoring of short continuations, generated by a faster but less powerful draft model, is comparable to that of sampling a single token from the larger target model. This is combined with a novel modified rejection sampling scheme which preserves the distribution of the target model within hardware numerics. We benchmark speculative sampling with Chinchilla, a 70 billion parameter language model, achieving a 2-2.5x decoding speedup in a distributed setup, without compromising the sample quality or making modifications to the model itself.

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

↑