Grouping First, Attending Smartly: Training-Free Acceleration for Diffusion Transformers

Sucheng Ren, Qihang Yu, Ju He, Alan Yuille, Liang-Chieh Chen
5/20/2025
cs.CV
diffusion-flowtransformer-attention

No confident code implementation found for this paper.

Abstract

Diffusion-based Transformers have demonstrated impressive generative capabilities, but their high computational costs hinder practical deployment, for example, generating an $8192\times 8192$ image can take over an hour on an A100 GPU. In this work, we propose GRAT (\textbf{GR}ouping first, \textbf{AT}tending smartly), a training-free attention acceleration strategy for fast image and video generation without compromising output quality.

Show full abstract

The key insight is to exploit the inherent sparsity in learned attention maps (which tend to be locally focused) in pretrained Diffusion Transformers and leverage better GPU parallelism. Specifically, GRAT first partitions contiguous tokens into non-overlapping groups, aligning both with GPU execution patterns and the local attention structures learned in pretrained generative Transformers. It then accelerates attention by having all query tokens within the same group share a common set of attendable key and value tokens. These key and value tokens are further restricted to structured regions, such as surrounding blocks or criss-cross regions, significantly reducing computational overhead (e.g., attaining a \textbf{35.8$\times$} speedup over full attention when generating $8192\times 8192$ images) while preserving essential attention patterns and long-range context. We validate GRAT on pretrained Flux and HunyuanVideo for image and video generation, respectively. In both cases, GRAT achieves substantially faster inference without any fine-tuning, while maintaining the performance of full attention. We hope GRAT will inspire future research on accelerating Diffusion Transformers for scalable visual generation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ren2025grouping,
  title  = {Grouping First, Attending Smartly: Training-Free Acceleration for Diffusion Transformers},
  author = {Sucheng Ren and Qihang Yu and Ju He and Alan Yuille and Liang-Chieh Chen},
  year   = {2025},
  eprint = {2505.14687},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.14687v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.14687.svg)](https://codeofpaper.com/paper/2505.14687)

Discussion