Long-Term Planning and Situational Awareness in OpenAI Five

Jonathan Raiman, Susan Zhang, Filip Wolski · OpenReview

TL;DR

This paper investigates how the complex, model-free OpenAI Five agent, trained without explicit hierarchical planning, develops an understanding of long-term game objectives in Dota 2. The authors introduce novel methods to analyze the agent's internal representations and hidden states, revealing evidence of semantic understanding and the ability to predict future actions and milestones minutes in advance.

What Problem Does This Paper Address?

Deep reinforcement learning (RL) agents, particularly those trained on complex games like Dota 2 (e.g., OpenAI Five), operate as "black boxes." While they can achieve superhuman performance, understanding how they represent knowledge about the game world and how they plan for long-term objectives remains a significant challenge. Traditional hierarchical RL methods explicitly build in multi-step planning, but agents like OpenAI Five achieve success using only primitive actions. This raises a crucial question: how do these agents develop sophisticated, long-term planning capabilities without explicit hierarchical structures, and what does their internal "understanding" of the game look like?

Methods

The researchers employed two primary methodologies to probe OpenAI Five's internal workings:

  1. Similarity Analysis of Distributed Representations: They analyzed the cosine similarity between learned embeddings of game attributes (items, actions, heroes, etc.). The hypothesis was that if the agent develops a semantic understanding, functionally similar attributes should have similar vector representations.
  2. Hidden State Decoding for Future Prediction: They trained "Hidden State Decoders" – multi-layer perceptrons that take the agent's LSTM hidden states as input. These decoders were trained to predict future events and milestones (e.g., predicting when a tower will be destroyed, when a player will reach a certain location, or future rewards like kills). This approach uses a novel "online labeling" technique that propagates supervision signals across game slices using dynamic programming, allowing training without waiting for entire games to complete.

Datasets

  • Training Data: OpenAI Five was trained using self-play games against previous versions of itself. The training process involved asynchronous, distributed training on 34-second game slices.
  • Evaluation Data:
    • 1,000 self-play games were used to evaluate the performance of the trained hidden state decoders in predicting objectives.
  • Qualitative analysis was performed on games against the human world champions OG (April 2019).
  • A held-out set of 4,000 games was used to select thresholds for visualizing predictions.

Key Insights and Ideas

  • Emergent Semantic Understanding: Despite being trained with model-free RL and without explicit hierarchical planning, OpenAI Five develops a semantic understanding of game attributes. Functionally similar items or actions are represented by similar vectors in the agent's internal state.
  • Planning Minutes in Advance: The hidden state decoders provided evidence that OpenAI Five can predict future game events and objectives up to 30-90 seconds ahead of time. This suggests a form of latent planning occurring within the agent's neural network.
  • Dynamic Knowledge Acquisition: The analysis of embedding similarities over training versions showed that the agent's understanding of attribute relationships develops gradually, improving significantly within the first few thousand training steps.
  • Situational Awareness: The agent's ability to predict future events, like enemy attacks or team objectives, demonstrates a form of situational awareness that goes beyond immediate actions.

Key Results

  • Cosine Similarity: Pairs of functionally similar game attributes (e.g., "item_magic_stick" and "item_magic_wand") showed a significant increase in cosine similarity in their learned embeddings as training progressed, rising from near 0.03 to plateauing around 0.30-0.40 after about 30,000 training steps.
  • Objective Prediction: Hidden state decoders achieved high F1 scores and recall for predicting team and enemy objectives. Enemy objective prediction continued to improve throughout training, reaching peak performance at 56,000 versions.
  • Early Prediction: Density plots of the earliest true positive predictions showed that later versions of the model could predict objectives significantly earlier (e.g., 80 seconds before a team objective occurred) compared to earlier versions.
  • Win Probability Convergence: When replaying games with models from different training stages, win probability predictions gradually converged to match those of the final model used in the professional matches.
  • Qualitative Analysis: Visualizations of predictions during games against OG showed the agent predicting attacks on enemy towers minutes in advance, and adapting predictions when enemy defenses changed. The model also showed an ability to predict "fight" or "flight" behaviors based on near-death states.

Limitations and Future Work

  • Limitations: The paper acknowledges that model predictions can sometimes be incorrect due to partial information and the inherent unpredictability of human opponents. The "online labeling" technique is a proxy for true future labels, and while effective, it's not a perfect representation of the full game state.
  • Future Work: The authors suggest that these techniques could be generalized to other large-scale RL agents operating in complex environments. They also propose using these methods to augment collaboration between AI agents and humans, enabling agents to communicate their plans to human teammates, as hinted at in cooperative play scenarios.

Summary updated

BibTeX
@misc{raiman2019long,
  author = {Jonathan Raiman and Susan Zhang and Filip Wolski},
  title = {{Long-Term Planning and Situational Awareness in OpenAI Five}},
  year = {2019},
  eprint = {1912.06721},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.06721},
}
Figure