Overview
Direct Answer
Gradient clipping is a regularisation technique that constrains the magnitude of gradients during backpropagation to prevent their unbounded growth. By capping gradient values to a specified threshold, it stabilises training in deep networks prone to explosive gradient escalation.
How It Works
During each backpropagation pass, gradients are computed through the network layers. If the norm or individual values exceed a predefined threshold, they are rescaled proportionally to remain within bounds. Common approaches include L2 norm clipping (limiting vector magnitude) or element-wise clipping (bounding individual gradient components).
Why It Matters
Exploding gradients destabilise training, cause numerical overflow, and degrade model convergence—particularly in recurrent neural networks and very deep architectures. Clipping enables reliable training in challenging scenarios, reduces computational overhead from loss scaling workarounds, and improves model robustness across diverse initialisation schemes.
Common Applications
The technique is standard in natural language processing models, particularly sequence-to-sequence architectures and transformers. It is also employed in reinforcement learning policy gradient methods and in training deep convolutional networks on tasks with variable-length sequences.
Key Considerations
Aggressive clipping thresholds may impede gradient flow and slow convergence, whilst lenient thresholds offer minimal protection. The optimal threshold is dataset and architecture dependent, requiring empirical tuning alongside monitoring of gradient statistics.
Cross-References(1)
More in Deep Learning
Weight Decay
ArchitecturesA regularisation technique that penalises large model weights during training by adding a fraction of the weight magnitude to the loss function, preventing overfitting.
Deep Learning
ArchitecturesA subset of machine learning using neural networks with multiple layers to learn hierarchical representations of data.
Variational Autoencoder
ArchitecturesA generative model that learns a probabilistic latent space representation, enabling generation of new data samples.
Mixture of Experts
ArchitecturesAn architecture where different specialised sub-networks (experts) are selectively activated based on the input.
Pipeline Parallelism
ArchitecturesA form of model parallelism that splits neural network layers across devices and pipelines micro-batches through stages, maximising hardware utilisation during training.
Capsule Network
ArchitecturesA neural network architecture that groups neurons into capsules to better capture spatial hierarchies and part-whole relationships.
Gradient Checkpointing
ArchitecturesA memory optimisation that trades computation for memory by recomputing intermediate activations during the backward pass instead of storing them all during the forward pass.
Word Embedding
Language ModelsDense vector representations of words where semantically similar words are mapped to nearby points in vector space.