Manuscript Offprint

arXiv:2610.22282

Routing Policy Optimization for Online Diffusion Reinforcement Learning

Qiuhong Shen, Yiding Yang, Yuxin Zhang, Xinwei Huang, Minxuan Lin, Bo Liu, Hao Kang, Haotian Yang, Yizhi Wang, Chongyang Ma, Xinchao Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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 4×4\times higher training efficiency than Flow-GRPO-style methods. Please see our project page for visual results.

1 INTRODUCTION

Diffusion and flow models now generate high-quality images and videos from natural-language prompts (Shen et al., 2026b; Li & Wang, 2026). DDPM establishes stochastic reverse denoising, while DDIM exposes a deterministic sampling path under the same training objective (Ho et al., 2020; Song et al., 2021). Flow matching and rectified flow instead learn vector fields for continuous transport (Lipman et al., 2023; Liu et al., 2023; Esser et al., 2024). In parallel, latent diffusion, Diffusion Transformers, and video diffusion models make high-resolution visual generation tractable at scale (Rombach et al., 2021; Peebles & Xie, 2022; Yang et al., 2024; Wan Team et al., 2025; Yu et al., 2026). Learned preference models then expose alignment objectives beyond likelihood and reconstruction (Xu et al., 2023; Kirstain et al., 2023; Ma et al., 2025).

Online reinforcement learning can optimize these objectives, but its central bottleneck is the policy. DDPO and DPOK treat stochastic denoising transitions as actions (Black et al., 2024; Fan et al., 2023). Flow-GRPO and DanceGRPO extend this construction to deterministic flow models by converting their ODE samplers into stochastic SDEs (Liu et al., 2025a; Xue et al., 2025b). Temporal windows, shared branches, and one-step updates reduce the resulting rollout cost (Li et al., 2025a; He et al., 2025; Li et al., 2025b; He et al., 2026), while dense credit and regulated clipping improve how terminal rewards shape sampler transitions (Deng et al., 2026; Shen et al., 2026a; Yang et al., 2026; Wang et al., 2025a). Forward-matching objectives avoid reverse-trajectory likelihoods, but they also remove the explicit sampled action (Zheng et al., 2026; Luo et al., 2026; Xue et al., 2025a; Xu et al., 2026c; Choi et al., 2026). What remains missing is an explicit, tractable policy that preserves the original deterministic sampler for both image and video generators.

∗^{*}Corresponding author.

Figure

Figure 1: A controlled routing pair replaces a large sampler-noise group. Sampler-space GRPO injects continuous noise into the reverse process and estimates an advantage from many complete visual rollouts. RPO retains the original deterministic sampler and pairs two rollouts that share the prompt, initial visual latent, routed denoising levels, and anchor layers. They differ only in their sampled attention routes, so their reward difference measures the aggregate effect of the two recorded routed trajectories. Generated visual outputs are schematic.

Our key insight is that stochastic exploration need not perturb the denoising trajectory. A diffusion transformer splits each latent into visual tokens, and its attention layers already decide how much each token attends to the others. If we group neighboring tokens into blocks, each query block can attend to a sampled subset of key blocks instead of all of them as dense attention does. We call this choice of visible key blocks a route. Sampling routes exposes a stochastic action without adding a policy head or modifying the sampler. We introduce Routing Policy Optimization (RPO), which samples attention routes from the generator's own attention mass at a few denoising levels. Each sampled route perturbs the velocity of its transition, and a Gaussian likelihood around the dense velocity scores this perturbation. This likelihood supplies a score-function surrogate for the dense generator itself.

The routing action also enables a controlled two-rollout estimator, as Figure 1 illustrates. Both members share every non-routing source of variation and differ only in their sampled routes. Their signed reward difference therefore provides a leave-one-out advantage for the two routed trajectories. During replay, each routed transition is scored from its recorded input, so later levels condition on earlier routes.

Routing serves only as a training interface. The pass that proposes routes carries no gradient, and the likelihood differentiates the dense velocity. The update therefore acts on the same velocity field that dense inference evaluates. After training, we remove all masks and evaluate the updated generator with dense attention and its original deterministic sampler. The central empirical question is whether reward learned through temporary routing transfers to the dense image or video generator used at inference.

