Abstract
Perturbed-Attention Guidance (PAG) is a training-free, "plug-and-play" sampling method designed to enhance the structural coherence and visual quality of diffusion models. By intentionally degrading the self-attention mechanism to create a negative reference and guiding the denoising process away from this structural "collapse," PAG significantly improves unconditional generation and downstream image restoration tasks without requiring external conditions like text prompts or class labels.
Introduction
Diffusion models have set new benchmarks in image synthesis, yet their performance remains heavily dependent on sampling guidance. The current standard, Classifier-Free Guidance (CFG), necessitates models trained with specific conditions, such as text prompts. In the absence of these conditions—during "unconditional" generation—diffusion models often struggle with structural collapse or semantic inconsistencies. While existing unconditional guidance methods exist, they typically require auxiliary training or unstable heuristics. Perturbed-Attention Guidance (PAG) addresses this gap by providing a self-rectifying mechanism that utilizes the model's own internal architecture to improve fidelity without additional training.
Methodology: The Self-Rectifying Mechanism
The core innovation of PAG is the use of the model's internal self-attention as a structural anchor. The authors identify that self-attention maps are the primary drivers of structural understanding within a Transformer-based diffusion U-Net.
- Perturbed Self-Attention (PSA): PAG replaces standard self-attention maps with an identity matrix. This perturbation preserves local appearance (color and texture) but effectively destroys global structural relationships.
- Guidance Signal: During the sampling process, the model performs two forward passes: a standard pass and a perturbed pass. The difference between these two outputs ($Δ_t$) isolates the structural information the model possesses.
- The Update Rule: The final noise prediction is adjusted by moving away from the perturbed version: $\tilde{\epsilon}_t = \epsilon_t + s(\epsilon_t - \hat{\epsilon}_t)$, where $s$ is the guidance scale. This forces the model to prioritize structural coherence by actively avoiding the "broken" structure of the perturbed pass.
Experimental Evaluation
The authors validated PAG across diverse benchmarks, including ImageNet (256x256), MS-COCO 2014, and FFHQ. The results demonstrate significant quantitative and qualitative gains:
- Unconditional Generation: On ImageNet, PAG reduced the Frechet Inception Distance (FID) from 26.21 to 16.23, a substantial improvement for a training-free intervention.
- Stable Diffusion: In unconditional settings for Stable Diffusion v1.5, the FID dropped from 53.13 to 47.57.
- Inverse Problems: PAG proved highly effective for image restoration. In box inpainting tasks on the FFHQ dataset, the FID was halved from 43.11 to 21.13, effectively eliminating common artifacts.
Key Insights and Discussion
PAG reveals that self-attention is the structural backbone of diffusion models. By creating an internal reference point for "bad" structure, PAG enables high-quality generation even when external metadata is unavailable. Furthermore, PAG exhibits synergy with CFG; while CFG ensures alignment with text prompts, PAG ensures the resulting image is structurally sound, reducing common "AI artifacts" like anatomical errors.
Despite its advantages, PAG introduces computational overhead, as it requires an additional forward pass at each sampling step, effectively doubling inference time. Future work may focus on optimizing these dual passes or exploring alternative perturbation strategies to further refine the guidance signal.
Conclusion
Perturbed-Attention Guidance represents a significant step forward in making diffusion models more robust and versatile. As a training-free, universal modification to the sampling process, it provides a powerful tool for enhancing both unconditional synthesis and complex image restoration tasks across a wide variety of pre-trained architectures.
Summary updated