techlist.io

Self Play

7 posts

OpenAI2019-12-121 min readCurated summary

Dota 2 with large scale deep reinforcement learning

OpenAI Five became the first AI system to defeat world champions at an esports game when it beat Team OG, the Dota 2 world champion, on April 13, 2019. The work shows that self-play reinforcement learning, scaled up substantially, can reach superhuman performance on a task with long time horizons, imperfect information, and complex continuous action spaces. ## Why Dota 2 Is a Hard Problem - The game has long time horizons, so decisions made early can pay off only much later. - Players have imperfect information about the map and opponents. - The state and action spaces are complex and continuous, which makes them difficult for AI systems to handle. ## Training at Scale - OpenAI Five used existing reinforcement learning techniques but scaled them far beyond typical settings. - Training learned from batches of roughly 2 million frames every 2 seconds. - The team built a distributed training system and tools for continual training. - Training ran for 10 months in total. ## Results - OpenAI Five defeated the reigning Dota 2 world champion. - The result supports the claim that self-play alone, given enough scale, can produce superhuman play on a difficult, real-time strategy task.

OpenAI2019-09-164 min readCurated summary

Emergent tool use from multi-agent interaction

# Emergent Tool Use from Multi-Agent Hide-and-Seek OpenAI trained agents to play a team-based hide-and-seek game in a simulated physics environment, and they developed six distinct strategies and counterstrategies, including tool use that the designers had not anticipated. The agents received no incentive to interact with objects; the complex behavior arose from the competitive dynamics of the game alone. The authors argue that multi-agent competition is a more scalable route than intrinsic motivation to producing human-relevant skills without supervision, and that evaluating such agents requires new transfer-based tests. ## The Environment and Reward Structure - Hiders (blue) must avoid line-of-sight with seekers (red), while seekers must keep hiders in view. - Agents can grab and lock movable objects, and the map includes randomly generated immovable rooms and walls. - Hiders get a preparation phase in which seekers are immobilized, giving them time to run or rearrange the space. - The only supervision is a team-based reward: hiders receive +1 when all are hidden and -1 if any is seen, and seekers receive the opposite. - Agents are penalized for leaving the play area, and all agents receive zero reward during preparation. ## Autocurricula and Emergent Strategies - As agents train against each other, up to six strategies emerge, with each new one creating pressure for the next stage. - No direct incentive exists for object interaction or exploration. The behaviors result from an autocurriculum induced by multi-agent competition. ## Training Setup - The team reused the infrastructure and algorithms from OpenAI Five and Dactyl, with each agent acting independently on its own observations and hidden memory state. - The world is represented as entity-centric state, permutation invariant over objects and agents. - Each object is embedded and processed by a masked residual self-attention block, similar to transformers but attending over objects rather than time. Objects outside line-of-sight and in front of the agent are masked out. - Training uses self-play and Proximal Policy Optimization. The value function can use privileged information about obscured objects and agents. - Large-scale training was critical. Larger batch sizes drastically reduced wall-clock time to reach stage 4 (ramp defense) without greatly affecting sample efficiency at or above 32k. Batch sizes of 8k and 16k never reached stage 4 within the episode budget. ## Competition Versus Intrinsic Motivation - The team compared against count-based exploration, which rewards agents for visiting rarely seen states. - Count-based agents with a simple 2-D box-position state moved objects in seemingly undirected ways. With the full state, they had fewer meaningful object interactions as complexity grew. - Hide-and-seek agents produced more interpretable behavior, such as shelter construction. The authors expect competition to scale better as environments grow. ## Evaluating Agents Through Transfer - Reward alone is ambiguous in multi-agent settings, and ELO or TrueSkill cannot show whether gains come from new adaptations or from improving existing skills. Environment-specific statistics like object movement are also hard to interpret and costly to design as environments scale. - The authors propose a suite of domain-specific intelligence tests that measure transfer performance as a proxy for representation quality and skill. They compare against count-based pretraining and training from scratch. - The hide-and-seek agents transferred somewhat better on many tasks but did not show a dramatic improvement in performance or convergence time. The authors attribute this to entangled skill representations that are hard to fine-tune, and they open-sourced the evaluation tasks. ## Lessons From Surprising Behavior Building environments is difficult, and agents often exploit unintended quirks in the environment or physics engine. The authors suggest that agents can learn sophisticated tool use in a high-fidelity simulator, but that careful environment design remains essential.

OpenAI2019-04-143 min readCurated summary

OpenAI Five defeats Dota 2 world champions

