PPO Algorithm › Key Hyperparameters

Michael BrenndoerferDecember 27, 20255 min read
Language AI HandbookAll chapters
Part 37 of 67Alignment and RLHF
Chapter 278PPO Algorithm › Key Hyperparameters
Reading section 10 of 14 · Key Hyperparameters · 5 minSection 10 of 14 · 5 min

Book contents

Section 10 of 14 · 5 min read

PPO Algorithm › Key HyperparametersOne section · Sections in this chapter10 / 14 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

PPO's performance depends on several key hyperparameters, and understanding what each one controls is needed for successful application. These hyperparameters interact with each other, so tuning one often requires adjusting others. The values below represent good starting points, but every domain benefits from some tuning.

The clipping parameter ϵ\epsilon is the most basic hyperparameter because it directly controls the trust region. Smaller values make PPO more conservative, potentially requiring more rollouts to achieve the same policy improvement. Larger values allow faster learning but increase the risk of instability. The number of update epochs per rollout determines how much you squeeze out of each collected batch. More epochs improve sample efficiency (less environment interaction needed) but increase the risk that the policy drifts too far from the old policy within a single rollout. PPO's clipping limits this drift, but with many epochs and aggressive learning rates, the policy can still move substantially.

The key hyperparameters and their typical values are:

  • Clip parameter (ϵ\epsilon): Controls policy change by defining the trust region as [1−ϵ,1+ϵ][1-\epsilon, 1+\epsilon] for the probability ratio. Values of 0.1 to 0.3 are typical. Smaller values (e.g., 0.05) constrain updates too tightly and slow learning. Larger values (e.g., 0.5) provide insufficient constraint and risk instability.
  • GAE lambda (λ\lambda): Bias-variance tradeoff for advantage estimation. Values of 0.95 to 0.99 are typical.
  • Number of epochs: Number of passes through collected data. Using 3 to 10 epochs balances sample efficiency against overfitting to old data.
  • Minibatch size: Larger batches provide more stable gradients but may overfit. Sizes of 32 to 256 are common.
  • Rollout length: How much data to collect before updating. Longer rollouts provide better advantage estimates but slower iteration.
  • Learning rate: Values of 1e-4 to 3e-4 are typical for PPO. You can use learning rate scheduling to improve convergence.

Language model implementations often require adjusted values. The next chapter explores LLM-specific considerations, including how to adapt the reward signal from a reward model, manage the KL penalty against the reference model, and handle the much larger action spaces of language generation.

Out[17]:
Visualization
Line chart of the PPO clipped objective with a narrow shaded green gradient region between ratio 0.9 and 1.1, showing tight epsilon 0.1 constraints with red dotted vertical bound lines.
Tight trust region (epsilon = 0.1) constrains probability ratios to the narrow band [0.9, 1.1], limiting policy changes severely. The shaded green region shows where gradients flow, and you can see it is quite narrow. This conservative approach prevents destabilizing updates in unstable domains but may constrain learning excessively, which makes it difficult for the policy to improve significantly with each update. Best for environments where stability is necessary.
Line chart of the PPO clipped objective with a moderate shaded green gradient region between ratio 0.8 and 1.2, showing standard epsilon 0.2 constraints with red dotted vertical bound lines.
Standard trust region (epsilon = 0.2) constrains probability ratios to [0.8, 1.2], the most widely adopted setting. The moderate shaded gradient region balances stability against learning speed, giving adequate protection against instability while letting reasonable progress. This value works well across diverse continuous control tasks and RLHF applications.
Line chart of the PPO clipped objective with a wide shaded green gradient region between ratio 0.7 and 1.3, showing loose epsilon 0.3 constraints with red dotted vertical bound lines.
Loose trust region (epsilon = 0.3) permits probability ratios up to [0.7, 1.3], with a broader shaded gradient region. This permissive approach accelerates learning by letting larger policy changes per update, helpful in environments where the policy needs to change substantially. However, it provides less protection against instability and risks performance collapse if large updates move into poor regions. Use only when stability is less necessary.