I don't understand why the clipped surrogate objective works. As written in the article : "With this scheme, we only ignore the change in probability ratio when it would make the objective improved, and we include it when it makes the objective worse". I feel confused : how can it works if it doesn't take account of objective improvements?
Ok, so I think I have a better understanding of this now.
Firstly, let's remind the main idea of the PPO : staying close to the previous policy. It's the same idea than in TRPO, but the L function is improved.
So, you wanna make "small but safe steps". With clipped surrogate objective, you don't give too much importance to promising actions. You learn that bad actions are bad, so you decrease their probability according to "how bad" they are. But for good actions, you only learn that they are "a little bit good", and their probability will be just slightly increased.
This mechanism allows you to perform small but relevant updates of your policy.
hope this will help someone :)
I think @16Aghnar explains the concept quite well. However, by clipping the surrogate objective alone doesn't ensure the trust region as stated in the paper:
Engstrom et al., 2020, Implementation Matters in Deep RL: A Case Study on PPO and TRPO.
The authors inspected OpenAI's implementation of PPO and find many code-level optimizations, I'll list the most important optimizations below:
- Clipped surrogate objective
- Value function clipping
- Reward scaling
- Orthogonal initialization and layer scaling
- Adam learning rate and annealing
They find that:
5.) alone can maintain the trust region.
(PPO-M: PPO without Clipped surrogate objective, but with code-level optimizations)
1.only) cannot maintain the trust region.
(PPO-Clip: PPO without code-level optimizations, but with Clipped surrogate objective)
TRPO+ has better performance comparing to TRPO, and with similar performance comparing to PPO
(TRPO+: TRPO with code-level optimizations used in PPO OpenAI implementation)
A intuitive thought on why Clipped surrogate objective alone does not work is: The first step we take is unclipped.
As a result, since we initialize $\pi_\theta$ as $\pi$ (and thus the ratios start all equal to one) the first step we take is identical to a maximization step over the unclipped surrogate reward. Therefore, the size of step we take is determined solely be the steepness of the surrogate landscape (i.e. Lipschitz constant of the ptimization problem we solve), and we can end up moving arbitrarily far from the trust region. -- Engstrom et al., 2020