# OpenAI Five Becomes the First AI to Beat Esports World Champions OpenAI Five defeated OG, the reigning Dota 2 world champions, in two consecutive games at the Finals, marking the first time an AI has beaten world champions in an esports game and the first time it has done so on livestream. The post argues that the key to this milestone was scale rather than new algorithms, and that the same system could be turned from a competitor into a cooperative teammate with relatively little effort. ## Why Dota Was a Hard Target - The team chose Dota because it seemed beyond existing deep reinforcement learning methods, expecting to need ideas like hierarchical RL. - The main missing ingredient turned out to be scale. Their system, Rapid, ran PPO at unprecedented size, and they reached world-class play without hitting fundamental performance limits. - RL's data appetite remains a limitation. Rapid also trained a robotic hand in simulation to reorient a block, but reducing the required experience is a major open challenge. ## Compute and Training Scale - The Finals version beat The International 2018 version with a 99.9% winrate, though this figure is measured on the current patch, which favors the newer agent. - Compute increased 8x. The model consumed 800 petaflop/s-days and about 45,000 years of self-play over 10 realtime months, up from roughly 10,000 years over 1.5 months. - Since most compute was already devoted to a single model, the team scaled by training for longer rather than adding resources. ## Continuous Training and Transfer - The model has trained continuously since June 2018 through changes in model size and game rules, including major patches and new features. - The team built "surgery" tooling to transfer trained parameters across substantial architecture changes, addressing an open problem in RL. ## Expanding the Hero Pool - Going from 5 to 18 heroes caused little slowdown in training. Pools of up to 25 heroes reached about 5k MMR but did not reach pro level in time. - Hypotheses for the slowdown include limited model capacity, matchmaking issues with a larger pool, and the difficulty new heroes face catching up to mastered ones. - The Finals version uses 17 heroes, with Lich removed due to significant ability changes in patch 7.20. ## Cooperative Play - Although trained only by playing against copies of itself, the model generalized zero-shot to controlling a subset of heroes alongside or against humans. - Testers reported feeling supported by their bot teammates and found the experience enjoyable. ## Public Arena and Next Steps - OpenAI Five Arena lets the public play against the bot in competitive and cooperative modes from April 18 to April 21, 2019, with results posted to a public leaderboard. This tests how exploitable the system is. - A more technical analysis will follow the Arena results, and the team plans to keep using Dota 2 as a research environment for learning from less data and for human-AI cooperation. **Conclusion:** The post presents OpenAI Five's win as evidence that scaling existing RL methods can reach expert performance in complex environments, while data efficiency and robust human-AI cooperation remain open problems.

OpenAI2018-06-245 min readCurated summary

OpenAI Five

# OpenAI Five: Reaching Amateur-Level Dota 2 with Scaled Self-Play OpenAI's team of five neural networks, OpenAI Five, had begun beating amateur human teams at Dota 2 by June 2018, with a planned match against top professionals in August. The post argues that Dota 2, with its long time horizons, partial observability, and vast action and observation spaces, is a meaningful step beyond games like Chess and Go. It concludes that large-scale self-play with a modern policy-gradient algorithm can produce long-horizon planning without fundamentally new RL methods. ## Why Dota 2 Is Hard - **Long time horizons:** A typical game runs about 45 minutes at 30 frames per second, or roughly 80,000 ticks. The model observes every fourth frame, producing about 20,000 decisions per game, compared with fewer than 40 moves in a typical chess game and around 150 in Go. - **Partial observability:** Units see only their immediate surroundings, and the rest of the map is hidden by fog of war. Strong play requires inferring enemy positions and predicting opponent strategy. - **Large action space:** Each hero has dozens of actions, many of which target units or ground positions. The team discretized this into 170,000 possible actions per hero, with about 1,000 valid at any tick, compared with 35 in chess and 250 in Go. - **Large observation space:** The model receives about 20,000, mostly floating-point, values through Valve's Bot API, compared with roughly 70 enumeration values for a chess board and about 400 for Go. - **Complex, changing rules:** The game logic spans hundreds of thousands of lines of code, takes milliseconds per tick to execute, and receives updates about every two weeks. ## Training Approach - OpenAI Five uses a scaled-up version of Proximal Policy Optimization, trained on 256 GPUs and 128,000 CPU cores. Each hero has its own LSTM, and no human data is used. Training starts from random parameters. - The system plays about 180 years of games against itself each day. - The discount factor γ was annealed from 0.998, a half-life of about 46 seconds, to 0.9997, a half-life of about five minutes. For comparison, the longest horizons in the PPO, Rainbow, and Observe and Look Further papers had half-lives of 0.5 seconds, 4.4 seconds, and 46 seconds, respectively. - Each network has a single 1024-unit LSTM that outputs actions through several independent heads, such as action delay, action selection, and grid coordinates. - Although the model cannot see shrapnel zones, which are visible to human players, it learned to walk out of them by observing its health dropping. ## Exploration and Reward Design - Training is 80% self-play against current versions and 20% against past versions, which prevents strategy collapse. - Learned behavior progresses over time. Within hours, laning and farming emerge. Within days, the agents follow basic human strategies such as stealing runes and rotating across the map. With further training, they learn high-level tactics like five-hero pushes. - Domain randomization, which varies unit health, speed, and starting level during training only, forced the agent to explore strategy space. A "lane assignment" randomization penalizes straying from assigned lanes until a random point in the game. - The reward is based on metrics humans track, including net worth, kills, deaths, assists, and last hits. Each agent's reward has the opposing team's average subtracted to discourage positive-sum outcomes. - Item and skill builds are hardcoded and chosen randomly from a set. ## Coordination Without Communication - The heroes have no explicit communication channel. Instead, a "team spirit" hyperparameter, annealed from 0 to 1 during training, weights each hero's individual reward against the team average. ## Results - The system beat a team of OpenAI employees, Valve employees, and amateur and semi-pro teams with restricted hero pools. - The June 6 version decisively won against three teams and won two of three informal scrimmage games against two others. - Observed strategies included sacrificing the safe lane to control the enemy's safe lane, accelerating the early-to-mid transition through ganks and coordinated tower pushes, and giving support heroes early resources. - The team reports two surprising findings. A binary win/loss reward trained far more slowly and plateaued, and creep blocking emerged in a 2v2 model without any explicit reward. ## Caveats and Differences from Humans - The AI has advantages in reaction time (80ms on average) and perfect information access, since it reads exact values that humans must check manually. Its action rate is around 150 to 170 per minute, with a theoretical maximum of 450. - The restricted version used for testing excludes wards, Roshan, invisibility, summons, and several items, and it uses a fixed mirror matchup of five heroes. The team states these restrictions are temporary and planned for removal. - The team noted that the bot's objective prioritization resembled professional strategy, though its last-hitting was only around median. ## Conclusion The authors suggest that long-horizon planning can emerge from scaled reinforcement learning without new algorithmic breakthroughs. They plan to measure success by applying similar methods to real-world tasks.

