techlist.io
OpenAI2018-07-034 min read

Curated summary

Learning Montezuma’s Revenge from a single demonstration

Read original(opens in new tab)

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.

Continue with another curated summary.