Two key parameters that determine the stability and efficiency of training: max_norm for controlling gradients and clip_param for limiting policy updates in PPO.
What is it?
How max_norm works
If the total L2 norm (the square root of the sum of squared gradients of all parameters) exceeds the threshold, the gradients are rescaled:
g ← g × (max_norm / ||g||₂)
This guarantees that the optimization step magnitude is bounded, stabilizing the training process.
Effect of changing max_norm
How to manage max_norm
- Start with a reasonable default value (0.5 is a good baseline)
- If you see frequent NaNs or unstable, jumpy losses, decrease the value
- If convergence is very slow but training is stable, try increasing the value
clip_param (PPO policy clipping)
The PPO loss is:
L^PPO(θ) = E[min(r_t(θ)A_t, clip(r_t(θ), 1-ε, 1+ε)A_t)]
Here r_t(θ) is the ratio of the new action probability to the old, A_t is the advantage, and ε is clip_param.
How clip_param works
clip_param limits the ratio of the new to the old action probability (r_t). If the new policy tries to change the probability by more than ± clip_param, the change is ignored. Thus, optimization steps stay within a trust region, never moving too far from the previous policy.
Effect of changing clip_param
How to manage clip_param
- 0.1 is the gold standard for PPO
- If the agent adapts too slowly and losses are stable, you can increase it (0.15–0.2)
- If agent behavior is unstable and performance jumps wildly, decrease the value (0.05–0.08)
Comparison table
Parameter — Controls — Risk if too large — Risk if too small — Typical range max_norm — Gradient norm (training speed) — Exploding gradients, NaN, instability — Slow convergence, insufficient speed — 0.1–2.0 clip_param — PPO policy change per iteration — Policy instability, performance jumps — Too slow improvement — 0.05–0.3
Summary recommendations
- If your model suffers from instability and sudden jumps, focus first on lowering these parameters
- If the model is stable but progress is slow, gradually raise the values and watch the result
- Never change parameters too aggressively (adjust by ±10–20% from the current value)
In summary
By managing these two parameters together, you gain control over training quality and stability and balance adaptation speed against instability risk.
- max_norm controls the stability of the optimization process (gradients)
- clip_param controls the stability of the PPO policy (changes in action probabilities)