Skip to content

About

Scalable and Online Reinforcement Learning for Few-step Diffusion Models

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

DiffusionPOND

Scalable and Online Reinforcement Learning for Few-step Diffusion Models

Zhenglin Cheng1,2,3,4  ·  Peng Sun1,3,4  ·  Jun Xie1,2,3,4  ·  Jiacheng Liu5  ·  Jiaming Liu4,*  ·  Jiaqi Wang2  ·  Tao Lin3

1Zhejiang University  ·  2SII  ·  3Westlake University  ·  4Tencent  ·  5MBZUAI   (*Project Lead)

arXiv Project Page Hugging Face Models GitHub Apache 2.0 License

Method  /  Results  /  Installation  /  Quick Start  /  Configs  /  Docs  /  Citation


DiffusionPOND (Positive–Negative Distribution Matching) is a teacher-free, black-box online reinforcement learning framework tailored directly to few-step diffusion and flow models (NFE = 4). Rather than relying on pretrained teachers, differentiable reward models, composite RL surrogates, or tractable denoising likelihoods, DiffusionPOND partitions rollouts from the evolving generator into positive and negative distributions and optimizes the generator through a single distribution-matching objective.

Explore visual demos on the Project Page, read the paper on arXiv, and download released checkpoints from Hugging Face.

DiffusionPOND method overview

Highlights

  • Single distribution-matching objective: Requires no pretrained teacher anchor, no reward gradients or proxy models, and no tractable policy likelihood.
  • Broad few-step compatibility: Directly post-trains few-step generators across distillation paradigms — SD3.5-M-Turbo, Wan2.1-T2V-1.3B / 14B (rCM, AnyFlow, SMD), and autoregressive Causal-rCM video generators (chunk sizes 1 and 3).
  • Strong gains across modalities and scales:
    • Text-to-Image (SD3.5-M-Turbo, NFE = 4): Leads all few-step baselines on 6 of 7 metrics and ranks top-2 on 5 of 7 metrics even against 40-step RL baselines.
    • Text-to-Video (Wan2.1-T2V, NFE = 4): Reaches 84.25 VBench Total at 1.3B (surpassing both 50-step and 4-step baselines), and scales to 14B with +20.1% Gemini-judged test-set preference gain over the 4-step initialization (+10.9% over the 50-step base model).
    • Autoregressive Video (Causal-rCM Wan, NFE = 4): Directly improves Stage-2 causal video generators across combined reward, motion quality (MQ), text alignment (TA), and held-out visual quality (VQ) without Stage-1 exposure bias.

Scope note: The paper's 33B MiniMax-H3 joint audio–video experiments were conducted in a separate H3 codebase. This repository releases the complete training, evaluation, and configuration suite for Text-to-Image (SD3.5-M-Turbo), Text-to-Video (Wan2.1-1.3B & 14B across rCM / AnyFlow / SMD), Autoregressive Video (Causal-rCM), and aligned multi-step RL baselines (DiffusionART, DiffusionNFT, Flow-GRPO-Fast, ReFL).


Method

Given a condition $c$, an EMA reference generator $G_{\bar\theta}$ produces $N$ candidate rollouts scored by a black-box scalar reward $r(x_0, c)$. Ranking these candidates defines an evolving high-reward positive distribution $\pi^+$ (top-$k$) and a low-reward negative distribution $\pi^-$ (bottom-$k$).

  1. Positive and mixture score critics. Two lightweight score critics $v_{\phi_+}$ and $v_{\phi_{\mathrm{mix}}}$ (LoRA adapters sharing the generator backbone) are trained with standard flow matching on $\pi^+$ and the online–negative mixture $\pi_{\mathrm{mix}} = (1 - \rho)\pi_\theta + \rho\pi^-$ ($\rho \in [0, 1]$):

