BlockPilot: Instance-Adaptive Policy Learning for Diffusion-based Speculative Decoding
作者: Hao Zhang, Yiming Hu, Yong Wang, Mingqiao Mo, Xin Xiao, Xiangxiang Chu
分类: cs.CL
发布日期: 2026-06-30
备注: 16 pages
💡 一句话要点
提出BlockPilot以优化扩散基础的推测解码策略
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 推测解码 扩散模型 自适应策略 机器学习 自然语言处理 模型加速
📋 核心要点
- 现有的推测解码方法采用固定的推理块大小,未考虑不同输入的最优解码策略差异。
- 本文提出BlockPilot,通过实例自适应决策机制,根据预填充表示预测最优块大小,优化解码过程。
- 实验结果显示,BlockPilot在Qwen3-4B模型上实现了4.20倍的加速,接受长度达到5.92,显著提升了推理效率。
📝 摘要(中文)
推测解码通过使用轻量级草稿模型并行生成候选标记,从而加速推理,并由目标模型进行验证,实现无损加速。最近,基于扩散的推测解码通过块级扩散进一步提高了并行性,每次前向传递生成多个标记,达到了最先进的性能。然而,现有方法采用固定的推理块大小,并假设所有输入的解码策略均匀最优。本文表明这一假设并不理想,因为最优块大小因样本而异,并在推测解码性能中起着关键作用。基于这些见解,我们提出了BlockPilot,一种样本自适应策略,根据预填充表示预测最优块大小。实验表明,该方法可无缝集成,且效率显著提升。
🔬 方法详解
问题定义:本文解决的问题是现有推测解码方法中固定推理块大小导致的性能不足,未能考虑样本间的差异性。
核心思路:论文提出BlockPilot,通过分析样本的预填充表示,预测最优块大小,从而实现自适应解码策略,提升推理效率。
技术框架:整体架构包括预填充阶段和块大小预测阶段,首先进行预填充,然后利用实例自适应策略预测块大小,最后进行解码。
关键创新:最重要的创新在于提出了样本自适应的决策机制,能够根据输入样本的特征动态调整块大小,与传统固定块大小方法形成鲜明对比。
关键设计:在设计上,BlockPilot的预测过程仅在预填充后执行一次,减少了计算开销,且采用轻量级策略学习方法,确保了高效性。实验中验证了该方法的可插拔性和低开销特性。
🖼️ 关键图片
📊 实验亮点
实验结果表明,BlockPilot在Qwen3-4B模型上实现了4.20倍的速度提升,接受长度达到5.92,显示出其在推测解码中的显著优势,且与基线方法相比,效率提升明显。
🎯 应用场景
该研究在自然语言处理、机器翻译和对话系统等领域具有广泛的应用潜力。通过优化推测解码策略,BlockPilot能够显著提高模型的推理速度和效率,满足实时应用的需求,未来可能推动更复杂模型的实际应用。
📄 摘要(原文)
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$.