Fast Peer Adaptation with Context-aware Exploration

Long Ma, Yuanfei Wang, Fangwei Zhong, Song-Chun Zhu, Yizhou Wang

TL;DR

In multi-agent environments, AI agents often struggle to adapt to new, unknown partners or opponents, especially when the game is partially observable. This paper introduces PACE (Peer Adaptation with Context-aware Exploration), a method that uses an intrinsic "peer identification reward" to encourage agents to actively explore and uncover the hidden strategies of their peers. By balancing this active information gathering with exploiting the learned strategies, PACE achieves significantly faster adaptation and better performance across competitive, cooperative, and mixed games.

What Problem Does This Paper Address?

Conceptual illustration of active exploration to identify a peer's hidden preference.

For an AI agent to succeed in a multi-agent world, it needs to quickly adapt to the behaviors of its peers—whether that means countering an opponent's specific playstyle or cooperating with a teammate's unique preferences.

Previous research largely focused on "opponent modeling," assuming the AI could easily observe the other agents' actions and infer the best response. However, in realistic, partially observable environments, a peer's behavior might be hidden (e.g., an opponent's hand in poker, or a teammate working in another room). In these scenarios, the agent cannot passively observe; it must learn an exploratory policy to actively seek out information about the peer. Because these exploratory actions (like walking to another room just to look around) rarely yield immediate points, standard reinforcement learning agents often fail to learn them, settling instead for safe, sub-optimal strategies.

Methods

The PACE architecture, featuring a context encoder and a peer identification module that generates intrinsic exploration rewards.

To solve this lack of exploration, the authors propose PACE (Peer Adaptation with Context-aware Exploration). The core idea is to reward the agent not just for winning the game, but for figuring out who it is playing with.

  1. Context Encoder: The agent uses a neural network to compress its history of local observations and actions across multiple episodes into a fixed-length "context" vector.
  2. Auxiliary Task (Peer Identification): During training, the agent is exposed to a diverse pool of peer policies. An auxiliary network is trained to predict the exact identity/strategy of the current peer based solely on the context vector.
  3. Intrinsic Exploration Reward: To encourage the agent to gather useful context, PACE introduces an intrinsic reward based on the confidence of the peer identification module. Mathematically, this maximizes the mutual information between the agent's context and the peer's true policy.
  4. Context-Aware Policy: The agent is trained end-to-end using Proximal Policy Optimization (PPO) to maximize a combination of the standard environment reward and the decaying intrinsic exploration reward over multiple episodes.

Datasets

The authors evaluate PACE on three diverse multi-agent reinforcement learning (MARL) environments, modified to emphasize partial observability:

  • Kuhn Poker (Competitive): A simplified two-player poker game where agents must decide whether to bet or fold. Hand cards are hidden unless a showdown occurs.
  • PO-Overcooked (Cooperative): A partially observable, multi-recipe version of the popular Overcooked environment. A wall blocks the line of sight between the two chefs, forcing the ego agent to physically cross the room to see what the partner is doing.
  • Predator-Prey-W (Mixed): A continuous control environment where predators cooperate to catch prey. It features limited vision radiuses and "watchtowers" that grant full map visibility when visited.

Key Insights and Ideas

  • Sacrificing the short-term for the long-term: PACE learns that it is worth losing a little early on to gain a massive advantage later. For example, in Kuhn Poker, the PACE agent intentionally forces "showdowns" at a high rate in early episodes. This costs chips, but forces the opponent to reveal their cards, allowing PACE to perfectly counter their strategy in all subsequent episodes.
  • Intrinsic rewards prevent "lazy" local optima: In PO-Overcooked, baseline agents simply stood still because walking to the other room to check on their partner yielded no immediate task reward. PACE's intrinsic reward provided the necessary breadcrumbs to learn this complex exploratory behavior.
  • Dynamic Latent Spaces: Visualizations of PACE's context encoder show that at the start of an interaction, the agent's internal representation is a single, uncertain cluster. As episodes progress and the agent explores, the latent space beautifully splits into distinct clusters corresponding to the specific identity of the peer.

Key Results

  • Kuhn Poker: PACE achieved an average reward of 0.047, nearly double the best baseline (LIAMX at 0.027).
  • PO-Overcooked: PACE was the only method capable of adapting in this highly cooperative, partially observable setting. It achieved a 55.3% success rate, while all baselines failed completely (hovering around ~10%).
  • Predator-Prey-W: PACE outperformed all baselines, achieving a reward of -3.93 compared to the next best baseline (-4.34).
  • Sudden Changes: When the researchers secretly swapped the peer agent halfway through an evaluation, PACE successfully detected the drop in performance, cleared its context, re-explored, and recovered its high success rate.
  • Human-AI Teaming: In a preliminary study, PACE agents paired with real human players in PO-Overcooked achieved a 50.4% success rate, vastly outperforming the baseline's 7.4%.

Limitations and Future Work

  • Dependence on the Training Pool: PACE requires a diverse, pre-defined pool of peer strategies during training. If the training pool lacks diversity, the agent's ability to adapt to novel peers drops significantly. Generating more sophisticated, automated training pools is a key next step.
  • Agent Scalability: The main experiments assume the number of agents remains constant between training and testing. While preliminary tests showed some ability to transfer to different numbers of agents, handling highly dynamic team sizes remains a challenge.
  • Future Directions: The authors suggest extending this approach to heterogeneous multi-agent games, complex 3D embodied environments (like robotics), and conducting more extensive human-in-the-loop studies to evaluate real-world human-AI interaction.

Summary updated

BibTeX
@inproceedings{ma2024fast,
  author = {Long Ma and Yuanfei Wang and Fangwei Zhong and Song-Chun Zhu and Yizhou Wang},
  title = {{Fast Peer Adaptation with Context-aware Exploration}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=CBcNl5Eo32},
}
Figure