Abstract
Denoising diffusion models (DDMs) have attracted attention for their exceptional generation quality and diversity. This success is largely attributed to the use of class- or text-conditional diffusion guidance methods, such as classifier and classifier-free guidance. In this paper, we present a more comprehensive perspective that goes beyond the traditional guidance methods. From this generalized perspective, we introduce novel condition- and training-free strategies to enhance the quality of generated images. As a simple solution, blur guidance improves the suitability of intermediate samples for their fine-scale information and structures, enabling diffusion models to generate higher quality samples with a moderate guidance scale. Improving upon this, Self-Attention Guidance (SAG) uses the intermediate self-attention maps of diffusion models to enhance their stability and efficacy. Specifically, SAG adversarially blurs only the regions that diffusion models attend to at each iteration and guides them accordingly. Our experimental results show that our SAG improves the performance of various diffusion models, including ADM, IDDPM, Stable Diffusion, and DiT. Moreover, combining SAG with conventional guidance methods leads to further improvement.
Introduction
Denoising Diffusion Models (DDMs) have become the gold standard for high-fidelity image generation. However, their peak performance typically depends on guidance techniques like Classifier Guidance (CG) or Classifier-Free Guidance (CFG). While effective, these methods are "hard-earned": CG requires a separate pre-trained classifier, and CFG necessitates expensive retraining to handle both conditional and unconditional inputs. This creates a gap for models trained without labels or for users seeking to improve existing models without further training.
Methodology: Self-Attention Guidance (SAG)
We propose Self-Attention Guidance (SAG), a training-free method that extracts guidance signals directly from a model's internal representations. SAG operates during the sampling phase by leveraging the model's self-attention maps, which naturally act as heatmaps for salient image regions.
The process follows a "blur-and-guide" philosophy:
- Attention Extraction: At each denoising step, the model's self-attention map is used to identify important structural regions.
- Adversarial Blurring: A mask is created from this map to apply Gaussian blur specifically to the attended regions, creating a "degraded" version of the intermediate sample.
- Guidance Calculation: The model predicts noise for both the original and the partially blurred image. The difference between these predictions serves as the guidance signal, pushing the generation away from the blurred version and toward high-fidelity details.
Experimental Results
SAG was evaluated across multiple benchmarks, including ImageNet and LSUN. On unconditional ImageNet 256×256, SAG improved the Frechet Inception Distance (FID) from 26.21 to 20.08. Notably, SAG is orthogonal to existing methods; when added to Classifier Guidance on ImageNet 128×128, it further refined FID from 2.97 to 2.58.
Beyond quantitative metrics, human evaluation confirms the efficacy of the approach. In studies using Stable Diffusion, users significantly preferred images generated with SAG, noting reduced artifacts and improved realism even in the absence of complex text prompts.
Conclusion and Limitations
SAG provides a powerful, condition-free way to enhance diffusion models. Its main limitation is computational, as the extra forward pass required for the blurred image roughly doubles sampling time. Future work may focus on distilling this guidance signal back into the model to maintain quality improvements without the inference overhead. Despite the speed trade-off, SAG represents a significant step toward making high-quality diffusion guidance accessible for any pre-trained model.
Summary updated