Multi-agent In-context Coordination via Decentralized Memory Retrieval

Tao Jiang, Zichuan Lin, Lihe Li, Yi-Chen Li, Cong Guan, Lei Yuan, Zongzhang Zhang, Yang Yu, Deheng YearXiv 2025 · DOI

Introduction

In-Context Learning (ICL) has transformed how single-agent systems adapt to new tasks without retraining. However, extending this to Multi-Agent Reinforcement Learning (MARL) introduces significant hurdles. Multi-Agent In-Context Coordination (MAICC) addresses these by distilling team-level insights into decentralized agents, allowing them to coordinate on novel tasks by retrieving relevant past experiences from a hybrid memory of offline data and online trials.

The Challenges of Decentralized Coordination

The authors identify two "twin challenges" that hinder in-context adaptation in decentralized multi-agent systems:

  1. Partial Observability: Decentralized agents only perceive local surroundings, making it difficult to infer the global team context or goal.
  2. Credit Assignment: Shared team rewards often lead to the "lazy agent" problem, where individual contributions are obscured. This makes it hard for agents to identify which specific past memories are relevant to their current role.

The MAICC Framework

MAICC employs a three-pronged strategy to overcome these coordination hurdles:

Overview of the MAICC framework, illustrating embedding learning, memory retrieval, and in-context coordination.

1. Centralized-to-Decentralized Embedding Distillation

During training, a Centralized Embedding Model (CEM) acts as a "teacher," processing the full global state (all agents' views and actions) to learn fine-grained task representations. Decentralized Embedding Models (DEMs) are then trained to mimic the CEM. This allows agents to "hallucinate" global task information during execution, even when limited to local observations.

2. Selective Memory Retrieval

Agents maintain a hybrid memory buffer. An exponential time decay mechanism ($\beta_t$) balances exploration and exploitation: early in a task, agents rely on a diverse offline multi-task dataset; as they gain experience, they shift toward their own successful online trajectories.

3. Hybrid Utility Score

To ensure retrieved memories are relevant, agents use a utility score combining global team return with predicted individual return. This ensures agents retrieve examples where they played a clear, constructive role in the team's success.

Key Insights

  • Context as a Team Sport: Effective decentralized ICL requires embeddings informed by the team's collective state. Distilling a "God's eye view" into local models is critical for coordination.
  • The RTG Pitfall: Interestingly, the researchers found that including "Return-To-Go" (RTG) tokens—common in single-agent models—actually degraded performance. RTG caused models to retrieve trajectories based on reward values rather than task dynamics.
  • Role Clarification: By incorporating individual rewards into retrieval, the system avoids the "lazy agent" trap, forcing the model to find examples where the specific agent's actions were pivotal.

Experimental Results

The framework was evaluated on Level-Based Foraging (LBF) and the StarCraft Multi-Agent Challenge (SMAC v1 & v2). SMAC v2 is particularly demanding due to high randomness in unit types and spawn positions.

Performance comparison on SMACv2, showing MAICC (red) adapting significantly faster than baselines.

Across all benchmarks, MAICC demonstrated significantly faster adaptation than baselines like the Multi-Agent Decision Transformer (MADT). In the highly diverse SMACv2 "all" scenario, MAICC was the only method to show consistent improvement through in-context adaptation. Visualization of learned embeddings via t-SNE confirmed that MAICC creates tighter, task-distinct clusters, proving that agents successfully recognize their current task context.

Limitations and Future Work

While MAICC shows promise, the authors note that the current exponential memory decay is heuristic; future iterations could use uncertainty-based metrics for more intelligent data selection. Additionally, the quadratic scaling of Transformer context length remains a computational bottleneck for real-time execution in more complex or real-world environments.

Summary updated

BibTeX
@misc{jiang2025multi,
  author = {Tao Jiang and Zichuan Lin and Lihe Li and Yi-Chen Li and Cong Guan and Lei Yuan and Zongzhang Zhang and Yang Yu and Deheng Ye},
  title = {{Multi-agent In-context Coordination via Decentralized Memory Retrieval}},
  year = {2025},
  eprint = {2511.10030},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.10030},
}
Figure