$$ \mathcal{L}_{\mathrm{aux}}^+(\phi_+) = \mathcal{L}_{\mathrm{aux}}(\phi_+; \pi^+), \qquad \mathcal{L}_{\mathrm{aux}}^{\mathrm{mix}}(\phi_{\mathrm{mix}}) = (1-\rho)\mathcal{L}_{\mathrm{aux}}(\phi_{\mathrm{mix}}; \pi_\theta) + \rho\mathcal{L}_{\mathrm{aux}}(\phi_{\mathrm{mix}}; \pi^-) $$

  1. Generator distribution matching. Holding $\pi^+$ and $\pi^-$ fixed, DiffusionPOND minimizes the reverse KL divergence between $\pi_{\mathrm{mix}, t}$ and $\pi_t^+$ using a single DMD-style surrogate on re-noised online samples $x_t = (1-t)x_0 + t z'$:

$$ \mathcal{L}_G(\theta) = \mathbb{E}\left[\left|x_0 - \mathrm{sg}(x_0 + d)\right|_2^2\right], \qquad d = t\big[v_{\phi_{\mathrm{mix}}}(x_t, t) - v_{\phi_+}(x_t, t)\big] $$

The effective score difference decomposes cleanly into online-to-positive attraction and positive–negative contrast:

$$ s_{+,t} - s_{\mathrm{mix},t} = (1 - \omega_t)(s_{+,t} - s_{\theta,t}) + \omega_t(s_{+,t} - s_{-,t}), \qquad \omega_t = \frac{\rho,\pi_t^-(x_t)}{\pi_{\mathrm{mix},t}(x_t)} $$

  1. Training recipe. In practice, we pair a 4:1 critic-to-generator update ratio with EMA tracking $\bar\theta \leftarrow \beta\bar\theta + (1-\beta)\theta$ and online rollout replay across uniform random schedule steps. See docs/pond.md and docs/wan-pond-rollout-steps.md for implementation details.

Results

Text-to-Image RL (SD3.5-M, 1024×1024)

DiffusionPOND matches or surpasses 40-step RL methods while generating at NFE = 4 (10× fewer function evaluations) and preserving out-of-distribution aesthetic and human-preference quality:

Method NFE GenEval OCR PickScore CLIPScore HPSv2.1 Aesthetic (OOD) ImageReward (OOD)
SD3.5-M (Base) 40 0.683 0.534 22.773 29.272 0.288 5.265 0.989
+ Flow-GRPO 40 0.791 0.959 23.774 30.463 0.336 5.918 1.422
+ DiffusionNFT 40 0.913 0.953 22.618 30.829 0.271 4.932 1.078
+ DiffusionART 40 0.684 0.942 22.508 31.082 0.311 4.748 1.254
SD3.5-M-Turbo 4 0.587 0.284 22.331 28.145 0.266 5.275 0.526
+ RTDMD 4 0.584 0.418 22.587 28.864 0.279 5.335 0.759
+ TDM-R1 4 0.823 0.944 22.047 29.635 0.274 5.127 1.005
+ MeanFlowNFT 4 0.649 0.459 22.769 28.997 0.288 5.401 0.886
+ DiffusionPOND (ours) 4 0.767 0.948 23.885 30.867 0.328 5.608 1.346

Text-to-Image RL training curves on SD3.5-M

Text-to-Video RL (Wan2.1-T2V-1.3B)

At 480p / 81 frames, 4-step DiffusionPOND achieves the highest VBench Total and VBench Quality scores while improving both targeted rewards (MQ, TA) and held-out VQ at a fraction of multi-step RL compute:

Method NFE GPU Hours VBench Total VBench Qual. VBench Sem. Test MQ Test TA Test VQ (OOD)
Wan2.1-T2V-1.3B 50 — 82.65 83.30 80.08 0.480 -0.821 0.096
+ ReFL 50 329 82.82 83.46 80.23 0.398 -0.547 0.006
+ Flow-GRPO Fast 50 704 82.83 83.42 80.50 0.472 -0.712 0.157
+ DiffusionNFT (best) 50 2,682 82.98 83.37 81.42 0.982 -0.622 0.209
+ DiffusionART (best) 50 1,113 81.72 83.11 76.12 2.935 -0.972 1.411
Wan2.1-T2V-1.3B-rCM 4 — 83.70 84.57 80.21 0.326 -0.638 0.021
+ MeanFlowNFT 4 1,643 80.20 79.65 82.38 0.520 -0.557 0.151
+ DiffusionPOND (ours) 4 764 84.25 85.14 80.69 0.705 -0.469 0.434

