Distributionally-Constrained Policy Optimization via Unbalanced Optimal Transport

Arash Givchi, Pei Wang, Junqi Wang, Patrick ShaftoarXiv 2021

Abstract: We consider constrained policy optimization in Reinforcement Learning, where the constraints are in form of marginals on state visitations and global action executions. Given these distributions, we formulate policy optimization as unbalanced optimal transport over the space of occupancy measures. We propose a general purpose RL objective based on Bregman divergence and optimize it using Dykstra's algorithm. The approach admits an actor-critic algorithm for when the state or action space is large, and only samples from the marginals are available. We discuss applications of our approach and provide demonstrations to show the effectiveness of our algorithm.

Introduction

In standard Reinforcement Learning (RL), the primary objective is to maximize a scalar reward. However, real-world deployment often requires more nuance. For instance, a robot might need to follow a specific "budget" of actions—such as limiting high-energy thruster use—or avoid certain state visitation patterns for safety.

Existing methods for Constrained Markov Decision Processes (CMDPs) typically rely on hard scalar limits. This paper addresses the need for distributional constraints, where the agent's entire behavior distribution is required to stay close to a target baseline. This is particularly useful in imitation learning or when global behaviors are preferred over local reward maximization.

Methodology

This research reframes RL as a "stochastic assignment problem" solved through the lens of Unbalanced Optimal Transport (UOT).

  1. Unbalanced Optimal Transport (UOT): Unlike standard Optimal Transport, UOT relaxes the requirement for a perfect match between distributions using penalty functions (like KL divergence). This allows for "unbalanced" mass in occupancy measures.
  2. Bregman Divergence Objective: By generalizing the RL objective using Bregman divergences, various types of regularization (e.g., entropy) and constraints are incorporated into a single convex optimization problem.
  3. Dykstra’s Algorithm: To solve the optimization, the authors employ Dykstra’s algorithm, an iterative method that projects the current solution onto different constraint sets. This decomposes complex constrained problems into manageable steps.
  4. Actor-Critic Extension: For large state spaces, the authors use Fenchel duality to derive an off-policy actor-critic algorithm, enabling the use of neural networks for function approximation.

Experimental Setup

The framework was evaluated using a 3x4 Gridworld environment. This setup includes obstacles, terminal rewards, and "trap" states, providing a clear visualization of how policies adapt to different state and action distribution constraints.

The 3x4 Gridworld environment layout featuring a terminal reward (+1), a penalty (-1), and an obstacle (B).

Key Results

The approach was demonstrated through several gridworld experiments focusing on action shifting and state visitation control.

  • Action Shifting: When forced to adopt action distributions favoring specific directions (e.g., "Right" and "Up"), the agent successfully identified the next-best paths to the goal while strictly adhering to the required action budget.
  • State Visitation Control: By penalizing specific state visitations, the agent learned to take circuitous routes to satisfy distributional constraints, even at the cost of immediate rewards.
  • Convergence: Empirical evidence shows that Dykstra’s algorithm converges quickly and reliably to the constrained optimal policy.
Policy visualizations (1-7) and convergence plots (8) for Dykstra's algorithm across various constraint settings.

Conclusion and Future Work

While the theoretical foundation is robust, several areas remain for future exploration. Scalability testing on high-dimensional benchmarks like MuJoCo or Atari is necessary to confirm the utility of these constraints in complex environments. Additionally, the sensitivity of penalty coefficients ($\epsilon_1, \epsilon_2$) suggests a need for more automated tuning methods. A promising future direction is applying this framework to imitation learning, where target distributions are derived directly from expert demonstrations.

Summary updated

Abstract

We consider constrained policy optimization in Reinforcement Learning, where the constraints are in form of marginals on state visitations and global action executions. Given these distributions, we formulate policy optimization as unbalanced optimal transport over the space of occupancy measures. We propose a general purpose RL objective based on Bregman divergence and optimize it using Dykstra's algorithm. The approach admits an actor-critic algorithm for when the state or action space is large, and only samples from the marginals are available. We discuss applications of our approach and provide demonstrations to show the effectiveness of our algorithm.
BibTeX
@misc{givchi2021distributionally,
  author = {Arash Givchi and Pei Wang and Junqi Wang and Patrick Shafto},
  title = {{Distributionally-Constrained Policy Optimization via Unbalanced Optimal Transport}},
  year = {2021},
  eprint = {2102.07889},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.07889},
}
Figure