Solving Constrained Reinforcement Learning through Augmented State and Reward Penalties

Hao Jiang, Tien Mai, Pradeep VarakanthamarXiv 2023 · DOI

TL;DR

This paper introduces a novel approach to Constrained Reinforcement Learning (CRL) by reformulating the problem into an unconstrained one using an augmented state space and reward penalties. This method effectively handles various safety constraints, outperforming existing state-of-the-art techniques on benchmark tasks.

What Problem Does This Paper Address?

Reinforcement Learning (RL) agents often need to operate under safety constraints, such as not exceeding a certain cost or risk level. Traditional Constrained RL (CRL) methods often struggle with constraints that depend on the cumulative cost over an entire trajectory. Existing approaches try to convert these trajectory-level constraints into step-by-step local constraints. However, this often relies on cost estimations, which can lead to overly conservative or aggressive policies, hindering performance. The core challenge is to enforce these cumulative cost constraints effectively without sacrificing the primary objective (e.g., maximizing reward).

Methods

The paper proposes an Extended MDP (EMDP) formulation. The key innovation is augmenting the state space to include the accumulated cost so far. This allows the agent to directly track its progress towards violating the constraint. Additionally, instead of directly enforcing the constraint, the EMDP formulation introduces reward penalties when the accumulated cost approaches or exceeds the limit. This approach is theoretically shown to be equivalent to various types of constrained RL problems, including:

  • Risk-Neural CMDP (RN-CMDP): Standard expected cost constraints.
  • Worst-Case CMDP (WC-CMDP): Ensuring constraints are never violated.
  • Value at Risk (VaR) CMDP: Bounding the probability of constraint violation.
  • Conditional Value at Risk (CVaR) CMDP: Bounding the expected cost of violation.

The authors then adapt existing RL algorithms, specifically Deep Q-Network (DQN) and Soft Actor-Critic (SAC), to work with this EMDP formulation, creating "Safe DQN" and "Safe SAC." These modified algorithms leverage the augmented state and reward penalties to learn safe policies.

Datasets

The paper evaluates its methods on several benchmark environments:

  • GridWorld: A discrete state-action environment with pits that incur costs.
  • Highway: A continuous control environment simulating car driving with lane change constraints.
  • Merge Environment: A continuous control environment for car merging maneuvers.
  • Safety Gym (StaticEnv): A continuous control environment used for evaluating CVaR constraints.
  • Puddle Environment: A continuous control environment with a hazardous puddle area.

No new datasets were introduced; existing benchmarks were used and adapted for specific constraint types.

Key Insights and Ideas

  • Augmented State + Reward Penalty is Powerful: The core insight is that by augmenting the state with accumulated cost and using carefully designed reward penalties, a constrained problem can be transformed into an unconstrained one. This simplifies the learning problem significantly.
  • Exact Credit Assignment: Unlike methods relying on estimated future costs, the augmented state provides exact information about past costs, enabling more precise credit assignment for constraint violations during learning.
  • Unified Framework: The EMDP formulation acts as a unifying framework, capable of representing and solving various types of safety constraints (expected cost, VaR, CVaR, worst-case) by simply adjusting the penalty parameter ($\lambda$).
  • Theoretical Guarantees: The paper provides theoretical proofs demonstrating the equivalence between the EMDP and different CMDP formulations under specific penalty parameter settings. This provides a strong foundation for the empirical results.

Key Results

The proposed Safe SAC and Safe DQN methods consistently outperformed existing approaches like BVF and Lyapunov on RN-CMDP tasks in terms of both expected reward and constraint satisfaction across GridWorld, Highway, and Puddle environments. For CVaR-CMDP, Safe SAC achieved comparable or superior performance to WCSAC, a leading algorithm in this area. Ablation studies confirmed that both state augmentation and reward penalties are crucial for achieving good performance. The impact of the reward penalty parameter ($\lambda$) was also analyzed, showing that an appropriate value is key for balancing reward and safety, with very large $\lambda$ leading to conservative, near-zero-violation policies.

Limitations and Future Work

  • Hyperparameter Tuning: The paper acknowledges that the initial value and threshold for the reward penalty ($\lambda$) might require tuning for different environments to achieve optimal performance.
  • Scalability of State Space: For complex environments with large state spaces (like the Highway merge environment), Safe DQN struggled due to the increased dimensionality of the augmented state. Safe SAC, being more suited for continuous control, performed better.
  • Future Work: The paper suggests extending the framework to multi-constrained MDPs, which has been partially explored in the appendix. Further research could focus on more automated methods for setting the penalty parameter $\lambda$ and exploring its dynamic adjustment more deeply.

Summary updated

BibTeX
@misc{jiang2023solving,
  author = {Hao Jiang and Tien Mai and Pradeep Varakantham},
  title = {{Solving Constrained Reinforcement Learning through Augmented State and Reward Penalties}},
  year = {2023},
  eprint = {2301.11592},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.11592},
}
Figure