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

Safe Policy Iteration

Matteo Pirotta, Marcello Restelli, Alessio Pecorino, Daniele Calandriello

Overview and the Problem of Policy Oscillation

In Reinforcement Learning (RL), Policy Iteration (PI) is a fundamental algorithm that alternates between evaluating a policy and improving it by choosing the "greedy" action for every state. While PI works perfectly when calculations are exact, it often fails in real-world scenarios where we must use Approximate Policy Iteration (API).

When value functions are estimated from samples or represented by restricted models, the "greedy" update can be too aggressive. A policy that looks better based on noisy data might actually be much worse in reality. This leads to policy oscillations, where the agent's performance bounces around instead of improving. Previous solutions, like Conservative Policy Iteration (CPI), fixed this by taking extremely small, "safe" steps, but they are often too slow for practical use.

This paper introduces Safe Policy Iteration (SPI), a framework that guarantees monotonic performance improvements even when using approximations. By deriving new, tighter lower bounds on policy improvement, the authors propose two algorithms—USPI and MSPI—that avoid the destructive oscillations of standard approximate methods while converging significantly faster than previous conservative approaches.

Proposed Methods: USPI and MSPI

The authors propose two new algorithms that find the "sweet spot" between aggressive greedy updates and overly cautious conservative updates:

  1. Unique-parameter Safe Policy Improvement (USPI): This method updates the policy by mixing the current policy with a target (greedy) policy using a single coefficient, $\alpha$. It uses a new, tighter lower bound to calculate the largest possible "safe" step size.
  2. Multiple-parameter Safe Policy Improvement (MSPI): This more flexible approach allows for a different mixing coefficient $\alpha(s)$ for every state. This allows the agent to take larger steps in states where it is more confident and smaller steps elsewhere.

To find the optimal state-dependent coefficients for MSPI, the authors developed a specialized iterative procedure, as the optimization problem involves a function with a discontinuous derivative.

Key Insights

  • Tighter Bounds = Faster Learning: The core insight is that the lower bounds used by previous safe methods (like CPI) were unnecessarily loose. By deriving more general and tighter bounds, USPI can take much larger steps toward the greedy policy without sacrificing safety.
  • Safety Prevents Oscillations: In approximate settings where standard PI fails to converge and instead oscillates between sub-optimal policies, the "safe" versions successfully reach the optimal policy by refusing to make updates that aren't guaranteed to help.
  • Flexibility in MSPI: While MSPI uses a slightly looser bound than USPI, its ability to vary updates per state makes it much more powerful in complex scenarios where some state updates are much "safer" than others.

Experimental Results

The algorithms were evaluated on two classic RL benchmarks: Chain-walk domains (both exact and approximate versions) and Blackjack. The experiments demonstrate a clear trade-off between speed and stability.

Stability under Approximation: In a 4-state chain-walk with function approximation, standard PI oscillates indefinitely between two poor policies. In contrast, the approximate versions of USPI and MSPI (aUSPI and aMSPI) successfully converge to the optimal performance.

Performance comparison in an approximate setting. Standard PI oscillates, while safe methods steadily climb.

Performance in Complex Domains: In the Blackjack experiment, aMSPI significantly outperformed both aUSPI and aCPI. It reached a higher level of performance much faster by exploiting its state-specific update coefficients.

Performance in Blackjack. aMSPI converges faster and to a better policy by using multiple update parameters.

Limitations and Future Work

The authors acknowledge a few hurdles for scaling these methods:

  • State Enumeration: Currently, both algorithms require looking at every state to compute the update, which is computationally prohibitive for continuous or massive state spaces.
  • Target Policy Selection: The methods rely on being able to find a good "target" policy to move toward.

For future directions, the authors suggest using state aggregation (grouping similar states together) to make MSPI practical for larger domains. They also see potential in applying these safe bounds to Natural Policy Gradient methods to automatically determine the best step size for learning.

Summary updated

BibTeX
@inproceedings{pirotta2013safe,
  author = {Matteo Pirotta and Marcello Restelli and Alessio Pecorino and Daniele Calandriello},
  title = {{Safe Policy Iteration}},
  booktitle = {International Conference on Machine Learning},
  year = {2013},
}
Figure