ACPO: A Policy Optimization Algorithm for Average MDPs with Constraints

Akhil Agnihotri, Rahul Jain, Haipeng Luo

Executive Summary

Average-Constrained Policy Optimization (ACPO) is a novel, scalable, trust-region-based reinforcement learning algorithm designed specifically for Constrained Markov Decision Processes (CMDPs) using the average reward criterion. By deriving new theoretical bounds for stationary distribution sensitivity, ACPO ensures long-term safety and higher rewards in complex environments where traditional discounted-reward algorithms typically fail.

The Challenge of Long-Term Safety

In Reinforcement Learning (RL), agents are often tasked with maximizing rewards while strictly satisfying safety constraints (e.g., a robot reaching a goal without colliding with obstacles). Most existing "Safe RL" algorithms rely on a discounted criterion, where future rewards and costs are weighted less heavily than immediate ones.

However, discounting is frequently just a mathematical convenience. In many real-world scenarios—such as long-term robot safety or stable traffic management—the average reward/cost criterion is far more appropriate. Relying on a discount factor as a proxy for safety can be dangerous: it incentivizes "short-term safe" policies that might ultimately lead to catastrophic failures in the long run.

The primary challenge is that Average-criterion Constrained MDPs (ACMDPs) are mathematically much harder to solve than their discounted counterparts. Standard tools like Bellman’s principle of optimality do not apply directly, and existing algorithms like Constrained Policy Optimization (CPO) see their performance bounds explode or become useless as the discount factor approaches 1.

Methodology: The ACPO Algorithm

To address these limitations, the authors introduce ACPO, a policy optimization algorithm that leverages function approximation (deep neural networks) to solve ACMDPs.

  1. New Sensitivity Theory: The core technical contribution is a set of new bounds relating a change in the agent's policy to the resulting change in its stationary state distribution. By analyzing the eigenvalues of the transition matrix, the authors prove that if two policies are "close" (measured via KL divergence), their long-term state distributions remain close.
  2. Trust Region Optimization: Inspired by the renowned TRPO algorithm, ACPO defines a "trust region" around the current policy. At each step, it solves a constrained optimization problem: maximize the average reward advantage subject to cost constraints and a strict limit on how much the policy can change.
  3. Novel Recovery Routine: If the agent enters an "infeasible" state (violating constraints with no clear path to a safe, high-reward update), ACPO employs a unique recovery step. Unlike previous methods that solely follow the cost gradient to regain safety, ACPO's recovery balances the cost gradient with the reward gradient. This prevents the agent from "forgetting" its primary task while attempting to become safe.

Experimental Setup

The algorithm was rigorously evaluated on several challenging continuous control environments within OpenAI Gym (MuJoCo):

  • Point-Circle & Ant-Circle: Agents must navigate in a circle while staying within a specific diameter.
  • Point-Gather & Ant-Gather: Agents must collect green balls (rewards) while avoiding red balls (costs/constraints).
  • Grid: Controlling traffic lights in a 3x3 road network to maximize vehicle throughput while limiting wait times.
  • Bottleneck: Managing vehicles merging into a lane to maximize traffic flow while ensuring non-autonomous vehicles maintain a minimum speed.

Key Insights

  • The "Discounting Trap": The paper mathematically proves that simply setting the discount factor $\gamma \approx 1$ in existing algorithms is not a valid substitute for a true average-reward formulation. The theoretical error bounds for discounted algorithms approach infinity in the average-reward limit.
  • Spectral Analysis for Stability: By utilizing the spectral properties (eigenvalues) of the Markov chain, the authors successfully "tamed" the complexity of how policies affect long-term behavior, providing the first tight performance bounds for this setting.
  • Balanced Recovery: Including the reward gradient alongside the cost gradient during the recovery phase is a crucial practical innovation. It helps the agent maintain better performance stability during training compared to the "safety-only" recovery used in CPO.

Key Results

Average rewards and constraint values across key environments.
  • Superior Performance: In the Ant-Gather environment, ACPO improved rewards by 41.1% over CPO and 61.5% over PCPO, all while strictly satisfying the safety constraints.
  • Scalability: ACPO successfully handled high-dimensional tasks like Bottleneck and Grid (which feature state spaces up to $10^{96}$). In these complex settings, other state-of-the-art algorithms either failed to satisfy constraints entirely or produced significantly lower rewards.
  • Constraint Tracking: In simpler environments like Gather, ACPO was uniquely able to "track" the cost constraint threshold almost exactly, whereas competing algorithms were either overly conservative or recklessly violated safety limits.

Limitations and Future Work

  • Computational Complexity: For computational efficiency, the current practical implementation focuses on a single constraint during the recovery phase, even though the underlying theory supports multiple constraints.
  • Theoretical Assumptions: The theory relies on "unichain" and "ergodic" assumptions (meaning the agent can eventually reach any state from any other state). While standard in RL theory, these assumptions may not hold in environments with strict "dead ends" or irreversible failures.
  • Parallelization: Future work could involve optimizing the algorithm to fully exploit parallel computing architectures, which would significantly speed up training on even larger-scale, real-world problems.

Summary updated

BibTeX
@inproceedings{agnihotri2024acpo,
  author = {Akhil Agnihotri and Rahul Jain and Haipeng Luo},
  title = {{ACPO: A Policy Optimization Algorithm for Average MDPs with Constraints}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=dmfvHU1LNF},
}
Figure