Foundation reference

Natural Gradient & Riemannian Optimization

The ordinary gradient depends on how the model is parameterized; the natural gradient follows the geometry of the distributions instead, so in the limit of small steps it traces the same path under any smooth reparameterization, and approximately so for finite steps (Amari, 1998; Martens, 2020).

Concept 56 of 100OptimizationStudy phase 10
Key equation
∇~L=F(θ)−1∇θL\tilde{\nabla} L = F(\theta)^{-1} \nabla_\theta L
Reading map and next steps

Study guide

Where to start

Concept 56 of 100Natural GradientOptimization · Study phase 10: Mathematical foundations & information geometry
Question

Why is the gradient naturally a covector, a linear map from parameter changes to changes in the loss, so that a metric is needed to turn it into a direction of steepest descent?

How to study this pagePredict · Check · Generalize · Continue
PredictSay what you expect.

Pick a concrete input and say what the equation should give before you read the math.

CheckCheck against the math and the papers.

Work through the math, then read the cited papers for the original argument.

GeneralizeName what stays the same.

Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.

ContinueFollow the connections.

Use the prerequisites and related concepts at the end of the page to fill the next gap.

Why It Matters for Modern Models

  • The ordinary gradient depends on how the model is parameterized; the natural gradient follows the geometry of the distributions instead, so in the limit of small steps it traces the same path under any smooth reparameterization, and approximately so for finite steps (Amari, 1998; Martens, 2020).
  • Trust-region policy optimization (TRPO) applies this idea to reinforcement learning: it computes a natural-gradient direction with the conjugate-gradient method and then searches along it for a step that satisfies a KL constraint (Schulman et al., 2015). Proximal policy optimization (PPO) keeps the aim of limiting each policy change but replaces the constraint with a clipped first-order objective (Schulman et al., 2017).
  • In many important cases, including the usual losses for regression and classification, the Fisher matrix equals the generalized Gauss–Newton matrix, so natural gradient descent can be read as a second-order method with the Fisher standing in for the Hessian (Martens, 2020).
  • Adam divides by the square root of a running average of squared gradients, which resembles a diagonal of the "empirical Fisher"; Kunstner et al. (2019) argue that the empirical Fisher does not generally capture curvature, so the link between Adam and natural gradient is loose.

Questions to Think About

  • If one parameter is rescaled, say θ₁ → 10θ₁, how does an ordinary gradient step change, and why does the natural gradient step describe the same change in the distribution?
  • Why might natural gradient avoid or shorten the plateaus that slow backpropagation in multilayer perceptrons, as Amari (1998) suggested?

Core Math

Key Equation
∇~L=F(θ)−1∇θL\tilde{\nabla} L = F(\theta)^{-1} \nabla_\theta L

The natural gradient preconditions the ordinary gradient with the inverse of the Fisher information matrix F(θ)F(\theta):

∇~L=F(θ)−1∇θL\tilde{\nabla} L = F(\theta)^{-1} \nabla_\theta L

and natural gradient descent takes the step

θt+1=θt−η F(θt)−1∇θL(θt)\theta_{t+1} = \theta_t - \eta\, F(\theta_t)^{-1} \nabla_\theta L(\theta_t)

Why it is called natural. Among small steps δ\delta that change the model's distribution by a fixed amount, measured by the KL divergence, the natural gradient step decreases the loss fastest:

δ∗=arg⁡min⁡δ ⟨∇L,δ⟩s.t.12 δ⊤Fδ≤ϵ\delta^* = \arg\min_\delta \, \langle \nabla L, \delta \rangle \quad \text{s.t.} \quad \tfrac{1}{2}\, \delta^\top F \delta \le \epsilon

where 12δ⊤Fδ\tfrac{1}{2}\delta^\top F \delta is the second-order approximation of KL(pθ ∥ pθ+δ)\text{KL}(p_\theta \,\|\, p_{\theta+\delta}). Setting the gradient of the Lagrangian to zero gives

δ∗∝−F−1∇L\delta^* \propto -F^{-1} \nabla L

and the minus sign makes it a descent direction. For a network with millions of parameters FF cannot be stored or inverted, so practical methods approximate it, for example with Kronecker-factored blocks (K-FAC; Martens & Grosse, 2015).

Key Papers

Natural Gradient Works Efficiently in Learning

Amari1998Neural Computation
Read paper →

Trust Region Policy Optimization

Schulman et al.2015ICML
Read paper →

Optimizing Neural Networks with Kronecker-factored Approximate Curvature

Martens & Grosse2015ICML
Read paper →

New Insights and Perspectives on the Natural Gradient Method

Martens2020JMLR
Read paper →

Connections

Where to go next

Bregman Divergence builds directly on Natural Gradient.

Bregman Divergence