Learning Strategy Representation for Imitation Learning in Multi-Agent Games

Shiqi Lei, Kanghoon Lee, Linjing Li, Jinkyoo Park

Abstract

Imitation Learning (IL) often struggles with heterogeneous datasets containing sub-optimal demonstrations. In multi-agent games, this challenge is exacerbated by the lack of player identifications and the dynamic influence of opponent behaviors. We present the STRIL (Strategy Representation for Imitation Learning) framework, which utilizes a specialized Partially-trainable-conditioned Variational Recurrent Neural Network (P-VRNN) to learn unsupervised strategy representations. These representations enable the estimation of trajectory quality through two key metrics: the Randomness Indicator and the Exploited Level. By filtering for high-quality data, STRIL significantly enhances the performance of standard imitation learning algorithms in competitive environments.

Introduction

Standard Imitation Learning typically assumes that the demonstrations provided are from an expert source. However, real-world offline datasets—particularly in multi-agent games—are often a "mixed bag" containing diverse strategies ranging from professional-level play to complete amateurism.

In multi-agent scenarios, identifying high-quality data is difficult because a player's behavior is intrinsically linked to their opponent's actions. Existing filtering methods often rely on metadata like player IDs or require a complete model of the environment's dynamics. STRIL addresses these challenges by identifying dominant strategies in unlabeled, heterogeneous datasets to ensure that learned models do not inherit undesirable behaviors.

The STRIL Framework

The STRIL framework overview, illustrating the three-step process from strategy representation learning to filtered imitation learning.

The STRIL framework is designed as a modular "plug-in" that operates in three main stages:

  1. Strategy Representation Learning (P-VRNN): The system first learns to encode trajectories into a latent strategy space. Unlike standard Variational Autoencoders (VAEs) that might encode a whole trajectory into a single point, the P-VRNN treats the "strategy" ($l$) as a learnable, constant attribute for the entire trajectory duration. This allows the model to disentangle the player's underlying intent from the immediate influence of the opponent.
  2. Indicator Estimation: Once representations are learned, the framework judges trajectory quality using two metrics:
  3. Randomness Indicator (RI): An unsupervised metric based on the entropy of the predicted action distribution. Novice players tend to act more randomly, leading to higher reconstruction uncertainty.
  4. Exploited Level (EL): This measures how "exploitable" a strategy is by leveraging the geometric structure of the learned representation space. This estimation is effective even when only a small fraction (e.g., 5%) of the dataset has reward labels.
  5. Filtered Imitation Learning: The dataset is pruned to retain only the top-performing trajectories based on RI or EL. Standard IL algorithms, such as Behavior Cloning (BC) or IQ-Learn, are then trained on this refined subset.

Strategy Representation with P-VRNN

Graphical models illustrating the Prior, Generation, Recurrence, and Inference components of the P-VRNN.

The core of the framework is the P-VRNN, which models the temporal dependencies of multi-agent interactions. By conditioning the generation and inference processes on a constant strategy representation $l$, the model effectively captures the "style" of a player. As shown in the graphical models, the strategy $l$ and observation $o_t$ influence the latent state $z_t$ and the resulting action $a_t$, while the hidden state $h_t$ maintains the temporal context.

Experimental Evaluation

The framework was evaluated on three competitive zero-sum games: Two-player Pong, Limit Texas Hold’em, and Connect Four. The datasets were intentionally mixed with experts, mid-level players, and novices.

Key results include:

  • Significant Performance Boosts: In Limit Texas Hold’em, standard IQ-Learn achieved a score of -3.652. Applying STRIL with the RI indicator boosted this to 0.667, occasionally outperforming oracle-based filtering.
  • Robustness and Efficiency: In Pong, filtering with the EL indicator improved Behavior Cloning scores from -0.832 to -0.343. Furthermore, the EL indicator remained highly accurate even when reward labels were available for only 5% of the trajectories.

Conclusion

STRIL demonstrates that high-skill strategies can be identified in mixed datasets without requiring player IDs or dense reward signals. By treating strategy as a trajectory-level constant, the framework provides a robust, privacy-preserving method for cleaning multi-agent data. Future research will explore extending these indicators to cooperative settings and adaptive agents that change strategies mid-game.

Summary updated

BibTeX
@inproceedings{lei2025learning,
  author = {Shiqi Lei and Kanghoon Lee and Linjing Li and Jinkyoo Park},
  title = {{Learning Strategy Representation for Imitation Learning in Multi-Agent Games}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i17.33998},
}
Figure