Proximal Policy Optimization

Illustration:Â Ben Barry
Weâre releasing a new class of reinforcement learning algorithms, Proximal Policy Optimization (PPO), which perform comparably or better than state-of-the-art approaches while being much simpler to implement and tune. PPO has become the default reinforcement learning algorithm at OpenAI because of its ease of use and good performance.
Policy gradient methodsâ (opens in a new window) are fundamental to recent breakthroughs in using deep neural networks for control, from video gamesâ (opens in a new window), to 3D locomotionâ (opens in a new window), to Goâ (opens in a new window). But getting good results via policy gradient methods is challenging because they are sensitive to the choice of stepsize â too small, and progress is hopelessly slow; too large and the signal is overwhelmed by the noise, or one might see catastrophic drops in performance. They also often have very poor sample efficiency, taking millions (or billions) of timesteps to learn simple tasks.
Researchers have sought to eliminate these flaws with approaches like TRPOâ (opens in a new window) and ACERâ (opens in a new window), by constraining or otherwise optimizing the size of a policy update. These methods have their own trade-offsâACER is far more complicated than PPO, requiring the addition of code for off-policy corrections and a replay buffer, while only doing marginally better than PPO on the Atari benchmark; TRPOâthough useful for continuous control tasksâisnât easily compatible with algorithms that share parameters between a policy and value function or auxiliary losses, like those used to solve problems in Atari and other domains where the visual input is significant.
With supervised learning, we can easily implement the cost function, run gradient descent on it, and be very confident that weâll get excellent results with relatively little hyperparameter tuning. The route to success in reinforcement learning isnât as obviousâthe algorithms have many moving parts that are hard to debug, and they require substantial effort in tuning in order to get good results. PPO strikes a balance between ease of implementation, sample complexity, and ease of tuning, trying to compute an update at each step that minimizes the cost function while ensuring the deviation from the previous policy is relatively small.
Weâve previouslyâ (opens in a new window) detailed a variant of PPO that uses an adaptive KLâ (opens in a new window) penalty to control the change of the policy at each iteration. The new variant uses a novel objective function not typically found in other algorithms:
is the policy parameter
denotes the empirical expectation over timesteps
is the ratio of the probability under the new and old policies, respectively
is the estimated advantage at time
is a hyperparameter, usually 0.1 or 0.2
This objective implements a way to do a Trust Region update which is compatible with Stochastic Gradient Descent, and simplifies the algorithm by removing the KL penalty and need to make adaptive updates. In tests, this algorithm has displayed the best performance on continuous control tasks and almost matches ACERâs performance on Atari, despite being far simpler to implement.
Weâve created interactive agents based on policies trained by PPOâwe can use the keyboardâ (opens in a new window) to set new target positions for a robot in an environment within Roboschool; though the input sequences are different from what the agent was trained on, it manages to generalize.
This release of baselinesâ (opens in a new window) includes scalable, parallel implementations of PPO and TRPO which both use MPI for data passing. Both use Python3 and TensorFlow. Weâre also adding pre-trained versions of the policies used to train the above robots to the Roboschoolâ  agent zooâ (opens in a new window).
Update: Weâre also releasing a GPU-enabled implementation of PPO, called PPO2. This runs approximately 3x faster than the current PPO baseline on Atari. In addition, weâre releasing an implementation of Actor Critic with Experience Replay (ACER), a sample-efficient policy gradient algorithm. ACER makes use of a replay buffer, enabling it to perform more than one gradient update using each piece of sampled experience, as well as a Q-Function approximate trained with the Retrace algorithm.
Weâre looking for people to help build and optimize our reinforcement learning algorithm codebase. If youâre excited about RL, benchmarking, thorough experimentation, and open source, please applyâ (opens in a new window), and mention that you read the baselines PPO post in your application.


