Skip to main content
QUICK REVIEW

[Paper Review] I'm sorry Dave, I'm afraid I can't do that, Deep Q-learning from forbidden action

Mathieu Seurin, Pierre‐Marie Preux|arXiv (Cornell University)|Oct 4, 2019
Reinforcement Learning in RoboticsComputer Science48 references7 citations
TL;DR

This paper proposes a modified Deep Q-Network (DQN) that learns from forbidden actions—actions rejected by safety constraints in real-world environments—by introducing a frontier loss that pushes Q-values of invalid actions below those of valid ones. The method accelerates convergence and reduces unsafe action calls compared to standard DQN, enabling safer and more efficient reinforcement learning in constrained environments.

ABSTRACT

The use of Reinforcement Learning (RL) is still restricted to simulation or to enhance human-operated systems through recommendations. Real-world environments (e.g. industrial robots or power grids) are generally designed with safety constraints in mind implemented in the shape of valid actions masks or contingency controllers. For example, the range of motion and the angles of the motors of a robot can be limited to physical boundaries. Violating constraints thus results in rejected actions or entering in a safe mode driven by an external controller, making RL agents incapable of learning from their mistakes. In this paper, we propose a simple modification of a state-of-the-art deep RL algorithm (DQN), enabling learning from forbidden actions. To do so, the standard Q-learning update is enhanced with an extra safety loss inspired by structured classification. We empirically show that it reduces the number of hit constraints during the learning phase and accelerates convergence to near-optimal policies compared to using standard DQN. Experiments are done on a Visual Grid World Environment and Text-World domain.

Motivation & Objective

  • To address the challenge of reinforcement learning in environments with safety constraints that reject hazardous actions.
  • To overcome the limitation of standard DQN, which treats rejected actions as no-ops, thereby failing to learn from them.
  • To design a method that leverages feedback from external controllers or action masks to improve exploration and policy learning.
  • To accelerate convergence to near-optimal policies while minimizing unsafe action usage in real-world applications.

Proposed method

  • Augment standard DQN with a frontier loss inspired by structured classification to separate Q-values of forbidden actions from valid ones.
  • Train a classification head to predict whether an action is forbidden, using a margin-based loss to enforce a safe gap in Q-values.
  • Integrate the frontier loss into the DQN update rule, modifying the temporal difference target to include safety-aware regularization.
  • Use a dual-head network: one for Q-value prediction and one for action validity classification, both trained jointly.
  • Apply the method in environments with action masks (e.g., visual grid world, TextWorld), where actions outside physical or syntactic bounds are rejected.
  • Ensure the model learns that forbidden actions are not just ineffective but inherently suboptimal, guiding exploration toward safer policies.

Experimental results

Research questions

  • RQ1Can standard DQN effectively learn from rejected actions that are filtered by external safety controllers?
  • RQ2How does adding a frontier loss improve learning efficiency and safety in environments with forbidden actions?
  • RQ3Does the proposed method reduce the number of calls to forbidden actions during training compared to standard DQN?
  • RQ4Can the frontier loss guide exploration toward safer policies even when the agent initially explores hazardous actions?
  • RQ5To what extent does the method generalize to environments with large or variable action spaces?

Key findings

  • The proposed DQN with frontier loss significantly reduces the number of calls to forbidden actions during training compared to standard DQN.
  • The method accelerates convergence to near-optimal policies, as evidenced by faster performance gains in both the visual grid world and TextWorld environments.
  • Even after 100,000 training steps, standard DQN fails to clearly separate Q-values of forbidden and valid actions, while the frontier loss maintains a consistent gap.
  • Visualization shows that the frontier loss reshapes Q-value distributions early in training, guiding the agent to avoid dangerous actions.
  • The method improves exploration by teaching the agent that certain actions are not just ineffective but actively harmful, leading to better policy generalization.
  • The frontier loss enables effective learning in environments with large or variable action spaces, where action rejection is common.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.