Multi-Agent Reinforcement Learning with Selective State-Space Models

Jemma Daniel, Ruan John de Kock, Louay Ben Nessir, Sasha Abramowitz, Omayma Mahjoub, Wiem Khlifi, Juan Claude Formanek, Arnu Pretorius

Introduction

In Multi-Agent Reinforcement Learning (MARL), coordinating the actions of multiple agents is a fundamental challenge. The current state-of-the-art approach, the Multi-Agent Transformer (MAT), treats joint action selection as a sequence modeling problem. By leveraging the attention mechanism, MAT effectively captures inter-agent dependencies. However, Transformers suffer from a quadratic computational bottleneck ($O(L^2)$) relative to the sequence length $L$, which in MARL corresponds to the number of agents. This scaling behavior makes Transformers prohibitively expensive for large-scale swarms or complex multi-agent environments.

To address this, researchers from InstaDeep introduced Multi-Agent Mamba (MAM). MAM replaces the attention-based blocks of MAT with Selective State-Space Models (SSMs), specifically the Mamba architecture. MAM achieves linear scaling ($O(L)$) with respect to the number of agents while maintaining, and in some cases exceeding, the performance of Transformer-based models.

Methodology

MAM adapts the encoder-decoder structure of MAT by utilizing Mamba-based components designed for multi-agent coordination:

  1. Bi-directional Mamba Encoder: Unlike standard causal Mamba, the encoder must process the observations of all agents simultaneously. MAM employs a bi-directional Mamba block that scans the agent sequence in both directions to build a comprehensive global context.
  2. Causal Mamba Decoder: For action selection, agents decide sequentially. A standard causal Mamba block is used here, replacing the masked self-attention found in MAT, to ensure mathematical guarantees of policy improvement.
  3. CrossMamba: The most significant technical innovation is the CrossMamba block. In standard Transformers, cross-attention allows the decoder to attend to encoder outputs. CrossMamba replicates this functionality within an SSM framework by making the selective parameters (such as the reset and update gates) dependent on a second input sequence—the observations from the encoder.
Architectural building blocks of MAM, including BiMamba and the CrossMamba mechanism.

Experimental Setup

The performance and efficiency of MAM were evaluated across 21 tasks in three JAX-based MARL benchmarks:

  • Robotic Warehouse (RWARE): Grid-based coordination for moving crates.
  • Level Based Foraging (LBF): Cooperative food harvesting.
  • StarCraft Multi-Agent Challenge (SMAX): Complex unit micromanagement.

Results and Discussion

MAM demonstrated strong performance parity with MAT, matching or outperforming it in 18 out of 21 tasks. Notably, in the SMAX benchmark—which features the highest agent counts—MAM showed superior sample efficiency, suggesting that Mamba's selective mechanism may be better at filtering irrelevant information in dense agent interactions.

The primary advantage of MAM is its scalability. As shown in the evaluation of the smacv2 environment, MAT's computational cost spikes quadratically as the number of agents increases. In contrast, MAM maintains linear scaling, matching the efficiency of simpler, non-centralized algorithms like MAPPO while retaining the coordination benefits of a centralized sequence model.

Comparison of mean evaluation time per step as the number of agents increases, highlighting MAM's linear scaling versus MAT's quadratic growth.

Limitations and Future Work

While MAM offers theoretical scaling advantages, the current JAX implementation does not yet benefit from the specialized CUDA kernels available for PyTorch, which limits practical training speedups on current hardware. Furthermore, existing MARL benchmarks rarely exceed a few dozen agents, making it difficult to fully stress-test MAM's capabilities. Future work will focus on porting the architecture to PyTorch and developing new "many-agent" environments to explore the limits of linear-scaling MARL.

Summary updated

BibTeX
@inproceedings{daniel2024multi,
  author = {Jemma Daniel and Ruan John de Kock and Louay Ben Nessir and Sasha Abramowitz and Omayma Mahjoub and Wiem Khlifi and Juan Claude Formanek and Arnu Pretorius},
  title = {{Multi-Agent Reinforcement Learning with Selective State-Space Models}},
  booktitle = {AAMAS},
  year = {2024},
  doi = {10.48550/arxiv.2410.19382},
}
Figure