EDiT: Efficient Diffusion Transformers with Linear Compressed Attention

Philipp Becker, Abhinav Mehrotra, Ruchika Chavhan, Malcolm Chadwick, Luca Morreale, Mehdi Noroozi, Alberto Gil C. P. Ramos, Sourav Bhattacharya

TL;DR

This paper introduces EDiT, a novel linear compressed attention mechanism for Diffusion Transformers (DiTs) that significantly speeds up image generation by reducing the computational cost of attention layers. They also propose MM-EDiT, a hybrid attention approach for multimodal DiTs, achieving substantial speedups with comparable image quality.

What Problem Does This Paper Address?

Diffusion Transformers (DiTs) have become the go-to architecture for state-of-the-art text-to-image generation, producing incredibly high-quality and photorealistic images. However, a major bottleneck is the quadratic scaling of the attention mechanism with the number of image tokens. This limitation severely hinders the generation of high-resolution images and makes deployment on resource-constrained devices challenging. Existing solutions like linear attention or token compression have had limitations, particularly when applied to DiTs or multimodal variants.

Methods

The core innovation is the Efficient Diffusion Transformer (EDiT), which tackles the attention bottleneck with a two-pronged approach:

  • ConvFusion for Queries: This novel function uses a multi-layer convolutional network to process query tokens. It effectively integrates local spatial information by reshaping tokens to match the image's 2D structure and applying 2D convolutions. This is inspired by prior work but unified into a single convolutional mapping.
  • Spatial Compressor for Keys and Values: This component uses a convolution-based spatial compression technique. It applies a depthwise convolution with a stride of 2 to aggregate local token information in keys and values, reducing their dimensionality by a factor of 4. This is integrated with linear attention, unlike previous KV compression methods used with standard attention.

For Multimodal DiTs (MM-DiTs), which handle both image and text prompts, they introduce MM-EDiT. This architecture employs a hybrid attention mechanism:

  • Linear Compressed Attention (EDiT): Used for computationally intensive image-to-image interactions.
  • Standard Scaled Dot-Product Attention: Used for prompt-to-image interactions, leveraging its power for text understanding.

This hybrid approach aims to balance efficiency with the expressiveness needed for multimodal tasks.

Datasets

  • Training: YE-POP dataset (a subset of Laion-POP) with approximately 480K images and alternative captions.
  • Evaluation: PixartEval30K dataset.

Key Insights and Ideas

  • Local Information is Key for Queries: The ConvFusion mechanism highlights that effectively processing queries by incorporating local spatial context is crucial for efficient and expressive attention.
  • Spatial Compression for Keys/Values Works with Linear Attention: Unlike prior work that used KV compression with standard attention, this paper shows its effectiveness when integrated with linear attention for further efficiency gains.
  • Hybrid Attention is Optimal for Multimodal Tasks: For MM-DiTs, a pure linear attention approach for all interactions can degrade quality. MM-EDiT's hybrid strategy, using linear attention for image-image and scaled dot-product for text-image, strikes a better balance.
  • Approximation for Normalization Works Well: Approximating the normalization term in MM-EDiT's hybrid attention by the ratio of token counts (N_image / (N_image + N_prompt)) leads to faster computation and even slightly better performance.

Key Results

  • EDiT: Achieves speedups of up to 2.5x on high-resolution images (2048x2048) compared to the base PixArt-Σ model, with comparable image quality. It outperforms prior linear attention methods (SANA-DiT, LinFusion-DiT) and KV compression approaches in terms of FID scores.
  • MM-EDiT: Distilled from Stable Diffusion 3.5-Medium, it achieves comparable image quality while significantly reducing latency. On a mobile chipset, EDiT was 38% faster than its base model, and MM-EDiT was 2.2x faster than SD-v3.5M at 4096x4096 resolution.
  • Latency: The latency improvements scale quadratically with image resolution, making EDiT and MM-EDiT particularly beneficial for high-resolution generation.

Limitations and Future Work

  • On-device MM-DiT Latency: While MM-EDiT is faster than its base model, its latency on mobile devices is still slightly higher than SANA-MM-DiT. This is attributed to the computationally expensive image-text QK interactions where token compression is not applied to image queries.
  • Future Work: The authors encourage research into alternative interaction strategies within hybrid attention for MM-DiTs to further optimize on-device performance. They also suggest exploring masking approaches for increased training efficiency in linear DiTs.

Summary updated

BibTeX
@inproceedings{becker2025edit,
  author = {Philipp Becker and Abhinav Mehrotra and Ruchika Chavhan and Malcolm Chadwick and Luca Morreale and Mehdi Noroozi and Alberto Gil C. P. Ramos and Sourav Bhattacharya},
  title = {{EDiT: Efficient Diffusion Transformers with Linear Compressed Attention}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure