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

通过隐藏状态混合与梯度分离改进尾部增强的推测草稿生成

Improving Tail-Augmented Speculative Drafting with Hidden State Mixing and Gradient Detach

Yaniv Galron, Rabeeh Karimi Mahabadi, Maor Ashkenazi, Roger Waleffe, Talor Abramovich, Tiyasa Mitra, Yoav Miron, Dor Tsur, Sanjeev Satheesh, Jimmy Zhang, Jiaji … 展开作者

Yaniv Galron, Rabeeh Karimi Mahabadi, Maor Ashkenazi, Roger Waleffe, Talor Abramovich, Tiyasa Mitra, Yoav Miron, Dor Tsur, Sanjeev Satheesh, Jimmy Zhang, Jiaji Huang, Yonatan Geifman, Mostofa Patwary, Mohammad Shoeybi, Bita Rouhani, Ran Zilberstein

AI总结:

本研究提出隐藏状态混合(HSM)与隐藏状态梯度分离(HSGD)两种训练方法改进推测草稿生成,HSM可提升长草稿接受率且内存开销低,相关实现已公开。

摘要:

多令牌预测(MTP)模块和EAGLE风格草稿生成器通过复用目标模型的隐藏状态支持高效的推测解码。然而,它们的自回归使用引入了训练-推理不匹配问题:训练阶段提供来自主干网络或单个MTP步骤的隐藏状态序列,而推理阶段则关注目标模型前缀,随后是通过循环生成的MTP状态构成的增长尾部。EAGLE-3的训练时测试(TTT)在训练期间显式模拟此行为,但会以额外内存和专用注意力掩码为代价。我们提出两种仅训练的方法来改进自回归草稿生成:隐藏状态混合(HSM)在与同一预测目标对齐的主干网络和MTP隐藏状态中采样,使草稿生成器接触不同MTP步骤的状态混合,无需显式模拟推理;隐藏状态梯度分离(HSGD)是一种正则化方法,在保留前向计算的同时,随机阻断通过隐藏状态和嵌入路径的梯度。两种方法均不增加推理成本。在联合预训练后进行监督微调时,HSGD在草稿早期位置产生最高的接受率,而HSM在草稿后期表现最佳。这些接受率趋势表明,HSM适用于长草稿长度的服务,HSGD适用于短草稿长度的服务。此外,在四个Nemotron模型和DeepSeek-V4-Pro上,基于HSM的MTP增强(主干网络冻结)相比联合训练的MTP,平均接受长度提升最高达52.2%;对于EAGLE-3草稿生成器,HSM的接受率与TTT相当,在四步Qwen3-8B对比中,峰值预留训练内存降低48%。HSM的实现已在Megatron-LM和NVIDIA Model Optimizer中公开提供。

英文摘要:

Multi-token prediction (MTP) modules and EAGLE-style drafters support efficient speculative decoding by reusing target-model hidden states. Their autoregressive use, however, introduces a training-inference mismatch: training supplies sequences of hidden states from the backbone or a single MTP step, whereas inference attends to a target-model prefix followed by a growing tail of recurrently generated MTP states. EAGLE-3's training-time test (TTT) explicitly simulates this behavior during training, at the cost of additional memory and specialized attention masks. We introduce two training-only methods for improving autoregressive drafting. Hidden State Mixing (HSM) samples among backbone and MTP hidden states aligned to the same prediction target, exposing the drafter to mixtures of states from different MTP steps without explicitly simulating inference. Hidden State Gradient Detach (HSGD) is a regularization method that stochastically blocks gradients through hidden state and embedding pathways while preserving the forward computation. Neither method adds inference cost. In joint pretraining followed by supervised fine-tuning, HSGD yields the highest acceptance rates at early draft positions, while HSM performs best later in the draft. These acceptance rate trends favor HSM for long-draft-length serving and HSGD for short-draft-length serving. Furthermore, across four Nemotron models and DeepSeek-V4-Pro, HSM-based MTP boosting with a frozen backbone improves mean acceptance length by up to 52.2% over the co-trained MTP. For EAGLE-3 drafters, HSM offers competitive acceptance with TTT, with 48% lower peak reserved training memory in a four-step Qwen3-8B comparison. HSM implementations are publicly available in Megatron-LM and NVIDIA Model Optimizer.

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

↑