Paper commentary
Dota 2 with Large Scale Deep Reinforcement Learning
OpenAI Five trains large self-play reinforcement learning agents to beat Dota 2 champions
- Problem Dota 2 combines long games, partial visibility and huge action spaces, which earlier reinforcement learning agents could not handle. The game lasts about 20,000 decision steps, far longer than chess or Go.
- Method A recurrent policy with a 4096-unit LSTM core is trained with PPO and GAE on asynchronously collected self-play data, and surgery tools carry the trained policy across environment and architecture changes.
- Results Reached a 2-0 win over the reigning Dota 2 world champions (OG) on April 13th, 2019, and won 99.4% of 7,257 public Arena games.
Why Dota 2 is a hard test for reinforcement learning
Dota 2 runs at 30 frames per second and a typical game lasts about 45 minutes. The agent acts only on every fourth frame, so one episode spans roughly 20,000 decision steps, while chess games last about 80 moves and Go games about 150. The gap is not only in length: each observation holds about 16,000 values, mostly floats and categorical values with hundreds of possibilities.
Actions are discretized, and on an average timestep the model chooses among 8,000 to 80,000 actions depending on the hero. Chess has a branching factor near 35 and Go near 250, so the per-step decision space is far larger than in the classic board games. Partial observability adds a further difficulty, because each team sees only the part of the map near its own units and buildings.
Policy, observations and the self-play loop
The policy maps the history of observations to a distribution over actions and is parameterized as a recurrent network with about 159 million parameters. Its core is a single-layer LSTM with 4096 units, which accounts for 84% of the parameter count. The five heroes on a team are each driven by a replica of this network that shares the same parameters but keeps its own hidden state.
Heroes on one team see largely the same information because visibility is shared, so their observations are nearly identical. The input is a set of semantic data arrays instead of rendered pixels, a choice the authors make to focus on strategic decisions and to avoid the cost of rendering each frame.
Training uses Proximal Policy Optimization, which the authors describe as a variant of advantage actor-critic, with Generalized Advantage Estimation to reduce variance. The lambda of the advantage estimator is 0.95, and because of this the rewards need smoothing over a window much longer than 20 timesteps; the authors find that a window of 256 timesteps loses relatively little.
Optimizer GPUs compute gradients on minibatches drawn from experience buffers, and the gradients are averaged across the pool before the synchronous update, giving an effective batch of 2,949,120 time steps at the peak of up to 1536 GPUs.
Most games (80%) are played against the latest policy, while the rest (20%) are played against older policies. The whole system runs on the authors' Rapid platform.
Carrying a trained policy across changes
The game changed for three reasons: the training process and architecture were revised, the supported mechanics grew, and Valve released new Dota 2 versions. Retraining from scratch after each such change would have cost months and a large budget, so the authors built tools that take a trained model offline and produce a new model in the changed environment.
The ideal target is a new policy that gives the same action probabilities as the old one for every observation, a condition that follows the Net2Net-style function preserving transformations. When the observation, action and environment spaces are unchanged, this identity can be enforced directly; when a change makes it impossible, the tools aim for approximate preservation.
The authors also note that a change to the encoder can be handled by keeping the mapping from game state to action fixed as a composition, so the new encoder feeds the same policy function.
Over the ten-month run the authors performed more than twenty surgeries, along with many unsuccessful attempts. One of these came eight days before the match against OG, when Dota 2 version 7.21d was adopted, and that change was possible only because training continued from the previous agent. The authors report that surgery allowed continuous training without loss in performance.
Scale and the human evaluation results
Batch sizes ranged from 1 to 3 million timesteps, the model had over 150 million parameters, and training covered 180 days spread over ten months of real time because of restarts and reverts. Relative to AlphaGo, the authors used 50 to 150 times the batch size, 20 times the model size and 25 times the training time.
On April 13th, OpenAI Five played OG, the reigning Dota 2 world champions, and won a best-of-three match 2-0. The authors present this as the first time an AI system beat an esports world champion. A single showmatch does not by itself show broad robustness, so the authors also opened the agent to public games.
In the OpenAI Five Arena, held from April 18 to 21, 2019, the agent played 3,193 teams in 7,257 games and won 99.4% of them.
The authors measure reaction time as the key dexterity measure in Dota 2, and OpenAI Five reacts to a game event in 217 ms on average, independent of game state. Typical human visual reaction time is about 250 ms, according to the authors' reference, so the agent reacts faster on average.
Sample reuse and asynchronous training
Sample reuse is defined as the ratio of samples per batch times batches per second to the experience buffer intake rate in samples per second, and it is measured rather than set exactly. To raise sample reuse, the authors cut the number of rollouts by 2, 4 and 8 times, and doubling the rollouts gave a sample reuse below 1, with measured values between 0.57 and 6.3.
In these experiments, increasing sample reuse caused a significant decrease in performance. The run with one eighth as many rollout workers, at a measured sample reuse near 6.3, appears to have converged to less than 75 TrueSkill. Changing the number of rollouts also changes how many games run at once, so game diversity differs between these runs.
Measured by wall time, the asynchronous run was nearly 3 times faster at reaching TrueSkill 150, while the two runs performed similarly per iteration. A sample reuse just below 1 also outperformed the other runs after about iteration 5,000, though the gain over sample reuse 1 is small.
Limitations
The system supported 17 heroes, while the normal game offers a pool of 117 heroes from which players choose. Items that let a player control several units at once, such as Manta Style and Necronomicon, were removed. Hand-scripted logic handled item purchase order, courier control and which items heroes keep in reserve, and the authors expect the agent could do better without this scripting.
TrueSkill evaluations use the final policy and environment, so they are biased against earlier models trained in earlier environments. The authors note that the TrueSkill environment rates agents on a scale where 0 corresponds to random play, and a scripted agent that defeats beginners but not amateurs sits near 105.
Paper info
- Authors
- OpenAI, :, Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysław Dębiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, Rafal Józefowicz, Scott Gray, Catherine Olsson, Jakub Pachocki, Michael Petrov, Henrique P. d. O. Pinto, Jonathan Raiman, Tim Salimans, Jeremy Schlatter, Jonas Schneider, Szymon Sidor, Ilya Sutskever, Jie Tang, Filip Wolski, Susan Zhang
- Venue
- arXiv · Preprint
- First published
- 2019-12-13
- Added
- 2026-11-12
- Updated
- 2019-12-13
- Version
- v1
- arXiv
- 1912.06680
- Category
- cs.LG · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
OpenAI, :, Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysław Dębiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, Rafal Józefowicz, Scott Gray, Catherine Olsson, Jakub Pachocki, Michael Petrov, Henrique P. d. O. Pinto, Jonathan Raiman, Tim Salimans et al. (2019). Dota 2 with Large Scale Deep Reinforcement Learning. arXiv:1912.06680v1. https://arxiv.org/abs/1912.06680v1
BibTeX
@misc{openai2019dota,
title = {{Dota 2 with Large Scale Deep Reinforcement Learning}},
author = {OpenAI and : and Christopher Berner and Greg Brockman and Brooke Chan and Vicki Cheung and Przemysław Dębiak and Christy Dennison and David Farhi and Quirin Fischer and Shariq Hashme and Chris Hesse and Rafal Józefowicz and Scott Gray and Catherine Olsson and Jakub Pachocki and Michael Petrov and Henrique P. d. O. Pinto and Jonathan Raiman and Tim Salimans and Jeremy Schlatter and Jonas Schneider and Szymon Sidor and Ilya Sutskever and Jie Tang and Filip Wolski and Susan Zhang},
year = {2019},
eprint = {1912.06680},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1912.06680v1}
}