TL;DR
This paper introduces Dynamic Sliding Block (DSB) scheduling for diffusion large language models (dLLMs), a novel approach that dynamically adjusts block sizes during inference to better align with the semantic difficulty of the text. Combined with a specialized DSB Cache, this method significantly improves both generation quality and inference speed compared to existing fixed block scheduling techniques.
What Problem Does This Paper Address?
Diffusion large language models (dLLMs) offer parallel decoding capabilities, a significant advantage over traditional autoregressive models. However, to maintain natural language's causal structure and improve output quality, they often employ "block-diffusion inference." This involves processing text in fixed-size blocks. The problem is that these fixed blocks are rigid and don't account for the varying semantic difficulty of text. This can lead to inefficient decoding: forcing the model to commit to uncertain (low-confidence) tokens within a block while delaying easy-to-decode tokens just outside the block's boundary. This results in a suboptimal trade-off between generation quality and inference speed.
Methods
The core innovation is the Dynamic Sliding Block (DSB) scheduling. Unlike fixed blocks, DSB uses a block that slides and dynamically changes its size. The block's left boundary advances as masked positions within it are resolved, while the right boundary expands to include a minimum number of unmasked tokens, up to a maximum size. This dynamic adjustment allows the model to adapt to the context and semantic difficulty, avoiding premature commitments to uncertain tokens and unmasking high-confidence tokens sooner.
To further enhance efficiency, the paper introduces DSB Cache. Standard KV-caching techniques struggle with DSB's dynamic block movement because newly exposed positions might have unstable KV states. DSB Cache addresses this by maintaining a "prefix window" immediately before the active block. This window is continuously refreshed along with the active block, stabilizing KV states and mitigating cache invalidation. Periodic global cache refreshes are also employed to amortize costs.
Datasets
The experiments were conducted on several benchmarks covering reasoning, code generation, and general tasks:
- GSM8K (5-shot)
- MATH (4-shot)
- HumanEval (0-shot)
- MBPP (3-shot)
- BBH (3-shot)
The models used were variants of LLaDA (LLaDA-8B-Instruct, LLaDA-1.5) and Dream (Dream-v0-Base-7B, Dream-v0-Instruct-7B). No new benchmarks were introduced.
Key Insights and Ideas
- Semantic Difficulty Matters: The paper strongly argues that fixed block schedules are a bottleneck because they ignore the varying semantic difficulty of text. Dynamically adapting to this difficulty is key for better performance.
- The "Premature Commitment" Problem: Forcing the model to decode low-confidence tokens within a block, while delaying high-confidence tokens just outside, is a significant source of errors and inefficiency.
- DSB Cache Solves a Cache Instability Problem: The dynamic nature of DSB creates challenges for traditional KV caching. The prefix window in DSB Cache is a clever solution to stabilize KV states during block movement.
- Trade-offs are Manageable: While increasing block size (Smax) can boost throughput, it can sometimes hurt accuracy. DSB offers a more balanced approach, and the choice of parameters (like Smax and lpmin) allows for tuning the quality-speed trade-off.
Key Results
- Improved Quality and Efficiency: DSB, especially when combined with DSB Cache, consistently improves both generation quality (accuracy) and inference speed (tokens per second, TPS) across various models and benchmarks.
- Significant Speedups: For instance, on GSM8K with LLaDA-8B-Instruct, DSB (greedy) achieved 78.54 accuracy and 51.03 TPS, a notable improvement over vanilla sampling. With DSB Cache, TPS could reach up to 99.61.
- Competitive Performance: DSB (const.) on HumanEval with LLaDA-8B-Instruct achieved 42.07 accuracy and 124.6 TPS, outperforming AdaBlock-dLLM by 2.44 accuracy points and 14.0 TPS.
- Robustness: DSB is shown to be more robust to the choice of initial block length (Sinit) compared to naive block scheduling.
Limitations and Future Work
- Model Architecture Sensitivity: The paper notes that the effect of maximum block length (Smax) can vary slightly across datasets and model architectures, suggesting that simpler DSB variants (Const. and Greedy) are more generally applicable.
- Inconsistency on Dream (without cache): DSB's performance on the Dream model without KV caching was somewhat inconsistent. However, with KV caching, DSB consistently showed superiority.
- Future Work: The authors suggest exploring further inference optimizations and training approaches that incorporate DSB-like schedules during pretraining or post-training to better align model behavior with dynamic block scheduling. They also explored a "suffix window" but found it less consistently beneficial than the prefix window.
Summary updated