TL;DR
Focus-dLLM is a novel, training-free attention sparsification framework that accelerates long-context inference for Diffusion Large Language Models (dLLMs). By predicting future unmasked token positions using past confidence scores and exploiting the cross-layer consistency of attention sinks, it achieves up to a 29.6× lossless speedup at a 32K context length.
What Problem Does This Paper Address?
While standard Large Language Models (LLMs) generate text autoregressively (token-by-token from left to right), Diffusion LLMs (dLLMs) generate text non-autoregressively by iteratively denoising an entire sequence at once. This allows dLLMs to update multiple token positions in parallel and leverage bidirectional attention, making them highly effective for long-context processing.
However, this bidirectional full attention comes with a massive computational bottleneck during inference, especially as context windows scale up to 32K tokens or more. Standard sparse attention techniques—which reduce computation by only looking at important tokens—don't work well here. Why? Because traditional sparse attention relies on using the currently decoded token as a query to find important key-value pairs. In a diffusion model, the positions of the tokens to be unmasked (decoded) in the next step are completely unknown in advance, leading prior methods to rely on inaccurate, coarse-grained estimations that degrade performance.
Methods
Focus-dLLM solves this challenge without any additional training by introducing two core components:
- Past Confidence-Guided Indicator (PCGI): The authors discovered that token confidence scores are highly correlated across adjacent denoising steps. PCGI leverages the confidence scores from step $t-1$ to accurately predict which masked positions are highly likely to be unmasked at step $t$. It then applies a local "window expansion" around these predicted positions to maintain semantic coherence, forming an active query set.
- Sink-Aware Sparse Attention: Attention sinks (tokens, often at the beginning of a sequence, that capture disproportionately high attention scores) are vital for maintaining model accuracy. Focus-dLLM identifies these sinks at an intermediate "probe" layer ($l_{dense}$). Crucially, because these attention sinks show strong consistency across different layers, the framework reuses these identified sink locations for all deeper layers, eliminating redundant re-calculation. Finally, it applies block-wise token pruning to the prompt context to discard irrelevant history.
Datasets
The authors evaluated Focus-dLLM across two representative long-context diffusion models: UltraLLaDA and Dream-7B-Instruct.
- LongBench: A comprehensive multi-task benchmark for long-context understanding (including tasks like single/multi-doc QA, summarization, few-shot learning, synthetic tasks, and code analysis).
- GSM8K: Used during the initial motivation analysis to study confidence dynamics.
Key Insights and Ideas
- Confidence is Predictable: A key "aha" moment in the paper is that tokens destined to be unmasked at step $t$ already exhibit high confidence at step $t-1$. Selecting the top-4 highest confidence tokens from the previous step yields a remarkable 96.1% average recall in predicting the next unmasked tokens.
- Attention Sinks are Layer-Agnostic: While attention sinks evolve dynamically across different denoising steps, their spatial positions remain highly stable across different transformer layers within the same step. This allows the model to look for sinks once at an intermediate layer and safely skip the search in deeper layers.
Key Results
Focus-dLLM delivers substantial efficiency gains over vanilla inference and state-of-the-art baselines like Fast-dLLM, SparseD, and Sparse-dLLM, without sacrificing accuracy:
- Massive Speedups: At a 32K context length, Focus-dLLM achieves a 29.6× speedup on UltraLLaDA and a 27.6× speedup on Dream-7B-Instruct compared to vanilla dense inference. It also outperforms the strong Fast-dLLM baseline by up to 2.05×.
- Lossless Accuracy: On LongBench, Focus-dLLM achieves an average score of 45.14 on UltraLLaDA, actually outperforming the Vanilla baseline (44.90) and all other acceleration frameworks.
- Needle-in-a-Haystack (Niah) Robustness: In retrieval tests across various layer depths up to a 32K context length, Focus-dLLM maintains high accuracy, proving that its context pruning does not discard critical information.
Limitations and Future Work
While Focus-dLLM excels at text-based long-context tasks, the authors note a few limitations:
- Text-Only Focus: The framework has not yet been extended or tested on multimodal reasoning tasks (e.g., interleaved text and images).
- Manual Hyperparameters: Key parameters such as the sparsity ratio ($\alpha$) and window size ($w$) are currently manually configured. Developing a fully adaptive mechanism that dynamically tunes these parameters based on the input context remains an open direction for future research.
Summary updated