TL;DR
Action Mapping (AM) is a novel training strategy for deep reinforcement learning (DRL) that tames continuous action spaces under strict safety constraints. By pretraining a feasibility policy to map a latent space exclusively to valid actions, AM transforms a complex constrained problem into an unconstrained one, drastically improving sample efficiency and robustness—even when the underlying feasibility model is imperfect.
What Problem Does This Paper Address?
In reinforcement learning, teaching an agent to maximize rewards while respecting real-world constraints (like avoiding obstacles or staying within physical limits) is notoriously difficult. In discrete action spaces, this is easily solved with "action masking"—simply blocking the illegal choices. However, in continuous domains (e.g., robotics, autonomous driving), you can't just mask out an infinite set of invalid actions.
Existing solutions like action replacement (swapping bad actions for a safe default), resampling (trying again until a safe action is found), or action projection (mathematically pushing an invalid action to the nearest safe boundary) have major drawbacks. They are either computationally expensive, ruin the agent's gradient updates, or fail catastrophically when the safety model is only an approximation. This paper introduces Action Mapping to bridge this gap efficiently.
Methods
The core idea behind Action Mapping is to decouple learning what is feasible from learning what is optimal.
- The Feasibility Policy ($\pi_f$): First, the authors pretrain a task-independent generator using a known (or approximate) feasibility model. This policy maps a latent space $Z$ to the set of safe actions $A^+_s$. It is trained using Kernel Density Estimation (KDE) and Jensen-Shannon divergence to ensure it maps uniformly across all valid actions without bias.
- The Objective Policy ($\pi_o$): During actual DRL training (using standard algorithms like PPO or SAC), the agent doesn't output a direct action. Instead, it outputs a latent variable $z \in Z$. This latent variable is then passed through the frozen feasibility policy to produce a guaranteed safe (or mostly safe) action $a$.
This architecture effectively warps the environment from the agent's perspective, turning a State-wise Constrained Markov Decision Process (SCMDP) into a standard, unconstrained MDP.
The training loop for combining this mapping with standard actor-critic methods is straightforward and can be integrated into off-policy (SAC) or on-policy (PPO) pipelines:
Datasets
The authors evaluated their approach on two custom continuous simulation environments designed to test different feasibility conditions:
- Robotic Arm End-Effector Pose: A kinematic 7-DOF robot arm task where the agent must move its joints to reach a target pose while avoiding up to 20 spherical obstacles. This setup features a perfect feasibility model and a known safe "null action" (stop moving).
- Non-Holonomic Path Planning: A highly challenging aircraft-like routing environment where the agent must collect targets while avoiding 30 rectangular obstacles. Because the agent moves at a constant velocity and has a maximum turning curvature, it cannot stop. This setup uses a multi-step spline-based action space and an approximate numerical feasibility model.
Key Insights and Ideas
- The Latent Space "Jump" Trick: In complex environments, the safe action space is often disconnected (e.g., going left or right around an obstacle). In the real action space, moving from left to right requires passing through an unsafe "middle" zone, which standard policy gradients struggle to cross. In Action Mapping's latent space, these disconnected safe zones are mapped right next to each other, allowing the agent to seamlessly switch strategies.
- Expressing Multi-Modal Distributions: Even if the objective policy only outputs a simple single-modal Gaussian distribution in the latent space, the feasibility mapping can warp it into a complex, multi-modal distribution in the real action space. This drastically improves exploration early in training.
- Interior vs. Boundary Learning: Action projection methods push invalid actions directly onto the safety boundary. If your safety model is imperfect, the boundary is a dangerous place to be. Action Mapping, by contrast, learns a distribution over the entire volume of safe actions, making it far more robust to approximate models.
Key Results
- Superior Performance: In both environments, Action Mapping (AM-PPO and AM-SAC) learned significantly faster and achieved higher cumulative rewards than standard baselines and Lagrangian safety methods.
- Outperforming Projection with Imperfect Models: In the path planning task (where the safety model was approximate), action projection failed because it constantly pushed the agent onto poorly approximated boundaries. AM-SAC successfully navigated the obstacles by learning to stay safely within the interior regions.
- Massive Computational Speedups: Because Action Mapping replaces expensive online optimization (required by projection methods) with a simple neural network forward pass, it reduced training and inference times significantly. For instance, in the path planning task, AM-SAC inference was roughly 3x faster than projection methods when utilizing GPU acceleration.
Limitations and Future Work
While highly effective, Action Mapping is not without limitations:
- Conservative Boundaries: The use of KDE during feasibility pretraining introduces a slight buffer zone, which can cause the agent to act overly conservatively near safe boundaries.
- No Strict Safety Guarantees: Because the feasibility policy is a learned neural network, it isn't perfectly surjective and can occasionally output an invalid action. For absolute safety, it must still be paired with a fallback mechanism like action replacement if a safe default action is known.
- Future Directions: The authors suggest exploring weight-sharing between the feasibility and objective policies to improve efficiency further, as well as extending the framework to handle entirely learned feasibility models from data.
Summary updated