快速且准确的因果并行解码使用雅可比强迫
Fast and Accurate Causal Parallel Decoding using Jacobi Forcing
AI总结:
本文提出雅可比强迫方法,通过渐进蒸馏将AR模型转化为高效的并行解码器,实现3.8倍的速度提升并保持性能,同时引入多块解码与拒绝回收进一步提升效率。
摘要:
多令牌生成已成为加速基于变换器的大型模型推理的一种有希望的范式。最近的努力主要探索扩散大语言模型(dLLMs)进行并行解码以减少推理延迟。为了实现AR级别的生成质量,许多技术将AR模型适应到dLLMs中,以启用并行解码。然而,它们受到限制的速度提升相比AR模型,由于预训练到后训练的不匹配。具体来说,后训练中的遮蔽数据分布与预训练期间看到的真实世界数据分布有显著差异,并且dLLMs依赖于双向注意力,这与预训练期间学习的因果先验相冲突,并阻碍了精确KV缓存重用的整合。为了解决这个问题,我们引入了雅可比强迫,一种渐进蒸馏范式,其中模型在其自己生成的并行解码轨迹上进行训练,平滑地将AR模型转变为高效的并行解码器,同时保持其预训练的因果推理属性。在该范式下训练的模型,即雅可比强迫模型,在编码和数学基准上实现了3.8倍的时钟速度提升,同时性能损失极小。基于雅可比强迫模型的轨迹特征,我们引入了多块解码与拒绝回收,这使得每个迭代的令牌接受计数可高达4.5倍,几乎4.0倍的时钟速度提升,有效地用额外的计算换取更低的推理延迟。我们的代码可在https://github.com/hao-ai-lab/JacobiForcing上获得。
英文摘要:
Multi-token generation has emerged as a promising paradigm for accelerating transformer-based large model inference. Recent efforts primarily explore diffusion Large Language Models (dLLMs) for parallel decoding to reduce inference latency. To achieve AR-level generation quality, many techniques adapt AR models into dLLMs to enable parallel decoding. However, they suffer from limited speedup compared to AR models due to a pretrain-to-posttrain mismatch. Specifically, the masked data distribution in post-training deviates significantly from the real-world data distribution seen during pretraining, and dLLMs rely on bidirectional attention, which conflicts with the causal prior learned during pretraining and hinders the integration of exact KV cache reuse. To address this, we introduce Jacobi Forcing, a progressive distillation paradigm where models are trained on their own generated parallel decoding trajectories, smoothly shifting AR models into efficient parallel decoders while preserving their pretrained causal inference property. The models trained under this paradigm, Jacobi Forcing Model, achieves 3.8x wall-clock speedup on coding and math benchmarks with minimal loss in performance. Based on Jacobi Forcing Models' trajectory characteristics, we introduce multi-block decoding with rejection recycling, which enables up to 4.5x higher token acceptance count per iteration and nearly 4.0x wall-clock speedup, effectively trading additional compute for lower inference latency. Our code is available at https://github.com/hao-ai-lab/JacobiForcing.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。