Paper commentary
Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks
- Problem Plain gradient descent slows down when the weight parameterization leaves the objective badly conditioned. Batch normalization fixes the scales of activations, but it ties each example's output to its minibatch.
- Method Rewrites each weight vector as g times v divided by the norm of v, then trains v and g with stochastic gradient descent. A data-based initialization sets the bias and scale from one minibatch.
- Results Reached 8.46% test error on CIFAR-10 without data augmentation, against 8.43% for the normal parameterization; adding mean-only batch normalization gave 7.31%.
Why the parameterization of weights matters
Gradient descent on a neural network struggles when the curvature of the objective is badly conditioned, and that curvature is not fixed: it changes with how the same model is parameterized. Several equivalent parameterizations of one model can differ a lot in how easy they are to optimize. Each neuron computes a weighted sum of its inputs, adds a bias and applies an elementwise nonlinearity, so a better parameterization of these building blocks can help many architectures at once.
Some methods precondition the gradient with an approximate inverse of the Fisher information matrix, for example KFAC, FANG or PRONG. Other methods keep plain first-order updates and change the model so that its gradients behave more like whitened natural gradients, as with the transformation of neuron outputs proposed by Raiko et al. and with batch normalization.
Batch normalization normalizes each neuron output with statistics over the minibatch, which makes each example's output depend on the other examples in that minibatch and makes it awkward for recurrent models and noise-sensitive training such as reinforcement learning.
Splitting each weight vector into scale and direction
A neuron computes y = φ(w·x + b), and weight normalization replaces the weight vector w with a k-dimensional vector v and a scalar g through \( \mathbf{w} = \frac{g}{\|v\|}\, v \). Here the norm of v is the Euclidean norm, so the norm of w equals g whatever v is; g sets the length and v only sets the direction.
Normalizing weight vectors is an older idea, but earlier methods normalized after each gradient step while still running the optimization in the w parameters. Weight normalization instead runs stochastic gradient descent directly on v and g, which decouples the length of w from its direction and, according to the authors, improves the conditioning of the gradient and speeds up convergence.
An exponential form g = e^s, with s learned by gradient descent, is also possible. In the experiments this form was not better: test-set performance did not differ significantly, and optimization was slightly slower.
How the gradient moves through the reparameterization
Differentiating the loss through the reparameterization gives the gradient with respect to g as the dot product of the weight gradient with v over the norm of v, and the gradient with respect to v as a rescaled weight gradient minus a term along v. The formulas are \[ \nabla_g L = \nabla_w L \cdot \frac{v}{\|v\|}, \qquad \nabla_v L = \frac{g}{\|v\|}\nabla_w L - \frac{g\,\nabla_g L}{\|v\|^2}\, v \] Because only a small change to ordinary backpropagation is needed, the expressions are independent of the minibatch size and add only minimal computation.
The same gradient can be written as \( \nabla_v L = \frac{g}{\|v\|} M_w \nabla_w L \) with \( M_w = I - \frac{w w'}{\|w\|^2} \), where M_w is a projection matrix onto the complement of w. So the update does two things: it scales the weight gradient by g over the norm of v, and it removes the component of the gradient along the current weight vector.
With plain gradient descent and no momentum, the update to v is orthogonal to w and therefore to v, so the norm of v grows monotonically. If the ratio of the update norm to the norm of v is c, the new norm is \( \sqrt{1+c^2}\,\|v\| \), so noisy gradients with large c make the norm grow, which shrinks the factor g over the norm of v and stabilizes the scaled gradient.
This self-stabilizing property does not strictly hold for optimizers with separate per-parameter learning rates, such as Adam used in the experiments, or when momentum is used, although the authors find the same effect qualitatively.
Growing the norm of v makes training robust to the learning rate: a learning rate that is too large makes the norm of the unnormalized weights grow until the effective learning rate is reduced to a workable size, and afterwards the effective rate stays stable. The authors note that batch normalization has the same property, which they explain with this analysis.
Projecting out the direction of w also removes gradient noise in that direction.
Relation to batch normalization
Batch normalization standardizes the pre-activation t with the minibatch mean and standard deviation. For a single-layer network whose inputs are whitened, the minibatch mean of t = v·x is zero and its standard deviation equals the norm of v, so normalizing pre-activations is then equivalent to normalizing the weights.
Because it does not depend on the minibatch, it also applies more easily to RNNs, LSTMs and noise-sensitive settings such as reinforcement learning.
Data-dependent initialization
Batch normalization keeps feature scales fixed across layers, which weight normalization does not do on its own, so the initialization of its parameters needs care.
A single minibatch is passed once through the network, and each neuron computes t = v·x over the norm of v; the mean and standard deviation of t over that minibatch are then taken. The bias and scale are set from these statistics as \[ g \leftarrow \frac{1}{\sigma[t]}, \qquad b \leftarrow -\frac{\mu[t]}{\sigma[t]} \] so that the neuron output equals φ(w·x + b) with the standardized pre-activation.
The pre-activations then have zero mean and unit variance, but only for the minibatch used at initialization; later minibatches may have somewhat different statistics. The method can also be used for the standard parameterization in terms of w, and similar data-based initializations were proposed independently by other authors.
Mean-only batch normalization with weight normalization
The variant subtracts the minibatch mean of t = w·x and adds a bias, but it does not divide by the minibatch standard deviation. During training a running average of the minibatch mean is kept and used in place of the minibatch mean at test time.
The gradient with respect to the pre-activation is the gradient with respect to the shifted output minus its minibatch mean, which centers the backpropagated gradients. This is cheaper than full batch normalization, and because the minibatch mean is approximately normally distributed the noise it adds has lighter tails than the kurtotic noise of the minibatch variance estimate.
CIFAR-10 classification results
The network follows the ConvPool-CNN-C architecture, with the first dropout layer replaced by Gaussian noise, the last hidden layer widened from 10 to 192 units, and 2×2 max pooling instead of 3×3. Adam trained the network for 200 epochs with momentum 0.9 for the first 100 epochs and momentum 0.5 for the last 100, while the learning rate was decayed linearly to zero over the last 100 epochs.
The minibatch size was 100, and for each parameterization the learning rate was picked from 0.0003, 0.001, 0.003 and 0.01.
Weight normalization and batch normalization both gave a significant speed-up over the standard parameterization in training error. Batch normalization made slightly more progress per epoch early on, but in the authors' implementation its training was about 16% slower than the standard parameterization, while weight normalization was not noticeably slower.
Without data augmentation, the test error was 8.46% for weight normalization, 8.43% for the normal parameterization and 8.52% for mean-only batch normalization with the normal parameterization. Batch normalization reached 8.05%, and weight normalization combined with mean-only batch normalization reached 7.31%, the lowest test error among the models in that table.
The authors suggest that the noise added by batch normalization helps regularize the network, but that the reparameterization from weight normalization or full batch normalization is also needed for the best result. They attribute the gap between mean-only batch normalization with weight normalization and with the normal parameterization to the noise distribution: the minibatch mean is approximately Gaussian, while full batch normalization noise has much higher kurtosis.
Convolutional variational auto-encoders
A variational auto-encoder defines a joint distribution \( p(z,x) = p(z)p(x|z) \) with a neural decoder, and optimizes a lower bound on the log marginal likelihood using an encoder distribution q(z|x). The model here uses ResNet blocks in the encoder and decoder, and auto-regressive variational inference replaces the diagonal posterior. For MNIST the encoder has three sequences of two ResNet blocks on 16, 32 and 32 feature maps, with 2×2 stride subsampling after the first two sequences and a fully connected layer with 450 units after the third.
Adamax with α = 0.002 is combined with Polyak averaging as an exponential moving average over about 10 epochs.
With weight normalization the test-set lower bound has lower variance across random seeds and converges to a better optimum than with the normal parameterization on MNIST. The error bars for the MNIST runs reflect different initial random seeds, and the authors observe similar results across hyper-parameter settings.
DRAW with weight-normalized LSTMs
DRAW is a variational auto-encoder whose encoder and decoder are recurrent networks built from LSTM units. Normalizing the cell states would reduce their ability to pass information, so batch normalization is unclear here, while weight normalization can be applied to the weight vectors of each LSTM unit.
The experiment starts from the Theano implementation of DRAW and applies weight normalization to all weight vectors, with the initialization and learning rate kept from the normal parameterization. On the MNIST test set the weight-normalized model makes clearly faster progress in the marginal log likelihood bound than the normal parameterization over 100 epochs.
The authors note that 100 epochs are not enough for this model to converge.
Atari games with DQN
The authors report that batch normalization did not work for DQN without an impractically large minibatch size, while weight normalization was easy to apply with the initialization of section 3. Stochastic gradient learning used Adamax with momentum 0.5, a minibatch size of 64, and learning rates searched over 0.0001, 0.0003, 0.001 and 0.003.
The search generally favored 0.0003 with weight normalization and 0.0001 for the normal parameterization.
On Space Invaders, the maximum evaluation score rose from 1,779 with the normal parameterization to 2,179 with weight normalization. On Enduro it rose from 1,250 to 1,448, while on Seaquest it rose from 7,188 to 7,375. On Breakout the weight-normalized score was 403 against 410 for the normal parameterization. The Mnih et al. scores were taken from their paper, and the authors note that differences from their own numbers may come from implementation details.
Limitations
Data-dependent initialization can only be applied in cases where batch normalization is applicable, so recurrent models such as RNNs and LSTMs fall back on standard initialization. The initialization statistics hold only for the minibatch used at initialization.
The self-stabilizing behavior of the norm of v does not strictly hold for Adam or when momentum is used. The DRAW model had not converged after 100 epochs. DQN learning rates were selected to maximize the highest achieved test score. The CIFAR-10 comparisons were run without data augmentation.
Paper info
- Authors
- Tim Salimans, Diederik P. Kingma
- Venue
- arXiv · Preprint
- First published
- 2016-2-25
- Added
- 2026-10-20
- Updated
- 2016-6-4
- Version
- v3
- arXiv
- 1602.07868
- Category
- cs.LG · cs.AI · cs.NE
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Tim Salimans, Diederik P. Kingma (2016). Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks. arXiv:1602.07868v3. https://arxiv.org/abs/1602.07868v3
BibTeX
@misc{salimans2016weight,
title = {{Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks}},
author = {Tim Salimans and Diederik P. Kingma},
year = {2016},
eprint = {1602.07868},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1602.07868v3}
}