UniRL: one RL post-training loop for diffusion, LLM and unified models
- Source
- github.com
- Publisher
- Tencent
- Author
- Tencent Hy
- Date

Context
UniRL is an open-source framework from Tencent's Hunyuan team for improving generative models with reinforcement learning after , and its point is that one training loop serves very different kinds of model. The loop generates samples, scores them, works out which samples did better than their peers, updates the model and sends the new weights back to the workers that generate samples. The repository ships recipes for image models such as Stable Diffusion 3.5 and FLUX.2-Klein, video models such as WAN 2.2 and HunyuanVideo, models that both understand and generate images such as HunyuanImage 3.0 and BAGEL, and language and vision-language models such as Qwen3. Model and algorithm are separate choices, but only within a family: diffusion algorithms run on diffusion models and language-model algorithms on language models.
The two algorithms Tencent launched with it apply one idea to both families. Reinforcement learning methods such as PPO and GRPO keep each update from moving the model too far, a limit called a trust region, by ratio clipping: they compare how likely a sampled output is under the new model and the old one, and stop the update when that ratio leaves a fixed band. Both papers argue the ratio, measured on a single sample, is a poor stand-in for how much the model has actually changed, and replace it with a direct measure of that change.
For image and video models, Flow-DPPO uses the fact that each denoising step in a flow-matching model is a Gaussian distribution, so the divergence between the old and new model can be computed exactly from forward passes training already performs. It blocks an update only when the update both moves away from the trusted region and exceeds a divergence threshold. The authors report higher rewards for the same amount of drift, less forgetting of earlier abilities, and stable training over several passes through the same samples, where ratio clipping degraded. For language models, DRPO keeps the trust region of an earlier divergence-based method, DPPO, but replaces its hard cutoff, which simply discards the gradient of a token that crosses the , with a smooth penalty that pulls such tokens back. The authors report more stable and efficient training across model sizes, architectures and numeric precisions.
Both results come from the authors' own experiments, and the framework's roadmap lists extending Flow-DPPO and DRPO to more model families as near-term work. The shared loop makes it possible to try one family's training method on another; it does not yet mean every algorithm runs on every model.
- Training — The process that adjusts a model using examples and a measure of how well it performs.
- pretraining — The first, biggest phase of building a model: training it on enormous amounts of text so it learns language, facts, and reasoning in general.
- Boundary — A point in a program where one part finishes its job and hands its result to another.
- Large language model — A model trained on large amounts of data to process and generate language.






