Clip the Gradient, Then Find Its Biggest Step

Norms & DistanceEasy+10 XP+10

Clip the Gradient, Then Find Its Biggest Step

A training run keeps exploding, so the team switches on gradient clipping.

At one particular step, the gradient over the model's five parameters is

g=(7,  −5,  4,  −3,  1)g = (7,\; -5,\; 4,\; -3,\; 1)g=(7,−5,4,−3,1)

Three different sizes of the same vector show up in this problem, so here they are side by side:

NameSymbolDefinition
Manhattan norm∥v∥1\lVert v \rVert_1∥v∥1​sum of the absolute entries
Euclidean norm∥v∥2\lVert v \rVert_2∥v∥2​square root of the sum of the squared entries
Chebyshev norm∥v∥∞\lVert v \rVert_\infty∥v∥∞​the largest absolute entry

The clipping rule the team uses is the standard clip-by-norm rule, and it is triggered by the Euclidean norm:

If ∥g∥2≤c\lVert g \rVert_2 \le c∥g∥2​≤c, leave ggg exactly as it is.

If ∥g∥2>c\lVert g \rVert_2 > c∥g∥2​>c, replace ggg by the rescaled vector
g^  =  g⋅c∥g∥2\hat{g} \;=\; g \cdot \frac{c}{\lVert g \rVert_2}g^​=g⋅∥g∥2​c​

They set the clipping threshold to c=6c = 6c=6.

The engineer on call wants to know how far the single most-affected parameter moves after clipping — that is, the largest absolute entry of the clipped gradient g^\hat{g}g^​, which is exactly its Chebyshev norm ∥g^∥∞\lVert \hat{g} \rVert_\infty∥g^​∥∞​.

Compute ∥g^∥∞\lVert \hat{g} \rVert_\infty∥g^​∥∞​.

Give your answer rounded to two decimal places — for example 1.23.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.