Safe Policy Learning from Observations

Elad Sarafian, Aviv Tamar, Sarit Kraus

Reinforcement Learning (RL) often faces a significant hurdle: improving a policy without inadvertently causing a catastrophic drop in performance due to noisy data. Standard "greedy" algorithms frequently over-optimize for actions that appear promising but have high variance due to limited sampling. This paper introduces Rerouted Behavior Improvement (RBI), a novel constraint designed to ensure safe and efficient policy updates in both offline and online settings.

The Problem: The Improvement Penalty

In standard RL, agents use a $Q$-function to estimate the value of actions. However, these estimates are prone to error, particularly for actions rarely explored. A greedy algorithm ignores this uncertainty; if a $Q$-value appears high—even as a statistical fluke—the agent may shift its entire strategy toward that action. This often results in an "improvement penalty," where the new policy performs significantly worse than the original behavior policy.

While existing methods like TRPO or PPO use KL divergence to keep new policies close to old ones, they do not specifically protect against the high-variance errors associated with low-probability actions.

Rerouted Behavior Improvement (RBI)

The core of the proposed approach is the Reroute Constraint. Instead of limiting the total distance between policies, RBI constrains the ratio of the new policy ($\pi$) to the behavior policy ($\beta$):

$$c_{min} \beta(a|s) \leq \pi(a|s) \leq c_{max} \beta(a|s)$$

By setting hyperparameters $c_{min}$ and $c_{max}$ (e.g., 0.1 and 2.0), the algorithm acts as a "speed limit" for policy changes. This ensures that the agent does not make aggressive bets on actions it hasn't sampled sufficiently.

Figure 1: Visualization of the improvement penalty in a two-armed bandit scenario. The greedy policy (black) risks catastrophic performance drops, while RBI (colored lines) maintains safety across varying noise levels and sample sizes.

Key Innovations

  1. Mathematical Risk Analysis: The authors demonstrate that the variance of the improvement penalty is proportional to the square of the change in probability divided by the original probability. This justifies a more conservative approach to low-probability actions.
  2. Max-Reroute Algorithm: A linear program is solved at each state to identify the optimal policy within the reroute bounds.
  3. Actor-Learner Split: To maintain efficiency in deep RL, the actor calculates the constrained policy on-the-fly, while the learner uses KL divergence to imitate these safe targets, avoiding complex policy gradients.

Experimental Evaluation

The authors evaluated RBI across several benchmarks, including a simplified Two-Armed Bandit and the Atari Learning Environment.

Offline Learning from Observations

When learning from human play data in games like MsPacman and Qbert, RBI consistently improved upon the human behavior policy. In contrast, other constrained methods, such as Total Variation (TV), often resulted in agents performing worse than the original human data.

Iterative Online RL

In iterative online learning across 12 Atari games, RBI demonstrated superior data efficiency and performance. It outperformed the high-performance Ape-X baseline in 7 out of 11 environments and beat the Rainbow benchmark in 9 out of 11. RBI was particularly effective in "hard exploration" games like Seaquest, where it learned complex strategies faster than greedy baselines.

Conclusion and Future Work

RBI provides a robust framework for safe policy improvement by focusing on the ranking of actions and the reliability of their estimates rather than absolute $Q$-value magnitudes. This makes it resilient to scaling issues and estimation errors.

However, the method requires an accurate estimate of the behavior policy $\beta$. If the data source is unknown, the agent must first model that source, which can introduce new errors. Future research may explore more efficient ways to approximate these bounds directly within neural network architectures to reduce the computational overhead of solving linear programs at every state.

Summary updated

BibTeX
@misc{sarafian2018safe,
  author = {Elad Sarafian and Aviv Tamar and Sarit Kraus},
  title = {{Safe Policy Learning from Observations}},
  year = {2018},
  eprint = {1805.07805},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.07805},
}

Loading related content...

Figure