Papers › Self-Rectifying Diffusion Sampling with Perturbed-Attention Guidance

Self-Rectifying Diffusion Sampling with Perturbed-Attention Guidance

26 Mar 2024arXiv:2403.17377archive 2025-07-28

Donghoon Ahn, Hyoungwon Cho, Jaewon Min, Wooseok Jang, Jungwoo Kim, SeonHwa Kim, Hyun Hee Park, Kyong Hwan Jin, Seungryong Kim

Recent studies have demonstrated that diffusion models are capable of generating high-quality samples, but their quality heavily depends on sampling guidance techniques, such as classifier guidance (CG) and classifier-free guidance (CFG). These techniques are often not applicable in unconditional generation or in various downstream tasks such as image restoration. In this paper, we propose a novel sampling guidance, called Perturbed-Attention Guidance (PAG), which improves diffusion sample quality across both unconditional and conditional settings, achieving this without requiring additional training or the integration of external modules. PAG is designed to progressively enhance the structure of samples throughout the denoising process. It involves generating intermediate samples with degraded structure by substituting selected self-attention maps in diffusion U-Net with an identity matrix, by considering the self-attention mechanisms' ability to capture structural information, and guiding the denoising process away from these degraded samples. In both ADM and Stable Diffusion, PAG surprisingly improves sample quality in conditional and even unconditional scenarios. Moreover, PAG significantly improves the baseline performance in various downstream tasks where existing guidances such as CG or CFG cannot be fully utilized, including ControlNet with empty prompts and image restoration such as inpainting and deblurring.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2403.17377")

Code

Syntology Ran 13 of 16 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 3 ran · honoured contract; 3 ran · our draft was wrong; 7 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

KU-CVLAB/Perturbed-Attention-Guidance officialmentioned on GitHubpytorchMIT report
susunghong/seg-sdxl mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 13 ran; 3 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
3ran · our draft was wrong
7ran
3unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from KU-CVLAB/Perturbed-Attention-Guidance. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

center_crop_arr KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/image_datasets.py official repository ran · our draft was wrong MIT (permissive) · 8ab9a97df8161f31 · report
approx_standard_normal_cdf KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/losses.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · cfd76fd0d89574a4 · report
attention_from_qkv KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/unet.py official repository ran fingerprinted MIT (permissive) · e2497fcb1db5da74 · report
betas_for_alpha_bar KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/gaussian_diffusion.py official repository ran · honoured contract MIT (permissive) · 2ab2316ac6fdd869 · report
discretized_gaussian_log_likelihood KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/losses.py official repository ran · our draft was wrong MIT (permissive) · cd33283d615fb3d7 · report
get_named_beta_schedule KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/gaussian_diffusion.py official repository ran · honoured contract MIT (permissive) · a086d6286a40b889 · report
get_param_groups_and_shapes KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/fp16_util.py official repository ran MIT (permissive) · e41367ad14ff58fd · report
get_short_layer_names_str KU-CVLAB/Perturbed-Attention-Guidance/classifier_sample.py official repository ran MIT (permissive) · 44b1aa06ec13a1ff · report
make_master_params KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/fp16_util.py official repository ran MIT (permissive) · e20dd5102da3b050 · report
make_output_format KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/logger.py official repository ran MIT (permissive) · bcd8b4acab199405 · report
normal_kl KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/losses.py official repository ran · honoured contract fingerprinted MIT (permissive) · cf2798b666b231ca · report
save_input_hook KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/unet.py official repository ran MIT (permissive) · 25d9a8be93bc84f5 · report
unflatten_master_params KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/fp16_util.py official repository ran MIT (permissive) · 64fff1e30802b815 · report
mpi_weighted_mean KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/logger.py official repository unverified MIT (permissive) · e515a67f7f32e76d · report
profile KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/logger.py official repository unverified MIT (permissive) · 0c6607473a4c4c55 · report
random_crop_arr KU-CVLAB/Perturbed-Attention-Guidance/guided_diffusion/image_datasets.py official repository unverified MIT (permissive) · 53d5be4fdbcfac23 · report

Tasks

DeblurringDenoisingImage GenerationImage Restoration

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Introduced by this paper: PAG, Perturbed-Attention Guidance

DiffusionPAGPerturbed-Attention Guidance

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections