Reduced Policy Optimization for Continuous Control with Hard Constraints

Shutong Ding, Jingya Wang, Yali Du, Ye Shi

Introduction

Reinforcement Learning (RL) has demonstrated remarkable capabilities in solving complex decision-making tasks, from mastering games to enabling robotic maneuvers. However, its application in safety-critical physical systems—such as power grids or high-precision robotics—remains limited by the inability to strictly enforce "hard" constraints. While standard Safe RL algorithms typically utilize Lagrangian multipliers to penalize constraint violations, these "soft" approaches only encourage compliance rather than guaranteeing it. In many real-world scenarios, such as maintaining supply-demand equilibrium in a power grid or respecting hardware joint limits, even minor violations can lead to system failure.

This paper, presented at NeurIPS 2023 by researchers from ShanghaiTech University and King’s College London, introduces Reduced Policy Optimization (RPO). RPO is a novel framework designed to bridge the gap between classical optimization and modern RL by integrating the Generalized Reduced Gradient (GRG) method into off-policy RL to ensure strict adherence to both equality and inequality constraints.

Problem Formulation

The primary challenge addressed is the enforcement of hard constraints in continuous control. Most existing Safe RL methods transform constraints into penalties, which often results in a trade-off where safety is sacrificed for reward or vice versa. Furthermore, existing frameworks often struggle with:

  1. Equality Constraints: $f(x) = 0$, which require exact solutions (e.g., physical conservation laws).
  2. Nonlinear/Non-convex Constraints: Complex physical laws that do not follow simple linear patterns.
  3. Simultaneous Constraints: Managing both equality and inequality constraints concurrently.

The RPO Framework

The core innovation of RPO is a two-stage decision procedure that ensures feasibility throughout the learning process.

1. Construction Stage (Equality Constraints)

Drawing inspiration from the GRG method, RPO partitions the action vector into basic actions ($a_B$) and nonbasic actions ($a_N$). The policy network is tasked only with outputting the basic actions. The nonbasic actions are then derived using an equation solver to satisfy the equality constraints $h(a_B, a_N) = 0$. To enable end-to-end training, the authors utilize implicit differentiation, allowing gradients to propagate through the solver back to the policy network. This effectively reduces the search space for the RL agent, as it only needs to learn the "creative" part of the action while the "physics" part is solved deterministically.

2. Projection Stage (Inequality Constraints)

Once equality constraints are satisfied, the resulting action may still violate inequality constraints ($g(a) \leq 0$). RPO performs an iterative projection within the null space of the equality constraints. This ensures that the action is moved into the feasible region for inequalities without disturbing the previously established equality compliance. Unlike penalty-based methods that only become safe after long training, RPO's projection stage can enforce feasibility even during early exploration.

3. Modified Lagrangian Relaxation

To improve training stability and reduce the computational burden on the solver, RPO incorporates an exact penalty term into the loss function. This guides the policy network toward initial guesses that are closer to the feasible region, reducing the work required by the projection stage.

Experimental Evaluation

Due to a lack of standard benchmarks for hard physical constraints, the authors developed and released three new environments:

  • Safe CartPole: Requires the sum of two applied forces to be zero in the vertical direction (equality) while staying within a horizontal box (inequality).
  • Spring Pendulum: Mimics a rigid rod by requiring a zero length-change rate while keeping force magnitudes bounded.
  • Optimal Power Flow (OPF) with Battery Storage: A complex task involving nonlinear power flow equations and 58 different box constraints on voltage and power generation.

Key Results

RPO was integrated into DDPG and SAC and compared against state-of-the-art methods like CPO, CUP, and Safety Layer.

  • Superior Safety: In the Safe CartPole environment, RPO achieved a perfect reward of 200.0 with zero constraint violations. In contrast, competing methods like CPO and CUP exhibited significant violations and lower rewards.
  • Complexity Handling: In the OPF benchmark—the most difficult task—RPO was the only method capable of maintaining near-zero violations for both equality and inequality constraints while maintaining positive rewards.
  • Efficiency: RPO-based agents showed faster convergence, as the reduced degrees of freedom simplified the learning objective and avoided the typical "penalty vs. reward" trade-off struggle.

Discussion and Conclusion

RPO represents a significant step toward deploying RL in environments governed by strict physical laws. By reducing the degrees of freedom and utilizing differentiable optimization, it ensures feasibility even during the exploration phase, which is vital for real-world deployment.

However, some limitations remain. The iterative projection stage introduces computational overhead compared to standard forward passes. Additionally, the partitioning of actions currently requires domain expertise to determine which variables are dependent on others. Future research will focus on automating action division and optimizing the projection stage for real-time, high-frequency control applications like drone stabilization.

Summary updated

BibTeX
@inproceedings{ding2023reduced,
  author = {Shutong Ding and Jingya Wang and Yali Du and Ye Shi},
  title = {{Reduced Policy Optimization for Continuous Control with Hard Constraints}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=fKVEMNmWqU},
}
Figure