Natural Gradient
The natural gradient rescales updates by the Fisher information, so steps are measured in model behavior change rather than raw parameter distance.
Why Does This Exist?
Plain gradient descent measures distance in parameter coordinates. Reparametrize the model (say, scaling one weight by 100 and dividing the next layer) and the same behavior change looks 100 times larger, so the optimizer takes a different path to the same place. That coordinate dependence wastes steps whenever parameters have mismatched scales, which is nearly always in deep networks.
The natural gradient fixes the ruler. It defines distance between models by KL divergence of their predictive distributions, whose local curvature is the Fisher information matrix . The update is invariant to smooth reparametrization. Geometry view: Fisher information metric. Implementation cousin: Amari natural gradient.
The one idea you need first
KL divergence measures how much one predictive distribution differs from another. For a tiny parameter move , it grows quadratically as . So is the local ruler of behavior change. Background in KL divergence.
Think of It Like This
A map with a stretched axis
Imagine a city map where the east-west axis is drawn at one mile per inch but north-south at ten miles per inch. The shortest route on paper is not the shortest drive, because the paper lies about one direction.
Plain gradient descent trusts the paper. The natural gradient carries the true scale card: it shrinks moves along the stretched axis and stretches moves along the compressed one, so each step is even in miles, not inches.
Where the analogy stops: the Fisher ruler changes at every point and must be re-estimated, while a map scale is printed once.
How It Actually Works
For a model with loss :
equals the expected Hessian of the negative log-likelihood under the model, so this is a Gauss-Newton-like step using behavior curvature instead of loss curvature. Exact inversion costs , so practice uses diagonal, block-diagonal (K-FAC), or Hessian-free approximations. The geometric sequel is statistical manifolds.
Worked example
Bernoulli model with , single observation , at ():
- Loss (negative log-likelihood): . Gradient: .
- Fisher: . Plain step with : .
- Natural step: , so . New , loss .
- Plain gradient cut loss to . The natural step moved five times further in probability (0.38 vs 0.12 gain) because it knew the parameter was in a flat-probability zone.
Code
import numpy as np
def sigmoid(t: float) -> float: return 1.0 / (1.0 + np.exp(-t))
theta, y, eta = 0.0, 1.0, 1.0p = sigmoid(theta)g = p - y # plain gradient of NLLF = p * (1 - p) # Fisher for Bernoulliprint(round(-np.log(p), 3)) # -> 0.693print(round(theta - eta * g, 3)) # -> 0.5 plain updateprint(round(theta - eta * g / F, 3)) # -> 2.0 natural updateWatch Out For
Inverting a singular empirical Fisher
With small batches the empirical Fisher is rank-deficient and its inverse explodes along unobserved directions. Updates shoot to huge values and loss goes to NaN.
Always damp: solve with around times the Fisher trace, and verify the update norm before applying it.
Paying full Fisher cost on every step
Exact Fisher inversion on a million parameters is hopeless. Teams that try stall training with hours-long steps.
Use K-FAC, diagonal, or update the curvature estimate every 10 to 100 steps instead of every step. The curvature changes slower than the gradient.
The Quick Version
- Plain gradients depend on parametrization; the natural gradient uses behavior distance instead.
- The Fisher matrix is the local ruler from KL divergence curvature.
- The update is inverse-Fisher times gradient, with damping to handle singularity.
- Exact inversion is cubic cost, so K-FAC and diagonal approximations carry practice.
- Reparametrizing the model leaves the natural path unchanged.