the.ai

Optimization / Training

verified

Gradient Clipping

Occasionally a batch produces an enormous gradient — a strange example, a numerical accident — and one full-size step in that direction can undo hours of training. Clipping caps the size of the update while keeping its direction, so a bad batch costs a small step rather than the run.

Viz primitive · update-spectrumclip-strength = 0.3

8 values. The left group decays steeply; the right group is 51% of the way to flat, and reads flatter than the left.

Per-batch gradient norms before clipping and after. Drag the clipping up to watch the outliers pulled in while the rest pass through untouched.

0.3

Reviewed by opendroid · 2026-08-04

  • arXiv:1211.5063 — On the difficulty of training Recurrent Neural Networks