arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.16714cs.CL
收藏

面向绿色文本生成:基于记忆的推测解码

Towards Green Text Generation: Memory-Based Speculative Decoding

Utrecht University(乌得勒支大学)

Antal van den Bosch

AI总结:

该研究提出基于记忆分类器的Olifant草稿模型,用于推测解码,在消费级硬件上可提升文本生成的吞吐量、降低能耗,为绿色文本生成提供了高效方案。

摘要:

推测解码通过让廉价草稿模型提出token,再由大型验证模型在单次前向传播中检查这些token,从而加速大型语言模型的文本生成。我们推出Olifant,这是一款基于记忆分类器构建的草稿模型,它在CPU上从4个token的窗口预测下一个token的时间不到0.3毫秒,无需GPU、反向传播或加速器内存。我们在消费级硬件上针对两种验证模型场景测量了吞吐量和能耗:在不使用KV缓存的情况下,草稿生成几乎无成本,与神经验证模型单独运行相比,领域匹配的Olifant模型在欧盟法律文本上的接受率达到38.1%,实现了2.43倍的吞吐量提升和每token能耗降低2.51倍;在使用KV缓存的验证模型(本身可节省约10倍能耗)的情况下,草稿生成的成本就会产生影响:TinyLlama草稿模型尽管接受率高,但会使吞吐量减半、能耗增至3倍,而Olifant仍能实现1.25倍的吞吐量提升,并成为该研究中能耗最低的(每100 token能耗93 J,比未缓存基准低14倍)。我们进一步表明,KV缓存使时间与能耗解耦:对更长草稿的验证会提高功耗,使能耗最优的草稿长度低于速度最优的长度。在快速验证模型的时代,只要草稿生成几乎无成本,推测解码就依然有效。

英文摘要:

Speculative decoding accelerates text generation with large language models by letting a cheap draft model propose tokens that a large verifier checks in a single forward pass. We introduce Olifant, a draft model built on a memory-based classifier. It predicts the next token from a four-token window in under 0.3 ms on CPU, requiring no GPU, no backpropagation, and no accelerator memory. We measure throughput and energy under two verifier regimes on consumer hardware. Without a KV cache, drafting is nearly free: a domain-matched Olifant model reaches 38.1% acceptance on EU legal text, delivering 2.43x throughput and 2.51x lower energy per token than the neural verifier model alone. With a KV-cached verifier, itself a ~10x energy saver, drafting costs matter: a TinyLlama draft model halves throughput and triples energy despite high acceptance, whereas Olifant still yields 1.25x throughput and the lowest energy in the study (93 J per 100 tokens, 14x below the uncached baseline). We further show that KV caching decouples time from energy: verification of longer drafts raises power draw, shifting the energy-optimal draft length below the speed-optimal one. Speculative decoding is not dead in the age of fast verifiers, provided drafting is nearly free.

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

↑