Flow Matching for Offline Reinforcement Learning with Discrete Actions

Fairoz Nower Khan, Nabuat Zaman Nahim, Ruiquan Huang, Haibo Yang, Peizhong Ju · DOI

Abstract

Generative policies based on diffusion models and flow matching have shown strong promise for offline reinforcement learning (RL), but their applicability remains largely confined to continuous action spaces. To address a broader range of offline RL settings, we extend flow matching to a general framework that supports discrete action spaces with multiple objectives. Specifically, we replace continuous flows with continuous-time Markov chains, trained using a Q-weighted flow matching objective. We then extend our design to multi-agent settings, mitigating the exponential growth of joint action spaces via a factorized conditional path. We theoretically show that, under idealized conditions, optimizing this objective recovers the optimal policy. Extensive experiments further demonstrate that our method performs robustly in practical scenarios, including high-dimensional control, multi-modal decision-making, and dynamically changing preferences over multiple objectives. Our discrete framework can also be applied to continuous-control problems through action quantization, providing a flexible trade-off between representational complexity and performance.

Introduction: The Challenge of Discrete Actions in Generative RL

Generative models—specifically diffusion and flow matching—have revolutionized offline RL by allowing agents to model complex data distributions and "steer" them toward high-reward actions. However, these models are fundamentally built for continuous Euclidean spaces.

When applied to discrete actions (like choosing between "Move Left" or "Move Right"), standard generative models struggle. They rely on gradients and ordinary differential equations (ODEs) to "slide" probability mass from a noise distribution to an action. In a discrete world, there is no "sliding" between actions; there are only jumps. Forcing a continuous model onto discrete data often leads to interpolation errors: the model might try to "average" two optimal but distant actions, resulting in an invalid or catastrophic intermediate action (e.g., walking into a trap located between two goals).

Figure 1: (a) Offline dataset with two disjoint modes avoiding a central trap. (b) Continuous interpolation leads to mode collapse, where the agent averages the modes and moves directly into the trap.

Q-weighted Discrete Flow Matching (QDFM)

The core innovation of QDFM is a shift from continuous differential equations to Continuous-Time Markov Chains (CTMC). Instead of using a velocity field to move particles continuously, QDFM learns a rate function (governed by the Kolmogorov forward equation) that defines the probability of "jumping" from one discrete action to another over a time horizon $t \in [0, 1]$.

To turn this generative model into an RL policy, the authors integrate value-based guidance directly into the training objective. They use a learned Q-function to reweight endpoint actions, biasing the "flow" toward high-reward actions while staying within the support of the offline dataset.

Multi-Objective and Multi-Agent Extensions

  • Preference Conditioning: The model is conditioned on a preference vector $\omega$, allowing it to navigate trade-offs (e.g., speed vs. safety) at inference time without retraining.
  • Factorized Paths: To handle the "curse of dimensionality" in multi-agent settings (where the joint action space grows exponentially), QDFM uses a factorized approach where only one agent updates its action at any given "jump" in the chain.

Experimental Evaluation

The researchers evaluated QDFM across several diverse benchmarks:

  • Discretized MuJoCo: Standard continuous control tasks (HalfCheetah, Hopper, Walker2d) converted into discrete spaces with up to 256 "bins" per action dimension.
  • Discrete Multi-Objective RL: Deep-Sea-Treasure (2 objectives) and Resource-Gathering (3 objectives).
  • Multi-Agent Coordination: A two-agent matrix game designed to test coordination under conflicting objectives.
  • Toy Gridworld: A "Multi-Objective Fork" environment used to qualitatively demonstrate how the model avoids "trap" states that trap-averaging continuous models would fall into.

Key Insights

  • Jumps > Slides: For discrete logic, modeling "jumps" via rate matrices is more robust than "sliding" via vector fields. This preserves the multi-modality of the data (the ability to choose between two distinct good options without picking the "average" bad option).
  • Inference Speedup: QDFM is significantly faster than diffusion-based RL. Because it uses a discrete-time Euler approximation of a CTMC, it achieved an order-of-magnitude reduction in action generation time (5.87ms) compared to reported values for continuous diffusion models (~75ms).
  • Quantization as a Feature: Interestingly, the authors found that discretizing continuous problems and solving them with QDFM can sometimes yield better performance and faster inference than staying in the continuous domain, providing a flexible trade-off between complexity and precision.

Results and Performance

On discretized MuJoCo benchmarks, QDFM outperformed strong offline RL baselines like CQL, BCQ, and AWAC in 4 out of 6 tasks. In multi-objective tasks, QDFM discovered a diverse set of Pareto-optimal solutions (e.g., 15 distinct solutions in Deep-Sea-Treasure), whereas scalarized CQL collapsed to a single solution. In the matrix game, QDFM achieved a much higher 2D hypervolume (47.667) compared to Independent BC (30.145), proving it can effectively coordinate multiple agents toward a Pareto front.

Conclusion and Future Work

QDFM provides the first principled framework to adapt generative flow matching for offline RL in discrete action spaces. While performance is sensitive to the number of action divisions ($K_{act}$) and the policy exhibits higher variance due to its stochastic nature, it offers a robust solution for multi-modal and multi-objective decision-making. Future work includes extending this to online/hybrid learning and exploring decentralized multi-agent RL.

Summary updated

Abstract

Generative policies based on diffusion models and flow matching have shown strong promise for offline reinforcement learning (RL), but their applicability remains largely confined to continuous action spaces. To address a broader range of offline RL settings, we extend flow matching to a general framework that supports discrete action spaces with multiple objectives. Specifically, we replace continuous flows with continuous-time Markov chains, trained using a Q-weighted flow matching objective. We then extend our design to multi-agent settings, mitigating the exponential growth of joint action spaces via a factorized conditional path. We theoretically show that, under idealized conditions, optimizing this objective recovers the optimal policy. Extensive experiments further demonstrate that our method performs robustly in practical scenarios, including high-dimensional control, multi-modal decision-making, and dynamically changing preferences over multiple objectives. Our discrete framework can also be applied to continuous-control problems through action quantization, providing a flexible trade-off between representational complexity and performance.
BibTeX
@inproceedings{khan2026flow,
  author = {Fairoz Nower Khan and Nabuat Zaman Nahim and Ruiquan Huang and Haibo Yang and Peizhong Ju},
  title = {{Flow Matching for Offline Reinforcement Learning with Discrete Actions}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ImlV9V1zY1},
}
Figure