How does clipping gradients by global L2 norm differ from clipping element-wise by value? Given a gradient vector and threshold , what is the clipped gradient under each method, and which preserves the steepest-descent direction?
Deep learning, Optimisation of deep networks
Level L2 Elementary. Length Short. Nature Mat Mathematical.
What's being asked
Whether you can compute both clipping rules and explain the geometric difference in update direction.
Key idea
Global norm clipping scales the entire gradient vector by whenever , keeping its direction intact; value clipping clamps each coordinate independently to , which rotates the gradient direction. On with , norm clipping gives while value clipping gives .
Steps
- Norm clipping: compute . Scale the whole vector by : (which has norm and points in the exact direction of ).
- Value clipping: clamp each entry to independently: (which has norm and points along , no longer parallel to ).
- Comparison: global norm clipping is usually preferred in RNNs and Transformers because it caps step size at steep cliffs without biasing the direction of steepest descent.
Common mistakes
- Clipping each parameter tensor’s norm separately instead of computing one global L2 norm across all parameters, which distorts the relative step sizes between layers.
- Thinking gradient clipping fixes vanishing gradients; it only stops exploding steps from throwing weights across steep cliffs.
How long your answer should be
4–5 lines with both vectors computed.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: What are the Huber loss for residual with threshold and its derivative ? For , what are and at and , and why does Huber loss combine the benefits of MSE and MAE?
Next in Deep learning: A network uses cosine annealing without restarts from down to over steps: . What is the learning rate at , and why is cosine decay often preferred over step decay?