Towards Better Alignment: Training Diffusion Models with Reinforcement Learning Against Sparse Rewards

Zijing Hu, Fengda Zhang, Long Chen, Kun Kuang, Jiahui Li +4 more
3/14/2025
cs.CVcs.LG

No official code found. Best implementation: hu-zijing/B2-DiffuRL (57 stars, MIT, last commit 2025-03-31).

Abstract

Diffusion models have achieved remarkable success in text-to-image generation. However, their practical applications are hindered by the misalignment between generated images and corresponding text prompts. To tackle this issue, reinforcement learning (RL) has been considered for diffusion model fine-tuning. Yet, RL's effectiveness is limited by the challenge of sparse reward, where feedback is only available at the end of the generation process. This makes it difficult to identify which actions during the denoising process contribute positively to the final generated image, potentially leading to ineffective or unnecessary denoising policies. To this end, this paper presents a novel RL-based framework that addresses the sparse reward problem when training diffusion models. Our framework, named $\text{B}^2\text{-DiffuRL}$, employs two strategies: \textbf{B}ackward progressive training and \textbf{B}ranch-based sampling. For one thing, backward progressive training focuses initially on the final timesteps of denoising process and gradually extends the training interval to earlier timesteps, easing the learning difficulty from sparse rewards. For another, we perform branch-based sampling for each training interval. By comparing the samples within the same branch, we can identify how much the policies of the current training interval contribute to the final image, which helps to learn effective policies instead of unnecessary ones. $\text{B}^2\text{-DiffuRL}$ is compatible with existing optimization algorithms. Extensive experiments demonstrate the effectiveness of $\text{B}^2\text{-DiffuRL}$ in improving prompt-image alignment and maintaining diversity in generated images. The code for this work is available.

View on arXivView PDF

Code Implementations(1)

MIT

[CVPR 25] A framework named B^2-DiffuRL for RL-based diffusion model fine-tuning.

574Shell, PythonMar 11, 20251 years agoMIT
diffusion-modelsreinforcement-learningtext-to-image-generation

Similar Papers

Cite this paper

@article{hu2025towards,
  title  = {Towards Better Alignment: Training Diffusion Models with Reinforcement Learning Against Sparse Rewards},
  author = {Zijing Hu and Fengda Zhang and Long Chen and Kun Kuang and Jiahui Li and Kaifeng Gao and Jun Xiao and Xin Wang and Wenwu Zhu},
  year   = {2025},
  eprint = {2503.11240},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.11240v2},
  journal = {CVPR 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.11240.svg)](https://codeofpaper.com/paper/2503.11240)

Discussion