TL;DR
DUNE (Diffusion Unified Network refiNEr) is a training-free, plug-and-play refinement framework that eliminates visual artifacts and hallucinations in both U-Net and Transformer-based diffusion models. By identifying and suppressing abrupt feature deviations in deep internal latents during the early stages of generation, DUNE significantly improves image fidelity and structural correctness without sacrificing semantic consistency or requiring additional training memory.
What Problem Does This Paper Address?
Despite the spectacular success of diffusion models in image generation, they frequently suffer from localized visual artifacts and "hallucinations"—think extra fingers, distorted faces, or physically impossible geometry.
While existing training-free refinement methods try to fix this by scaling internal feature maps (like FreeU) or modifying the score trajectory directly (like ASCED), they often introduce unwanted side effects. These include severe color over-saturation, loss of fine background details, or "semantic drift" where the generated image strays from the user's original prompt. The core limitation of these prior approaches is a lack of phase-aware and location-aware control; they treat the entire denoising trajectory uniformly rather than targeting exactly when and where artifacts originate.
Methods
DUNE introduces a surgical, two-phase approach based on the discovery that artifact-causing dynamics are concentrated in the early denoising stages and are highly visible within the model's deepest latent spaces.
- The Detect Phase (1.0T to 0.6T): DUNE tracks the internal latent variables ($h_t$) at the model's bottleneck (the
h-spacein U-Nets or the 3/4-depth self-attention blocks in Transformers). It normalizes these latents to remove timestep-dependent drift and computes an Exponential Moving Average (EMA) to serve as a stable semantic reference. By calculating a log-ratio deviation between the current latent and the EMA reference, DUNE flags the top $(1-p)\%$ most anomalous feature regions, creating a binary anomaly mask ($M$). - The Suppress Phase: Once anomalies are detected, DUNE applies a backbone-specific suppression operator to smooth out these abrupt spikes:
- For U-Nets: It utilizes a channel-aware masked scaling mechanism to shrink anomalous channels while preserving specialized semantic activations.
- For Transformers: It uses masked EMA blending to smoothly mix the anomalous tokens back toward the stable EMA reference.
- The Optional Detail Phase (0.6T to 0.0T): In the later stages of generation, users can optionally apply stylistic adjustments (modulating skip connections and upsampling blocks) to fine-tune brightness, tone, and saturation.
Datasets
The authors evaluated DUNE across several high-resolution text-to-image and unconditional generation tasks using:
- COCO Prompts: 5,000 prompts used to generate images for quantitative evaluation via Fréchet Inception Distance (FID) and the Human Artifact Detection Metric (HADM-L).
- CelebA-HQ, FFHQ, LSUN Bedroom, and LSUN Church: Used to evaluate unconditional diffusion models (DDPM and VE architectures) via qualitative user studies.
Key Insights and Ideas
- Deep Latents as "Sweet Spots": Through mathematical analysis (Propositions 1 & 2), the authors prove that downsampling convolutions in U-Nets and self-attention mechanisms in Transformers act as data-adaptive averaging kernels that naturally contract noise. This makes deep internal latents highly stable "sweet spots" for intervention.
- Shallow Corrections Hurt: The paper demonstrates that trying to correct anomalies in shallower layers (like skip connections or upsampling blocks) actually increases score deviations and worsens hallucinations, whereas operating in the deep bottleneck space successfully mitigates them.
- Signal-to-Noise Ratio (SNR) Gain: The authors provide a theoretical proof showing that DUNE’s masked EMA suppression guarantees a post-suppression global latent SNR gain, provided the mask accurately targets noise-dominant regions.
Key Results
DUNE was tested across five major diffusion backbones: SDXL, LCM, Kandinsky 3, PixArt-$\Sigma$, and Hunyuan-DiT. It consistently outperformed existing baselines by improving both image quality (FID) and structural fidelity (HADM) simultaneously.
- Artifact Reduction on SDXL: DUNE achieved the lowest human artifact score (HADM dropped from 0.227 to 0.074) while simultaneously improving the FID score to 18.75. In contrast, baselines like FreeU and PAG significantly degraded the FID score due to over-saturation.
- Semantic Preservation: DUNE maintained exceptionally high CLIP similarity scores between original and refined images, proving that it cleans up details without altering the core meaning of the prompt.
- User Preference: In a study featuring 50 human volunteers, DUNE-enhanced images were overwhelmingly preferred over vanilla generations (e.g., scoring a 93.40% preference rate on the CelebA-HQ dataset).
Limitations and Future Work
While DUNE requires no training or fine-tuning, it does rely on two hyperparameters that must be set per backbone architecture: the detection percentile threshold ($p$) and the suppression scaling factor ($\kappa$). Although the authors provide robust default guidelines (such as fixing $p=0.9$ and placing the Transformer target layer at 3/4 depth), developing a fully automated, dynamic thresholding mechanism remains an open direction for future work.
Summary updated