techlist.io

Random Network Distillation

1 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.