UniRL
Getting Started

Project README

Project quick start, documentation entry points, checks, and citation.

UniRL β€” A Reinforcement Learning Framework for Unified Multimodal Models

A Reinforcement Learning Framework for Unified Multimodal Models

U(you)Β·ni(need)Β·RL for unified multimodal intelligence

Python License Documentation WeChat


UniRL ranked #16 Python Repository of the Day on Trendshift

News πŸš€

  • [2026-10] UniRL v0.2.0 released β€” 12 new model packages, SFT / agentic / async training modes, and SGLang 0.5.19 + vLLM-Omni 0.28 rollout stacks (release notes).
  • [2026-06] DRPO released β€” "Rethinking the Divergence Regularization in LLM RL" (arXiv).
  • [2026-06] Flow-DPPO released β€” "FlowDPPO: Divergence Proximal Policy Optimization for Flow Matching Models" (arXiv).
  • [2026-06] CPPO released β€” "Beyond Uniform Token-Level Trust Region in LLM Reinforcement Learning" (arXiv).

About πŸ’‘

UniRL applies one RL post-training loop β€” generate samples, score them, compute advantages, update the policy, and sync weights back to rollout workers β€” across multimodal model families.

UniRL architecture

UniRL is a layered, composable system. Each training entrypoint loads a Hydra example config and creates the matching domain trainer. RL trainers coordinate generation, scoring, and updates across pluggable rollout engines, algorithms, model bundles, reward services, and the shared distributed runtime: Ray DevicePool, FSDP, Transfer Queue (TQ), and LoRA/full-weight sync. SFT consumes supervised manifests, while the async AR and diffusion entrypoints overlap rollout with training on separate GPU slabs. See examples/README.md for all entrypoints and unirl/README.md for the runtime loop, deployment modes, and module map.

Team-Proposed Algorithms 🌟

🌟 These algorithms are proposed by our team β€” the highlight of UniRL. Each algorithm's folder holds a step-by-step tutorial and a runnable example recipe. We highly recommend trying them in our framework!

AlgorithmPaperTutorialNotes
Flow-DPPO"Flow-DPPO: Divergence Proximal Policy Optimization for Flow Matching Models"FlowDPPO/Diffusion/flow RL with an exact divergence-based trust-region mask.
DRPO"Rethinking the Divergence Regularization in LLM RL"DRPO/Token-level LLM RL with a smooth advantage-weighted quadratic regularizer.
CPPO"Beyond Uniform Token-Level Trust Region in LLM Reinforcement Learning"CPPO/Token-level LLM RL with a position-weighted, cumulative-prefix-budget Binary-TV mask.