Text-to-Video RL training curves on Wan2.1-T2V-1.3B

Autoregressive Video RL (Causal-rCM Wan2.1-1.3B)

DiffusionPOND applies directly to causal chunk-wise video generators with KV caching, delivering steady gains on combined reward, MQ, TA, and held-out VQ across both chunk size 1 and chunk size 3:

Autoregressive Causal-rCM Wan RL training curves


Installation

All core, image RL, and video RL dependencies are managed with uv (pyproject.toml + uv.lock, Python ≥ 3.10, PyTorch 2.6.0 + CUDA 12.4).

1. Core & Image RL Environment

git clone https://github.com/Tencent-TEXCH/DiffusionPOND.git
cd DiffusionPOND

# Core + diffusers + image rewards + W&B (recommended for SD3.5-M-Turbo POND)
export UV_PROJECT_ENVIRONMENT="$HOME/envs/pond"
uv sync --locked --python 3.10 \
  --extra diffusers --extra image-rewards --extra wandb

# Optional extras:
#   --extra ocr      # PaddleOCR reward support (see docs/sd3-ocr.md)
#   --extra hpsv2    # HPSv2.1 reward (uses vendored wheel in third_party/hpsv2)
#   --extra dev      # pytest & ruff for development

Verify the environment with a quick CPU dry-run:

uv run python -m visual_rl.check_environment
uv run visual-rl --config configs/examples/cpu_smoke.yaml --validate

GenEval reward: GenEval runs in an isolated worker environment via GENEVAL_PYTHON. See docs/geneval.md for setup details.

2. Video RL Environment (Wan2.1-T2V & Causal-rCM)

Video RL requires Linux x86_64, ffmpeg/ffprobe, and pinned Wan/VideoReward dependencies. Install into a dedicated environment:

bash scripts/install_video_environment.sh wan $HOME/envs/pond-wan

# Optional (Hopper H100/H200 GPUs): install FlashAttention-3
bash scripts/install_wan_fa3.sh $HOME/envs/pond-wan

See docs/video-installation.md and docs/wan-fa3.md for details and troubleshooting.


Quick Start

1. Prepare Checkpoints, Rewards & Prompts

Released DiffusionPOND checkpoints are hosted at Tencent-TEXCH/DiffusionPOND.

All YAML configs use declarative ${ENV_VAR} placeholders with no hardcoded paths. Inspect or download public image assets and prompt manifests with:

uv run python -m visual_rl.prepare_assets \
  --config configs/pond/image/pickscore_rho05.yaml --plan

Refer to configs/pond/README.md for the complete environment variable reference, and validate any config before launching:

uv run visual-rl --config <config.yaml> --validate

2. Text-to-Image RL (SD3.5-M-Turbo, 8 GPUs)

# Single-reward (PickScore / OCR / GenEval) or joint Multi-Reward
uv run visual-rl --config configs/pond/image/pickscore_rho05.yaml --nproc-per-node 8
uv run visual-rl --config configs/pond/image/ocr_rho05.yaml --nproc-per-node 8
uv run visual-rl --config configs/pond/image/geneval_rho05.yaml --nproc-per-node 8
uv run visual-rl --config configs/pond/image/multireward_rho05.yaml --nproc-per-node 8

3. Text-to-Video RL (Wan2.1-T2V 1.3B & 14B)

# Wan2.1-T2V-1.3B rCM (8 GPUs; use *_32gpu.yaml for the 4x8 multi-node paper setup)
POND_OPTIMIZE=1 python -m visual_rl.train \
  --config configs/pond/video/mqta13_gray_bon8_rho05.yaml \
  --nproc-per-node 8

