让扩散语言模型实现快速并行生成,推理速度提升超8倍。
dParallel: Learnable Parallel Decoding for dLLMs
- 通过强制确定性蒸馏,让模型更快达成掩码词的高置信度。
- 在GSM8K上将解码步数从256降至30,提速8.5倍。
- 适合追求低延迟生成的应用场景,如实时对话系统。
扩散大语言模型(dLLMs)因其并行生成能力与更低的推理延迟,成为自回归生成的有前景替代方案。然而,现有开源模型仍需接近词元长度的解码步骤才能保证性能,其并行潜力未被充分挖掘。为此,我们提出dParallel,一种简单有效的并行解码方法,可显著加速dLLMs的采样过程。我们发现,解码效率受限于掩码词的序列置信度收敛过程。基于此,提出核心策略:确定性强制蒸馏,即在保持原始采样轨迹的同时,强制模型更快速、并行地对掩码词达到高置信度。在多个基准测试中,dParallel大幅减少解码步数且不降低性能。应用于LLaDA-8B-Instruct模型时,在GSM8K上将解码步数从256降至30,实现8.5倍加速;在MBPP上从256步降至24步,提速10.5倍,准确率保持不变。代码已开源:https://github.com/czg1225/dParallel。
原文摘要 · Abstract (English)
Diffusion large language models (dLLMs) have recently drawn considerable attention within the research community as a promising alternative to autoregressive generation, offering parallel token prediction and lower inference latency. Yet, their parallel decoding potential remains largely underexplored, as existing open-source models still require nearly token-length decoding steps to ensure performance. To address this, we introduce dParallel, a simple and effective method that unlocks the inherent parallelism of dLLMs for fast sampling. We identify that the key bottleneck to parallel decoding arises from the sequential certainty convergence for masked tokens. Building on this insight, we introduce the core of our approach: certainty-forcing distillation, a novel training strategy that distills the model to follow its original sampling trajectories while enforcing it to achieve high certainty on masked tokens more rapidly and in parallel. Extensive experiments across various benchmarks demonstrate that our method can dramatically reduce the number of decoding steps while maintaining performance. When applied to the LLaDA-8B-Instruct model, dParallel reduces decoding steps from 256 to 30 on GSM8K, achieving an 8.5x speedup without performance degradation. On the MBPP benchmark, it cuts decoding steps from 256 to 24, resulting in a 10.5x speedup while maintaining accuracy. Our code is available at https://github.com/czg1225/dParallel
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。