Abstract
Generating long-form content, such as minute-long videos and extended texts, is increasingly important for modern generative models. Block diffusion improves inference efficiency via KV caching and block-wise causal inference. However, in long-context settings, block diffusion still incurs substantial overhead from repeatedly computing attention over a growing KV cache. We identify an underexplored property: cross-step redundancy of attention within a block. We propose FlashBlock, a cached block-external attention mechanism that reuses stable attention output, reducing computation and KV cache access. Experiments demonstrate up to 1.44× higher token throughput and 1.6× reduction in attention time with negligible impact on generation quality.
Introduction
Diffusion models are the backbone of modern generative AI for text and video. To handle long sequences, researchers have adopted block diffusion, which generates content in chunks (blocks) using causal inference and KV caching. While this improves efficiency, the iterative nature of diffusion requires recomputing attention over the entire history of tokens at every denoising step. As the context window expands, this recomputation becomes a massive bottleneck for both compute and memory bandwidth.
Key Insights: The Cross-Step Redundancy Observation
The central discovery of this work is the phenomenon of cross-step redundancy. By analyzing attention heatmaps during the diffusion process, we observed a distinct behavior between two types of attention:
- Block-Internal Attention ($A_{in}$): Attention directed at tokens within the current active block. This fluctuates significantly as the model denoises the current segment.
- Block-External Attention ($A_{out}$): Attention directed at previously generated, frozen tokens.
As shown in Figure 1, $A_{out}$ remains remarkably stable across diffusion steps. Recomputing this component at every step is computationally wasteful.
Methods: The FlashBlock Architecture
FlashBlock exploits this stability by caching the results of block-external attention. The mechanism consists of three main technical pillars:
- Attention Decomposition: The total attention is split into internal and external parts.
- Caching and Reuse: At the first step of a block, the model computes and caches the block-external attention output ($A_{out}$) and its log-normalizer ($L_{out}$). In subsequent steps, these values are read from the cache instead of being recomputed.
- Log-Space Composition: The model recomputes only the internal attention and then mathematically merges it with the cached external attention in log-space, leveraging FlashAttention's streaming logic to ensure the final output remains accurate.
To handle potential instability in discrete diffusion models, FlashBlock uses a threshold ($\tau$) to trigger recomputation if token changes exceed a certain limit. Additionally, a lightweight LoRA-based "reuse-aware distillation" step ensures the student model remains aligned with the original dense-attention teacher.
Results and Discussion
FlashBlock delivers significant performance gains across different modalities:
- Text Generation: On the Trado-8B-Thinking model, throughput increased from 532 to 674 tokens/second (1.44× speedup) with negligible accuracy loss on math (GSM8K) and coding (HumanEval) benchmarks.
- Video Generation: On the LongLive-1.3B model, attention time was reduced by 1.6× (from 23.02s to 14.43s per step) while maintaining visual fidelity on VBench2.
- Synergy with Sparse Attention: FlashBlock is complementary to sparse attention methods. When paired with SparseD at 20% density, it recovered significant performance, improving GSM8K accuracy by +7.96% and HumanEval pass@1 by +9.76% compared to using SparseD alone.
Conclusion
FlashBlock addresses a critical efficiency bottleneck in long-context block diffusion. By identifying and exploiting cross-step redundancy, it provides a simple yet powerful caching mechanism that accelerates inference without compromising generation quality. Future work will focus on deeper kernel-level integration to further optimize memory access patterns.
Summary updated