An Open-Ended Learning Framework for Opponent Modeling

Yuheng Jing, Kai Li, Bingyun Liu, Haobo Fu, Qiang Fu, Junliang Xing, Jian Cheng

Abstract

Opponent Modeling (OM) is critical for multi-agent reinforcement learning, yet existing approaches often fail to generalize to novel, out-of-distribution behaviors. This paper introduces OEOM, an open-ended framework that iteratively generates a diverse curriculum of training opponents by optimizing for both strength and style diversity. Complementing this, the authors propose IOM, a sequence-to-sequence model based on a Causal Transformer that learns to adapt to opponent behaviors in-context. Experimental results across competitive and cooperative benchmarks demonstrate that OEOM significantly enhances the generalization and robustness of OM agents compared to traditional static training methods.

Introduction

The primary challenge in opponent modeling is the "generalization gap." Agents trained against a static set of opponents—such as handcrafted scripts or simple self-play versions—frequently struggle against novel strategies in real-world or testing scenarios. This lack of behavioral flexibility stems from the limited diversity of the training distribution. To address this, researchers from the Chinese Academy of Sciences and Tencent AI Lab propose a framework that treats opponent generation as an open-ended process, ensuring agents are exposed to a wide spectrum of strengths and styles.

Methods

The OEOM Framework

The Open-Ended Opponent Modeling (OEOM) framework moves beyond static training sets by iteratively evolving a population of opponents. It employs two key mechanisms for diversity:

  1. Strength Diversity: Utilizing Population-Based Training (PBT), the framework uses cross-play and natural selection to evolve increasingly challenging opponents.
  2. Style Diversity: To prevent agents from converging on a single "optimal" but narrow strategy, the authors introduce Trajectory Space Diversity (TSD). This objective maximizes the mutual information between policy indices and visited trajectories, forcing the population to explore diverse behavioral styles.
The iterative process of OEOM: optimizing for strength and style, then selecting representative policies.

In-Context Opponent Modeling (IOM)

To leverage the diverse data generated by OEOM, the authors propose IOM, which reframes opponent modeling as a sequence-to-sequence (Seq2Seq) task. IOM utilizes a Causal Transformer to map interaction histories directly to optimal responses. By training on "Best Responses" to the OEOM-generated population, the model learns to recognize and adapt to an opponent's style "in-context" during an episode, effectively imitating the best response for the observed behavior.

Experimental Results

The framework was evaluated on three multi-agent benchmarks: Predator Prey (PP) (competitive), Level-Based Foraging (LBF) (mixed), and OverCooked (OC) (cooperative).

As shown in the performance summary below, IOM trained within the OEOM framework consistently outperformed baselines like Scripted opponents and standard Self-Play (SP) across all environments. Notably, the performance advantage is most pronounced in "Unseen" settings, where the agent must adapt to completely novel opponent policies.

Average results across different environments and opponent settings. IOM (red) consistently leads.

Key findings include:

  • Synergy of Strength and Style: Ablations confirmed that both PBT and TSD are necessary for maximum generalization. Facing opponents that are both "good" and "different" is essential for robust learning.
  • Framework Versatility: OEOM improved the performance of other OM algorithms (e.g., DRON, LIAM), demonstrating its utility as a general-purpose data engine for the field.
  • Adaptability to Non-Stationarity: IOM showed superior robustness to non-stationary opponents that switch strategies mid-game, thanks to its Transformer-based in-context learning capabilities.

Conclusion

The OEOM framework provides a robust solution to the generalization problem in opponent modeling by automating the creation of a diverse training curriculum. By combining this with the IOM architecture, the authors demonstrate a significant leap in an agent's ability to handle unknown and non-stationary adversaries or partners. Future work aims to incorporate evolving opponents that adapt during the training phase to better simulate real-world strategic "arms races."

Summary updated

BibTeX
@inproceedings{jing2025open,
  author = {Yuheng Jing and Kai Li and Bingyun Liu and Haobo Fu and Qiang Fu and Junliang Xing and Jian Cheng},
  title = {{An Open-Ended Learning Framework for Opponent Modeling}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i22.34488},
}
Figure