Bidirectional Sparse Attention for Faster Video Diffusion Training

Chenlu Zhan, Wen Li, Jun Zhang, chuyu shen, Hao Zhang

TL;DR

Training video generation models is brutally slow because every patch of video tries to pay attention to every other patch across space and time. Bidirectional Sparse Attention (BSA) cuts through this computational thicket by pruning redundant work on both sides of the attention equation—skipping repetitive queries while dynamically cherry-picking only the most relevant context. The result? Over a $6\times$ end-to-end training speedup on long video sequences with virtually no loss in visual quality.

What Problem Does This Paper Address?

Modern video generators rely on Diffusion Transformers (DiTs). When you feed a high-resolution video into a DiT, it gets chopped into tens or hundreds of thousands of 3D patches, or "tokens." Standard "full" attention forces every single token to compare itself against every other token—a quadratic cost that turns training on long videos into a multi-week slog.

Look closely at a video, though, and you'll notice two massive inefficiencies:

  1. Query-side redundancy: Neighboring patches—like two adjacent pieces of a static wall across consecutive frames—ask the exact same questions and get nearly identical attention updates. Computing them separately is wasted effort.
  2. Context (Key–Value) redundancy: An individual token rarely needs the entire video to figure out what it's doing; it only cares about a fraction of the scene, and that fraction changes depending on the layer and content.
Query-side redundancy across video frames, showing how BSA focuses computation on distinctive regions.

Most existing sparse attention methods only trim the context (Key–Value, or KV) side, or force every token to keep a fixed number of context blocks. BSA tackles both redundancies simultaneously—and crucially, makes the whole setup fast and trainable directly on GPUs.

Methods

BSA reimagines the attention layer through three main steps, backed by custom hardware-aware Triton kernels:

Figure 2: BSA pipeline. Spatiotemporal partitioning exposes local query redundancy. Selected queries attend to KV blocks that pass a per-query statistical threshold; token filling restores the full output layout. KV selection is a score-threshold test, not an iterative cumulative-probability rule.
  • 3D Query Sparsification & Token Filling: BSA divides the video latent space into small 3D spatiotemporal windows (e.g., $2\times2\times2$ tokens) and picks a center "representative" token. If a neighboring token looks too similar to the center (measured via cosine similarity), BSA skips its attention calculation. Afterward, token filling copies the center token’s attention update into the skipped spots. Unlike token merging—which physically shrinks the sequence—each skipped token keeps its own residual connection and MLP path, preserving the dense architecture around the attention block.
  • Statistical KV Selection: Instead of sorting all context blocks or training a separate neural router, BSA uses a fast, parameter-free statistical test. For each kept query block, it calculates the mean and standard deviation of coarse block-to-block attention scores, keeping only KV blocks that clear a threshold calibrated via Cantelli’s inequality.
  • Trainable Sparse Kernels & Sparsity Annealing: Skipping math on paper doesn't automatically make GPUs faster. The authors wrote custom forward and backward Triton kernels that process only selected pairs, using an inverted index map during backpropagation to accumulate gradients deterministically without slow atomicAdd bottlenecks. During training, BSA starts dense and gradually ramps up sparsity ("annealing") so the model adapts smoothly.

Datasets

  • Training: 300,000 videos from Vchitect T2V DataVerse, preprocessed with shot segmentation, temporal truncation, and automated captions generated by Tarsier2.
  • Evaluation: VBench, a standard benchmark suite measuring text consistency, background consistency, image quality, subject consistency, and an aggregate score (VBench-Total). No new datasets are introduced.

Key Insights and Ideas

  • Share the update, keep the identity: By filling skipped attention outputs rather than deleting tokens, gradients from skipped positions flow back and accumulate into the representative token, while residual paths still update every individual token's features. You get sequence-shortening speedups without losing spatial layout.
  • Beware the "FLOPs illusion": Papers often conflate theoretical FLOP reductions with actual wall-clock training speed. BSA separates them cleanly: a $\sim20\times$ drop in attention FLOPs yields a $17.79\times$ attention-operator speedup, which translates to a $6.20\times$ complete training-step speedup once you honestly account for data loading, MLPs, optimizer steps, and index bookkeeping.
  • Ease into sparsity: Jumping straight to 95% sparsity from step zero hurts final video quality. Gradually annealing sparsity lets the model's weights adjust to local output sharing, beating both fixed sparsity and abrupt warmup-then-jump schedules.

Key Results

Tested primarily on the Wan2.1-1.3B video diffusion backbone at a sequence length of 153,600 tokens (~95% joint interaction sparsity) on H100 GPUs:

  • End-to-End Training Speed: Complete optimization step time drops from 10.40 s to 1.68 s ($6.20\times$ faster), slashing a 50,000-step single-GPU budget from 144.4 GPU-hours down to 23.3 GPU-hours.
  • Operator Speed & FLOPs: Forward attention FLOPs drop roughly $20\times$ ($6.99\times 10^{13}$ to $3.49\times 10^{12}$), achieving a $17.79\times$ attention-operator speedup.
  • Visual Quality & Convergence: VBench-Total is 81.36 for BSA vs. 81.43 for full dense attention (with slight gains in four submetrics like subject and text consistency). Validation loss at 50k steps matches dense training within standard deviation ($0.212$ vs. $0.213$). At matched 95% sparsity, BSA outperforms sparse baselines like VSA (80.80, $9.83\times$ attn speedup) and VMoBA (78.90, $6.41\times$).
Figure 3: Qualitative examples from the original evaluation. Corresponding frames illustrate facial details, scene structure, textures, and motion under full attention and BSA. These selected examples complement the quantitative metrics rather than establishing lossless generation.

Limitations and Future Work

  • Fast motion and fine textures: Sharing a center token's attention output across a local window acts like a mild low-pass filter; quality preservation is less reliable when scenes contain rapid, fine-grained motion or tiny moving objects.
  • No hard guarantees on context size: Because KV selection uses an empirical score threshold rather than a strict top-$k$ cutoff, it doesn't guarantee an exact number of retained blocks or optimal probability mass preservation.
  • Amdahl's Law: With attention accelerated nearly $18\times$, non-attention components (MLPs, normalization, data movement) now cap end-to-end speedups at $6.2\times$.

Future work aims to develop content-adaptive token representatives to better handle rapid, intricate motion, alongside testing over longer training horizons.

Summary updated

BibTeX
@inproceedings{zhan2026bidirectional,
  author = {Chenlu Zhan and Wen Li and Jun Zhang and chuyu shen and Hao Zhang},
  title = {{Bidirectional Sparse Attention for Faster Video Diffusion Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Es6mFi84XA},
}
Figure