SEED: Self-Speculative Decoding via Implicit Encoder-Decoder
作者: Hankun Lin, Patrick Pynadath, Ruqi Zhang
分类: cs.CL, cs.LG
发布日期: 2026-09-29
备注: Accepted to NeurIPS 2026
🔗 代码/项目: GITHUB
💡 一句话要点
提出SEED以解决大语言模型推理速度与质量的权衡问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 自我推测解码 大语言模型 推理加速 上下文表示 自然语言处理
📋 核心要点
- 现有方法在大语言模型推理中面临草拟质量与计算成本之间的权衡,导致效率低下。
- SEED通过将编码和验证合并为一个步骤,重用已计算的深层上下文表示,从而实现高效草拟。
- 实验结果显示,SEED在多个基准上实现了显著加速,同时保持或提升了生成质量。
📝 摘要(中文)
自我推测解码通过从目标模型自身草拟令牌来加速大语言模型(LLM)推理,但在草拟质量与成本之间存在明显的权衡。早期退出方法通过在中间层终止计算来廉价生成草拟,但放弃了后续层提供的深层表示,从而导致草拟质量下降。多令牌预测通过从模型的最终隐藏状态发出令牌来保持草拟质量,但在每个草拟步骤都需要完整的前向传递。本文提出的自我推测编码器-解码器(SEED)方法,通过重用在验证过程中已计算的深层上下文表示,以低成本获得高质量草拟。实验表明,SEED在4B规模模型上实现了最高2.7倍的平均加速,超越了早期退出和多令牌预测基线,同时比现有最先进的EAGLE-3快28%,并保持或改善了标准自回归微调的生成质量。
🔬 方法详解
问题定义:本文旨在解决大语言模型推理中草拟质量与计算成本之间的矛盾。现有的早期退出方法虽然降低了计算成本,但牺牲了草拟质量,而多令牌预测则需要完整的前向传递,导致效率低下。
核心思路:SEED方法的核心在于将编码和验证过程合并,通过重用已计算的深层上下文表示,快速生成高质量草拟。这样设计的目的是在不牺牲质量的前提下,显著提高推理速度。
技术框架:SEED将标准的解码器-编码器结构重新解释为隐式编码器-解码器。前几层作为编码器构建深层上下文表示,最后几层作为解码器从中发出令牌。验证过程通过完整的编码器-解码器进行,已验证的前缀的上下文表示被缓存以供后续草拟使用。
关键创新:SEED的创新在于将验证与草拟过程合并,利用缓存的上下文表示进行快速草拟。这一设计与传统方法的本质区别在于,SEED避免了每次草拟都进行完整前向传递的需求。
关键设计:在实现中,SEED采用了轻量级解码器,能够自回归地草拟多个令牌,每个令牌都基于缓存的上下文表示和先前的草拟结果进行生成。
🖼️ 关键图片
📊 实验亮点
实验结果显示,SEED在4B规模模型上实现了最高2.7倍的平均加速,超越了早期退出和多令牌预测的基线,同时比现有最先进的EAGLE-3快28%。此外,SEED在生成质量上保持或提升了标准自回归微调的效果,展现出其优越的性能。
🎯 应用场景
SEED方法在自然语言处理、对话系统和文本生成等领域具有广泛的应用潜力。通过提高大语言模型的推理速度和生成质量,SEED能够为实时应用提供更高效的解决方案,推动智能助手和自动化内容生成的发展。
📄 摘要(原文)
Self-speculative decoding accelerates large language model (LLM) inference by drafting tokens from the target model itself, but faces a sharp tradeoff between the quality and cost of the draft. Early-exit methods produce drafts cheaply by terminating computation at intermediate layers, but forgo the deeper representations that later layers provide and thus suffer in draft quality. Multi-token prediction preserves draft quality by emitting from the model's final hidden states, but pays for a full forward pass to produce those states at every drafting step. We propose self-speculative encoder-decoder (SEED), a self-speculative method that obtains high-quality drafts cheaply by reusing the deep contextual representations already computed during verification. We reinterpret the standard decoder-only transformer as an implicit encoder-decoder: the first layers (encoder) build deep contextual representations, and the last few layers (decoder) emit tokens from them. Encoding and verification are merged into a single step: verification is performed by the full encoder-decoder, and the contextual representations of the verified prefix are cached for reuse during drafting. Drafting is therefore very fast: between verifications, the lightweight decoder drafts multiple tokens autoregressively, each conditioned on the cached representations and on preceding drafts. Experiments across multiple benchmarks show that SEED achieves up to 2.7$\times$ average speedup on 4B-scale models, outperforming both early-exit and MTP-style self-speculative baselines and running 28% faster than the state-of-the-art EAGLE-3, while preserving or even improving the generation quality of standard autoregressive fine-tuning. Code is available at https://github.com/lhk2004/SEED.