We evaluate this question on Stable Diffusion 3.5 Medium and Wan2.2-TI2V-5B (Wan Team et al., 2025), covering text-to-image and text-to-video generation. Across both settings, RPO improves reward-aligned generation quality while retaining dense inference. On Stable Diffusion 3.5, RPO exceeds the final dense validation reward of Flow-GRPO within 25 of 50 training steps and ends 1.1 points higher. On Wan2.2, RPO attains the strongest overall VBench score among the evaluated checkpoints while using 24.1 GPU-hours, compared with 75.4 for Flow-GRPO and 102.3 for Dance-GRPO. This corresponds to 3.1×3.1 \times and 4.2×4.2 \times lower training cost, respectively. Our contributions can be summarized as following:

• We introduce a sampler-preserving formulation for online alignment of continuous visual generators. Its exploration action is a training-time attention route sampled from native attention mass, with no auxiliary policy head or SDE conversion.

• We score each routed transition with a Gaussian velocity likelihood around the dense velocity and optimize it with a controlled two-rollout surrogate that holds the non-routing generation context fixed.

• Because this likelihood updates the dense velocity directly, we remove routing at inference and preserve the original image or video sampler.

• We validate RPO on Stable Diffusion 3.5 and Wan2.2, demonstrating improved reward-aligned quality across image and video generation together with substantially lower training cost than sampler-space baselines.

