Zubnet AIApprendreWiki › Normalization
Training

Normalization

LayerNorm, RMSNorm, BatchNorm
Des techniques qui stabilisent l'entraînement des réseaux de neurones en normalisant les valeurs qui circulent à travers le réseau pour avoir une échelle constante. Layer Normalization (LayerNorm) normalise à travers les features à l'intérieur de chaque exemple. RMSNorm est une variante simplifiée. Batch Normalization (BatchNorm) normalise à travers le batch. Chaque Transformer utilise une forme de normalisation entre ses couches.

Pourquoi c'est important

Sans normalisation, les réseaux profonds sont extrêmement difficiles à entraîner — les activations peuvent exploser ou disparaître à travers les couches, rendant le gradient descent instable. La normalisation est une de ces techniques peu glamour qui sont absolument essentielles : enlève-la de n'importe quelle architecture moderne et l'entraînement s'effondre.

Deep Dive

LayerNorm (Ba et al., 2016) computes the mean and variance of all activations within a single training example and normalizes them to zero mean and unit variance, then applies learned scale and shift parameters. This ensures that regardless of the input magnitude, each layer receives inputs with a consistent distribution. It's the standard in Transformers.

RMSNorm: The Modern Default

RMSNorm (Zhang & Sennrich, 2019) simplifies LayerNorm by removing the mean centering and only normalizing by the root mean square: x / sqrt(mean(x²)). This is computationally cheaper (no need to compute mean for centering) and performs comparably. LLaMA, Mistral, and most modern LLMs use RMSNorm instead of LayerNorm.

Pre-Norm vs. Post-Norm

The original Transformer placed normalization after the attention/feed-forward block (post-norm). Modern architectures almost universally use pre-norm: normalize the input before passing it through the block, then add the residual. Pre-norm is more stable during training (especially at large scale) and allows training without learning rate warmup. This seemingly minor architectural choice has a significant impact on training stability.

Concepts liés

← Tous les termes
← Neuron NVIDIA →