# Wan2.1-T2V-1.3B AnyFlow or SMD
POND_OPTIMIZE=1 python -m visual_rl.train \
  --config configs/pond/video/anyflow/mqta13_gray_bon8_rho05_8gpu.yaml \
  --nproc-per-node 8

POND_OPTIMIZE=1 python -m visual_rl.train \
  --config configs/pond/video/smd/mqta13_gray_bon8_rho05_8gpu.yaml \
  --nproc-per-node 8

# Wan2.1-T2V-14B rCM (32 GPUs, 2-step rollout, 480x480)
POND_OPTIMIZE=1 python -m visual_rl.train \
  --config configs/pond/video/14b/tamqvq721_gray_bon8_rho05_480sq_rollout2_replay4_32gpu.yaml \
  --nproc-per-node 8 --nnodes 4 --node-rank "$NODE_RANK" --master-addr "$MASTER_ADDR"

4. Autoregressive Video RL (Causal-rCM Wan2.1-1.3B)

# Chunk size 3 (8 GPUs with the POND_OPTIMIZE=1 kernel bundle)
bash scripts/train_optimized_causal_pond.sh outputs/pond/causal_c3

# Multi-node 32 GPUs (chunk=3 or chunk=1)
POND_OPTIMIZE=1 python -m visual_rl.train \
  --config configs/pond/causal/rcm_scm_sfdmd_c3_step4_mqta13_replay4_optimized_32gpu.yaml \
  --nproc-per-node 8 --nnodes 4 --node-rank "$NODE_RANK" --master-addr "$MASTER_ADDR"

5. Evaluation (VBench & Gemini Pairwise Judge)

  • VBench: See docs/vbench.md for offline checkpoint sampling and VBench scoring.
  • VidProM Pairwise Evaluation (Gemini API):
    export GEMINI_API_KEY="your-api-key"
    # Prepare balanced A/B pairs (omit --submit for a dry run)
    python -m visual_rl.evaluation.evaluate_vidprom_gemini \
      --eval-a outputs/eval_base --eval-b outputs/eval_pond \
      --output outputs/vidprom_pair_eval --submit

Experiment Configurations

All paper recipes and ablations live under configs/:

Directory Contents
configs/pond/image/ SD3.5-M-Turbo main recipes (pickscore, ocr, geneval, multireward) and ablations (N, rho, ema, top-k, bottom-k, optimality, stability)
configs/pond/video/ Wan2.1-T2V 1.3B (rCM, AnyFlow, SMD), 14B (rCM), and ablations (N, rho, ema, top-k, bottom-k, teacher anchor, fake_steps, replay, rollout steps)
configs/pond/causal/ Causal-rCM Wan2.1-1.3B autoregressive recipes (chunk=3, chunk=1, replay/reward/rollout ablations)
configs/baselines/ Aligned multi-step baselines (DiffusionART, DiffusionNFT, Flow-GRPO-Fast, ReFL) on SD3.5-M and Wan2.1-T2V
configs/models/ Reusable Wan2.1 1.3B / 14B model presets (base, rcm4, smd4)

Development & Tests

uv sync --locked --python 3.10 --extra dev --extra diffusers --extra image-rewards --extra ocr --extra wandb
uv run python scripts/check_coding_style.py
uv run ruff check src tests
uv run pytest -q

Acknowledgements

This codebase builds upon DiffusionART and integrates open-source models, rewards, and baselines from Diffusers, DanceGRPO, Flow-GRPO, DiffusionNFT, rCM, AnyFlow, SMD, VideoReward, and VBench. See THIRD_PARTY_NOTICES.md for license attribution.


Citation

If you find DiffusionPOND useful in your research, please cite our paper:

@article{cheng2026diffusionpond,
  title   = {DiffusionPOND: Scalable and Online Reinforcement Learning for Few-step Diffusion Models},
  author  = {Zhenglin Cheng and Peng Sun and Jun Xie and Jiacheng Liu and Jiaming Liu and Jiaqi Wang and Tao Lin},
  journal = {arXiv preprint arXiv:2612.03900},
  year    = {2026}
}

About

Scalable and Online Reinforcement Learning for Few-step Diffusion Models

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages