NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compact Attention: Exploiting Structured Spatio-Temporal Sparsity for Fast Video Generation

Qirui Li, Guangcong Zheng, Qi Zhao, Jie Li, Bin Dong, Yiwu Yao, Xi Li · DOI

Abstract

Generating high-resolution video with Transformers is computationally intensive due to the quadratic scaling of self-attention. We present Compact Attention, a training-free, hardware-aware framework designed to accelerate Video Diffusion Transformers (DiTs). By exploiting structured sparsity—predictable patterns such as local clusters and cross-shaped interactions—and employing adaptive 3D tiling with offline configuration search, our method achieves up to a 2.5× speedup in attention computation. Evaluations on state-of-the-art models like Wan2.1 and Hunyuan-video demonstrate significant efficiency gains with negligible impact on visual quality.

Introduction: The Computational Bottleneck

Modern video generation models, including Hunyuan-video and Wan2.1, rely on Video Diffusion Transformers (DiTs) to produce high-fidelity results. However, processing the 100,000+ tokens required for 720p HD video is extremely expensive. In these architectures, self-attention computation accounts for approximately 68–72% of the total generation time. Existing sparse attention methods often fail to account for the unique 3D spatio-temporal structure of video or introduce excessive management overhead that negates speed gains.

Structured Attention Patterns

A key insight of this work is that attention patterns in DiTs are highly structured and largely independent of the specific input prompt. Analysis reveals three dominant spatial patterns: Local (focusing on immediate neighborhoods), Cross-Shaped (focusing on horizontal and vertical axes), and Global (full connectivity).

Structured interpretation of attention patterns in video DiTs.

As shown in the figure above, while raw attention maps appear sparse, they follow predictable geometric structures. Recognizing these patterns allows for the design of efficient masks that capture essential interactions without the cost of full attention.

Proposed Method: Compact Attention

Compact Attention introduces three core innovations to leverage these structured patterns efficiently:

  1. Adaptive 3D Tiling: Rather than treating video as a 1D sequence, tokens are reorganized into 3D "spacetime tiles." This preserves spatial and temporal locality, making the sparsity patterns hardware-friendly for GPU kernels.
  2. Dual Attention Windows: The framework uses complementary window shapes (e.g., local blocks and cross-shaped corridors) to approximate the diverse interaction patterns observed across different attention heads.
  3. Offline Configuration Search: To eliminate the overhead of dynamic mask prediction, optimal sparse patterns are searched for offline. These patterns are stable across prompts and seeds, allowing them to be pre-computed and reused.
Adaptive 3D tiling improves attention recall by preserving spatial and temporal locality.

The 3D tiling approach (illustrated above) significantly reduces the number of active blocks needed to maintain high recall. By reordering tokens based on 3D proximity, the method achieves 95% recall with substantially fewer tokens compared to standard 1D flattening.

Key Results and Performance

Compact Attention was evaluated on the Wan2.1 (14B) and Hunyuan-video models. Key findings include:

  • Acceleration: Achieved 1.6× to 2.5× speedup in attention computation on NVIDIA H800 GPUs.
  • Efficiency: On the Hunyuan model, the method reached 62.36% sparsity while maintaining a PSNR of 30.08, outperforming baselines like Sparse VideoGen and SpargeAttn.
  • Temporal Scheduling: By applying full attention only during the critical initial ~15 denoising steps and switching to Compact Attention thereafter, the model maintains high visual fidelity without artifacts like "melting" or "warping."

Conclusion

Compact Attention demonstrates that the inherent structured sparsity of video data can be effectively exploited to accelerate high-resolution video generation. By moving from dynamic, unstructured sparsity to hardware-aware, pre-computed 3D patterns, it provides a practical path toward more efficient Video DiTs. Future work will explore context-aware search strategies to further refine performance for high-motion content.

Summary updated

BibTeX
@misc{li2025compact,
  author = {Qirui Li and Guangcong Zheng and Qi Zhao and Jie Li and Bin Dong and Yiwu Yao and Xi Li},
  title = {{Compact Attention: Exploiting Structured Spatio-Temporal Sparsity for Fast Video Generation}},
  year = {2025},
  eprint = {2508.12969},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.12969},
}
Figure