arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.16615cs.CV
收藏

用于高效扩散变压器的可训练对数线性稀疏注意力

Trainable Log-linear Sparse Attention for Efficient Diffusion Transformers

S-Lab, Nanyang Technological University(南洋理工大学S实验室);Wangxuan Institute of Computer Technology, Peking University(北京大学王萱计算机技术研究所)

Yifan Zhou, Zeqi Xiao, Tianyi Wei, Shuai Yang, Xingang Pan

AI总结:

研究针对扩散变压器二次自注意力成本限制长序列扩展问题,提出可训练的对数线性稀疏注意力机制LLSA,通过分层结构降低成本,经实验验证其能加速注意力推理和DiT训练,为高效训练长序列DiTs提供方向。

摘要:

扩散变压器(DiTs)在视觉生成方面处于领先地位,但其二次自注意力成本限制了对长令牌序列的扩展。近期的Top-K稀疏注意力方法虽有改进,但仍存在二次选择成本等问题。本文提出对数线性稀疏注意力(LLSA),利用分层结构将选择和注意力成本从二次降低到对数线性复杂度,介绍了分层Top-K选择等机制,开发了高性能GPU实现,实验表明其能加速注意力推理和DiT训练,同时保持生成质量。

英文摘要:

Diffusion Transformers (DiTs) set the state of the art in visual generation, yet their quadratic self-attention cost fundamentally limits scaling to long token sequences. Recent Top-K sparse attention approaches reduce the computation of DiTs by compressing tokens into block-wise representation and selecting a small set of relevant key blocks, but still suffer from (i) quadratic selection cost on compressed tokens and (ii) increasing K required to maintain model quality as sequences grow. We identify that their inefficiency is due to the single-level design, as a single coarse level is insufficient to represent the global structure. In this paper, we introduce Log-linear Sparse Attention (LLSA), a trainable sparse attention mechanism for extremely long token sequences that reduces both selection and attention costs from quadratic to log-linear complexity by utilizing a hierarchical structure. LLSA performs hierarchical Top-K selection, progressively adopting sparse Top-K selection with the indices found at the previous level, and introduces a Hierarchical KV Enrichment mechanism that preserves global context while using fewer tokens of different granularity during attention computation. To support efficient training, we develop a high-performance GPU implementation that uses only sparse indices for both the forward and backward passes, eliminating the need for dense attention masks. We evaluate LLSA on high-resolution pixel-space image generation without using patchification and VAE encoding. LLSA accelerates attention inference by 28.27x and DiT training by 6.09x on 256x256 pixel token sequences, while maintaining generation quality. The results demonstrate that LLSA offers a promising direction for training long-sequence DiTs efficiently. Code is available at: https://github.com/SingleZombie/LLSA

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