LC-GRPO: Bridging Train-Inference Gap for Flow-Based GRPO with Langevin Correction
cs.LG, cs.AI, cs.CV
Submitted: 2026-08-06
Updated: 2026-10-25
Code: https://github.com/black-forest-labs/flux
License: http://creativecommons.org/licenses/by-nc-sa/4.0/
The gist: Flow-based generative models are typically sampled by solving a deterministic ordinary differential equation (ODE), whereas online reinforcement learning requires stochastic rollouts for policy
Terminology
Abstract
Flow-based generative models are typically sampled by solving a deterministic ordinary differential equation (ODE), whereas online reinforcement learning requires stochastic rollouts for policy exploration and optimization. Existing GRPO methods for flow models therefore replace the inference-time ODE with a stochastic differential equation (SDE) during training. Although the ODE and SDE share the same marginal distributions in continuous time, their finite-step discretizations can differ substantially. In particular, SDE rollouts often become blurry as the exploration noise increases, creating a mismatch between the samples used for reinforcement learning and those generated by the test-time ODE sampler. We introduce LC-GRPO, a flow-based GRPO framework with Langevin correction. Each rollout transition first takes an inference-aligned ODE Euler step and then applies a stochastic Langevin correction targeting the marginal distribution at the resulting timestep. The required score is recovered directly from the flow velocity, requiring no additional score model, while the resulting transition remains an isotropic Gaussian with a tractable likelihood for policy optimization. We theoretically show that, under suitable conditions, one Langevin correction step reduces the Wasserstein error of an imperfect ODE Euler step. At a matched randomness level, we further show that the proposed transition can be more accurate than the standard Euler--Maruyama discretization of the reverse SDE. Experiments on SD3.5-Medium, FLUX.1-Dev, and HunyuanVideo demonstrate that LC-GRPO consistently improves reward optimization across text-to-image and text-to-video tasks, preserves generation quality, and substantially narrows the gap between stochastic training rollouts and deterministic test-time ODE inference.
Sources
- Diffusion Posterior Sampling for General Noisy Inverse Problems
- DenseGRPO: From Sparse to Dense Reward for Flow Matching Model Alignment
- TreeGRPO: Tree-Advantage GRPO for Online RL Post-Training of Diffusion Models
- RAFT: Reward rAnked FineTuning for Generative Foundation Model Alignment
- Gradient Guidance for Diffusion Models: An Optimization Perspective
- HunyuanVideo: A Systematic Framework For Large Video Generative Models
- Aligning Text-to-Image Models using Human Feedback
- MixGRPO: Unlocking Flow-based GRPO Efficiency with Mixed ODE-SDE
- The Mirage of Optimizing Training Policies: Monotonic Inference Policies as the Real Objective for LLM Reinforcement Learning
- Flow Matching for Generative Modeling
- Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow
- Defeating the Training-Inference Mismatch via FP16
- FP8-RL: A Practical and Stable Low-Precision Stack for LLM Reinforcement Learning
- Denoising Diffusion Implicit Models
- Score-Based Generative Modeling through Stochastic Differential Equations
- Wan: Open and Advanced Large-Scale Video Generative Models
- Coefficients-Preserving Sampling for Reinforcement Learning with Flow Matching
- Qwen-Image Technical Report
- DanceGRPO: Unleashing GRPO on Visual Generation
- DiffusionNFT: Online Diffusion Reinforcement with Forward Process
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks