Training AI to cooperate with humans or unknown partners is notoriously difficult. Agents trained via standard methods often develop "secret handshakes"—arbitrary conventions that work perfectly with their training partners but fail completely when paired with new teammates. This paper introduces Trajectory Diversity (TrajeDi), a novel method that forces a population of agents to solve tasks in fundamentally different ways. By training a "common best response" to this diverse group, the authors create agents that excel at Zero-Shot Coordination (ZSC), achieving state-of-the-art results in the complex cooperative card game Hanabi.
The Zero-Shot Coordination Problem
In cooperative AI, the standard training paradigm is Self-Play (SP), where agents train by playing against themselves. While SP produces highly skilled agents, they often rely on arbitrary conventions.
Imagine two robots in a corridor. To pass each other, they both need to move to the same side. In Self-Play, they might both learn to always move "Left." However, if you pair a "Left-moving" robot with a "Right-moving" robot trained in a different Self-Play run (a scenario known as Cross-Play), they will collide.
This illustrates the Zero-Shot Coordination (ZSC) problem: how do we train agents to be compatible with partners they’ve never seen before? The authors argue that the key is diversity. If we can train a population of agents that cover all possible "conventions," we can then train a single "generalist" agent that knows how to respond optimally to any of them.
The TrajeDi Framework
To achieve this, the authors propose a two-part framework:
- TrajeDi (Trajectory Diversity): A differentiable objective function designed to make a population of agents behave differently. It is based on the Jensen-Shannon Divergence (JSD) of the probability distributions of the trajectories (the sequence of states and actions) the agents produce. Unlike standard entropy maximization, which simply makes a single agent "noisy," TrajeDi forces different agents to specialize in different parts of the solution space. It also introduces Action Discounting ($\gamma$), allowing users to tune the "granularity" of diversity to ignore parts of a game where actions don't meaningfully impact the outcome.
- Population-Based Training with a Common Best Response: The researchers train a population of $n$ agents to be as diverse as possible using the TrajeDi objective. Simultaneously, they train an $(n+1)$-th agent—the Common Best Response (BR). This agent is optimized to perform well when paired with any member of the diverse population, effectively becoming a robust partner suitable for ZSC.
Experiments and Key Results
The researchers evaluated TrajeDi across several benchmarks, including Tree-like MDPs, a Collaborative Matrix Game, and the complex card game Hanabi.
Finding All Solutions in Tree MDPs
In synthetic Tree-like MDP environments designed to test if an algorithm can find all possible optimal paths to a goal, TrajeDi excelled. Particularly when paired with "entropic initialization," TrajeDi was the only method that reliably found every single optimal solution. In contrast, baseline methods typically collapsed into a single path.
State-of-the-Art in Hanabi
Hanabi is a partially observable, cooperative card game that serves as a grand challenge for ZSC, requiring agents to reason about their partners' knowledge and intentions. When combined with Other-Play (OP)—a previous state-of-the-art method that handles symmetries—TrajeDi improved the Cross-Play (XP) score from 23.65 to 24.09 (out of 25). This demonstrates that trajectory diversity is highly complementary to existing ZSC techniques.
Matrix Game Convergence
In a single-step coordination task (Collaborative Matrix Game), the Common BR trained against a TrajeDi population converged to the unique ZSC-optimal strategy significantly faster than alternative methods.
Insights and Limitations
The success of TrajeDi supports the "BR Classes" Hypothesis. The authors suggest that while there are millions of possible strategies, they can be grouped into classes that share a common best response. Strategies robust to many partners are rare but represent the "natural" ways to coordinate. TrajeDi successfully finds these rare, robust equilibria by focusing on the entire trajectory rather than just state distributions or individual actions, capturing the true "behavioral" essence of an agent.
However, the method has limitations:
- Computational Cost: Calculating TrajeDi is quadratic relative to the population size ($O(n^2)$). In the Hanabi experiments, the massive compute required (48-72 hours on 2 GPUs per agent) limited the population size to 3.
- Reliance on Symmetry Knowledge: While TrajeDi improves performance, the best results in Hanabi still required "Other-Play," which assumes prior knowledge of the game's symmetries. Achieving these results without domain-specific knowledge remains a future goal.
Looking forward, the authors suggest that TrajeDi could be applied in competitive games to train agents that are robust against adversarial or "cheesy" strategies by exposing them to a wide variety of playstyles during training.
Summary updated