TL;DR
Natural gradient descent is gradient descent with a correction for the geometry of the model. The ordinary gradient points in the steepest direction in the raw numbers of the parameters, which is not the same as the steepest direction in the probabilities the model assigns. The natural gradient multiplies the ordinary gradient by the inverse of the Fisher information matrix, which measures how sensitive those probabilities are to each parameter. The result does not depend on how the parameters happen to be labelled.
Builds on: Gradient Descent, Fisher Information · Leads to: Kullback–Leibler Divergence (the distance the method is measured in)
Where it's used
Training neural networks. Plain gradient descent struggles on deep networks because layers have very different sensitivities, so one learning rate fits some directions and not others. Kronecker-factored approximate curvature, or K-FAC, is a practical approximation to the natural gradient that James Martens and Roger Grosse introduced in 2015. On the benchmark problems its authors tested, it reduced the number of training steps compared with plain stochastic gradient descent, at a higher cost per step.
Reinforcement learning. A policy is a probability distribution over actions, so changing its parameters changes the probabilities directly. This is the setting of Reinforcement Learning. Sham Kakade's natural policy gradient used this geometry, and Schulman and colleagues' 2015 Trust Region Policy Optimization (TRPO) took a natural-gradient-like step while limiting how far the policy moves, measured in KL divergence.
Variational inference. Variational methods fit a simple probability distribution to a harder one by adjusting that simple distribution's parameters. The same family can be written with different parameters, and the step should not depend on the writing. Natural-gradient updates are used in many variational methods for this reason.
How it works
Here is one tiny instance traced from start to finish: a single parameter , the probability that a coin lands heads. Assume the current value is , and the gradient of the loss with respect to is . The learning rate is .
- Start with the current value and the gradient . The gradient says the loss would fall if went down.
- Take the plain gradient step: . Check: .
- Measure how sensitive the coin's outcomes are to at this point. This is the Fisher information, . It comes from the score (the slope of the log-probability): when heads, the score is ; when tails, it is . Averaging the squared score gives . At it is , which is also . A large value means small changes in change the outcome probabilities a lot.
- Divide the gradient by that sensitivity: the natural step is . Check: , and .
- Compare the two results. The plain step moved by , and the KL divergence between the old and new coin is about (worked out in the math section). The natural step moved by only , because this coin is sensitive to here, and its KL change is about . The same gradient asks for a much smaller move where the distribution responds strongly.
flowchart LR A[Current parameters] --> B[Compute ordinary gradient] A --> C[Compute Fisher matrix] B --> D[Multiply gradient by inverse Fisher] C --> D D --> E[Take step of size eta] E --> F[New parameters]
The math
Step 1 in symbols: the distance that matters
Let be the loss. For a small step , the loss changes by approximately . The model's distributions change by an amount measured with the KL divergence between the old and new distributions. For a small step, that divergence is approximately
This is the geometry: a step counts as large when it moves the distributions far, and says how far each direction moves them. In the coin example, , so the divergence for a step of is about .
Step 2 in symbols: the best step for a fixed distance
We want the step that lowers the loss the most while keeping the KL size fixed at some value . Minimise subject to . Introduce a multiplier (a Lagrange multiplier) for the constraint and set the gradient of the Lagrangian to zero:
So the steepest direction in the model's geometry is , and the update is
With one parameter, this is , which is the coin step above.
Step 3 in symbols: what it costs
For a network with parameters, is an matrix. A model with ten million parameters would need entries, and inverting it is far beyond a normal computer. Practical methods replace with a cheaper approximation, such as its diagonal (an Adam-like scaling) or, in K-FAC, a product of two small matrices for each layer. The mathematics of the update is unchanged; only the matrix it uses is simpler.
Worked examples
Take , a gradient , and a learning rate .
- The Fisher information is .
- The plain step is , so the plain update gives .
- The natural step is .
- The natural update gives .
- The natural step is smaller here because the coin is sensitive at this (). The plain step of would change the coin's probabilities a lot, so the natural update takes a far smaller move, .
The model is a Gaussian with mean and standard deviation , with parameters . Set . The Fisher matrix is diagonal:
- Suppose the ordinary gradient of the loss is .
- Invert : .
- The natural direction is .
- With , the plain step is .
- The natural step is .
- The natural step is larger in and smaller in because is the less sensitive parameter at this scale. Each parameter is rescaled by how much the distribution responds to it.
A fully connected layer maps 500 inputs to 200 outputs, so its weight matrix has entries (ignore biases). The full Fisher matrix for that layer would have entries.
K-FAC replaces the layer's block with a Kronecker product . Here is a matrix built from the layer's input activations, and is a matrix built from the gradients at the layer's output. Each is much smaller:
- Count the entries of : .
- Count the entries of : .
- Total stored: , against for the full matrix.
- Inverting a product is the product of inverses, , so the update for the weight matrix becomes . This needs inverses of a and a matrix, not of a matrix.
- The layer's update is then computed with two small matrix products per step, which is why the method is affordable at scale.
Try it: A layer maps 1000 inputs to 300 outputs. How many entries does the full Fisher matrix have, and how many does the K-FAC pair and store? Answer: the weights number , so the full matrix has entries; K-FAC stores entries.
Common mistakes and tradeoffs
It is tempting to think the natural gradient is the Hessian of the loss. In fact the Fisher matrix is an expectation under the model's own distribution and depends only on the model, while the Hessian depends on the loss and the data. They agree in one common case: when the loss is a negative log-likelihood and its curvature is averaged over the model's own distribution.
It is tempting to think the natural gradient always trains faster. In fact each step is more expensive, and it helps most when the sensitivity of the model varies a lot across parameters. A method that takes fewer steps can still lose on wall-clock time if the step is too costly.
It is tempting to think the method needs the exact inverse of a huge matrix. In fact practical versions use diagonal or block approximations such as K-FAC, and the approximation quality determines how much of the benefit survives.
When to use it: models that are probability distributions, reinforcement learning policies, and variational models, where the parameterisation is arbitrary and the step should not depend on it. Also deep networks where a block approximation is available.
When not to use it: very large models where no good approximation fits the budget. Plain stochastic gradient descent and adaptive methods such as Adam are cheaper and are the default for most large-scale training. The natural gradient is the principled reference point that those methods approximate.
History
Calculus on parameter spaces was well established long before anyone asked which geometry a learning rule should use. C. R. Rao's 1945 work made the Fisher information a measure of distance between models, and information geometry grew from that idea in the following decades.
In 1998 Shun-ichi Amari argued that learning should follow the natural gradient, because ordinary gradient descent depends on how the parameters happen to be written and can slow down badly on flat regions. The idea stayed mostly theoretical for years, mainly because the matrix inverse was too expensive for the models of the day.
Sham Kakade's natural policy gradient, in the early 2000s, brought the idea into reinforcement learning, where policies are naturally probability distributions. In 2015 Martens and Grosse introduced K-FAC, which made a practical approximation possible for deep networks, and TRPO used a closely related step with a KL limit to train policies more reliably. Both helped the idea spread from theory into training systems.
Recap
- The ordinary gradient depends on how the parameters are labelled; the natural gradient does not.
- The Fisher matrix measures how much each direction in parameter space changes the model's probabilities.
- The natural step is the inverse Fisher matrix times the gradient, the steepest direction for a fixed KL distance.
- Exact inverses are too expensive for large models, so approximations such as K-FAC are used in practice.
- Read next: Kullback–Leibler Divergence, the distance this method is measured in, and Hessian Matrix, the curvature it is often confused with.