Masked Pretraining for Multi-Agent Decision Making

Jie Liu, Yinmin Zhang, Chuming Li, Chao Yang, Yaodong Yang, Yu Liu, Wanli Ouyang

Abstract

Building a single generalist agent with strong zero-shot capability has recently sparked significant advancements. However, extending this capability to multi-agent decision making scenarios presents challenges. Most current works struggle with zero-shot transfer, due to two challenges particular to the multi-agent settings: (a) a mismatch between centralized training and decentralized execution; and (b) difficulties in creating generalizable representations across diverse tasks due to varying agent numbers and action spaces. To overcome these challenges, we propose a Mask-Based collaborative learning framework for Multi-Agent decision making (MaskMA). Firstly, we propose to randomly mask part of the units and collaboratively learn the policies of unmasked units to handle the mismatch. In addition, MaskMA integrates a generalizable action representation by dividing the action space into intrinsic actions solely related to the unit itself and interactive actions involving interactions with other units. This flexibility allows MaskMA to tackle tasks with varying agent numbers and thus different action spaces. Extensive experiments in SMAC reveal MaskMA, with a single model trained on 11 training maps, can achieve an impressive 77.8% average zero-shot win rate on 60 unseen test maps by decentralized execution, while also performing effectively on other types of downstream tasks (e.g., varied policies collaboration, ally malfunction, and ad hoc team play).

Introduction

In Multi-Agent Reinforcement Learning (MARL), the standard paradigm is Centralized Training with Decentralized Execution (CTDE). Agents learn together with access to global information but must act individually based only on local observations during deployment. However, current transformer-based models face two major hurdles: the Observation Mismatch, where models trained on full visibility struggle with the partial observability of execution, and the Generalization Gap, where fixed input/output dimensions prevent models from scaling to different numbers of agents or unit types.

MaskMA aims to create a "generalist" agent capable of zero-shot coordination on new maps with varying ally and enemy counts without any additional fine-tuning.

The MaskMA Framework

Overview of the MaskMA framework, illustrating the mask-based training strategy and generalizable action representation across various testing scenarios.

The MaskMA architecture integrates two scalable techniques into a transformer-based backbone to address the limitations of existing MARL models:

Mask-based Training Strategy (MTS)

To bridge the gap between centralized training and decentralized execution, MaskMA randomly masks parts of the attention matrix during training. This forces the model to learn robust policies even when information about certain units is missing, effectively simulating the "fog of war" inherent in decentralized execution while still leveraging a centralized training signal.

Generalizable Action Representation (GAR)

Instead of a fixed-length action vector, MaskMA categorizes actions into:

  • Intrinsic Actions: Self-related movements (e.g., Stop, Move North).
  • Interactive Actions: Interactions with other units (e.g., Attack Enemy X, Heal Ally Y).

GAR predicts interactive actions by analyzing the relationship (concatenated embeddings) between the acting unit and the target unit. This allows the action space to scale dynamically based on the number of visible units, making the model invariant to the total number of agents.

Experimental Results

The researchers evaluated MaskMA using the StarCraft Multi-Agent Challenge (SMAC). The model was trained on only 11 maps and tested on 60 entirely unseen maps with varying unit types and counts.

Zero-shot win rate comparison between MaskMA and MADT across training and testing maps in the StarCraft Multi-Agent Challenge (SMAC).

Key Findings

  • Zero-Shot Performance: On 60 unseen maps, MaskMA achieved an average win rate of 77.75%, nearly doubling the performance of the previous state-of-the-art (MADT), which achieved 43.72%.
  • Efficiency: MaskMA processes all agents concurrently in a single pass, requiring only 31 hours to train for 2M iterations on an A100 GPU, compared to 70 hours for the MADT baseline.
  • Downstream Robustness: The model demonstrated emergent robustness in "Ad Hoc" scenarios, such as successfully integrating a new teammate added mid-game or coordinating when an ally malfunctions.

Conclusion and Future Work

MaskMA demonstrates that structural masking and relational action logic can create highly generalizable multi-agent systems. While the model currently relies on expert imitation learning datasets, future work will explore the use of sub-optimal data and cross-domain generalization beyond the StarCraft environment. Additionally, addressing the quadratic complexity of self-attention remains a priority for scaling to simulations involving thousands of agents.

Summary updated

BibTeX
@article{liu2024masked,
  author = {Jie Liu and Yinmin Zhang and Chuming Li and Chao Yang and Yaodong Yang and Yu Liu and Wanli Ouyang},
  title = {{Masked Pretraining for Multi-Agent Decision Making}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=Susy8EAff9},
}
Figure