NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Zigzag Diffusion Sampling: Diffusion Models Can Self-Improve via Self-Reflection

Bai LiChen, Shitong Shao, zikai zhou, Zipeng Qi, zhiqiang xu, Haoyi Xiong, Zeke Xie

Z-Sampling is a novel, training-free sampling method that allows diffusion models to "self-improve" during inference. By alternating between denoising and inversion steps, it leverages a "guidance gap" to step-by-step inject semantic information into the latent space. This leads to massive gains in image quality and prompt alignment—boasting up to a 94% win rate over standard sampling.

The Challenge of Complex Prompts

While text-to-image diffusion models like Stable Diffusion or SDXL are incredibly powerful, they often stumble on "challenging" prompts involving complex spatial relations, specific counts, or fine-grained attributes (like spelling out text).

Comparison of Standard Sampling vs. Z-Sampling across various challenging prompts.

To fix this, researchers usually crank up the Classifier-Free Guidance (CFG) scale. However, high CFG is a double-edged sword: it improves prompt alignment but often destroys image fidelity, leading to oversaturation, "deep-fried" artifacts, and a loss of diversity. There is a fundamental need for a way to inject semantic meaning into the generation process without the destructive side effects of brute-force guidance.

Methodology: Diffusion Self-Reflection

The authors introduce Diffusion Self-Reflection, inspired by how Large Language Models (LLMs) can improve their reasoning by looking back at their own outputs.

The core algorithm is Zigzag Diffusion Sampling (Z-Sampling). Instead of a straight path from noise to image, the model takes a "zigzag" approach at each timestep $t$:

  1. Denoise: Move from $x_t$ to $x_{t-1}$ using a high guidance scale ($\gamma_1$).
  2. Invert: Immediately perform a deterministic inversion (like DDIM inversion) from $x_{t-1}$ back to a new latent $\tilde{x}_t$ using a low or zero guidance scale ($\gamma_2$).
  3. Repeat: Use this "reflected" latent $\tilde{x}_t$ for the next denoising step.

The magic happens in the Guidance Gap ($\delta_\gamma = \gamma_1 - \gamma_2$). Theoretical analysis proves that this gap captures the semantic difference between what the model generates with the prompt versus what it would generate without it. By zigzagging, the model accumulates this semantic signal step-by-step, effectively "optimizing" the latent noise to be more compatible with the text prompt.

Key Insights

  • Latents are not just noise: Random latents (seeds) naturally carry "semantic leanings." A specific seed might be inherently "better" at generating a cat than a car. Z-Sampling essentially nudges a random seed to become a "good seed" for the specific prompt provided.
  • The "Semantic Cancellation" Trap: Previous attempts at "end-to-end" inversion (denoising the whole way, then inverting the whole way) failed because semantic gains at different timesteps often cancel each other out. The "zigzag" approach prevents this by accumulating the signal locally at every step.
  • Stability under High CFG: Z-Sampling acts as a stabilizer. While standard sampling produces artifacts at a CFG of 11.5, Z-Sampling maintains high image quality, allowing users to push guidance further than ever before.
  • Plug-and-Play Efficiency: The method requires zero retraining. It works on U-Nets, Transformer-based DiTs (like Hunyuan-DiT), and even distilled "Turbo" models with as few as 4 steps.

Performance and Results

The researchers evaluated Z-Sampling across a wide battery of benchmarks, including Pick-a-Pic, DrawBench, GenEval, PartiPrompts, and MS-COCO 2014.

  • Massive Win Rates: On the Pick-a-Pic benchmark using DreamShaper-xl-turbo, Z-Sampling achieved a 94% winning rate over standard sampling in terms of human preference (HPS v2).
  • Superior Alignment: In GenEval, Z-Sampling significantly improved performance in difficult categories like Counting (jumping from 33.75% to 46.25%) and Color Attribution.
  • Efficiency Gains: Z-Sampling is so effective that a model using it with fewer total steps can still outperform a standard model using more steps. Specifically, Z-Sampling with 36% less computational time still beat the peak performance of standard sampling.
  • Orthogonality: Adding Z-Sampling to Diffusion-DPO (a training-based alignment method) further boosted all metrics, showing it captures improvements that training alone misses.

Limitations and Future Work

Currently, Z-Sampling relies on deterministic inversion (like DDIM) and struggles with stochastic samplers (like Euler Ancestral) because the random noise added during those processes breaks the "reflection" logic. Additionally, because each step involves an inversion and a second denoising pass, it roughly triples the Number of Function Evaluations (NFE) per zigzag step.

Future work may explore distilling the "zigzag path" discovered during inference back into the model weights, potentially delivering the benefits of Z-Sampling at the speed of standard sampling. The authors also aim to explore its application in 3D generation and molecular synthesis.

Summary updated

BibTeX
@inproceedings{lichen2025zigzag,
  author = {Bai LiChen and Shitong Shao and zikai zhou and Zipeng Qi and zhiqiang xu and Haoyi Xiong and Zeke Xie},
  title = {{Zigzag Diffusion Sampling: Diffusion Models Can Self-Improve via Self-Reflection}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=MKvQH1ekeY},
}
Figure