In-Context Fully Decentralized Cooperative Multi-Agent Reinforcement Learning

Chao Li, Bingkun Bao, Yang GaoNeurIPS 2025

Introduction

In fully decentralized multi-agent reinforcement learning (MARL), agents must learn to cooperate without knowing what actions their peers are taking. This extreme lack of communication often leads to unstable training and sub-optimal teamwork. To address this, researchers have introduced Return-Aware Context (RAC), a novel approach that uses an episode's total reward as a proxy for the team's current joint strategy. By conditioning learning on this "context," RAC stabilizes the training process and encourages agents to confidently pursue optimal cooperative strategies, significantly outperforming existing baselines in complex environments.

The Challenge of Decentralized MARL

In a fully decentralized setting, a team of AI agents must work together to maximize a shared reward, but each agent can only observe the environment state, its own actions, and the shared reward. They cannot see the actions or policies of their teammates. This creates two massive hurdles for standard Q-learning algorithms:

  1. Non-stationarity: From a single agent's perspective, the environment's rules seem to constantly change because the other agents are simultaneously learning and updating their behaviors. This moving target breaks the mathematical guarantees of standard reinforcement learning.
  2. Relative Overgeneralization: Agents often underestimate the value of optimal cooperative actions because their teammates might currently be exploring or acting sub-optimally. For instance, if a highly rewarding coordinated action fails because a teammate wasn't ready, an agent might settle for a safer, lower-reward individual action. Consequently, the whole team converges on safe, mediocre strategies.

Existing decentralized MARL methods usually struggle to handle both issues simultaneously because they lack a way to model the unobserved actions of the rest of the team.

Return-Aware Context (RAC)

To overcome these limitations, RAC frames the shifting environment as a Contextual Markov Decision Process (MDP). Instead of viewing the environment as chaotic, RAC assumes the environment is stable but operates under different "contexts" depending on the team's current joint strategy.

Graphical models contrasting step-level and episode-level context changes.

Here is how RAC works in practice:

  • The Episodic Return as Context: Since an agent cannot see its teammates' actions, RAC uses the total shared reward of the episode as a proxy. Assuming the team's policy is fixed for an episode, the total return serves as a surprisingly good summary of their joint behavior. RAC discretizes this return into distinct intervals to create a stable "context."
  • Context-Based Value Function: Each agent learns a Q-function conditioned on this context. Because the context accounts for what the rest of the team is doing, the environment dynamics become stationary again, effectively solving the non-stationarity problem.
  • Individual Optimistic Marginal Value: To solve relative overgeneralization, RAC assumes the best of its teammates. When evaluating an action, the agent looks at its Context-Based Value Function and takes the maximum value across all possible contexts. This optimistic projection asks, "If my teammates play their optimal roles, how good is this action?"
  • Practical Bootstrapping: Because agents haven't experienced all possible returns early in training, RAC trains a standard, context-free Q-network alongside the context-aware one. This standard network handles early exploration and is trained to gradually imitate the optimistic context-aware network via a KL-divergence loss.

Key Insights

  • Reward as a Zero-Communication Summary: The most elegant insight of RAC is realizing that agents do not need to observe other agents' actions to infer their strategy; the episodic return implicitly encodes the joint policy of the team.
  • Decoupling the Two MARL Challenges: By splitting the value function into two concepts—a context-conditioned value for updating (fixing non-stationarity) and an optimistic marginal value for acting (fixing overgeneralization)—RAC solves both fundamental decentralized MARL problems without compromising on either.

Experiments and Results

RAC was evaluated on three cooperative tasks of increasing difficulty:

  • Matrix Game: A didactic two-agent game specifically designed to trap algorithms in a sub-optimal local minimum. RAC easily found the global optimum (reward of 8), whereas standard Independent Q-Learning (IQL) got trapped in the sub-optimal safe strategy (reward of 6).
  • Predator and Prey: A partially observable grid-world where 8 predators must coordinate to capture 8 prey. RAC efficiently learned the optimal cooperative hunting strategy (reaching +40 reward), while IQL completely failed and optimistic baselines suffered from severe instability.
  • StarCraft Multi-Agent Challenge (SMAC): On this highly complex MARL benchmark, RAC significantly outperformed fully decentralized baselines on complex maps (like 5m_vs_6m and 10m_vs_11m). It achieved much higher win rates and learned faster, proving that the method scales to environments with partial observability and complex dynamics.

Limitations and Future Work

While powerful, RAC has a few limitations. First, it relies heavily on exploration; agents must eventually experience the full range of possible returns to build accurate contexts. Second, the return intervals (the "bins" used for context) are currently manually defined based on prior knowledge of the environment's reward bounds, which limits plug-and-play adaptability. Finally, RAC assumes that agents only update their policies between episodes. It currently cannot handle scenarios where teammates change their fundamental strategies mid-episode. Future work will likely focus on adaptive context modeling to address these constraints.

Summary updated

BibTeX
@inproceedings{li2025context,
  author = {Chao Li and Bingkun BAO and Yang Gao},
  title = {{In-Context Fully Decentralized Cooperative Multi-Agent Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=5J4IpiMKkq},
}
Figure