Proximal policy optimization (PPO) is an on-policy, model-free reinforcement-learning algorithm built on the actor–critic architecture. It is useful when an agent must improve a policy from experiences it generates while interacting with an environment—for example, learning to balance a pole or coordinate connections in a mobile network. section 12.1.5 section 12.3 section 12.4
The difficulty is that training data changes as the policy changes. Repeated policy-gradient updates on one batch can move the new policy too far from the policy that collected it. The estimated advantage can then become inaccurate, disrupting learning. PPO limits that shift rather than treating every apparent improvement in the batch as a reason for a large update. section 12.1.5
Two variants limit policy changes in different ways:
- PPO-penalty adds a penalty based on Kullback–Leibler (KL) divergence between the old and updated policies. It draws on the trust-region idea used in trust region policy optimization (TRPO). section 12.1.5
- PPO-clip uses a clipped surrogate objective to limit the effect of policy changes during an update. section 12.1.5
Figure 12.6 Clipped surrogate objective in PPO
The clipped-surrogate-objective figure illustrates the update-limiting idea behind PPO-clip. section 12.1.5
Balance CartPole with a PPO implementation
Create a Gymnasium CartPole-v1 environment, construct stable_baselines3.PPO with MlpPolicy, and train for 10,000 timesteps. Evaluate the trained policy over 10 episodes, then use its predicted actions to test it. Compare this run with A2C on the same task. Training rewards may fluctuate while the agent explores; inspect mean episode reward alongside approx_kl, clip_fraction, and clip_range to see both performance and how much updates change or clip the policy. section 12.3
Coordinate a small mobile network
A network with three base stations and five users must balance connection data rates against competition for limited station resources; maximizing each user’s connections does not necessarily maximize overall quality of experience. Train a PPO agent with MlpPolicy in mobile_env for 30,000 timesteps, log progress for TensorBoard, and render the changing connections. For a multi-agent version, configure a shared policy with Ray RLlib PPO and test actions from the selected checkpoint. section 12.4


