arXiv:2505.21467cs.CL2025-05被引 73

让扩散语言模型推理快12倍,且不丢质量。

FlashDLM: Accelerating Diffusion Language Model Inference via Efficient KV Caching and Guided Diffusion

  • 用缓存技术复用稳定键值对,降低计算开销。
  • 引入轻量自回归模型指导去噪,减少迭代次数。
  • 无需训练即可提速,适合长文本生成场景。

扩散语言模型(DLM)具备并行生成和双向建模能力,相比自回归模型在序列建模上更具潜力。然而,当前先进模型(如 Dream 7B、LLaDA 8B)推理速度慢,因需多次全序列前向传播,导致高计算成本与延迟,尤其在长输入和长上下文场景下更明显。此外,并行生成引发词元不一致问题,现有采样策略在减少去噪步数时质量显著下降。本文提出两种无需训练的技术:一是 FreeCache,通过重用去噪步骤中的稳定键值投影实现高效缓存;二是 Guided Diffusion,利用轻量级预训练自回归模型监督词元解码,大幅减少总去噪迭代次数而不损失质量。我们在多个开源推理基准上进行评估,联合方法在各类任务中实现平均 12.14 倍端到端加速,精度几乎无损。首次使 DLM 推理延迟可媲美甚至优于广泛使用的自回归模型,为扩散语言模型拓展至更多应用场景铺平道路。

原文摘要 · Abstract (English)

Diffusion language models offer parallel token generation and inherent bidirectionality, promising more efficient and powerful sequence modeling compared to autoregressive approaches. However, state-of-the-art diffusion models (e.g., Dream 7B, LLaDA 8B) suffer from slow inference. While they match the quality of similarly sized autoregressive (AR) models (e.g., Qwen2.5 7B, Llama3 8B), their iterative denoising requires multiple full-sequence forward passes, resulting in high computational costs and latency, particularly for long input prompts and long-context scenarios. Furthermore, parallel token generation introduces token incoherence problems, and current sampling heuristics suffer from significant quality drops with decreasing denoising steps. We address these limitations with two training-free techniques. First, we propose FreeCache, a Key-Value (KV) approximation caching technique that reuses stable KV projections across denoising steps, effectively reducing the computational cost of DLM inference. Second, we introduce Guided Diffusion, a training-free method that uses a lightweight pretrained autoregressive model to supervise token unmasking, dramatically reducing the total number of denoising iterations without sacrificing quality. We conduct extensive evaluations on open-source reasoning benchmarks, and our combined methods deliver an average of 12.14x end-to-end speedup across various tasks with negligible accuracy degradation. For the first time, diffusion language models achieve a comparable and even faster latency as the widely adopted autoregressive models. Our work successfully paved the way for scaling up the diffusion language model to a broader scope of applications across different domains.

扩散模型语言模型推理加速KV缓存

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。