Faster Video Diffusion with Trainable Sparse Attention

Peiyuan Zhang, Yongqi Chen, Haofeng Huang, Will Lin, Zhengzhong Liu, Ion Stoica, Eric P. Xing, Hao ZhangNeurIPS 2025

Abstract

Video Diffusion Transformers (DiTs) are the current state-of-the-art for high-fidelity video generation, yet they suffer from extreme computational costs due to the quadratic scaling of 3D attention. This paper introduces Video Sparse Attention (VSA), a trainable, hardware-efficient sparse attention mechanism designed to replace full attention during both training and inference. VSA reduces training FLOPS by 2.53x and nearly halves inference latency on large-scale models like Wan-14B, all while maintaining competitive video quality.

Introduction: The Quadratic Bottleneck in Video Generation

Modern generative video models, such as Sora and Wan, represent videos as flattened sequences of 3D spatial-temporal tokens. For a standard 5-second video, these sequences can exceed 100,000 tokens. Standard attention mechanisms require computing a relationship between every pair of tokens, leading to a computational cost that grows quadratically with sequence length. Consequently, the vast majority of compute in DiTs is consumed by attention operations.

While it is well-known that attention matrices in these models are naturally sparse—meaning most tokens only interact with a small subset of "critical" tokens—existing sparse attention methods are often applied post-hoc. These methods train with full attention and only introduce sparsity during inference, which fails to reduce training costs and often leads to quality degradation due to the train-test mismatch. VSA addresses this by providing a native, differentiable sparse attention framework that learns optimal sparsity patterns from scratch.

Video Sparse Attention (VSA) Architecture

VSA employs a hierarchical, two-stage attention mechanism that is fully differentiable and optimized for modern GPU architectures. The process is divided into a coarse stage for global context and a fine stage for detailed token-level interactions.

Overview of the VSA architecture, illustrating the hierarchical coarse-to-fine attention mechanism and the 3D cube partitioning strategy.

Coarse Stage: Predicting Critical Tokens

In the coarse stage, tokens are pooled into 3D cubes (e.g., 4x4x4 tokens). VSA computes a lightweight, dense attention matrix on these pooled cubes. This captures the global context of the video and allows the model to identify the Top-$K$ most important ("critical") cubes for any given query. Unlike heuristic-based methods, this selection is learned and dynamic.

Fine Stage: Token-Level Attention

Once the critical cubes are identified, standard token-level attention is computed, but only within the selected Top-$K$ cubes. This drastically reduces the number of token-to-token comparisons. The outputs from both the coarse and fine stages are then merged using a learned, differentiable gate, ensuring that global context is preserved while focusing compute on high-resolution details.

Hardware-Aware Co-Design

A key innovation of VSA is its alignment with GPU memory layouts. The 4x4x4 token cubes map directly to 64x64 kernel-level tiles. By using optimized block-sparse attention kernels (implemented via ThunderKittens), VSA avoids the memory fragmentation and overhead typically associated with unstructured sparsity, achieving high wall-clock speedups.

Experimental Results

The authors evaluated VSA across various scales, from 60M to 1.4B parameters, using the Vchitect-T2V-Dataverse dataset for pretraining and Wan-14B for sparse adaptation finetuning.

Performance benchmarks comparing VSA to full attention across training steps, Pareto frontiers, and sequence lengths.

Efficiency and Scaling

VSA consistently matches the diffusion loss of full-attention models while requiring significantly fewer resources. Key metrics include:

  • Training Efficiency: A 2.53x reduction in total training FLOPS and an 8x reduction in attention-specific FLOPS.
  • Hardware Utilization: The custom VSA kernel sustains 85% of FlashAttention-3's Model FLOPs Utilization (MFU), translating theoretical gains into real-world performance.
  • Inference Speedup: For the Wan-1.3B model, VSA reduced end-to-end generation time from 31s to 18s. For the 14B parameter model, generation time was slashed from 1274s to 576s.

Compatibility with Distillation

VSA is the first sparse attention method shown to be compatible with diffusion distillation techniques like DMD2. By combining VSA with distillation ("Sparse-Distill"), the authors achieved a 50.9x speedup on Wan-1.3B, enabling the generation of a 5-second video in approximately 5 seconds on a single H200 GPU.

Conclusion and Future Work

VSA demonstrates that learned, hardware-aligned sparsity is a viable path toward scaling video DiTs. By moving away from fixed heuristics and post-hoc masking, VSA provides a robust framework for both efficient training and high-speed inference.

However, some limitations remain. The current implementation requires input dimensions to be divisible by the cube size (4x4x4), and predicting the optimal sparsity level ($K$) for new model architectures remains an open research question. Future work will focus on integrating these sparsity parameters into formal scaling laws and further optimizing the coarse-stage overhead through kernel fusion.

Summary updated

BibTeX
@inproceedings{zhang2025faster,
  author = {Peiyuan Zhang and Yongqi Chen and Haofeng Huang and Will Lin and Zhengzhong Liu and Ion Stoica and Eric P. Xing and Hao Zhang},
  title = {{Faster Video Diffusion with Trainable Sparse Attention}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=VrYCLQ5inI},
}
Figure