Cautious Policy Programming: Exploiting KL Regularization in Monotonic Policy Improvement for Reinforcement Learning

Lingwei Zhu, Toshinori Kitamura, Takamitsu MatsubaraarXiv 2021

Abstract

In this paper, we propose cautious policy programming (CPP), a novel value-based reinforcement learning (RL) algorithm that can ensure monotonic policy improvement during learning. Based on the nature of entropy-regularized RL, we derive a new entropy regularization-aware lower bound of policy improvement that only requires estimating the expected policy advantage function. CPP leverages this lower bound as a criterion for adjusting the degree of a policy update for alleviating policy oscillation. Different from similar algorithms that are mostly theory-oriented, we also propose a novel interpolation scheme that makes CPP better scale in high dimensional control problems. We demonstrate that the proposed algorithm can trade off performance and stability in both didactic classic control problems and challenging high-dimensional Atari games.

Introduction

In the ideal theoretical framework of reinforcement learning (RL), every policy update should lead to a measurable improvement in performance. However, in practical applications—particularly those utilizing deep neural networks—agents often suffer from "policy oscillation." This phenomenon occurs when a policy update causes a sudden, significant dip in performance, leading to instability during training. Such fluctuations are a major barrier to deploying RL in high-stakes environments like robotics or autonomous driving, where reliability is paramount.

While existing methods like Conservative Policy Iteration (CPI) provide theoretical lower bounds to guarantee monotonic improvement, they are often computationally intractable. These methods typically require searching for the maximum difference between policies across the entire state-action space, a task that becomes impossible in high-dimensional environments. Consequently, there remains a significant gap between theoretically "safe" RL and the scalable, deep RL methods used in practice.

Methods: Cautious Policy Programming (CPP)

Cautious Policy Programming (CPP) bridges this gap by leveraging the mathematical properties of entropy-regularized RL to create a tractable, scalable algorithm for monotonic improvement.

1. Entropy-Regularized Framework

CPP operates within a framework that incorporates Shannon entropy and Kullback-Leibler (KL) divergence into the reward function. This regularization serves two purposes: it encourages exploration and ensures that policy updates are sufficiently smooth, preventing the agent from making radical, unverified changes to its behavior.

2. A Tractable Lower Bound

The core innovation of CPP is a new "entropy-regularization-aware" lower bound. By restricting the policy to the class of entropy-regularized (Boltzmann) policies, the authors prove that the maximum distance between consecutive policies is bounded. This allows the algorithm to replace intractable "max-space" calculations with a much simpler term based on the expected policy advantage. This shift makes the safety guarantee computationally feasible for the first time in complex settings.

3. The Cautiousness Coefficient ($\zeta$)

Rather than immediately adopting a new "greedy" policy, CPP performs a partial, controlled update: $$\text{New Policy} = \zeta(\text{Greedy}) + (1-\zeta)(\text{Old Policy})$$ The coefficient $\zeta$ acts as a dynamic "trust" meter. Early in training, when uncertainty is high, $\zeta$ remains small, ensuring the agent is cautious. As the advantage function becomes more reliable, $\zeta$ increases, allowing for more aggressive learning and faster convergence.

4. Deep CPP Implementation

To scale CPP to high-dimensional problems, the authors implemented it as a variant of the Deep Q-Network (DQN). Because interpolating two policies does not automatically result in a valid Boltzmann policy, the authors introduced a projection step. This step uses gradient descent on a KL loss to keep the model within the mathematically safe policy class, ensuring that the theoretical benefits of the lower bound are preserved in a deep learning context.

Experimental Evaluation

The authors evaluated CPP across three distinct environments to test its versatility and stability:

  • Safety Gridworld (5x5): A tabular environment used to verify the algorithm's behavior when exact computation is possible.
  • Pendulum Swing-Up: A classic control task used to test CPP with Linear Function Approximation.
  • Atari 2600 Games: High-dimensional benchmarks including MsPacman, SpaceInvaders, Beamrider, Assault, and Seaquest. These tests compared Deep CPP against state-of-the-art off-policy (MDQN, MoDQN) and on-policy (PPO, A2C) baselines.

Key Results and Insights

Superior Stability and Performance

In the Pendulum task, CPP demonstrated remarkable reliability, converging to the optimal solution across all random seeds. In contrast, previous Safe Policy Iteration (SPI) methods often failed or produced updates so small that they never reached optimality.

In the Atari benchmarks, Deep CPP achieved either first or second place in final scores across all five environments. Notably, on the challenging Seaquest environment, CPP achieved scores approximately 30% higher than Deep CPI. While some aggressive algorithms like MDQN showed high initial scores, they eventually suffered from numerical instability and performance crashes—problems that CPP successfully avoided through its cautious update mechanism.

Efficiency and Scalability

Unlike many "safe" RL methods that require expensive on-policy sampling, CPP is compatible with off-policy data and replay buffers. This makes it significantly more sample-efficient than its predecessors, allowing it to handle the high-dimensional input of Atari games without the prohibitive computational costs usually associated with monotonic improvement guarantees.

Conclusion and Future Work

Cautious Policy Programming demonstrates that entropy regularization is not just a tool for exploration, but a vital mechanism for simplifying the mathematics of safe policy improvement. By making safety guarantees tractable, CPP provides a robust framework for training stable deep RL agents.

However, some challenges remain. The current implementation relies on a heuristic projection step to maintain the Boltzmann policy class, which may slightly deviate from the strict theoretical bounds. Additionally, the algorithm's reliance on an approximation of the stationary state distribution ($d^\pi$) suggests that future improvements in distribution estimation could further enhance CPP's performance. Finally, extending these "cautious" guarantees to continuous action spaces (e.g., Soft Actor-Critic) represents a promising avenue for future research.

Summary updated

BibTeX
@misc{zhu2021cautious,
  author = {Lingwei Zhu and Toshinori Kitamura and Takamitsu Matsubara},
  title = {{Cautious Policy Programming: Exploiting KL Regularization in Monotonic Policy Improvement for Reinforcement Learning}},
  year = {2021},
  eprint = {2107.05798},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.05798},
}
Figure