Gumiho通过分层设计提升生成早期词元的准确性,加速大模型推理。
Gumiho: A Hybrid Architecture to Prioritize Early Tokens in Speculative Decoding
- 早期词元用串行Transformer头,后期用并行轻量MLP头
- 实验表明比现有方法更快更准,尤其在长序列生成中优势明显
- 适合追求推理速度与精度平衡的LLM应用开发者
推测解码(SPD)旨在加速目标大语言模型(LLM)的自回归词元生成过程。部分方法使用具有多个头的草稿模型预测未来词元序列,每个头负责一个词元。目标LLM验证预测序列并接受匹配词元,实现高效多词元生成。然而,现有方法假设序列内所有词元重要性相同,采用统一头结构并依赖单步生成范式(串行或并行)。我们理论证明:草稿序列中的初始词元比后续词元更为关键。基于此洞察,提出Gumiho——一种融合串行与并行头的混合架构。具体而言,鉴于早期词元的重要性,采用复杂度更高的Transformer结构以串行方式处理前几个词元,提升准确率;对后期词元则使用多个轻量级MLP头并行处理,提高效率。通过将更复杂的模型结构和更长运行时间分配给早期头,Gumiho实现整体性能提升。实验结果表明,该方法优于现有方案,充分验证其有效性。
原文摘要 · Abstract (English)
Speculative decoding (SPD) aims to accelerate the auto-regressive token generation process of a target Large Language Model (LLM). Some approaches employ a draft model with multiple heads to predict a sequence of future tokens, where each head handles a token in the sequence. The target LLM verifies the predicted sequence and accepts aligned tokens, enabling efficient multi-token generation. However, existing methods assume that all tokens within a sequence are equally important, employing identical head structures and relying on a single-generation paradigm, either serial or parallel. To this end, we theoretically demonstrate that initial tokens in the draft sequence are more important than later ones. Building on this insight, we propose Gumiho, a hybrid model combining serial and parallel heads. Specifically, given the critical importance of early tokens, we employ a sophisticated Transformer architecture for the early draft heads in a serial configuration to improve accuracy. For later tokens, we utilize multiple lightweight MLP heads operating in parallel to enhance efficiency. By allocating more advanced model structures and longer running times to the early heads, Gumiho achieves improved overall performance. The experimental results demonstrate that our method outperforms existing approaches, fully validating its effectiveness.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。