Shield Decentralization for Safe Reinforcement Learning in General Partially Observable Multi-Agent Environments

Daniel Melcer, Christopher Amato, Stavros Tripakis

TL;DR

This paper introduces a novel method for ensuring safety in multi-agent reinforcement learning (RL) systems operating in environments where agents have limited and potentially different observations. Their approach successfully synthesizes decentralized safety shields, allowing agents to act safely and effectively in complex, partially observable scenarios where previous methods failed.

What Problem Does This Paper Address?

Reinforcement learning is increasingly being applied to safety-critical systems, such as autonomous driving or robotics. A key challenge is ensuring that RL agents behave safely, especially during the exploration phase of training, where unpredictable actions can lead to catastrophic failures. "Shielding" is a technique that uses formal methods to guarantee safe behavior by restricting an agent's actions. However, existing multi-agent shielding methods have been limited to scenarios where all agents share the same or similar observations. This is a significant limitation, as many real-world multi-agent systems involve agents with distinct and incomplete views of the environment. This paper tackles the problem of developing safe shielding for multi-agent systems with general partial observability, where agents can have arbitrary and different observations, and there's no single agent with complete information.

Methods

The authors propose a two-stage approach to synthesize decentralized shields for general partially observable multi-agent environments:

  1. Centralized Shield Synthesis: They first synthesize a centralized shield for an abstracted version of the environment. This shield guarantees safety by ensuring that no action leads to a "bad" state. They adapt existing fixpoint-finding algorithms for this purpose.
  2. Shield Decomposition: The core novelty lies in decomposing this centralized shield into a decentralized shield. This means each agent receives its own safety constraints based on its individual observations, without needing to communicate with other agents. They explore two methods for this decomposition:
  3. Naive Algorithm: This method involves choosing arbitrary "state-decentralizations" (sets of allowed actions for each agent in a given state) and checking if they are compatible with the centralized shield. This can be computationally expensive and may fail.
  4. SAT-based Algorithm: This approach formulates the shield decomposition problem as a Boolean satisfiability (SAT) problem. By encoding constraints related to state-decentralizations and observation-based safety, they leverage powerful SAT solvers to find a valid decentralized shield. This method is shown to be more robust and scalable.

They also introduce a method to incorporate bounded history into the shield synthesis process, allowing agents to disambiguate states based on a limited sequence of past observations.

Datasets

The paper evaluates their method on several environments, including:

  • Grid-Col: A standard two-agent gridworld domain.
  • Particle-P and Particle-P-V: Domains involving agents with inertia, where observability is limited to positions or positions and velocities.
  • Nearby-Obs: An environment where agents have limited observation ranges, with visibility decreasing with distance.
  • Flashlight-6 and Flashlight-10: Novel environments designed to specifically test general partial observability. Agents have limited visibility (flashlight range) and must coordinate to see each other, introducing challenges for decentralized shielding.

These environments are either existing benchmarks or variations thereof, with the Flashlight environments being introduced to specifically challenge existing shielding methods.

Key Insights and Ideas

  • General Partial Observability is Key: The paper highlights that previous multi-agent shielding methods were too restrictive by assuming shared observations. Their work demonstrates that safe RL is achievable even when agents have vastly different and incomplete views of the world.
  • Decomposition is the Bridge: The core idea is to first ensure global safety with a centralized shield and then break it down into individual, observation-dependent constraints for each agent. This allows for decentralized execution without sacrificing safety.
  • SAT Solvers for Scalability: Using SAT solvers to encode the shield decomposition problem is a crucial innovation. It allows for efficient synthesis of decentralized shields in complex scenarios where brute-force or naive methods would fail.
  • History Can Disambiguate: Incorporating a limited history of observations can significantly help agents disambiguate states and lead to more permissive shields, improving RL performance.
  • Decentralized Shields Can Be Permissive: The results show that their decentralized shields not only ensure safety but also allow RL agents to achieve comparable or even better performance than unshielded or centrally shielded agents.

Key Results

  • Their SAT-based method successfully synthesizes decentralized shields in environments where prior methods (including their own naive approach) failed, particularly in the challenging Flashlight environments.
  • In most tested domains, agents using their decentralized shields achieved comparable or better RL performance (average discounted sum of rewards) compared to unshielded or centrally shielded agents.
  • Crucially, their shielded agents achieved zero safety violations across all tested environments, a significant improvement over unshielded agents which incurred thousands of violations during training.
  • The runtime of their decentralization algorithm is practical, with SAT-based methods being efficient for many real-world scenarios.

Limitations and Future Work

  • Abstraction is Still Necessary: The method relies on creating an abstraction of the environment for shielding. If the abstraction is too coarse, it might not be possible to find a shield. The authors suggest that automatic abstraction creation and refinement is an area for future work.
  • Shield Quality: While they ensure safety, there can be multiple valid shields. Developing metrics to measure shield "quality" (e.g., how permissive it is for learning) and iteratively improving shields are suggested future directions.
  • Scalability of Abstractions: While their method scales well with the number of agents and states in the abstraction, scaling to very large and complex actual environments still requires effective abstraction techniques.
  • MARL Integration: The paper notes that their method is independent of the underlying RL algorithm and suggests exploring its application with state-of-the-art multi-agent RL (MARL) methods as future research.

Summary updated

BibTeX
@inproceedings{melcer2024shield,
  author = {Daniel Melcer and Christopher Amato and Stavros Tripakis},
  title = {{Shield Decentralization for Safe Reinforcement Learning in General Partially Observable Multi-Agent Environments}},
  booktitle = {AAMAS},
  year = {2024},
}

Loading related content...

Figure