Diffusion Language Models (DLMs) offer a compelling alternative to traditional autoregressive LLMs by generating blocks of tokens simultaneously through iterative denoising. However, this "any-order" generation introduces a severe bottleneck in long-context scenarios: memory-bound attention.
While sparse attention mitigates memory bottlenecks in autoregressive models (which process one query at a time), it fails in block-wise DLMs. Because the model processes a block of $B$ queries simultaneously, each query might attend to a different subset of the Key-Value (KV) cache. The hardware must load the union of all these subsets, a phenomenon known as KV Inflation. This causes memory access to balloon back to nearly the size of the full cache, erasing the speed benefits of sparsity.
Key Insight: Locality of Representation Changes
The authors of LoSA (Locality-aware Sparse Attention) identified a unique property in diffusion models to solve this bottleneck: Locality of Representation Changes.
During the iterative denoising process, diffusion is not uniform. Most tokens "settle" into their final representations early on (Stable tokens), while only a small fraction undergo significant hidden-state updates (Active tokens). Furthermore, this stability is layer-dependent, with early and late layers stabilizing faster than middle layers.
The LoSA Methodology
LoSA capitalizes on this insight to bypass KV Inflation through a three-step process:
- Locality Pruning: The model computes the Mean Squared Error (MSE) between the current and previous hidden states for each token in the block. It selects the top-$k$ tokens with the highest variance as "Active."
- Selective Sparse Attention: Sparse attention is executed only for the Active tokens. By drastically reducing the number of queries, LoSA minimizes the union of KV indices that must be fetched from memory.
- Cached Reuse: For the remaining Stable tokens, LoSA bypasses attention computation entirely. Instead, it reuses the attention outputs and log-normalizers cached from the previous denoising step.
Because the cache is populated by a full dense attention pass during the initial step of the block, Stable tokens benefit from dense accuracy rather than lossy sparse approximations.
Evaluation and Key Results
Evaluated on models like Trado-8B, Trado-4B, and SDAR-8B across LongBench, Commonsense Reasoning benchmarks, and TriviaQA, LoSA demonstrated exceptional performance:
- Massive Speedups: Achieved up to a 4.14× speedup over dense attention on NVIDIA RTX A6000 GPUs, and a 3.67× speedup on RTX 5090 GPUs.
- Superior Accuracy: Counter-intuitively, LoSA improves accuracy over standard sparse methods. At an aggressive sparsity budget of 128 KV positions, it outperformed the QUEST baseline by up to +9 points in average accuracy on LongBench.
- High Efficiency: Maintained an average of 1.54× lower attention density (the percentage of the KV cache loaded) compared to standard sparse attention.
Limitations and Future Directions
While highly effective for long-context generation, LoSA has a few limitations:
- Short-Context Overhead: For sequences under 1K tokens, the computational overhead of locality pruning and cache management can outweigh memory traffic savings.
- Initialization Cost: LoSA requires a full dense attention pass at the first denoising step of each block to populate the cache. While amortized over subsequent steps, it remains a fixed overhead.
- Batch Size Constraints: Current evaluations focus on a batch size of 1. Integrating LoSA into high-throughput serving engines (e.g., vLLM or TensorRT-LLM) remains an area for future engineering.
Summary updated