Towards Safe Reinforcement Learning with a Safety Editor Policy
Haonan Yu, Wei Xu, Haichao Zhang
Abstract
We consider the safe reinforcement learning (RL) problem of maximizing utility with extremely low constraint violation rates. Assuming no prior knowledge or pre-training of the environment safety model given a task, an agent has to learn, via exploration, which states and actions are safe. A popular approach in this line of research is to combine a model-free RL algorithm with the Lagrangian method to adjust the weight of the constraint reward relative to the utility reward dynamically. It relies on a single policy to handle the conflict between utility and constraint rewards, which is often challenging. We present SEditor, a two-policy approach that learns a safety editor policy transforming potentially unsafe actions proposed by a utility maximizer policy into safe ones. The safety editor is trained to maximize the constraint reward while minimizing a hinge loss of the utility state-action values before and after an action is edited. SEditor extends existing safety layer designs that assume simplified safety models, to general safe RL scenarios where the safety model can in theory be arbitrarily complex. As a first-order method, it is easy to implement and efficient for both inference and training. On 12 Safety Gym tasks and 2 safe racing tasks, SEditor obtains much a higher overall safety-weighted-utility (SWU) score than the baselines, and demonstrates outstanding utility performance with constraint violation rates as low as once per 2k time steps, even in obstacle-dense environments. On some tasks, this low violation rate is up to 200 times lower than that of an unconstrained RL method with similar utility performance. Code is available at https://github.com/hnyu/seditor.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4cc95aa3-a887-493e-b83f-a6b5e0999a72Cited by top-tier papers11
- Constraint-Conditioned Policy Optimization for Versatile Safe Reinforcement LearningYihang Yao, Zuxin Liu, Zhepeng Cen, Jiacheng Zhu et al.NeurIPS 2023 · 24 citations
- OASIS: Conditional Distribution Shaping for Offline Safe Reinforcement LearningYihang Yao, Zhepeng Cen, Wenhao Ding, Haohong Lin et al.NeurIPS 2024 · 16 citations
- Reinforcement Learning with Adaptive Regularization for Safe Control of Critical SystemsHaozhe Tian, Homayoun Hamedmoghadam, Robert Shorten, Pietro FerraroNeurIPS 2024 · 11 citations
- On the Robustness of Safe Reinforcement Learning under Observational PerturbationsZuxin Liu, Zijian Guo, Zhepeng Cen, Huan Zhang et al.ICLR 2023 · 9 citations
- CHPO: Constrained Hybrid-action Policy Optimization for Reinforcement LearningAo Zhou, Jiayi Guan, Li Shen, Fan Lu et al.NeurIPS 2025 · 1 citation
Builds on11
- Responsive Safety in Reinforcement Learning by PID Lagrangian MethodsAdam Stooke, Joshua Achiam, Pieter AbbeelICML 2020 · 403 citations
- Projection-Based Constrained Policy OptimizationTsung-Yen Yang, Justinian Rosca, Karthik Narasimhan, Peter J. RamadgeICLR 2020 · 306 citations
- First Order Constrained Optimization in Policy SpaceYiming Zhang, Quan Vuong, Keith W. RossNeurIPS 2020 · 238 citations
- Safe Reinforcement Learning by Imagining the Near FutureGarrett Thomas, Yuping Luo, Tengyu MaNeurIPS 2021 · 118 citations
- Constrained Variational Policy Optimization for Safe Reinforcement LearningZuxin Liu, Zhepeng Cen, Vladislav Isenbaev, Wei Liu et al.ICML 2022 · 112 citations
Related papers
- Exploring Safer Behaviors for Deep Reinforcement LearningEnrico Marchesini, Davide Corsi, Alessandro FarinelliAAAI 2022 · 36 citations
- Breaking Safety Paradox with Feasible Dual Policy IterationYujie Yang, Jinglin Teh, Ziyu Lin, Kaicheng Yu et al.ICLR 2026
- Safe Exploration in Reinforcement Learning: A Generalized Formulation and AlgorithmsAkifumi Wachi, Wataru Hashimoto, Xun Shen, Kazumune HashimotoNeurIPS 2023 · 38 citations
- Enhancing Efficiency of Safe Reinforcement Learning via Sample ManipulationShangding Gu, Laixi Shi, Yuhao Ding, Alois Knoll et al.NeurIPS 2024 · 14 citations
- Constraint-Adaptive Policy Switching for Offline Safe Reinforcement LearningYassine Chemingui, Aryan Deshwal, Honghao Wei, Alan Fern et al.AAAI 2025 · 12 citations
