NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Constrained Policy Gradient Method for Safe and Fast Reinforcement Learning: a Neural Tangent Kernel Based Approach

Balázs Varga, Balázs Kulcsár, Morteza Haghir ChehreghaniarXiv 2021

Introduction

Reinforcement Learning (RL) has demonstrated remarkable success in complex decision-making tasks, yet its practical deployment in real-world systems remains hindered by two primary challenges: the lack of safety guarantees during exploration and the high sample complexity required for convergence. In the early stages of training, RL agents typically engage in "blind exploration," often attempting catastrophic actions—such as crashing a drone or damaging robotic hardware—simply because the negative consequences have not yet been experienced.

Existing "Safe RL" frameworks frequently rely on complex environment models or non-convex optimization techniques, which can be computationally expensive and prone to local minima. This paper introduces a novel approach that leverages the Neural Tangent Kernel (NTK) to transform policy updates into a system of linear equations or quadratic programs. By treating wide neural networks as linear operators in function space, the proposed method allows for the injection of human prior knowledge and strict safety constraints, enabling successful learning in as few as five episodes.

Theoretical Framework: The NTK Bridge

The core innovation of this work lies in utilizing the NTK to linearize the relationship between policy updates and expected returns. The methodology rests on three pillars:

  1. Lazy Learning Regime: By employing over-parameterized (very wide) neural networks and a sufficiently small learning rate, the network remains within the "NTK regime." In this state, the evolution of the network's outputs during training can be accurately described by a linear differential equation.
  2. The Policy-Return Relationship: The authors derive a mathematical bridge that links the change in policy ($\\pi$) directly to the returns ($G$) via the NTK. This allows the researchers to quantify exactly how a specific reward at one state will influence the probability of actions in other, related states.
  3. Linearized Policy Surgery: Because the relationship between returns and policy changes becomes linear under the NTK approximation, the authors can perform "policy surgery." They can effectively work backward: given a desired change in policy behavior, they calculate the specific "safe returns" required to induce that change through standard gradient updates.

Constraint Injection Strategies

Rather than waiting for the environment to provide sparse rewards for safety violations, the algorithm allows for the proactive prescription of behaviors at specific states. The authors propose three types of constraints:

  • Equality Constraints: When a specific action probability is required at a given state, the method solves a system of linear equations to determine the necessary returns to force that specific policy configuration.
  • Inequality Constraints: To ensure an action probability stays above or below a certain threshold, the authors formulate the update as a Convex Quadratic Program (QP). This avoids the instability and local minima common in Lagrangian-based constrained RL.
  • Regional Constraints: For broader safety requirements, the method extends to entire regions of the state space. It dynamically identifies the point within a region where the current policy deviates most from the desired behavior and applies a constraint at that specific point.

Experimental Evaluation

The algorithm was evaluated on two standard benchmarks from the OpenAI Gym:

  1. Cartpole: A low-dimensional environment used to analyze the precision of policy evolution and the speed of convergence.
  2. Lunar Lander: A higher-dimensional environment (8 states, 4 actions) used to test the efficiency of the method in more complex, discrete-action scenarios.

Key Results and Insights

Extreme Sample Efficiency

In the Cartpole environment, the constrained agent achieved stability and learned to balance the pole in just five episodes. This represents a massive improvement over standard unconstrained policy gradient methods, which typically require hundreds of episodes to reach comparable performance.

Strict Safety Adherence

The agents demonstrated the ability to respect prescribed constraints from the very first updates. By hard-coding physical limits (e.g., maximum tilt angles or specific action preferences in danger zones), the "gray-box" RL approach ensures that the agent does not have to "fail" to learn what is dangerous.

Competitive Performance

In the Lunar Lander task, the NTK-based method reached "solved" status significantly faster than traditional benchmarks like Double Deep Q-Learning (DDQN). While highly restrictive constraints can sometimes lead to a slight trade-off in reaching a perfectly optimal (but potentially risky) policy, the gains in safety and speed are substantial.

Limitations and Future Work

Despite its advantages, the method faces several challenges:

  • Dimensionality: Manually defining constraints is straightforward for low-dimensional states but becomes "tedious" for high-dimensional inputs like raw pixels.
  • Expert Dependency: The safety of the agent is entirely dependent on the quality of the provided constraints; poor human priors can degrade long-term performance.
  • Computational Overhead: Solving linear systems and QPs involves kernel evaluations with polynomial time complexity, which may scale poorly as the number of constraints increases.

Future research directions include automating the transformation of regional constraints and exploring more complex policy architectures to reduce the manual tuning required for high-dimensional tasks.

Conclusion

By bridging the gap between the theoretical properties of the Neural Tangent Kernel and practical Reinforcement Learning, this paper provides a robust framework for safe and rapid policy optimization. The ability to treat policy updates as a convex optimization problem offers a promising path toward RL systems that are both mathematically grounded and safe for real-world application.

Summary updated

BibTeX
@misc{varga2021constrained,
  author = {Balázs Varga and Balázs Kulcsár and Morteza Haghir Chehreghani},
  title = {{Constrained Policy Gradient Method for Safe and Fast Reinforcement Learning: a Neural Tangent Kernel Based Approach}},
  year = {2021},
  eprint = {2107.09139},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.09139},
}
Figure