Achieving Zero Constraint Violation for Constrained Reinforcement Learning via Conservative Natural Policy Gradient Primal-Dual Algorithm

Qinbo Bai, Amrit Singh Bedi, Vaneet Aggarwal · OpenReview

Abstract

We consider the problem of constrained Markov decision process (CMDP) in continuous state-actions spaces where the goal is to maximize the expected cumulative reward subject to some constraints. We propose a novel Conservative Natural Policy Gradient Primal-Dual Algorithm (C-NPG-PD) to achieve zero constraint violation while achieving state of the art convergence results for the objective value function. For general policy parametrization, we prove convergence of value function to global optimal upto an approximation error due to restricted policy class. We even improve the sample complexity of existing constrained NPG-PD algorithm from $\mathcal{O}(1/\epsilon^6)$ to $\mathcal{O}(1/\epsilon^4)$. To the best of our knowledge, this is the first work to establish zero constraint violation with Natural policy gradient style algorithms for infinite horizon discounted CMDPs. We demonstrate the merits of proposed algorithm via experimental evaluations.

Introduction

Standard Reinforcement Learning (RL) focuses on maximizing a reward signal. However, in real-world applications like autonomous driving or power grid management, agents must also satisfy strict constraints (e.g., "don't crash" or "don't exceed voltage limits"). These are modeled as Constrained Markov Decision Processes (CMDPs).

The challenge in modern CMDP research is twofold:

  1. Safety vs. Approximation: Most existing algorithms for large-scale CMDPs only guarantee "$\epsilon$-violation," meaning the agent might slightly break the rules during or after training. In high-stakes scenarios, even a small violation can be catastrophic.
  2. Efficiency: Previous methods for general policy types (like neural networks) required a massive number of samples ($O(1/\epsilon^6)$) to converge, making them impractical for complex tasks.

Methodology: The C-NPG-PDA Approach

The authors propose the Conservative Natural Policy Gradient Primal-Dual Algorithm (C-NPG-PDA). Its design rests on three pillars:

  • Conservative Constraints: Instead of solving for the original constraint (e.g., $J_g \ge 0$), the algorithm solves a stricter version: $J_g \ge \kappa$, where $\kappa$ is a positive "safety buffer." This buffer ensures that even with the inevitable errors of function approximation, the agent stays within the original safe zone.
  • Natural Policy Gradient (NPG): Unlike standard gradients, NPG follows the "steepest ascent" in the space of probability distributions (using the Fisher Information Matrix). This often leads to more stable and efficient learning.
  • Primal-Dual Optimization: The algorithm simultaneously updates the policy (the "primal" player trying to maximize reward) and a Lagrange multiplier (the "dual" player enforcing the constraints).

Theoretical Contributions

A key insight of this work is the bridging of the duality gap. In general, non-convex RL with function approximation does not satisfy "strong duality." The authors performed a novel analysis to bound the gap between the conservative problem and the original one, proving that safety does not come at an excessive cost to rewards.

Furthermore, by utilizing first-order stationary results to bound the NPG update direction, they proved that the sample complexity is actually $O(1/\epsilon^4)$, a significant mathematical improvement over the previously accepted $O(1/\epsilon^6)$ for this class of algorithms.

Table 1: Comparison of sample complexity and constraint violation across various CMDP algorithms.

Empirical Performance

The algorithm was evaluated using a Random CMDP model with 10 states and 5 actions. Transition matrices, rewards, and constraints were generated uniformly at random and then normalized. This synthetic environment allowed for precise control of parameters to validate theoretical claims regarding zero violation and convergence rates.

Figure 1: Convergence of objective value (left) and constraint violation (right) for C-NPG-PDA (kappa=0.5) vs. standard NPG-PD (kappa=0).

As shown in Figure 1, C-NPG-PDA achieved zero constraint violation (the log of violation converged to negative infinity), whereas the baseline NPG-PD algorithm ($\kappa=0$) continued to exhibit violations. Despite being more "cautious," the algorithm converged to the neighborhood of the global optimum faster than previous state-of-the-art methods.

Conclusion and Future Work

C-NPG-PDA provides the first proof of zero constraint violation for NPG-style algorithms in infinite-horizon discounted CMDPs with general parametrization. While the results are promising, some limitations remain:

  • Bias Assumptions: The proof relies on specific assumptions regarding "transfer error" and policy richness.
  • Scaling: Future work should test the algorithm on complex physics simulators like MuJoCo or Safety Gym.
  • Hyperparameter Tuning: The choice of the conservative variable $\kappa$ is critical; automating its tuning remains an open research area.

Summary updated

BibTeX
@inproceedings{bai2023achieving,
  author = {Qinbo Bai and Amrit Singh Bedi and Vaneet Aggarwal},
  title = {{Achieving Zero Constraint Violation for Constrained Reinforcement Learning via Conservative Natural Policy Gradient Primal-Dual Algorithm}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i6.25826},
}
Figure