Gradient norm clipping, name the failure mode it exists to prevent
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Gradient norm clipping caps the L2 norm of the full gradient vector so one outlier batch cannot blow up the weights and crater the loss for the rest of the run.
Imagine driving a car along a winding road. Most of the time you press the gas gently and stay in your lane. Occasionally you hit a patch of ice and slam the pedal by accident. Without a speed limit, that one slip launches the car off the road and you never get back. A speed limiter is the small device that says, no matter how hard you press, you will not go above sixty. Norm clipping is that limiter for training. Each step calculates how hard to nudge the model, and on a bad batch that nudge can be a hundred times larger than normal. The clip keeps the direction of the push but caps how far you actually travel in one go. The model still learns, it just cannot ruin itself in a single step.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: the exploding-gradient failure mode, the global L2 rescale formula, the typical 1.0 threshold, where in the step order to apply it, and how to read the clip rate as a data diagnostic.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Clipping per-tensor instead of across the whole parameter vector. That changes the relative scale between layers and silently distorts the update direction the optimizer was about to take.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.