What is the difference between gradient clipping by value and gradient clipping by norm?

Quick Overview

Asks how clipping gradients by value differs from clipping them by norm when training neural networks. Tests whether you can work both through on a small vector, explain what happens to the update direction, and handle practical details such as the global norm and mixed-precision scaling.

What is the difference between gradient clipping by value and gradient clipping by norm?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the difference between gradient clipping by value and gradient clipping by norm? ```hint Try a two-component gradient Take a gradient such as (3, 0.4) and a threshold of 1. Apply each kind of clipping by hand and compare the direction of the result with the original. ``` ```hint Scope of the norm For norm clipping, ask which vector the norm is computed over: one tensor, one layer, or every parameter in the model at once. ``` ### What a Strong Answer Covers - What each method does mathematically, including the threshold check for norm clipping - Whether each method preserves the gradient's direction, shown with a concrete vector - Global norm across all parameters compared with per-tensor or per-element clipping - Where each is used in practice and typical threshold values - Practical pitfalls such as mixed-precision loss scaling and where the clip sits in the training step ### Follow-up Questions - How would you pick the clipping threshold for a new model, and what does it mean if almost every step gets clipped? - How does gradient clipping interact with an adaptive optimizer such as Adam? - With gradient accumulation over several micro-batches, when should clipping be applied? - Why are exploding gradients more common in RNNs than in feedforward networks of similar size?

Overview: Asks how clipping gradients by value differs from clipping them by norm when training neural networks. Tests whether you can work both through on a small vector, explain what happens to the update direction, and handle practical details such as the global norm and mixed-precision scaling.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What is the difference between gradient clipping by value and gradient clipping by norm?

What a Strong Answer Covers Guidance

  • What each method does mathematically, including the threshold check for norm clipping
  • Whether each method preserves the gradient's direction, shown with a concrete vector
  • Global norm across all parameters compared with per-tensor or per-element clipping
  • Where each is used in practice and typical threshold values
  • Practical pitfalls such as mixed-precision loss scaling and where the clip sits in the training step

Follow-up Questions Guidance

  • How would you pick the clipping threshold for a new model, and what does it mean if almost every step gets clipped?
  • How does gradient clipping interact with an adaptive optimizer such as Adam?
  • With gradient accumulation over several micro-batches, when should clipping be applied?
  • Why are exploding gradients more common in RNNs than in feedforward networks of similar size?