Can We Achieve Efficient Diffusion Without Self-Attention? Distilling Self-Attention into Convolutions

Ziyi Dong, Chengxing Zhou, Weijian Deng, Pengxu Wei, Xiangyang Ji, Liang Lin

TL;DR

This paper proposes a novel convolutional module, △ConvBlock, that effectively replaces the computationally expensive self-attention mechanism in diffusion models. By analyzing diffusion models and finding that self-attention primarily operates locally, the authors demonstrate that their approach achieves comparable image generation quality with a significant reduction in computational cost and latency.

What Problem Does This Paper Address?

Diffusion models have revolutionized image generation, producing remarkably high-fidelity and coherent images. However, a major bottleneck is the computational cost, largely attributed to the self-attention mechanism within their U-Net and Transformer architectures. Self-attention has quadratic complexity with respect to image resolution, making high-resolution generation extremely demanding in terms of computation and memory. While some methods have explored optimizations like windowed attention or state-space models, they often still rely on the assumption of global interactions and offer limited efficiency gains. This paper questions the necessity of global self-attention for diffusion models and seeks a more efficient alternative.

Methods

The core of this work is the proposed △ConvBlock, a convolutional module designed to mimic the behavior of self-attention in diffusion models. The authors' analysis reveals that self-attention in these models exhibits two key components:

  1. Smooth, low-intensity global interactions: These are approximated by an average pooling branch within △ConvBlock.
  2. Strong, localized interactions: These are captured by a pyramid convolutional structure that uses multi-scale convolutions to process features.

The △ConvBlock is integrated into diffusion models by replacing the self-attention modules, forming the △ConvFusion architecture. To ensure effective training, only the △ConvBlocks are updated while other components remain frozen. Knowledge distillation is employed at both feature and output levels to align the new module with the original self-attention behavior.

Datasets

  • Training: The paper mentions pre-training △ConvBlock on 2M synthetic images from Midjourney-v5, followed by fine-tuning on 4K curated LAION images.
  • Evaluation: For attention map analysis, prompts from the Text2Image-Multi-Prompt dataset were used. For image generation evaluation, 10,000 high-aesthetic LAION images were used, annotated by InternVL2-8B. The MS-COCO benchmark was noted as having a significant number of degraded images, reducing its reliability.

Key Insights and Ideas

  • Self-attention is surprisingly local: Contrary to the common assumption of global interaction, the authors' analysis (visual and quantitative) shows that self-attention in trained diffusion models primarily focuses on local spatial relationships, resembling convolutional inductive biases.
  • Global interactions are weak: While self-attention can capture global context, these interactions are often smooth and low-intensity, suggesting they are less critical than localized patterns.
  • Convolutions can replace self-attention: The paper demonstrates that a carefully designed convolutional architecture (△ConvBlock) can effectively replicate the essential functions of self-attention, leading to significant efficiency gains without sacrificing generative quality.
  • Decomposing attention: The key insight is to decouple the "global bias" and "local interaction" components of self-attention and implement them separately using pooling and multi-scale convolutions, respectively.

Key Results

  • Computational Cost Reduction: △ConvFusion achieves a dramatic reduction in computational cost, with up to 6929× fewer FLOPs at 16K resolution compared to self-attention.
  • Efficiency Improvement: The method offers significant speedups, with 3.4× speedup over LinFusion at 1024×1024 resolution and 3.37× speedup at 16K resolution.
  • Comparable Generation Quality: Despite the efficiency gains, △ConvFusion maintains comparable or superior image generation quality, as evidenced by metrics like DS, FDD, and CLIP Score.
  • Cross-Resolution Generalization: The proposed model shows better performance when generating images at resolutions different from the training setting, outperforming self-attention-based models that produce fragmented results.
  • Effective Receptive Field: The Effective Receptive Field (ERF) of △ConvFusion closely matches that of self-attention, indicating it captures similar spatial interaction patterns.

Limitations and Future Work

  • Limitations: The paper acknowledges that while △ConvFusion replaces self-attention, it doesn't tune the cross-attention modules responsible for text-image interaction. However, it still achieves superior CLIP scores, suggesting the convolutional approach is robust.
  • Future Work: The authors suggest that their approach is orthogonally compatible with other acceleration techniques like AST (Attention Streamlining), hinting at further potential for efficiency improvements. The findings also open avenues for exploring more efficient architectures for diffusion models by leveraging structured convolutional designs.

Summary updated

BibTeX
@inproceedings{dong2025can,
  author = {Ziyi Dong and Chengxing Zhou and Weijian Deng and Pengxu Wei and Xiangyang Ji and Liang Lin},
  title = {{Can We Achieve Efficient Diffusion Without Self-Attention? Distilling Self-Attention into Convolutions}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure