ICML2021

Safe Reinforcement Learning Using Advantage-Based Intervention

Nolan Wagener, Byron Boots, Ching-An Cheng

66 citations

Abstract

Many sequential decision problems involve finding a policy that maximizes total reward while obeying safety constraints. Although much recent research has focused on the development of safe reinforcement learning (RL) algorithms that produce a safe policy after training, ensuring safety during training as well remains an open problem. A fundamental challenge is performing exploration while still satisfying constraints in an unknown Markov decision process (MDP). In this work, we address this problem for the chanceconstrained setting. We propose a new algorithm, SAILR, that uses an intervention mechanism based on advantage functions to keep the agent safe throughout training and optimizes the agent's policy using off-the-shelf RL algorithms designed for unconstrained MDPs. Our method comes with strong guarantees on safety during both training and deployment (i.e., after training and without the intervention mechanism) and policy performance compared to the optimal safetyconstrained policy. In our experiments, we show that SAILR violates constraints far less during training than standard safe RL and constrained MDP approaches and converges to a wellperforming policy that can be deployed safely without intervention. Our code is available at https://github.com/nolanwagener/safe_rl . * be its state-action value function, and V * be its state value function. be a subset of admissible intervention rules with a threshold of zero and average as the advantage function of the optimal policy. For some intervention rule G ∈ G 0 and policy π, let π = G(π). Then, the inequality A(s, a) ≥ A * (s, a) holds for all a ∈ A almost surely over the distribution d π (s). Proof. First, we show by induction that running π starting from d 0 results in the agent staying in the subset S G = s ∈ S : For t = 0, consider some s 0 ∼ d 0 . We observe from admissibility of G and Proposition 2 that Now suppose the agent is in S G with probability one at some time step t. Consider some s t ∼ d π t (observing that s t ∈ S G ). We assume that s t ∈ S safe (otherwise, the below is trivially true as there is no intervention outside S safe ). By Lemma 4 and admissibility, we can derive: where the second and fourth equalities are due to s t ∈ S safe , and the third equality is due to s t ∈ S G . Notice also, since s t ∈ S safe , we have Therefore, combining the two inequalities above, we have Since Q(s, a) ≥ V * (s) on S × A, by the same argument we made for s 0 , we conclude Q(s t+1 , µ) = V * (s t+1 ) with probability one. Therefore, the agent stays in the subset S G . With this property in mind, let s ∼ d π . Then the following holds for all a ∈ A: where the second equality is due to Q Proposition 4. Let π * be an optimal policy for M, Q * be its state-action value function, and V * be its state value function. π * , 0) ∈ G 0 . Consider arbitrary G ∈ G 0 and policy π. Let M and M * be the absorbing MDPs induced by G and G * , respectively, and let d π and d * ,π be their state-action distributions of π. Then, Supp S×A ( d π ) ⊆ Supp S×A ( d * ,π ), where Supp S×A (d) denotes the support of a distribution d when restricted on S × A.