Routing Policy Optimization for Online Diffusion Reinforcement Learning
Organizations: National University of Singapore · ByteDance
Abstract
Reinforcement learning can align visual generators with reward signals beyond their pretraining objectives, but existing score-function methods typically introduce stochasticity by perturbing the reverse denoising trajectory, leading to costly rollout-based optimization. We instead ask whether stochastic exploration can be introduced inside the generator while preserving its original sampler. Routing Policy Optimization (RPO) answers this question by turning attention routing into a stochastic exploration action. At a few selected denoising levels, each query block keeps its own block and samples further key blocks in proportion to the generator's native attention mass, or keeps dense attention. The sampled route perturbs the velocity of that transition, and a Gaussian likelihood around the dense velocity scores the perturbation with a score-function objective. RPO further uses a controlled two-rollout estimator: two rollouts share the same prompt, initial latent, routed denoising levels, and dense anchor layers, differing only in their sampled attention routes. Their reward difference provides an advantage signal for the routed transitions. Because the likelihood differentiates the dense velocity itself, the learned updates remain effective after routing is removed. At inference, RPO restores dense attention and retains the original deterministic sampler. Experiments on text-to-image and text-to-video generation show that RPO improves generation quality while achieving nearly 4x higher training efficiency than Flow-GRPO-style methods. Please see our project page at https://velox-world.com/rpo for visual results.
Figures & tables
| Method | Train GPU-h | Aesthetic quality | Imaging quality | Subject consistency | Motion smoothness | Object class | Multiple objects | Human action | Scene | Overall score |
|---|---|---|---|---|---|---|---|---|---|---|
| CogVideoX-5B | – | 60.17 | 61.92 | 96.50 | 97.42 | 82.44 | 57.29 | 86.40 | 42.73 | 81.30 |
| HunyuanVideo | – | 63.05 | 63.78 | 98.76 | 99.42 | 65.79 | 56.46 | 83.20 | 27.01 | 78.69 |
| Wan2.2-TI2V-5B | – | 61.91 | 67.71 | 98.37 | 98.76 | 81.01 | 59.15 | 79.40 | 37.41 | 81.61 |
| RPO | 24.1 | 62.64 | 68.65 | 98.69 | 99.06 | 85.41 | 61.30 | 84.20 | 40.84 | 82.00 |
| DanceGRPO | 102.3 | 61.74 | 67.69 | 98.38 | 98.75 | 80.81 | 59.34 | 80.00 | 36.95 | 81.46 |
| Flow-GRPO | 75.4 | 60.09 | 67.43 | 97.59 | 97.88 | 79.10 | 59.98 | 81.80 | 36.73 | 81.19 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Wan2.2 | Stable Diffusion 3.5 | |
| Output size | ||
| Token grid | ||
| Visual tokens | 3,520 | 1,024 |
| Block size | 128 | 128 |
| Blocks | 28 | 8 |
| Safety set | 1 | 1 |
RL for Image Generation
Reinforcement learning for image generation trains visual models with reward feedback to improve prompt alignment, quality, and control.
See all 93 papers