References (77)

  • ReCache: Learning Budget-Aware Caching Schedules for Diffusion Models via REINFORCE, 2026
  • Stochastic Simulation: Algorithms and Analysis, volume 57 of Stochastic Modelling and Applied Probability (opens the publisher in a new tab)
  • Reinforce Adjoint Matching: Scaling RL Post-Training of Diffusion and Flow-Matching Models, 2026
  • Training diffusion models with reinforcement learning
  • Sparse-vDiT: Unleashing the Power of Sparse Attention to Accelerate Video Diffusion Transformers, 2025
  • Scaling Reinforcement Learning for Diffusion Models via Velocity Matching, 2026
  • Directly Fine-Tuning Diffusion Models on Differentiable Rewards, 2023
  • DenseGRPO: From Sparse to Dense Reward for Flow Matching Model Alignment, 2026
  • Scaling Rectified Flow Transformers for High-Resolution Image Synthesis, 2024
  • Dpok: Reinforcement learning for fine-tuning text-to-image diffusion models
  • SeerAttention: Learning Intrinsic Sparse Attention in Your LLMs, 2024
  • TempFlow-GRPO: When Timing Matters for GRPO in Flow Models, 2025
  • Flash-GRPO: Efficient Alignment for Video Diffusion via One-Step Policy Optimization, 2026
  • Denoising diffusion probabilistic models
  • Reinforcing Few-step Generators via Reward-Tilted Distribution Matching, 2026
  • VBench: Comprehensive benchmark suite for video generative models (opens the publisher in a new tab)
  • Pick-a-pic: An open dataset of user preferences for text-to-image generation
  • HunyuanVideo: A systematic framework for large video generative models, 2024
  • Reinforced Attention Learning, 2026
  • Mixgrpo: Unlocking flow-based grpo efficiency with mixed ode-sde, 2025a
  • Jeva: System One Models from First Principles
  • BranchGRPO: Stable and Efficient GRPO with Structured Branching in Diffusion Models, 2025b
  • Flow matching for generative modeling
  • Flow-grpo: Training flow matching models via online rl
  • Improving video generation with human feedback
  • VideoDPO: Omni-Preference Alignment for Video Diffusion Generation, 2024
  • Flow straight and fast: Learning to generate and transfer data with rectified flow
  • Reinforcement Learning Meets Masked Generative Models: Mask-GRPO for Text-to-Image Generation, 2025
  • Reinforcing diffusion models by direct group preference optimization
  • Light Forcing: Accelerating Autoregressive Video Diffusion via Sparse Attention, 2026
  • Consolidating reinforcement learning for multimodal discrete diffusion models
  • HPSv3: Towards wide-spectrum human preference score (opens the publisher in a new tab)
  • Scalable Diffusion Models with Transformers, 2022
  • Video Diffusion Alignment via Reward Gradients, 2024
  • High-Resolution Image Synthesis with Latent Diffusion Models, 2021
  • Photorealistic text-to-image diffusion models with deep language understanding (opens the publisher in a new tab)
  • Deepseekmath: Pushing the limits of mathematical reasoning in open language models, 2024
  • STAR: SpatioTemporal Adaptive Reward Allocation for Text-to-Image RL Post-Training, 2026a
  • World action models: A survey (opens arXiv in a new tab)
  • Denoising diffusion implicit models
  • V-GRPO: Online Reinforcement Learning for Denoising Generative Models Is Easier than You Think, 2026
  • Diffusion model alignment using direct preference optimization
  • Wan: Open and advanced large-scale video generative models, 2025
  • TAGRPO: Boosting GRPO on Image-to-Video Generation with Direct Trajectory Alignment, 2026
  • GRPO-Guard: Mitigating Implicit Over-Optimization in Flow Matching via Regulated Clipping, 2025a
  • Unified reward model for multimodal understanding and generation, 2025b
  • It takes two: Your GRPO is secretly DPO, 2025a
  • DenseDPO: Fine-Grained Temporal Preference Optimization for Video Diffusion Models, 2025b
  • Sparse VideoGen: Accelerating Video Diffusion Transformers with Spatial-Temporal Sparsity, 2025
  • Sparse Forcing: Native Trainable Sparse Attention for Real-time Autoregressive Diffusion Video Generation, 2026a
  • ImageReward: Learning and Evaluating Human Preferences for Text-to-Image Generation, 2023
  • ToPO: Token-Conditioned Preference Routing for Attention-Based Latent Diffusion Models, 2026b
  • Designing Reinforcement Learning for Diffusion Models: A Unified Path-Space View, 2026c
  • Advantage Weighted Matching: Aligning RL with Pretraining in Diffusion Models, 2025a
  • Dancegrpo: Unleashing grpo on visual generation, 2025b
  • SpatialFlow-GRPO: Where Spatial Credit Drives Image Editing, 2026
  • Cogvideox: Text-to-video diffusion models with an expert transformer, 2024
  • Teaching large language models to regress accurate image quality scores using score distribution (opens the publisher in a new tab)
  • Vifeedit: A video-free tuner of your video diffusion transformer (opens arXiv in a new tab)
  • DiTFastAttn: Attention Compression for Diffusion Transformer Models, 2024
  • MaskFocus: Focusing Policy Optimization on Critical Steps for Masked Image Generation, 2025a
  • VSA: Faster Video Diffusion with Trainable Sparse Attention, 2025b
  • KVPO: ODE-native GRPO for autoregressive video alignment via KV semantic exploration, 2026
  • Training-free efficient video generation via dynamic token carving (opens the publisher in a new tab)
  • DyDiT++: Diffusion Transformers with Timestep and Spatial Dynamics for Efficient Visual Generation, 2025
  • RAPID $^{3}$: Tri-level reinforced acceleration policies for diffusion transformer
  • Diffusionnft: Online diffusion reinforcement with forward process
  • Trainable Log-linear Sparse Attention for Efficient Diffusion Transformers, 2025
  • This appendix gives the full construction that both generators use
  • (a) Raster order turns each block into a horizontal strip and jumps back at every row end (red dotted segments)
  • Jenga (Zhang et al., 2025c) partitions video tokens along such a curve for block-sparse attention, and we adopt the frame-sliced variant of its released implementation
  • The map $\phi_f$ reflects the rows, the columns, or both, so that frame $f$ starts at the corner nearest to the end of frame $f - 1$
  • The attention mass $m_{i,\ell,q,j}$ in Equation 3 sums the dense attention weights from the tokens of $Q_q$ to those of $K_j$, so a compact patch of 128 tokens is the unit of both the score and the action
  • Anchor layers use $\mu_i^t \equiv 1$
  • For Wan2.2, the video autoencoder compresses 13 frames at $704 \times 1280$ by a factor of 4 in time and 16 in space, and patchification halves each spatial side, which gives a $4 \times 22 \times 40$ token grid
  • Counts cover visual tokens only
  • The constant 1.349 converts the interquartile range into a standard-deviation scale under a Gaussian reference