> ## Documentation Index
> Fetch the complete documentation index at: https://aegean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Proximal Policy Optimization (PPO)

> PPO is an actor-critic policy gradient algorithm that constrains each update to stay close to the previous policy, stabilizing training by preventing destructively large gradient steps.

<img src="https://mintcdn.com/aegeanaiinc/WNDPFdbxFiDHVImn/aiml-common/lectures/reinforcement-learning/policy-based-algorithms/PPO/images/ppo-loop.svg?fit=max&auto=format&n=WNDPFdbxFiDHVImn&q=85&s=4a41f7f62b4a3758ae59ac34003827ae" alt="PPO actor-critic loop: query q enters the Policy Model, which generates output o evaluated by a frozen Reference Model (KL penalty), a frozen Reward Model, and a trainable Value Model; combined reward r and value estimate v feed into GAE to produce advantage A; dashed arcs show actor and critic gradient paths back to their respective models" width="780" height="240" data-path="aiml-common/lectures/reinforcement-learning/policy-based-algorithms/PPO/images/ppo-loop.svg" />

*Editable Mermaid source: [`images/ppo-loop.mermaid.md`](images/ppo-loop.mermaid.md)*

<iframe width="100%" height="480" src="https://www.youtube.com/embed/8jtAzxUwDj0?start=583" title="PPO talk" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen />

## Analytical Derivations

<iframe width="100%" height="480" src="https://www.youtube.com/embed/ycCtmp4hcUs" title="PPO analytical derivations" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen />

## Further reading

* Huang et al. (2022) — [The 37 Implementation Details of Proximal Policy Optimization](https://iclr-blog-track.github.io/2022/03/25/ppo-implementation-details/) — a detailed walkthrough of every engineering choice needed to reproduce PPO results in practice

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit this page on GitHub](https://github.com/aegean-ai/eaia/edit/main/src/aiml-common/lectures/reinforcement-learning/policy-based-algorithms/PPO/index.mdx) or [file an issue](https://github.com/aegean-ai/eaia/issues/new/choose).
</Callout>
