Skip to content

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

Z-Sampling is a training-free diffusion sampler that, at each denoising step, performs an extra inversion step under weaker CFG than the denoising step, then re-denoises. The asymmetry — strong CFG on denoise, weak CFG on invert — opens a guidance gap that injects prompt-related semantic information into the latent step by step instead of being cancelled out by an end-to-end inversion. As a plug-and-play wrapper around DDIM-style deterministic samplers, it lifts HPSv2/PickScore/ImageReward/AES across SD2.1, SDXL, Hunyuan-DiT, and DreamShaper-XL-Turbo, stacks with Diffusion-DPO and AYS-Sampling, and reaches the standard-sampling performance ceiling with ~36% less wall-clock per image.

  • A latent’s “semantic content” can be characterized operationally: a latent that produces images aligned with concept C under no conditional guidance also produces higher-quality C-related images under prompted guidance than a random latent does [§3.1, Fig. 3].
  • Comparing one denoising step at CFG scale s against the corresponding inversion step at CFG scale s′ < s, the inverted latent carries more prompt-relevant semantic information than the original — the guidance gap s − s′ is what injects it [§3.2, Eqs. 6–8].
  • Vanilla end-to-end inversion (invert all the way to noise, re-denoise) lets the per-step semantic gains cancel in the sum; Z-Sampling instead alternates one denoise + one invert at each timestep, so the gains accumulate via Jensen’s inequality (Σ|·| ≥ |Σ·|) [§3.3, Theorems 1–3].
  • The cumulative semantic information gain in Z-Sampling scales explicitly with the guidance gap Δw = w − w′; a zero gap reduces Z-Sampling to standard sampling, a negative gap can hurt [§3.3 Theorem 3, Figs. 7–8].
  • On Pick-a-Pic and DrawBench, Z-Sampling beats standard sampling and Resampling on nearly every metric across SD-2.1, SDXL, Hunyuan-DiT, and DreamShaper-XL-Turbo; HPSv2 winning rate exceeds 88% on both benchmarks [Table 1, Fig. 6].
  • On GenEval, the largest absolute gains are on the hard compositional axes — Counting (+12.5pts vs standard), Color attribution (+6pts), Two-object (+5pts) — with the overall score moving 52.5% → 57.0% [Table 2].
  • Z-Sampling stacks additively with orthogonal methods: AYS-Sampling alone barely moves over standard (32.78 → 33.57 HPSv2 with Z added on DreamShaper); Diffusion-DPO (31.41 HPSv2) + Z-Sampling reaches 31.60 with a +4.2 ImageReward bump on Pick-a-Pic [Tables 4–5].
  • The zigzag operation pays off mostly in the early denoising steps: extending zigzag from the first 25 → all 50 steps on SDXL/Pick-a-Pic moves the winning rate only 75% → 80% [Fig. 9, §4.2 Zigzag Diffusion Steps].
  • Despite the extra inversion forward passes, at matched wall-clock Z-Sampling exceeds standard sampling’s best HPSv2 with ~36% less compute, because most of the lift comes from a few early zigzag steps rather than from more total NFEs [Fig. 10, §4.2 Efficiency Comparison].
  • The method is limited to deterministic samplers (DDIM); extending to SDE-based stochastic samplers is left as an open direction [§5 Discussion].

At each denoising step t, instead of a single deterministic update x_{t-1} = D_s(x_t), Z-Sampling does: (1) denoise once at strong CFG, x̃_{t-1} = D_s(x_t); (2) invert that result one step at weak CFG, x̂_t = I_{s′}(x̃_{t-1}) with s′ < s (typically s′ = 0); (3) replace x_t with x̂_t and proceed to step t-1 with the standard denoise. The replacement is the load-bearing move — the inverted latent has accumulated semantic information specifically because the denoise–invert pair was asymmetric in CFG scale. Theorem 2 shows the per-step semantic gain Σ_t |I(s, s′, t)| strictly upper-bounds the end-to-end vanilla-inversion gain |Σ_t I(s, s′, t)|, so the zigzag schedule extracts more information for the same number of additional forward passes. Operationally the method needs only a few lines of code around an existing DDIM loop and exposes two hyperparameters: the denoise/invert CFG gap Δw and the number of early steps T_z over which to apply zigzag (Algorithm 1).

  • Headline metric lift (Pick-a-Pic, SDXL): HPSv2 29.89 → 31.28 (+1.4), AES 6.09 → 6.13, PickScore 21.63 → 21.85, ImageReward 58.65 → 79.22 (+20.6) over standard sampling at the same nominal step count [Table 1].
  • Cross-architecture: comparable lifts hold for U-Net (SD-2.1, SDXL), DiT (Hunyuan-DiT), and distilled few-step backbones (DreamShaper-XL-Turbo, 4 steps) — Z-Sampling is not tied to a backbone family [Table 1].
  • Compositional benchmarks: GenEval overall 52.5% → 57.0% on SDXL, with the largest absolute gains on Counting (33.75 → 46.25, +12.5pts) and Color attribution (18.00 → 24.00, +6pts) — the prompt axes where standard CFG is known to fail [Table 2].
  • Stacks with DPO: Diffusion-DPO + Z-Sampling on SDXL/Pick-a-Pic: ImageReward 90.28 → 94.48, HPSv2 31.41 → 31.60 — Z-Sampling extracts a further lift on top of preference-trained weights [Table 5].
  • Compute-matched comparison: even at 36% less wall-clock per image, Z-Sampling exceeds the best metric value reachable by standard sampling at any step count [Fig. 10].
  • Guidance-gap ablation: the gain monotonically increases with Δw; at Δw = 0 Z-Sampling collapses to standard sampling and at Δw < 0 the method underperforms — i.e. the gap, not the extra NFEs, is what does the work [Figs. 7–8].

Z-Sampling is the cleanest available demonstration that CFG’s denoise/invert asymmetry is itself a usable signal — adjacent to but distinct from the directions in Classifier-Free Guidance variants. Where SoFlow: Solution Flow Models for One-Step Generative Modeling folds CFG into training to remove the two-pass at inference, and Normalized Attention Guidance: Universal Negative Guidance for Diffusion Models moves CFG-style extrapolation into attention-feature space to fix few-step models, Z-Sampling keeps standard CFG at every step but interlaces it with a cheaper-CFG inversion — a third design point that exploits the gap rather than collapsing it. It also slots into Inference-Time Scaling as a generation-side compute-for-quality knob analogous to Self-Refining Video Sampling‘s per-step Predict-and-Perturb refinement, but parameterized by CFG-gap instead of denoiser uncertainty. The unanswered question for Luma’s stack is whether Z-Sampling’s mechanism survives few-step distilled video models in the Diffusion Distillation regime, where the train-test gap Self Forcing: Bridging the Train-Test Gap in Autoregressive Video Diffusion addresses already perturbs the trajectory and CFG itself is known to interact awkwardly with distillation.