SparVAR:探索视觉自回归建模中的稀疏性以实现免训练加速
SparVAR: Exploring Sparsity in Visual AutoRegressive Modeling for Training-Free Acceleration
SparVAR 提出免训练的稀疏注意力机制,利用 VAR 模型中的注意力汇、跨尺度激活相似性和局部性,动态预测高分辨率尺度的稀疏模式,并实现高效块稀疏核,可将 8B 模型生成 1024x1024 图像的时间降至 1 秒,为视觉自回归生成模型提供通用加速方案。
原文依据 we present SparVAR, a training-free acceleration framework that exploits three properties of VAR attention
摘要译文
由模型翻译 · 术语统一 · 请对照原文核对关键结论视觉自回归(VAR)建模因其创新的下一尺度预测范式而备受关注。然而,主流 VAR 范式在每个自回归步骤中都会关注所有历史尺度上的全部 token。随着下一尺度分辨率的增长,注意力的计算复杂度随分辨率呈四次方增长,导致显著的延迟。先前的加速方法通常跳过的高分辨率尺度,这虽然加快了推理速度,但丢弃了高频细节并损害了图像质量。为了解决这些问题,我们提出了 SparVAR,一个免训练的加速框架,它利用了 VAR 注意力的三个特性:(i)强注意力汇,(ii)跨尺度激活相似性,以及(iii)显著的局部性。具体而言,我们从一个稀疏决策尺度动态预测后续高分辨率尺度的稀疏注意力模式,并通过高效的索引映射机制构建尺度自相似的稀疏注意力,从而在大尺度上实现高效的稀疏注意力计算。此外,我们提出了跨尺度局部稀疏注意力,并实现了一个高效的块稀疏核,其前向速度比 FlashAttention 快 5 倍以上。大量实验表明,所提出的 SparVAR 可以将一个生成 1024x1024 高分辨率图像的 8B 模型的生成时间减少到 1 秒,而无需跳过最后几个尺度。与使用 FlashAttention 加速的 VAR 基线相比,我们的方法在几乎保留所有高频细节的同时实现了 1.57 倍的加速。当与现有的尺度跳过策略结合时,SparVAR 可实现高达 2.28 倍的加速,同时保持有竞争力的视觉生成质量。
英文原文摘要 1716 字符
Visual AutoRegressive (VAR) modeling has garnered significant attention for its innovative next-scale prediction paradigm. However, mainstream VAR paradigms attend to all tokens across historical scales at each autoregressive step. As the next scale resolution grows, the computational complexity of attention increases quartically with resolution, causing substantial latency. Prior accelerations often skip high-resolution scales, which speeds up inference but discards high-frequency details and harms image quality. To address these problems, we present SparVAR, a training-free acceleration framework that exploits three properties of VAR attention: (i) strong attention sinks, (ii) cross-scale activation similarity, and (iii) pronounced locality. Specifically, we dynamically predict the sparse attention pattern of later high-resolution scales from a sparse decision scale, and construct scale self-similar sparse attention via an efficient index-mapping mechanism, enabling high-efficiency sparse attention computation at large scales. Furthermore, we propose cross-scale local sparse attention and implement an efficient block-wise sparse kernel, which achieves > 5xfaster forward speed than FlashAttention. Extensive experiments demonstrate that the proposed SparVAR can reduce the generation time of an 8B model producing 1024x1024 high-resolution images to the 1s, without skipping the last scales. Compared with the VAR baseline accelerated by FlashAttention, our method achieves a 1.57xspeed-up while preserving almost all high-frequency details. When combined with existing scale-skipping strategies, SparVAR attains up to a 2.28xacceleration, while maintaining competitive visual generation quality.