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

BlockPilot: 基于扩散的推测解码的实例自适应策略学习

BlockPilot: Instance-Adaptive Policy Learning for Diffusion-based Speculative Decoding

AMAP, Alibaba Group(阿里巴巴集团高德地图)

Hao Zhang, Yiming Hu, Yong Wang, Mingqiao Mo, Xin Xiao, Xiangxiang Chu

AI总结:

提出BlockPilot,通过实例自适应策略预测最优块大小,提升基于扩散的推测解码效率,在Qwen3-4B上实现4.20倍加速。

摘要:

推测解码通过使用轻量级草稿模型并行生成候选令牌,然后由目标模型验证,实现无损加速。最近,基于扩散的推测解码通过块级扩散每次前向传递生成多个令牌,进一步提高了并行性,达到了最先进的性能。然而,现有方法采用固定的推理块大小,并假设所有输入采用统一的解码策略。在本文中,我们证明这一假设是次优的,因为最优块大小在不同样本间变化,并对推测解码性能起关键作用。此外,这些值表现出清晰的局部结构,集中在训练块大小附近,从而将问题简化为低维且结构化的决策空间。基于这些见解,我们提出BlockPilot,一种样本自适应策略,从预填充表示中预测最优块大小。具体来说,我们将块大小选择形式化为一个轻量级策略学习问题,并提出一种实例自适应决策机制,基于预填充阶段的表示预测最优块大小。预测仅在预填充后执行一次,允许无缝集成。大量实验表明,我们的方法是即插即用的,引入极小的开销,并持续提高效率,在温度$T=1$下,Qwen3-4B的接受长度达到5.92,加速比达到4.20倍。

英文摘要:

Speculative decoding accelerates inference by using a lightweight draft model to generate candidate tokens in parallel, and are then verified by the target model, enabling lossless acceleration. Recently, diffusion-based speculative decoding further improves parallelism by generating multiple tokens per forward pass via block-level diffusion, achieving state-of-the-art (SOTA) performance. However, existing methods adopt a fixed inference block size and assume a uniform optimal decoding strategy across all inputs. In this paper, we show that this assumption is suboptimal, as the optimal block size varies across samples and plays a critical role in speculative decoding performance. Moreover, these values exhibit a clear local structure, concentrating around the training block size, which reduces the problem to a low-dimensional and structured decision space. Based on these insights, we propose BlockPilot, a sample-adaptive policy that predicts the optimal block size from the prefilling representation. Specifically, we formulate block size selection as a lightweight policy learning problem and propose an instance-adaptive decision mechanism that predicts the optimal block size based on the representation of the prefilling stage. The prediction is performed only once after prefilling, allowing for seamless integration. Extensive experiments demonstrate that our method is plug-and-play, introduces minimal overhead, and consistently improves efficiency, achieving an acceptance length of 5.92 and a 4.20$\times$ speedup on Qwen3-4B under temperature $T=1$.

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

↑