SpargeAttention2 Boosts Diffusion Model Speed by 16x
- •SpargeAttention2 reaches 95% attention sparsity while maintaining high-fidelity generation quality
- •Hybrid masking combines Top-k and Top-p rules to prevent detail loss during generation
- •Video diffusion models achieve a 16.2x speedup in attention operations using the new method
Researchers from Tsinghua University have introduced SpargeAttention2, a novel method designed to drastically accelerate diffusion models—the technology powering high-end AI image and video generators. While previous attempts to speed up these models often resulted in a noticeable drop in visual quality, this new approach maintains high-fidelity results even when removing 95% of the computational workload associated with the attention mechanism.
The breakthrough lies in a "hybrid masking" strategy that identifies which parts of a text prompt or video frame are most important to the final output. By combining two different selection rules—one that picks a fixed number of top elements (Top-k) and another that picks elements based on a cumulative probability (Top-p)—the system becomes significantly more robust. This prevents the glitches typically seen in simpler models where the AI might ignore crucial details while trying to save time.
To further refine the model, the team employed Knowledge Distillation during the fine-tuning process. This technique acts like a master-apprentice relationship, where the efficient sparse model learns to mimic the precise outputs of a full-sized, uncompressed model. In practical tests on video diffusion systems, SpargeAttention2 delivered a staggering 16.2x speedup in attention calculations, paving the way for near-instantaneous, high-quality AI video generation on standard hardware.