HomeAI & Machine LearningGradient Clipping: Exploding & Vanishing Gradients

Gradient Clipping: Exploding & Vanishing Gradients

Interactive 3D backprop chain showing how a gradient explodes or vanishes across layer depth, and how global-norm gradient clipping tames it — with live gradient-norm readouts.

AI & Machine Learning3DAdvanced60 FPS📱 Mobile-adapted
machine-learning-advanced ↗ Open standalone

Deep networks and long RNN unrolls backpropagate a gradient through many layers by the chain rule, and each layer multiplies it by another factor. This simulator renders that chain in 3D as a sequence of nodes whose size and color track the gradient's magnitude on a log scale, animates the actual backward flow of backpropagation from output to input, and lets you tune the network depth and the average per-layer gradient factor to watch the signal explode or vanish exponentially with depth. A global-norm gradient-clipping control — the same mechanism used in PyTorch's clip_grad_norm_ and TensorFlow's clipnorm — shows how rescaling the whole gradient vector once it crosses a threshold keeps deep training numerically stable, with live readouts for the raw norm, the clipped norm, and the scale factor actually applied.

⚙ Under the hood

A 3D backprop chain shows a gradient's magnitude compounding across layer depth via the chain rule, exploding or vanishing exponentially, and how global-norm gradient clipping keeps deep training stable.

gradient clippingexploding gradientsvanishing gradientsbackpropagationdeep learningoptimization

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)