SLA2: Sparse-Linear Attention with Learnable Routing and Quantization-aware Training
Organizations: Tsinghua University · UC Berkeley
Abstract
Sparse-Linear Attention (SLA) combines sparse and linear attention to accelerate diffusion models and has shown strong performance in video generation. However, (i) SLA relies on a heuristic split that assigns computations to the sparse or linear branch based on attention-weight magnitude, which can be suboptimal. Additionally, (ii) after formally analyzing the attention error in SLA, we identify a mismatch between SLA and a direct decomposition into sparse and linear attention. We propose SLA2, which introduces (I) a learnable router that dynamically selects whether each attention computation should use sparse or linear attention, (II) a more faithful and direct sparse-linear attention formulation that uses a learnable ratio to combine the sparse and linear attention branches, and (III) a sparse + low-bit attention design, where low-bit attention is introduced via quantization-aware fine-tuning to reduce quantization error. Experiments show that on video diffusion models, SLA2 can achieve 97% attention sparsity and deliver an 18.6x attention speedup while preserving generation quality.
Figures & tables
| Model | Method | Quality | Efficiency | ||||||
| IQ | OC | AQ | MS | SC | VR | FLOPs | Sparsity | ||
| Wan2.1 -T2V -1.3B -480P | Full Attention | 63.67 | 20.27 | 64.41 | 98.95 | 95.40 | 0.1084 | 52.75T | 0% |
| VMoBA | 65.31 | 20.82 | 64.14 | 97.80 | 86.69 | 0.0936 | 5.28T | 90% | |
| VSA | 59.57 | 19.27 | 50.60 | 97.44 | 87.98 | -0.0881 | 5.40T | ||
| SLA | 63.10 | 20.88 | 64.34 | 97.90 | 92.54 | 0.0872 | 5.40T | ||
| SLA2 | 67.70 | 21.62 | 64.86 | 98.69 | 95.54 | 0.1093 | 5.51T | ||
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | IQ | OC | AQ | MS | SC | VR |
|---|---|---|---|---|---|---|
| Without | 64.05 | 20.66 | 61.79 | 94.71 | 91.37 | 0.1008 |
| With | 66.64 | 21.42 | 64.62 | 98.04 | 94.83 | 0.1039 |
| Method | Fine-tuning steps | IQ | OC | VR |
|---|---|---|---|---|
| Full Attention | 0 | 63.67 | 20.27 | 0.1084 |
| Full Attention | 500 | 65.79 | 21.10 | 0.1014 |
| SLA2 (90% sparsity) | 500 | 67.70 | 21.62 | 0.1093 |
Sparse Attention
Sparse attention reduces the token interactions computed by Transformers to lower the cost of long-context modeling and inference.
See all 240 papers