Abstract
Diffusion Language Models (dLLMs) present a promising alternative to the dominant Autoregressive (AR) paradigm by enabling parallel sequence refinement. However, their adoption has been hindered by high computational costs and the lack of optimized inference infrastructure. This paper introduces dInfer, the first modular, high-performance inference framework specifically engineered for dLLMs. By integrating system-level optimizations with novel decoding algorithms, dInfer achieves a 10× speedup over existing dLLM systems and significantly outperforms state-of-the-art AR models like Qwen2.5 in throughput.
1. Introduction
The current landscape of Large Language Models (LLMs) is primarily defined by Autoregressive (AR) architectures. While highly effective, AR models generate text token-by-token, creating a sequential bottleneck that limits hardware utilization and increases latency for long sequences. Diffusion Language Models (dLLMs) offer a potential solution by refining entire sequences simultaneously through iterative denoising.
Despite their theoretical advantages, dLLMs face significant practical challenges:
- Computational Overhead: The iterative nature of denoising requires multiple passes, which can be computationally expensive.
- Decoding Complexity: Scaling parallel decoding often leads to a degradation in text quality due to local dependencies.
- Infrastructure Gap: While AR models benefit from mature inference engines like vLLM, dLLMs lack standardized, efficient frameworks. A key technical hurdle is the "KV-cache" mechanism; in dLLMs, bidirectional attention means any change in a token can invalidate the representations of the entire sequence, making traditional caching difficult.
To address these issues, we present dInfer, a framework designed to bridge the performance gap between diffusion and autoregressive inference.
2. The dInfer Framework
dInfer decomposes the dLLM inference pipeline into four modular components, each targeting a specific bottleneck.
2.1 Diffusion Iteration Manager
The framework introduces the Iteration Smoothing (IterSmooth) algorithm. In standard diffusion processes, "uncertain" tokens are often discarded between steps. IterSmooth instead fuses the probability distributions of these tokens into the embeddings for the subsequent step. This approach enriches the context and leads to more stable convergence.
2.2 Advanced Decoding Strategies
To improve both speed and quality, dInfer employs two novel strategies:
- Hierarchical Decoding: This method recursively partitions token spans to reduce local dependencies, allowing for more effective parallel generation.
- Credit Decoding: This strategy tracks the consistency of token predictions across iterations. By identifying tokens that "stabilize" early—even before reaching a high confidence threshold—the system can commit them faster, accelerating the overall process.
2.3 Vicinity KV-Cache Management
Addressing the bidirectional attention challenge, dInfer implements Vicinity KV-cache Refresh. Rather than updating the entire cache at every step, the system selectively refreshes a "window" around the current decoding block. This captures the most critical semantic influences while drastically reducing the overhead associated with full cache updates.
2.4 Runtime and System Optimizations
dInfer leverages several low-level optimizations to maximize GPU throughput:
- Parallelism: Support for Tensor Parallelism (TP) and Expert Parallelism (EP) allows the framework to scale across multiple GPUs.
- Kernel Optimization: Integration with PyTorch compilation and NVIDIA CUDA Graphs reduces CPU overhead.
- Loop Unrolling: This technique eliminates "bubbles" or idle gaps between GPU kernel launches, ensuring continuous hardware utilization.
Furthermore, the authors propose Trajectory Distillation (LLaDA-MoE-TD). This fine-tuning method trains the model to predict non-consecutive states in the diffusion process, effectively allowing it to "jump" through the trajectory and reduce the total number of required denoising steps.
3. Experimental Evaluation
The framework was rigorously tested across six benchmarks covering various domains:
- Code Generation: HumanEval, MBPP, and LiveCodeBenchv6 (LCB V6).
- Reasoning: CRUX-O (code reasoning) and GSM8K (mathematical reasoning).
- Instruction Following: IFEval.
3.1 Performance Results
The experimental results demonstrate the efficiency of dInfer:
- Throughput: On the HumanEval benchmark, dInfer achieved over 1,100 tokens per second (TPS) using a batch size of 1 on an 8× H800 GPU cluster.
- Comparison to AR Models: When compared to Qwen2.5-3B running on the vLLM engine, dInfer demonstrated a 2–3× speedup in tokens per second while maintaining competitive output quality.
- Comparison to dLLM Baselines: dInfer provided a 10× performance improvement over Fast-dLLM, the previous state-of-the-art for diffusion-based inference.
- Optimization Impact: System-level enhancements (compilation and CUDA graphs) contributed to an efficiency gain of over 200%.
4. Discussion and Limitations
While dInfer sets a new standard for dLLM inference, several areas for future research remain. Currently, the framework is optimized for LLaDA-MoE variants; expanding support to a broader range of dLLM architectures is a priority. Additionally, there is an inherent trade-off between the size of the parallel decoding span and semantic consistency; while dInfer's algorithms mitigate this, extreme parallelism can still impact quality. Finally, while performance on high-end H800 clusters is exceptional, optimizing for consumer-grade hardware is an ongoing challenge.
5. Conclusion
dInfer represents a significant milestone in making Diffusion Language Models a viable alternative to Autoregressive models for real-world applications. By combining algorithmic innovations like IterSmooth and Credit Decoding with robust system-level optimizations, dInfer proves that parallel sequence refinement can be both faster and more efficient than sequential generation.
The implementation is available as an open-source project at https://github.com/inclusionAI/dInfer.
Summary updated