A Gradient Guidance Perspective on Stepwise Preference Optimization for Diffusion Models

Joshua Tian Jin Tee, Hee Suk Yoon, Abu Hanif Muhammad Syarubany, Eunseop Yoon, Chang D. YooNeurIPS 2025 · OpenReview

Aligning text-to-image (T2I) diffusion models with human preferences—making them more aesthetically pleasing or faithful to a prompt—is a major focus in generative AI. While methods like Direct Preference Optimization (DPO) have successfully migrated from Large Language Models to image generation, they often struggle with computational efficiency and training stability.

A recent advancement called Stepwise Preference Optimization (SPO) attempted to solve this by providing feedback at every intermediate step of the denoising process. However, its practical success outpaced its theoretical grounding. In this paper, researchers pull back the curtain on SPO, re-interpreting it through the lens of gradient guidance to create a more robust and effective algorithm: GradSPO.

TL;DR

GradSPO re-frames preference alignment in diffusion models as a form of reward-based gradient guidance. By identifying and fixing a temporal bias in how timesteps are weighted, and by introducing a variance-informed noise reduction strategy, GradSPO achieves state-of-the-art alignment with human preferences on SD 1.5 and SDXL with superior stability.

Extracted figure from page 2 of A Gradient Guidance Perspective on Stepwise Preference Optimization for Diffusion Models

What Problem Does This Paper Address?

Standard diffusion models are trained to reconstruct images, not necessarily to make them perfectly aligned with complex human nuances. To fix this, researchers use preference learning, where a model is shown two versions of an image and told which one is better.

The previous state-of-the-art, SPO, applied this preference logic to every single step of the denoising process. While effective, the authors found two major flaws:

  1. Temporal Bias: SPO implicitly underweights the later stages of image generation. Since the final steps are where fine-grained details and textures are refined, this bias limits the model's aesthetic potential.
  2. Gradient Noise: Because the "preferred" samples are chosen from a small, noisy pool of candidates, the training signal (the gradient) is incredibly jittery, leading to unstable training.

Methods

The authors' core contribution is a theoretical bridge: they prove that SPO is mathematically equivalent to performing DPO on guided scores. This allows them to treat the preference signal as a "nudge" from a reward model's gradient.

Based on this insight, they introduced GradSPO, which features three key innovations:

  • Uniform Timestep Weighting: They replaced SPO’s biased weighting with a uniform approach. This ensures the model pays equal attention to the "coarse" early steps and the "fine-grained" later steps of generation.
  • Max-Min Noise Reduction: They introduced a targeted estimator that leverages the difference between winning and losing samples. Mathematically, they prove this technique halves the variance of the gradient estimate, significantly cleaning up the training signal.
  • EMA Stabilization: They utilize an Exponential Moving Average (EMA) of model parameters during training to further buffer against the inherent stochasticity of preference learning.

Key Insights and Ideas

  • The "Aha" Moment on Weighting: The authors discovered that SPO was accidentally ignoring the end of the denoising process. By visualizing the "Pick Score" difference over time, they showed that SPO's improvements decayed exponentially as the image got cleaner. GradSPO fixes this by ensuring the model keeps learning until the very last step.
Extracted figure from page 6 of A Gradient Guidance Perspective on Stepwise Preference Optimization for Diffusion Models
  • Guidance vs. Likelihood: Most previous work viewed preference optimization as maximizing the likelihood of "good" samples. By viewing it as gradient guidance, the authors could apply well-known variance reduction techniques from control theory and physics-informed ML.
  • Efficiency: GradSPO achieves these gains without needing a massive offline dataset of human-ranked images; it can learn "online" by comparing its own generated samples.

Key Results

GradSPO consistently outperformed leading baselines (DPO, SPO, InPO) across both SD 1.5 and SDXL backbones:

  • SDXL Performance: GradSPO achieved a Pick Score of 23.45 and an Aesthetic Score of 6.2985, surpassing SPO (22.93 and 6.2236, respectively).
  • User Study: In a blind test with human judges, GradSPO had a 75.6% win rate against vanilla SDXL and a 53.0% win rate against the original SPO.
  • Qualitative Superiority: The model showed a marked improvement in rendering text and adhering to complex semantic prompts.

Datasets

The models were trained and evaluated using several industry-standard benchmarks:

  • Training: 4,000 prompts sampled from the Pick-a-Pic v1 dataset.
  • Evaluation: Pick-a-Pic v2 for quantitative metrics, HPSv2 and Parti Prompts for broad generalization testing, HPDv2 for human preference alignment, and GenEval for testing compositional and semantic faithfulness.

Limitations and Future Work

  • Single-Step Constraint: The current implementation is restricted to "single-step" preference optimization. Extending this to "multi-step" trajectories could yield even better results.
  • Reward Model Dependency: Like all RLHF-style methods, GradSPO is only as good as the reward model used to rank the images.
  • Future Directions: Integrating more advanced "clean gradient" techniques (like backpropagating through the VAE) could further close the gap between noisy approximations and ideal guidance.

Check out the code and models: https://github.com/JoshuaTTJ/GradSPO