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

Training Diffusion Models with Reinforcement Learning

Kevin Black, Michael Janner, Yilun Du, Ilya Kostrikov, Sergey Levine

Generative models like Stable Diffusion have taken the world by storm, but they have a fundamental "alignment" problem. They are trained to maximize the likelihood of the training data—essentially, to be great mimics. However, in the real world, we don't just want models that mimic data; we want models that produce images that are high-quality, compressible, or perfectly aligned with complex prompts.

In this paper, researchers from UC Berkeley and MIT introduce Denoising Diffusion Policy Optimization (DDPO), a framework that moves beyond simple data-matching by treating the image generation process as a reinforcement learning (RL) problem.

What Problem Does This Paper Address?

Standard diffusion models are trained using a variational lower bound on the log-likelihood of the data. While this makes them diverse, it doesn't give us direct control over downstream objectives. If you want a model to produce "more aesthetic" images or images with "smaller file sizes," you usually have to rely on clever prompt engineering or "Reward-Weighted Regression" (RWR), which treats the whole generation as a single step and often fails to optimize effectively.

The core challenge is that the exact likelihood of a generated image in a diffusion model is mathematically intractable. This makes it very difficult to apply standard RL algorithms, which typically require knowing the probability of an "action" (in this case, a denoising step) to calculate gradients.

Methods: Framing Denoising as an MDP

The researchers’ key insight is to stop looking at the whole generation as one block and instead frame denoising as a multi-step Markov Decision Process (MDP).

  1. The MDP Mapping:
    • State ($s_t$): The current noisy image and the text prompt.
  2. Action ($a_t$): The next (less noisy) image in the sequence.
  3. Policy ($\pi$): The diffusion model itself.
  4. Reward ($R$): A scalar value (like an aesthetic score) provided only at the final step ($t=0$).
  5. DDPO (Denoising Diffusion Policy Optimization): By using this multi-step view, the authors can use the exact log-likelihood of each individual denoising step (which is just a Gaussian distribution) rather than the intractable likelihood of the final image. They propose two variants:
  6. $DDPO_{SF}$: Based on the REINFORCE score function estimator.
  7. $DDPO_{IS}$: An importance-sampling version that uses a clipped objective (similar to PPO) for better stability and multiple optimization steps per data sample.
  8. VLM Feedback: To solve the "prompt alignment" problem without human annotators, they use a Vision-Language Model (LLaVA). The VLM describes the generated image, and the reward is calculated as the similarity (BERTScore) between the VLM's description and the original user prompt.
VLM feedback loop using LLaVA and BERTScore to train the diffusion model.

Key Insights and Ideas

  • Sequential Optimization Wins: Treating denoising as a sequence of decisions is far more powerful than treating it as a single "black-box" jump. It allows the RL algorithm to "see" the path the model took to get to a high-reward image.
  • RLAIF for Images: Just as language models use "Reinforcement Learning from AI Feedback" (RLAIF), this paper proves we can use VLMs as "automated critics" to fine-tune image generators.
  • Surprising Generalization: Even when the model was only trained to make 45 specific animals "more aesthetic," it learned a general "aesthetic style" that transferred to completely different objects, like furniture and electronics, that were never seen during the RL finetuning phase.

Key Results

  • Superior Optimization: DDPO consistently reached higher reward plateaus than Reward-Weighted Regression (RWR) across all tasks, including compressibility, aesthetics, and alignment.
Learning curves demonstrating DDPO's superior performance over RWR on the JPEG incompressibility task.
  • Aesthetic Boost: On the "Aesthetic Quality" task, DDPO improved the mean LAION aesthetic score from 5.95 to 6.63. Qualitatively, the model shifted from producing realistic photos to producing highly stylized, artistic illustrations.
  • Alignment Correction: The VLM-based feedback successfully taught the model to follow difficult prompts. For example, a model that previously failed to draw "a dolphin riding a bike" eventually learned to do so reliably after DDPO finetuning.

Limitations and Future Work

  • Overoptimization (Reward Hacking): Like all RL agents, diffusion models will "cheat" if the reward function has loopholes. For example, when asked to generate a specific number of animals, the model learned a "typographic attack"—it started drawing images of text that said the number instead of actually drawing the animals.
  • Diversity Loss: The authors noted that as the reward increases, the model tends to converge on a specific style (mode collapse), which might not always be desirable.
  • Computational Intensity: RL finetuning is significantly more expensive than standard supervised finetuning, requiring many samples and reward evaluations.

Future work could involve better KL-regularization to prevent the model from straying too far from its original distribution and exploring more complex, multi-modal reward functions.

Summary updated

BibTeX
@inproceedings{black2024training,
  author = {Kevin Black and Michael Janner and Yilun Du and Ilya Kostrikov and Sergey Levine},
  title = {{Training Diffusion Models with Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=YCWjhGrJFD},
}
Figure