Safe Deep Reinforcement Learning for Multi-Agent Systems with Continuous Action Spaces

Ziyad Sheebaelhamd, Konstantinos Zisis, Athina Nisioti, Dimitris Gkouletsos, Dario Pavllo, Jonas KohlerarXiv 2021

In the domain of robotics and autonomous systems, the "trial-and-error" nature of Deep Reinforcement Learning (RL) presents a significant hurdle for safety-critical applications. While RL has demonstrated remarkable success in complex tasks, the risk of collisions during the training phase makes it difficult to deploy in real-world multi-agent environments, such as fleets of autonomous drones or warehouse robots. This paper, originally presented at the RL4RealLife Workshop (ICML 2021), proposes a novel framework to ensure safety during the learning process itself.

The Challenge of Multi-Agent Safety

Most Multi-Agent Reinforcement Learning (MARL) algorithms prioritize reward maximization, often neglecting safety until a policy is fully trained. Traditional "Safe RL" methods frequently rely on hard constraints, which project an agent's proposed action onto a mathematically "safe" space using Quadratic Programming (QP).

However, in multi-agent settings where agents move simultaneously, these QP problems often become infeasible. A situation may arise where no action satisfies the safety model's strict requirements. When a hard-constraint system encounters such an infeasible state, it typically fails, requiring a manual backup policy that is often difficult to design and implement.

Methodology: The Soft-Constraint Safety Layer

The researchers developed their solution by extending the Multi-Agent Deep Deterministic Policy Gradient (MADDPG) algorithm with a specialized Safety Layer.

Architecture of the proposed multi-agent safety framework, integrating a safety filter that processes actions from multiple policies before execution.

The framework consists of three primary components:

  1. Linearized Safety Model: A small neural network is trained to predict the impact of an action on safety constraints, creating a first-order Taylor approximation of environment boundaries.
  2. Soft Constraints: Instead of strict boundaries, the optimization problem is reformulated using slack variables. If a safe action exists, the agent takes it; if the situation is dire and no perfectly safe action is available (infeasibility), the "soft" formulation allows the agent to select the least unsafe action possible.
  3. Exact Penalty Functions: By utilizing specific penalty weights, the system ensures that the soft-constraint solution remains mathematically equivalent to a hard-constraint solution whenever a safe action is feasible.

Experimental Evaluation

The approach was evaluated using the Multi-Agent Particle Environment, featuring three agents in a 2D grid tasked with reaching target landmarks while avoiding collisions. The agents operated in a continuous action space (acceleration) with a 10-dimensional state space.

To test robustness, the agents were subjected to two high-stress conditions:

  • Unsafely Initialized (UI): Agents start in very close proximity to one another.
  • Exogenous Disturbances (ED): Agents are randomly pushed by external forces during the episode.

Key Results and Insights

The experimental results demonstrated that the safety layer drastically improves safety without compromising task performance. Reward convergence curves for unconstrained, hard-constrained, and soft-constrained agents remained nearly identical, proving that safety does not necessarily come at the cost of learning efficiency.

Observed collisions per episode across different experimental scenarios (UI and ED), comparing standard MADDPG with hard and soft safety constraints.

Key performance metrics include:

  • Collision Reduction: The soft-constrained version reduced cumulative collisions by over 97% in both the UI and ED scenarios compared to standard MADDPG.
  • Resilience to Infeasibility: In the ED scenario, hard-constrained agents failed to find a feasible safe action in 56.7% of episodes. In contrast, the soft-constrained approach maintained stability and resulted in roughly 28x fewer collisions than the hard-constrained baseline.
  • Implicit Recovery: Because the soft-constraint model does not "break" during infeasible states, it effectively learns an implicit recovery policy, guiding agents back toward safe regions after a disturbance.

Conclusion and Future Directions

This research highlights the brittleness of hard constraints in dynamic multi-agent environments and demonstrates that soft constraints provide a robust alternative for safe training. While the current model relies on linear approximations and a centralized safety filter, future work aims to decentralize the filter for larger-scale systems and incorporate safety interventions directly into the reward function to eventually eliminate the need for a safety filter during deployment.

Summary updated

BibTeX
@misc{sheebaelhamd2021safe,
  author = {Ziyad Sheebaelhamd and Konstantinos Zisis and Athina Nisioti and Dimitris Gkouletsos and Dario Pavllo and Jonas Kohler},
  title = {{Safe Deep Reinforcement Learning for Multi-Agent Systems with Continuous Action Spaces}},
  year = {2021},
  eprint = {2108.03952},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.03952},
}
Figure