Gradient Clipping

How models actually learn, from vanilla gradient descent to Adam

Gradient clipping limits how large an update can become. If a batch produces a huge gradient, clipping scales it down before the optimizer step.

Clipping fixes neither the objective nor the data. Think of it as a safety rule: one extreme batch should not be allowed to throw the parameters across the loss surface.

An elevator speed governor is the analogy. The elevator can move normally, but if it starts moving too fast, the governor limits the speed before the motion becomes dangerous. Gradient clipping lets normal gradients pass and limits the dangerous spikes. The figure below shows the object being clipped: drag the point around the bowl and watch the gradient arrow stretch as the surface steepens. Clipping caps that arrow's length at c while keeping its direction.

Where this lives in MLGradient clipping is a simple stability tool. It is often paired with AdamW, warmup, and mixed precision because those recipes can otherwise suffer from rare but damaging gradient spikes.
▶ Gradient Clipping
← Optimizer DiagnosticsAdam vs AdamW →