Multi-Agent Imitation by Learning and Sampling from Factorized Soft Q-Function

Yi-Chen Li, Zhongxiang Ling, Tao Jiang, Fuxiang Zhang, Pengyuan Wang, Lei Yuan, Zongzhang Zhang, Yang YuNeurIPS 2025

Introduction

Learning how multiple agents should interact by watching expert demonstrations—known as Multi-Agent Imitation Learning (MAIL)—is a powerful alternative to manually designing complex reward functions. However, existing MAIL methods face significant hurdles that limit their scalability and stability.

To address these issues, researchers have introduced MAFIS (Multi-Agent imitation by learning and sampling from FactorIzed Soft Q-function). MAFIS is a novel framework that makes MAIL more stable and scalable by factorizing the joint soft Q-function and treating the optimal policy as an energy-based model. This approach eliminates the need for unstable adversarial training, enabling high-performance imitation in both discrete and continuous multi-agent environments.

The Challenges of Multi-Agent Imitation

Prior approaches to MAIL generally fall into two categories, both of which have notable drawbacks:

  1. The Compounding Error Problem: Simple methods like Behavioral Cloning (BC) suffer when an agent makes a tiny mistake, drifts into an unfamiliar state, and lacks the knowledge to recover.
  2. The Adversarial Instability Problem: More advanced methods, such as Multi-Agent Generative Adversarial Imitation Learning (MA-GAIL), use a "cat-and-mouse" adversarial setup where a generator tries to fool a discriminator. This min-max optimization is notoriously difficult to tune and often fails to converge.
  3. The Curse of Dimensionality: As the number of agents increases, the joint action space grows exponentially, making it nearly impossible to train a centralized controller effectively.

The MAFIS Framework

MAFIS builds upon the single-agent IQ-Learn framework, which reformulates imitation learning as an optimization problem over the Q-function rather than a min-max game. To adapt this to multi-agent systems, MAFIS introduces two primary innovations:

1. Soft Q-Function Factorization

Borrowing ideas from value decomposition networks (like QMIX), MAFIS represents the global joint Q-function as a weighted sum of individual agent Q-functions. A major mathematical contribution of this work is demonstrating that the global normalization constant (the "partition function") can also be factorized. This turns an exponentially hard mathematical problem into a tractable linear one. Consequently, the system can be trained centrally but executed decentrally—each agent only needs its local observations to act.

2. Energy-Based Sampling via SGLD

Traditionally, reinforcement learning requires both an "Actor" (policy) and a "Critic" (Q-function). In continuous control tasks, calculating the best action from a Q-function usually requires complex optimization. MAFIS bypasses the Actor entirely. It observes that the soft Q-function implicitly defines the optimal policy as an Energy-Based Model (EBM). Instead of training a separate policy network—which can re-introduce instability—MAFIS uses Stochastic Gradient Langevin Dynamics (SGLD) to sample actions directly from the Q-function's landscape.

Experimental Results

The authors evaluated MAFIS across a diverse set of benchmarks, including discrete control tasks (SMACv2, Gold Miner, and MPE) and continuous control tasks (Multi-Agent MuJoCo, or MaMuJoCo). Expert demonstrations were generated using state-of-the-art RL algorithms.

Learning curves across discrete and continuous multi-agent benchmarks

Superior Performance and Stability

By moving away from the GAIL-style discriminator, the training curves for MAFIS are significantly smoother and less sensitive to hyperparameter changes compared to adversarial baselines. In almost every benchmark, MAFIS outperformed Behavioral Cloning and MA-GAIL, often achieving performance nearly identical to the expert demonstrations. Notably, on the challenging MaMuJoCo Ant task, MAFIS succeeded where adversarial update methods failed completely, demonstrating the robustness of the SGLD sampling approach.

Tabular results comparing MAFIS against baselines in offline and online settings

Offline Capability

MAFIS also proved highly effective in "offline" settings, where the agent learns purely from a static dataset without interacting with the environment. As shown in the performance tables, offline MAFIS consistently outperformed the recent MIFQ baseline across various environments, and its online variant pushed performance even closer to the expert level.

Conclusion and Limitations

While MAFIS represents a significant step forward for non-adversarial multi-agent imitation, the authors note a few areas for improvement:

  • Performance Gap in Complex Tasks: In the most complex continuous tasks, a slight performance gap remains between MAFIS and the original expert.
  • Computational Overhead: Sampling actions via SGLD (Langevin steps) is computationally more expensive during inference than a simple neural network forward pass.
  • Complex Action Spaces: Future work will focus on improving imitation efficiency in even more high-dimensional or hybrid action spaces.

Summary updated

BibTeX
@inproceedings{li2025multi,
  author = {Yi-Chen Li and Zhongxiang Ling and Tao Jiang and Fuxiang Zhang and Pengyuan Wang and Lei Yuan and Zongzhang Zhang and Yang Yu},
  title = {{Multi-Agent Imitation by Learning and Sampling from Factorized Soft Q-Function}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=RbkHARGCcH},
}
Figure