{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/rosarl-reward-only-safe-reinforcement","title":"ROSARL: Reward-Only Safe Reinforcement Learning","arxiv_id":"2306.00035","date":"2023-05-31","proceeding":null,"authors":["Geraud Nangue Tasse","Tamlin Love","Mark Nemecek","Steven James","Benjamin Rosman"],"abstract":"An important problem in reinforcement learning is designing agents that learn to solve tasks safely in an environment. A common solution is for a human expert to define either a penalty in the reward function or a cost to be minimised when reaching unsafe states. However, this is non-trivial, since too small a penalty may lead to agents that reach unsafe states, while too large a penalty increases the time to convergence. Additionally, the difficulty in designing reward or cost functions can increase with the complexity of the problem. Hence, for a given environment with a given set of unsafe states, we are interested in finding the upper bound of rewards at unsafe states whose optimal policies minimise the probability of reaching those unsafe states, irrespective of task rewards. We refer to this exact upper bound as the \"Minmax penalty\", and show that it can be obtained by taking into account both the controllability and diameter of an environment. We provide a simple practical model-free algorithm for an agent to learn this Minmax penalty while learning the task policy, and demonstrate that using it leads to agents that learn safe policies in high-dimensional continuous control environments.","url_abs":"https://arxiv.org/abs/2306.00035v1","url_pdf":"https://arxiv.org/pdf/2306.00035v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"rosarl-reward-only-safe-reinforcement","repo_url":"https://github.com/geraudnt/rosarl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"continuous-control","task_name":"Continuous Control"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"safe-reinforcement-learning","task_name":"Safe Reinforcement Learning"},{"task_slug":"continuous-control","task_name":"continuous-control"},{"task_slug":"reinforcement-learning-2","task_name":"reinforcement-learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2306.00035","atlas_url":"https://app.syntology.ai/?focus=2306.00035","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.00035"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/geraudnt/rosarl","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":6},"by_repo_kind":{"official":{"samples":7,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"d7740644bf4b7de1","entry":"normalize","repo":"geraudnt/rosarl","repo_kind":"official","path":"safety_ai_gym/safety-gym/safety_gym/bench/bench_utils.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/safety_ai_gym/safety-gym/safety_gym/bench/bench_utils.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d7740644bf4b7de1"}},{"code_sha256_prefix":"13b4fc7ea6350802","entry":"V_equal","repo":"geraudnt/rosarl","repo_kind":"official","path":"lavaworld/library.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/lavaworld/library.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"13b4fc7ea6350802"}},{"code_sha256_prefix":"8adf866e5bbbd248","entry":"epsilon_greedy_policy_improvement","repo":"geraudnt/rosarl","repo_kind":"official","path":"lavaworld/library.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/lavaworld/library.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8adf866e5bbbd248"}},{"code_sha256_prefix":"9fcb35d7c6f0cc51","entry":"evaluateQ","repo":"geraudnt/rosarl","repo_kind":"official","path":"lavaworld/exp1.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/lavaworld/exp1.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9fcb35d7c6f0cc51"}},{"code_sha256_prefix":"e68b07bcdded00fa","entry":"mlp","repo":"geraudnt/rosarl","repo_kind":"official","path":"safety_ai_gym/safety-starter-agents/safe_rl/pg/network.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/safety_ai_gym/safety-starter-agents/safe_rl/pg/network.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e68b07bcdded00fa"}},{"code_sha256_prefix":"fe9976fed2aaa536","entry":"process_data","repo":"geraudnt/rosarl","repo_kind":"official","path":"lavaworld/plots.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/lavaworld/plots.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fe9976fed2aaa536"}},{"code_sha256_prefix":"9581da5a5f857ed8","entry":"to_hash","repo":"geraudnt/rosarl","repo_kind":"official","path":"lavaworld/library.py","file_url":"https://github.com/geraudnt/rosarl/blob/HEAD/lavaworld/library.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9581da5a5f857ed8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}