TL;DR
Generating long, high-resolution videos with diffusion models is painfully slow because self-attention scales quadratically with token count—meaning a portrait of someone quietly reading requires the same massive compute as a high-speed drone chase. DynamicRad fixes this by reading the text prompt before generation begins, guessing how much motion the scene needs, and dynamically pruning up to 87% of unnecessary attention links. The result is a 1.7× to 2.5× speedup on massive video models without turning fast-moving scenes into blurry soup.
What Problem Does This Paper Address?
Modern video generators (like Sora-style Diffusion Transformers) treat video as a giant 3D grid of spatiotemporal tokens. To keep a video coherent, tokens attend to one another across space and time. Because self-attention scales quadratically ($\mathcal{O}(N^2)$), doubling video length quadruples the attention compute. For a 241-frame 768p video, you are suddenly wrangling over 200,000 tokens.
Naturally, researchers want to make attention sparse by dropping connections that don't matter. In video, attention energy naturally decays with distance—nearby pixels in adjacent frames matter most. Existing solutions fall into two camps, each with a catch:
- Static masks (like Radial Attention) hard-code a local neighborhood pattern. GPUs love the predictability, but if a car speeds across the screen, rigid masks sever critical long-range connections.
- Dynamic routing adapts the mask on the fly based on the video's content, preserving quality, but searching for the right sparse pattern during inference adds heavy computational overhead.
How do you get the adaptivity of dynamic routing at the raw speed of static masks?
Methods
DynamicRad bridges static priors and dynamic selection by splitting the workload into an offline preparation phase and an ultra-lightweight online inference phase.
Here is what is under the hood:
- Parameterized Radial Candidate Set: Building on the idea that attention decays over time, the authors construct a candidate pool of token pairs. As temporal distance between frames grows, the spatial window narrows logarithmically. Crucially, they introduce a continuous long-range factor ($\lambda$) that periodically samples distant frames—acting like a strobe light to catch repetitive or fast long-range motion—before grouping tokens into GPU-friendly blocks.
- Dual-Mode Selection: Within that candidate pool, DynamicRad operates in one of two modes:
- Static-ratio mode (Speed-first): Deterministically samples a fixed percentage of pairs without looking at token values. Zero scoring overhead.
- Dynamic-threshold mode (Quality-first): Computes lightweight importance scores by averaging pre-softmax attention logits across just two attention heads, keeping only connections that clear a normalized threshold.
- Offline Bayesian Optimization (BO) & Semantic Motion Router: Instead of tuning hyperparameters online, DynamicRad uses Bayesian Optimization offline on a lightweight proxy task (minimizing attention reconstruction MSE) in under 15 minutes. This builds a small lookup table of optimal sparsity settings for Low, Mid, and High motion regimes. At inference, a tiny 2-layer MLP—the Semantic Motion Router—reads the already-computed text prompt embedding in $<2\text{ms}$, predicts the motion intensity, and grabs the matching configuration.
- Optional Mask-Aware LoRA: For aggressive pruning, they offer an optional low-rank adapter fine-tuned specifically on the attention projection layers to smooth out any sparsity-induced temporal flicker, keeping the main diffusion backbone frozen.
Datasets
No new benchmarks were introduced. The authors used:
- OpenVid-1M: Subsets were used to train the Semantic Motion Router (20k video-text pairs labeled automatically with optical flow magnitudes via RAFT), to adapt long-context base checkpoints, and to fine-tune the optional Mask-Aware LoRA (1k steps).
- VBench & VisionReward: Standard evaluation suites used to measure subject consistency, aesthetic/imaging quality, and human-aligned visual preference.
Key Insights and Ideas
- Your prompt already knows the sparsity budget: Naive keyword heuristics fail on semantic nuances (e.g., "a fast snail" implies very little pixel movement despite the word "fast"). By training a tiny router on LLM/CLIP prompt embeddings supervised by real optical flow physics, DynamicRad predicts physical motion demands before a single denoising step occurs.
- Less attention can actually mean better long videos: In long-horizon generation, dense attention occasionally scores worse than DynamicRad's dynamic mode. Filtering out weak, distant token interactions appears to act like a denoiser, preventing irrelevant background clutter across hundreds of frames from corrupting the current frame.
Key Results
Tested on HunyuanVideo (120 and 241 frames) and Wan2.1-14B (72 and 145 frames) at 768p on H100 GPUs, DynamicRad delivers strong efficiency-quality trade-offs without retraining the backbone:
- 2.54× Speedup at High Sparsity: On 241-frame HunyuanVideo, Static mode hits 86.8% block sparsity, cutting generation time from 824s down to 324s (beating Radial Attention's 351s). On 145-frame Wan2.1-14B, Static mode achieves a 2.25× speedup (2289s vs. 5160s dense).
- Quality Matching (and Beating) Dense Baselines: Dynamic mode achieves 1.71×–2.18× speedups while preserving visual fidelity. On HunyuanVideo-241f, it scores 0.131 on VisionReward versus 0.122 for the checkpoint-matched dense baseline.
- Negligible Overhead: The router takes $<2\text{ms}$ once per video, and dynamic Q/K scoring adds just 1.71 ms per invocation. Adding optional Mask-Aware LoRA pushes VBench Subject Consistency up to 0.977 with only an 11-second latency bump on 241-frame videos.
Limitations and Future Work
The authors candidly note three boundary conditions:
- Extreme Fast Motion: In chaotic scenes like FPV drone racing, attention becomes highly dispersed across the entire frame, occasionally causing minor artifacts even in dynamic mode.
- Multi-Phase Prompts: Because the router assigns one global regime per text prompt, a video that starts dead-still and suddenly explodes into action gets stuck with a single compromise configuration.
- Hardware Tuning: Block sizes are tailored for server-grade H100s/A800s; consumer GPUs may require recalibrating the lookup table.
Future work aims to introduce frame-level dynamic routing (adapting to phase shifts mid-video) and extend the framework to image-to-video generation.
Summary updated