TL;DR
Block-wise Diffusion Language Models (DLMs) offer a highly flexible, non-autoregressive alternative for text generation but are severely bottlenecked by memory-bound attention in long-context scenarios. Standard sparse attention techniques fail here due to a "KV Inflation" problem, where different queries in a block select mismatched key-value (KV) positions, exploding memory traffic. LoSA (Locality-aware Sparse Attention) solves this by identifying that most tokens remain stable across denoising steps, allowing the model to reuse cached attention results for stable tokens and apply sparse attention exclusively to active ones—yielding up to a 4.14× speedup with virtually no loss in accuracy.
What Problem Does This Paper Address?
While autoregressive large language models (LLMs) generate text token-by-token, block-wise Diffusion Language Models (DLMs) generate blocks of tokens iteratively through denoising, allowing tokens to be updated in any order. This flexibility is highly advantageous for complex reasoning tasks. However, during long-context generation, DLMs hit a massive wall: every token within a block must attend to the entire prefix KV cache at every single denoising step, making the process heavily memory-bound.
If you try to apply standard sparse attention algorithms (which select a small subset of KV positions per query to save memory), you run into the KV Inflation problem. Because different queries within the same block look at different parts of the prefix, the GPU must load the union of all selected KV positions across the entire block. This union quickly grows to encompass nearly the entire cache, completely erasing any expected speedups from sparsity.
Methods
The authors introduce LoSA, an elegant solution built on a key structural insight unique to diffusion decoding: Locality of Representation Changes. Between consecutive denoising steps, only a small fraction of tokens (e.g., those transitioning from a [MASK] state to an actual word) undergo significant updates. The authors categorize tokens into two groups:
- Active Tokens: Tokens whose hidden states change substantially between steps.
- Stable Tokens: Tokens whose representations remain nearly constant.
The LoSA Workflow:
- Locality Pruning: At each denoising step, LoSA calculates the Mean Squared Error (MSE) of the hidden states between the current and previous steps. It ranks the tokens and selects the top-$k$ most changed tokens as the Active set.
- Cache Reuse for Stable Tokens: For all stable tokens, LoSA completely skips the prefix attention computation and reuses the exact attention outputs and log-normalizers cached from the previous denoising step.
- Sparse Attention for Active Tokens: Standard sparse attention (specifically using the QUEST algorithm as the base selector) is applied only to the active tokens.
By drastically shrinking the number of queries participating in the sparse attention step, the union of loaded KV indices contracts significantly, bypassing the KV Inflation bottleneck.
Datasets
The authors evaluated LoSA across several prominent benchmarks using three block-wise diffusion models (Trado-8B-Instruct, Trado-4B-Instruct, and SDAR-8B-Instruct):
- LongBench: Used to evaluate long-context capabilities across tasks like HotPotQA, TriviaQA, NarrativeQA, Qasper, and MultiFieldQA.
- Commonsense Reasoning: HellaSwag, WinoGrande, and BoolQ were utilized to verify that the method does not degrade performance on shorter-context tasks.
Key Insights and Ideas
- Sparsity is a Union Problem in Blocks: In block-wise processing, optimizing attention for an individual query is a trap. Memory bandwidth is dictated by the collective footprint (the union) of what the entire block needs to load.
- Diffusion Has Temporal Stability: Unlike autoregressive models where the context shifts with every new token, diffusion models iteratively refine a static block. This creates a strong temporal locality where most of the block is "quiet" from one step to the next.
- The Accuracy Paradox: Naive sparse attention forces every token to look at an incomplete subset of the KV cache, degrading accuracy. LoSA actually improves accuracy because stable tokens retain the full, dense attention information inherited from their cached initialization step.
Key Results
- Substantial Accuracy Gains at High Sparsity: On LongBench with an aggressive retrieval budget of 128 tokens, LoSA outperformed naive QUEST sparse attention by +10.43 points on Trado-8B and +8.38 points on SDAR-8B, remaining remarkably close to the dense baseline.
- Reduced Attention Density: LoSA achieved an average of 1.54× lower KV-cache density (fewer tokens fetched from memory) compared to standard sparse attention across all configurations.
- Wall-Clock Speedups: On an NVIDIA RTX A6000 GPU, LoSA delivered up to a 4.14× attention speedup over dense attention. On newer architectures like the NVIDIA RTX 5090, it maintained a potent 3.67× speedup, proving that the memory-bound savings successfully transfer across hardware generations.
Limitations and Future Work
- Short-Context Diminishing Returns: For short sequences (<1K tokens), the KV Inflation problem isn't severe enough to dominate latency, meaning LoSA performs comparably to existing methods without unique advantages.
- Batch Size Constraints: The current implementation and evaluation focus strictly on a batch size of 1. Extending and optimizing LoSA for high-throughput batched serving systems (like vLLM) remains an open engineering challenge.
- Initialization Overhead: LoSA requires a full, dense attention pass on the very first denoising step of each block to populate the initial cache statistics, adding a minor fixed overhead.
Summary updated