OpenAI2017-10-102 min readCurated summary

Competitive self-play

# Competitive Self-Play in Simulated 3D Environments OpenAI researchers found that simulated robots trained purely through competition against copies of themselves can learn physical skills such as tackling, ducking, faking, kicking, catching, and diving, without the environment being explicitly designed for them. Because self-play continually matches each agent against opponents of appropriate difficulty, it creates a learning curriculum that human designers would otherwise have to craft by hand. Combined with their earlier Dota 2 results, the work suggests self-play will be a core component of powerful AI systems. ## Experimental Setup - Simulated 3D robots compete in basic games such as sumo wrestling, pushing an opponent out of a ring, reaching the opposite side while blocking the other agent, and soccer-style goal scoring. - Each agent is given only simple goals, and the strategies that emerge are analyzed afterward. - Each agent's neural network policy is trained independently using Proximal Policy Optimization (PPO). ## Reward Shaping and Annealing - Agents first receive dense rewards that encourage exploration, such as standing and moving forward. - These dense rewards are gradually reduced to zero, leaving only the win/loss signal. - In sumo, the team took a walking reward from earlier work, removed the velocity term, and added a negative L2 distance from the ring's center as the exploration reward. - This shaping lets agents learn complex competitive behavior without hand-designed skill objectives. ## Emergent Skills and Transfer Learning - Agents learned tackling, ducking, faking, kicking, catching, and diving through competition alone. - Human-designed environments can only produce behaviors that designers anticipate, while self-play lets agents keep bootstrapping against successively stronger versions of themselves. - A sumo-trained agent kept its balance under "wind" forces it had never encountered, while standard RL-trained walkers fell immediately, suggesting the learned skills generalize. ## Avoiding Overfitting to Specific Opponents - Agents initially co-adapted to counter particular opponents and failed against new ones. - The fix was to train each agent against a diverse pool of opponents, including policies from parallel training runs and earlier checkpoints. - Diversity forces agents to learn general strategies rather than exploits tailored to a single opponent. ## Conclusion The researchers released the MuJoCo environments and trained policies so others can build on this work. The results indicate that self-play, paired with reward annealing and opponent diversity, can produce robust, transferable skills without requiring humans to specify those skills in advance.

OpenAI2017-08-155 min readCurated summary

More on Dota 2

