用代理令牌压缩注意力计算,提升文本到图像视频生成效率
Qihoo-T2X: An Efficient Proxy-Tokenized Diffusion Transformer for Text-to-Any-Task
- 用窗口平均值生成少量代理令牌,替代全量令牌做全局注意力
- 在图像和视频生成中计算量降低49%至34%,性能仍具竞争力
- 适合追求高效扩散模型的开发者与部署场景
扩散变压器中的全局自注意力因视觉信息稀疏冗余而产生大量无效计算,且空间窗口内令牌的注意力图高度相似。为此,我们提出代理令牌化扩散变压器(PT-DiT),通过稀疏代表性令牌注意力(代表性令牌数量远少于总令牌数)高效建模全局视觉信息。具体而言,在每个变换器块中,从每个时空窗口计算一个平均令牌作为该区域的代理令牌,通过代理令牌间的自注意力捕捉全局语义,并通过交叉注意力注入所有潜在令牌。同时引入窗口与移位窗口注意力,弥补稀疏注意力对细节建模的不足。基于设计优良的PT-DiT,我们进一步构建了Qihoo-T2X系列模型,涵盖文本到图像(T2I)、文本到视频(T2V)及文本到多模态视频(T2MV)任务。实验表明,PT-DiT在图像与视频生成任务中均实现显著计算复杂度降低(如相比DiT减少49%,相比PixArt-α减少34%),同时保持良好性能。Qihoo-T2X的可视化结果与源代码已公开于 https://360cvgroup.github.io/Qihoo-T2X/。
原文摘要 · Abstract (English)
The global self-attention mechanism in diffusion transformers involves redundant computation due to the sparse and redundant nature of visual information, and the attention map of tokens within a spatial window shows significant similarity. To address this redundancy, we propose the Proxy-Tokenized Diffusion Transformer (PT-DiT), which employs sparse representative token attention (where the number of representative tokens is much smaller than the total number of tokens) to model global visual information efficiently. Specifically, within each transformer block, we compute an averaging token from each spatial-temporal window to serve as a proxy token for that region. The global semantics are captured through the self-attention of these proxy tokens and then injected into all latent tokens via cross-attention. Simultaneously, we introduce window and shift window attention to address the limitations in detail modeling caused by the sparse attention mechanism. Building on the well-designed PT-DiT, we further develop the Qihoo-T2X family, which includes a variety of models for T2I, T2V, and T2MV tasks. Experimental results show that PT-DiT achieves competitive performance while reducing the computational complexity in both image and video generation tasks (e.g., a 49% reduction compared to DiT and a 34% reduction compared to PixArt-$α$). The visual exhibition and source code of Qihoo-T2X is available at https://360cvgroup.github.io/Qihoo-T2X/.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。