Gradient clipping stress test: unclipped RNN diverges in 17 steps, clipped runs converge to 0.043 loss

cneuralnetwork · x · 2026-10-24

An experiment training an intentionally unstable RNN in PyTorch with identical weights, data, and learning rate across 5 seeds, comparing gradient clipping configurations:

Mathematically, clipping rescales gradients via gclipped = g × min(1, c / ||g||₂), capping magnitude without changing direction; 94.7% of steps triggered clipping at threshold 1.0. Key takeaway: controlling parameter update magnitude alone can completely change training dynamics, and a loose clipping threshold (5.0) leaves performance on the table.

Original post →

More from Research

Research channel →