# OpenAI Five Beats Dota 2 Pros: Self-Play, Scaling, and Open Challenges OpenAI's Dota 2 bot shows that self-play can take a machine learning system from far below human skill to superhuman performance, given enough compute. In about a month, the 1v1 bot went from barely matching a high-ranked player to beating top professionals, including the world's best 1v1 player. Because the training data is generated by the agent itself, performance keeps improving rather than plateauing at the level of a fixed human-generated dataset. ## Progress Timeline - Rating improvement was steady: the bot's TrueSkill rating, computed from simulated games between bot versions, rose roughly linearly over time, which means its strength grew exponentially. - March 1: first classical reinforcement learning results, where a Drow Ranger learned to kite a scripted Earthshaker. - May 8: a 1.5k MMR tester reported improving faster than the bot. - Early June: the bot beat the 1.5k MMR tester. - June 30: the bot won most games against a 3k MMR tester. - July 8: the bot barely won its first game against a 7.5k MMR semi-pro. - August 7: the bot beat a former pro (6.2k), a pro (8.5k), and another pro (8.9k), with a 3–0, 2–1, and 3–0 record. - August 9: the bot beat Arteezy, a 10k top player, 10–0. - August 10: the bot beat Sumail, a top 1v1 player, 6–0, who then called it unbeatable. - August 11: the bot beat Dendi, a former world champion, 2–0. ## The 1v1 Task Setup - The bot played under standard tournament rules with no AI-specific simplifications. - Observations used the same Bot API features humans can see, covering heroes, creeps, courier, and nearby terrain. The game is partially observable. - Actions were available through the Bot API at a frequency comparable to humans, including movement, attacks, and item use. - Rewards were based on winning, plus basic signals such as health and last hits. - Only a few dozen item builds were whitelisted for training, and one was chosen for evaluation. - The initial creep block was trained separately with traditional RL, since it occurs before the opponent appears. ## Improving During The International - Human "coaching" combined with self-play allowed major improvements between Monday and Thursday of The International. - A Monday win by Pajkatt using an early magic wand led the team to add that build to the training whitelist. - A Wednesday test revealed the bot losing health in the first wave. The team found that this behavior baited opponents into aggression, and further self-play taught the bot to counter the baiting. Meanwhile, they used Monday's bot for the first wave only. - After the Arteezy matches, an updated creep block model added one TrueSkill point, and further training before the Sumail match added two more. - Sumail noticed the bot casting razes outside enemy vision, exploiting a mechanic the team hadn't known about: abilities cast outside enemy vision prevent the enemy from gaining a wand charge. ## Known Exploits Players at a LAN event played over 1,000 games trying to beat the bot by any means. The successful exploits fell into three types: - **Creep pulling:** Players lured lane creeps right as they spawned, between tier 2 and tier 3 towers, so dozens of creeps chased them around the map and eventually wore down the tower. - **Orb of venom with wind lace:** This gave a large level 1 movement speed advantage, enabling a quick first blood and a further kill. - **Level 1 razes:** Several 6–7k MMR players killed the bot at level 1 by landing 3–5 razes in quick succession. This required a lot of skill. The team notes that fixing these 1v1 issues would be similar to fixing the Pajkatt bug. In 5v5, such situations aren't really exploits, and the system must handle unfamiliar and unusual situations it has never seen. ## Infrastructure Challenges - Running Dota 2 on cloud GPUs initially failed with an obscure error. The team found the game booted only with a monitor attached, so they configured cloud instances to simulate one. - Because Dota lacked custom dedicated server support, scalable GPU-free runs depended on slow software rendering. The team wrote a shim that stubbed most OpenGL calls, except those needed for booting. - A scripted baseline bot was built for comparison and to understand the Bot API. It reached 70 last hits in ten minutes on an empty lane. The current best 1v1 bot reaches about 97, and the theoretical maximum is 101. ## Next Step: 5v5 - The team plans to start 5v5 with behavioral cloning, using a dataset of 5.8 million expert-level replays collected since the previous November, roughly 45 minutes per game with 10 human players. - Replays come from OpenDota, which the team supports with a $12k donation. - The team is hiring engineers and researchers, and thanks Microsoft Azure and Valve for their support.

OpenAI2017-08-102 min readCurated summary

Dota 2

# OpenAI Five Beats a Top Dota 2 Professional in 1v1 Matches OpenAI announced a bot that defeated Dendi, a top professional, in a best-of-three 1v1 Dota 2 match under standard tournament rules, and it went undefeated against several other leading players, including the world's top 1v1 player. The bot learned the game entirely through self-play, without imitation learning or tree search. The authors present this as a step toward AI systems that can accomplish well-defined goals in messy, real-world situations involving humans. ## Why Dota 2 Is a Hard Problem - Dota 1v1 is a complex game with hidden information, so agents must plan, attack, feint, and deceive. - Player skill does not correlate strongly with actions per minute, and the bot's APM is comparable to an average human player's, so the result does not rely on superhuman mechanical speed. ## What the Bot Learned - Through self-play alone, the bot learned to predict where opponents will move. - It improvised in unfamiliar situations. - It learned to influence the opponent's allied units to help it win. ## Next Steps: Five-versus-Five - The full game is played by two teams of five, with a pool of about a hundred heroes and hundreds of items, which is far more complex than 1v1. - The next goal is a team of Dota 2 bots that can compete and collaborate with top human teams.