UniRL also wires in standard reference algorithms β€” (LLM's)GRPO, DiffusionNFT, DanceGRPO, and MixGRPO β€” in unirl/algorithms/.

Model Support 🎨

Model and algorithm support are two independent dimensions that compose within a domain: any diffusion algorithm (see above) runs on a diffusion model, AR algorithms on AR models β€” so UniRL covers many more model Γ— algorithm combinations than the shipped example recipes alone. The table below is the model dimension: each row links one runnable recipe. Full matrix β€” package, every recipe, rollout engine, and restriction per model β€” in unirl/models/README.md.

ModelCategoryModalityRecipeStatus
Stable Diffusion 3.5Image diffusionText β†’ Imagesd3_trainsideβœ…
Qwen-ImageImage diffusionText β†’ Imageqwen_image_trainsideβœ…
Qwen-Image-Edit-2511Image diffusionText + Image β†’ Imageqwen_image_edit_plus_nftβœ…
FLUX.2-Klein (4B / 9B)Image diffusionText β†’ Image / Text + Image β†’ Imageflux2_klein_trainsideβœ…
Z-ImageImage diffusionText β†’ Imagez_image_trainsideβœ…
Boogu-Image-0.1Image diffusionText β†’ Imageboogu_image_trainsideβœ… trainside only
WAN 2.1Video diffusionText / Image β†’ Videowan21_t2vβœ…
WAN 2.2 (A14B)Video diffusionText / Image β†’ Videowan22_t2v_14bβœ…
WAN 2.2 V2VVideo diffusionVideo β†’ Videowan22_v2v_14bβœ… trainside only
HunyuanVideo 1.0Video diffusionText β†’ Videohunyuan_video10_t2v_trainsideβœ…
HunyuanVideo 1.5Video diffusionText β†’ Videohunyuan_video15_t2v_dancegrpo_trainsideβœ…
LTX-2Video diffusionText β†’ Videoltx2_t2v_trainsideβœ…
LTX-2.3Video diffusionText β†’ Audio + Videoltx2_3_t2av_trainsideβœ… trainside only
MiniMax-H3Video diffusionText β†’ Video + Audiominimax_h3_t2va_trainsideβœ… trainside only
HunyuanImage 3.0Unified AR + diffusionText / Text + Image β†’ Imagehi3_trainside_t2iβœ…
BAGEL-7B-MoTUnified AR + diffusionText / Text + Image β†’ Image; Text + Image β†’ Textbagel_trainside_loraβœ…
SenseNova-U1.5Unified MoT pixel flowText β†’ Imagesensenova_u1_5_trainsideβœ… trainside only
Janus-ProUnified ARText β†’ Image; Text + Image β†’ Textjanus_pro_grpo_t2i_loraβœ… trainside only
Qwen3LLM ARText β†’ Textqwen3_grpo_4b_base_dapo_sglangβœ…
Qwen3-MoE (VeOmni EP)LLM ARText β†’ Textqwen3_moe_grpo_30b_a3b_veomni_ep_sglang🧩 bundle-only
Qwen3.5 (9B / 35B-A3B)VLM ARText / Text + Image β†’ Textqwen3_5_grpo_9b_base_dapo_sglangβœ… sglang only
Qwen2.5-VLVLM ARText + Image β†’ Textqwen_vl_grpo_geo3k_mc_4x8βœ…
Qwen3-Omni ThinkerOmni-modality ARText / Image / Audio / Video β†’ Textqwen3_omni_video_r1_gspo_lora_vllm_omni_1x4βœ… vllm_omni only
Cosmos3-NanoWorld modelVideo (+ action) predictionsft/cosmos3_droid100_videopredπŸ§ͺ SFT-only
Prompt-EnhancerLLM + diffusion (composed)Text β†’ Text β†’ Imagepe_trainside_pickscoreπŸ”— composed

βœ… runnable end-to-end with the linked recipe (a qualifier names the only rollout engine that has a recipe) Β· 🧩 bundle-only (no pipeline of its own; runs under another package's pipeline) Β· πŸ§ͺ SFT-only (no rollout path) Β· πŸ”— composed from other rows. SFT, async, agentic, and scorer-service requirements per model are in the full matrix.

Training Modes 🧩

Each entrypoint has one built-in default, used when --config-name is omitted.

Training pathTrainsEntrypointBuilt-in default recipe
Diffusion RLImage / video diffusion modelstrain_diffusiondiffusion/sd3/sd3_trainside
AR RLVision-language (VLM) + text-only (LLM) modelstrain_arar/qwen_vl_grpo_geo3k_mc_4x8
SFTSupervised text, multimodal, and diffusion modelstrain_sftsft/qwen3_sft
Prompt enhancementAR rewriter + diffusion rewardtrain_pepe/pe_trainside_pickscore
Unified RLUnified AR + diffusion modelstrain_unified_modelunified_model/hi3_vllmomni
Agentic RLService-scored multi-turn tool usetrain_agenticdeep_research/deep_research_search_judge
Async AR RLAR models with separate train / rollout workerstrain_async_arar/qwen3_grpo_4b_base_dapo_sglang_async
Async diffusion RLDiffusion models with separate train / rollout workerstrain_async_diffusiondiffusion/bagel/bagel_vllmomni_async

See examples/README.md for the full launch guide, naming schema, and how to add a recipe.

Agentic Workflows πŸ€–

train_agentic extends the AR path with multi-turn tool use. Each turn is a Sample in a lineage; terminal answers are scored by a reward service, and training waits at a colocated rollout barrier.

AgenticTrainer synchronizes current training weights before every rollout, dispatches sibling trajectories concurrently, and waits for complete GRPO groups before scoring and training. Each successful trajectory receives one group-normalized advantage, which is applied to every generated assistant turn. Failed trajectories are excluded from the update.

See the agent environment guide for the environment, tool, and trajectory contracts.

Getting Started ⚑

Install dependencies first β€” see INSTALL.md.

# compose-check, then launch a single-node example
python -m unirl.train_diffusion --config-name=diffusion/sd3/sd3_trainside --cfg job --resolve
bash examples/run_experiment_single_node.sh diffusion/sd3/sd3_trainside

Full launch guide β€” multi-node, every entrypoint, mooncake.

Roadmap πŸ—ΊοΈ

We are actively expanding model and algorithm coverage. Near-term directions:

  • Broaden algorithm coverage for the newer model families β€” FLUX.2-Klein, HunyuanVideo 1.0 / 1.5, and Bagel.
  • Extend the team-proposed algorithms (Flow-DPPO, DRPO) to more model families.
  • Broaden reward backends and rollout-engine coverage across domains.

Want a model or algorithm prioritized? Open a feature request to discuss.

Contributing 🀝

Contributions and questions are welcome. Before opening a pull request, read the repository conventions in AGENTS.md, run the pre-PR checks for the files you touched, and fill in the pull request template. Use the issue forms for a bug report or feature request. WeChat is fine for chat; bugs still belong on GitHub so they stay searchable.

Acknowledgement πŸ™

UniRL builds on ideas and infrastructure from the open-source RL and inference ecosystem. We especially thank vLLM, SGLang, slime, and verl.

Citation πŸ“š

If you find UniRL helpful, please cite:

@misc{unirl_github,
  title        = {{UniRL: A Reinforcement Learning Framework for Unified Multimodal Models}},
  author       = {Haonan Wang and Linyu Wu and Qian Qiu and Lewei Jin and Bowen Ping and Jianghai Chen and Yiheng Du and Guangxin He and Yu Shi and Yongguang Lin and Zhuoxin Zhou and Zhanchao Zhou and Keming Wu and Rizhen Hu and Xuefei Ning and Lvfang Tao and Feiyu Hu and Xiangyan Liu and Siqi Kou and Jiarui Yao and Xiangxin Zhou and Liefeng Bo and Wenxi Zhu and Tianyu Pang},
  year         = {2026},
  howpublished = {\url{https://github.com/Tencent-Hunyuan/UniRL}},
  urldate      = {2026-06-05}
}

If you use DRPO, please also cite:

@article{yao2026rethinking,
  title={Rethinking the Divergence Regularization in LLM RL},
  author={Yao, Jiarui and Zhou, Xiangxin and Qi, Penghui and Lee, Wee Sun and Bo, Liefeng and Pang, Tianyu},
  journal={arXiv preprint arXiv:2606.09821},
  year={2026}
}

If you use Flow-DPPO, please also cite:

@article{ping2026flow,
  title={Flow-DPPO: Divergence Proximal Policy Optimization for Flow Matching Models},
  author={Ping, Bowen and Zhou, Xiangxin and Qi, Penghui and Luo, Minnan and Bo, Liefeng and Pang, Tianyu},
  journal={arXiv preprint arXiv:2606.11025},
  year={2026}
}

Source: README.md β€” edit the README next to the code, then run npm run sync:readmes from docs/.

On this page