面向扩散草稿投机解码的因子分解引导训练与推理

·

研究论文 · 2026/10/20

扩散草稿器通过并行生成候选令牌来加速大语言模型推理,但更高的平均接受令牌数(MAT)不一定带来更高吞吐量,因为验证只接受连续前缀,早期拒绝会使后续正确预测无效,且每轮延迟增加也会抵消MAT收益。本文提出DScout,利用两种互补的因子分解来指导扩散草稿器的训练和推理以提高吞吐量。训练时,DScout将位置损失分解为包含损失、加权损失和预测损失,指导混合视野训练、块内解掩码和接受加权损失的设计与组合,使监督与前缀接受对齐并提升MAT。推理时,DScout将吞吐量分解为MAT与每轮延迟之比,指导目标条件深度、草稿器深度和推理块大小的选择,为每个工作负载确定高吞吐配置。在六个基准上,DScout在Qwen3-4B和Qwen3-8B上分别实现3.84倍和4.14倍的平均加速,比最先进基线平均加速分别提升9.1%和7.1%。在不同模型和并发设置下,推理配置策略比DScout固定配置额外提供高达9.75%的平均加速。

该论文针对扩散草稿器投机解码中MAT与吞吐量不匹配的关键问题,提出了训练和推理的因子分解方法,显著提升了推理速度,并提供了可配置的推理策略,对加速大语言模型推理具有实际价值。

Speculative decoding accelerates large language model inference through parallel verification of tokens proposed by a drafter. Diffusion drafters further parallelize proposal generation, but greater proposal capacity or higher mean accepted tokens (MAT) need not yield higher throughput. Because verification accepts only a consecutive prefix, early rejections can render later correct predictions ineffective, limiting MAT gains, while even higher MAT may not improve throughput if per-round latency increases. We introduce DScout, which uses two complementary factorizations to guide diffusion drafter training and inference for higher throughput. For training, DScout factorizes position-wise loss into inclusion, weighting, and prediction loss. This guides the design and combination of mixed-horizon training, intra-block unmasking, and acceptance-weighted loss to align supervision with prefix acceptance and improve MAT. For inference, DScout factorizes throughput as the ratio of MAT to per-round latency, guiding target-conditioning depth, drafter depth, and inference block size selection to identify a high-throughput configuration for each workload. Across six benchmarks, DScout achieves 3.84times and 4.14times mean speedups over autoregressive decoding on Qwen3-4B and Qwen3-8B, respectively, improving mean speedup over the state-of-the-art baseline by 9.1% and 7.1%. Across models and concurrency settings, our inference configuration policy provides up to 9.75% additional mean speedup over DScout's fixed configuration.

阅读原文

参与讨论