techlist.io

Montezuma Revenge

2 posts

OpenAI2018-10-304 min readCurated summary

Reinforcement learning with prediction-based rewards

# Random Network Distillation: Curiosity-Driven Exploration That Cracks Montezuma's Revenge OpenAI introduces Random Network Distillation (RND), a prediction-based curiosity method that encourages reinforcement learning agents to explore. RND is the first approach to exceed average human performance on Montezuma's Revenge, a game that had long resisted exploration-based methods. It works by rewarding agents for visiting states that are hard to predict, and it avoids the classic failure modes of earlier curiosity approaches. The method can be combined with any RL algorithm and scales efficiently. ## The Long-Standing Challenge of Montezuma's Revenge - DQN scored 0% of the average human score on Montezuma's Revenge, the only game in the original DQN work where it failed completely. - Simple exploration rarely yields rewards or reaches more than a few of the game's 24 rooms. - A 2016 count-based exploration bonus added to DQN reached 15 rooms and an average score of about 3.7K. - Later gains mostly relied on human demonstrations or access to the emulator's underlying state, rather than on exploration alone. ## Learning Without Extrinsic Rewards - The authors, with collaborators from UC Berkeley, studied agents trained with no environment-specific reward, using curiosity as the sole learning signal. - Earlier next-state prediction methods rewarded the prediction error of a learned model, which made agents attracted to unpredictable events. - Surprisingly, even predicting random features of the observation worked well. - Across more than 50 environments, curious agents showed a range of behaviors, and some achieved the game's objective without ever receiving the score as a reward: - **Breakout:** Intrinsic reward spiked on seeing new brick configurations and on first clearing a level. - **Pong:** An agent controlling both paddles kept long rallies going rather than trying to win. - **Bowling:** Agents outperformed those trained on the clipped extrinsic reward, likely because they were drawn to the hard-to-predict scoreboard flashes after strikes. - **Mario:** Agents discovered 11 levels, secret rooms, and bosses, since new areas are inherently unpredictable. ## The Noisy-TV Problem - Prediction-based curiosity can trap an agent in sources of randomness, such as a TV showing static, since such transitions always yield high reward. - The authors demonstrated this in a Unity maze with a TV playing random channels. - For largely deterministic games like Montezuma's Revenge, the problem was expected to matter less, but the team used sticky actions (repeating the previous action with some probability) to prevent memorization and make room transitions less predictable. ## How Random Network Distillation Works - The authors identified three sources of prediction error: (1) poor generalization from previously seen examples, which reflects novelty; (2) stochastic prediction targets; and (3) missing information or a predictor too limited for the target function. - Factor 1 is useful for measuring novelty, while Factors 2 and 3 cause the noisy-TV trap. - RND trains a predictor to match the output of a fixed, randomly initialized neural network on the next state. - Because the target is deterministic and the predictor shares the target's architecture, the predictor can fit it well in familiar states, so error stays low there and rises in novel states. - Intrinsic and extrinsic rewards are combined through a variant of PPO that uses two value heads, allowing different discount rates and mixing episodic and non-episodic returns. - The best agent often finds 22 of 24 rooms on the first level of Montezuma's Revenge and occasionally clears the level, with state-of-the-art results on Venture and Gravitar as well. ## Scale and Results on Montezuma's Revenge - A large run with 1024 rollout workers reached a mean return of 10K over 9 runs, with a best mean of 14.5K, and each run discovered 20 to 22 rooms. - A smaller, longer run produced one of 10 runs that scored 17.5K, passing the first level and finding all 24 rooms. - Implementation details mattered greatly: stabilizing features and normalizing intrinsic rewards separated an agent stuck in the first room from one that clears the first level, and fixing a bug where extrinsic returns were mistakenly treated as non-episodic produced noticeable gains. ## Future Directions The authors suggest analyzing and combining different exploration methods, training curious agents on many environments without reward to study transfer to tasks with rewards, and investigating global exploration with coordinated decisions over long horizons.

OpenAI2018-07-034 min readCurated summary

Learning Montezuma’s Revenge from a single demonstration

# Learning Montezuma's Revenge from a Single Demonstration OpenAI trained an agent to score 74,500 on Montezuma's Revenge from a single human demonstration, a result better than any previously published. The method starts each reinforcement learning episode from a state in the demonstration and gradually moves the starting point back to the beginning of the game, optimizing the game score directly with PPO. This turns one hard exploration problem into a curriculum of short, easier subtasks. ## Why Exploration Is the Bottleneck - Model-free methods like policy gradients and Q-learning explore by taking random actions, which only works when rewards are frequent enough. - Games like Montezuma's Revenge require long, precise action sequences before any reward appears. If each of N actions has a fixed probability, the expected time to the first reward grows exponentially in N. - Getting the first key, for example, requires a chain of steps (down ladders, down a rope, jump a skull, climb a ladder), so the overall probability is far smaller than any single step's. ## Curriculum Built from Demonstration States - Each episode starts from a recorded demonstration state. Early in training, the agent starts near the end of the demonstration, where the remaining task is short. - Once the agent matches or beats the demonstrator's score on the remaining segment in at least 20% of rollouts, the starting point moves earlier in time. - This continues until the agent plays from the true start of the game without using the demonstration. - Because each stage is only slightly harder than the last, the agent's chance of success stays high, and the required exploration scales linearly rather than exponentially with the length of the action sequence. - The authors note that earlier work had proposed resetting to demonstration states, but the gradual backward curriculum was essential to getting a benefit from the demonstration. ## Comparison with Imitation Approaches - Prior DeepMind work imitated demonstrations, either by reproducing states from a YouTube video or by combining Q-learning with a likelihood term on demonstrated actions. - Those methods need less environment control, but this approach requires resetting the environment to arbitrary states and access to full game states from the demonstration. - Optimizing the game score directly avoids overfitting to a possibly suboptimal demonstration and allows the agent to discover strategies the demonstrator did not use. The authors also suggest this could help in multiplayer settings where opponents differ from the demonstrator. ## Remaining Challenges - **Generalization:** The agent rarely reproduces the exact demonstrated states because of frameskip differences and action randomness, so it must generalize to near-identical states. This works well for Montezuma's Revenge but much less well for Gravitar and Pitfall, which likely need better vision. - **Exploration–exploitation balance:** The PPO entropy coefficient, learning rate, and reward scaling required careful tuning. Gravitar and Pitfall never found workable hyperparameters for the full curriculum, and some runs for Montezuma's Revenge failed to converge. - **Robustness:** The trained policy does not yet generalize as well as a human. With sticky actions (repeat probability 0.25) it averages 10,000 points, and with random actions (probability 0.01) it averages 8,400. Humans also degrade under such perturbations, but less so. These perturbed scores still exceed previously published results. - **Start-state variation:** Starting with 0 to 30 random no-ops did not significantly hurt performance, with most rollouts reaching the demonstration's final score. ## Takeaway Decomposing a long-horizon sparse-reward problem into a curriculum of subtasks, seeded by demonstration states and optimized for the true reward, can solve tasks that pure random exploration cannot. The authors hope future RL algorithms will be more robust to noise and hyperparameter choices.