From Information Theory to Information Geometry
Begin with one badly modeled coin. End with a curved space whose points are probability distributions.
Outline: the path through this tutorial
By the end of this tutorial, you will have followed one continuous path from entropy and KL divergence to Fisher geometry, dual connections, and a natural-gradient variational-inference update. The five stages below preview that path and provide a practical sequence for revisiting the ideas afterward.
Learn it as a spiral: revisit the same few distributions with one new tool each time. Do not wait to “finish differential geometry.” The Bernoulli, categorical, and Gaussian families are enough to make nearly every new idea concrete.
Entropy, cross-entropy, KL, JS, and coding. Derive each for a Bernoulli coin.
Coordinates, tangent vectors, metrics, connections, and geodesics—always tied to a distribution family.
Do Bernoulli first, then categorical and univariate Gaussian. Verify that coordinate changes preserve .
Natural and expectation coordinates make duality concrete instead of mystical.
Implement a natural-gradient update and compare it with an ordinary parameter gradient.
Recommended related tutorials
Sources and further reading
- C. E. Shannon (1948), “A Mathematical Theory of Communication.” Bell System Technical Journal.
- T. Cover and J. Thomas (2006), Elements of Information Theory, 2nd ed.
- R. A. Fisher (1922), “On the Mathematical Foundations of Theoretical Statistics.” Philosophical Transactions of the Royal Society A.
- C. R. Rao (1945), “Information and the Accuracy Attainable in the Estimation of Statistical Parameters.” Reprinted in Breakthroughs in Statistics.
- S. Amari and H. Nagaoka (2000), Methods of Information Geometry.
- F. Nielsen (2020), “An Elementary Introduction to Information Geometry”. Open-access survey.
- D. J. C. MacKay (2003), Information Theory, Inference, and Learning Algorithms.
The bridge: distributions become points
Information theory begins with questions like: How surprising was this outcome? and How many bits does this message require? Information geometry asks a new question: What kind of space is formed by the probability distributions within a chosen statistical model?
Here, a statistical model is a particular family of probability distributions with the same mathematical form:
The parameter selects one distribution from that family. That individual distribution becomes one point in the geometry, while its parameter values provide coordinates for locating it.
For example, the Bernoulli family contains every Bernoulli distribution obtained by varying , so its points occupy the interval . A three-outcome categorical family contains every probability vector satisfying , so its points occupy a triangle.
Here is the whole bridge before we walk it slowly. Each step answers a question created by the previous one; none of the geometric language is being added merely for decoration.
Reality is P; your model is Q
Reality draws an outcome according to . Your model does not know that draw in advance; it assigns its own probability . The less probability Q assigned to what actually happened, the more surprised Q is—and the more information is needed to identify that outcome.
The surprisal, or pointwise information, of this one outcome is written with a lowercase . It is not yet the entropy of the whole distribution. Shannon entropy is obtained by averaging the surprisal of every possible outcome using Q's own probabilities.
Why define information like this?
In 1948, while working at Bell Labs, Claude Shannon formalized information to address the engineering problem of transmitting messages efficiently and reliably through a communication channel. He needed a numerical measure of how much information an observed outcome contributes. That measure had to satisfy three desiderata—three properties expected of any sensible definition:
- Rarer outcomes carry more information. Learning that an unlikely event occurred tells us more than learning that an expected event occurred.
- Information varies continuously with probability. A small change in probability should produce a small change in information.
- Independent outcomes add their information. Learning two independent facts should provide the information from the first plus the information from the second.
The third requirement supplies the mathematical key. If two independent outcomes have probabilities and , their joint probability is , while their combined information should be . The logarithm is precisely the function that converts multiplication into addition. Together, the three requirements determine up to a positive scale factor. Choosing base two and measures information in bits.
This gives the same number two complementary meanings. measures how surprising is under Q, and it gives the optimal amount of information needed to encode that outcome under Q. More probable outcomes can be represented more economically; improbable outcomes require more information to distinguish them.
For a broader intuitive treatment, see Thomas Varley's Information Theory for Complex Systems Scientists (2025).
Cross-entropy becomes KL divergence
Averaging Q's code lengths over data from P gives the cross-entropy . But some bits are unavoidable even with a perfect model: that irreducible cost is . Subtract it, and what remains is exactly the penalty for using Q when reality is P.
A concrete coin model
In the coin model introduced above, let P be the distribution that actually generates the flips and Q the model used to predict and encode them. Take while Q assigns to heads and tails. Q assigns a probability—and therefore an expected code length—to every outcome P might generate.
Encode coin P using a code designed for coin Q
Your model expects 75 heads per 100 flips, while reality produces about 50. Q rewards its expected outcomes with short codewords, but pays dearly whenever its “surprising” outcome occurs.
The price of the wrong codebook
If an outcome has model probability , its ideal information content is bits. Averaging that quantity over outcomes generated by P gives cross-entropy. Subtracting the best possible average code length leaves KL divergence.
The coin model: 50/50 reality versus a 75/25 model
- A Q-code gives heads an ideal length of bits.
- It gives tails a much longer length: bits.
- Reality produces each half the time, so bits/flip.
- A fair-coin code needs bit/flip.
- Therefore excess bits/flip.
Coding interpretation: Shannon (1948); Cover & Thomas (2006).
The local shape of KL is Fisher information
Begin with a parameterized family —for example, every Bernoulli distribution obtained by changing its probability parameter. Fix one member as the current distribution . Changing its parameters by selects another member, . We are asking how the probabilities assigned to all possible outcomes change as a function of that parameter displacement. Call the resulting KL divergence .
If the model has several parameters, is the gradient: the column vector containing every first partial derivative of , evaluated at . The superscript means transpose, which turns that column into a row. Multiplying it by the parameter-change column forms the dot product : one number giving the first-order change in along that particular direction. The transpose has no additional calculus meaning; it is needed only because multidimensional gradients and parameter changes are conventionally written as column vectors. We could equivalently write the dot product as . For a one-parameter model, it reduces to the familiar .
Writing KL explicitly gives
Only the nearby log-density depends on . Even though the nearby log-density can be evaluated exactly in simple models such as the Gaussian, Taylor-expanding it reveals how KL changes locally as the parameters move. It replaces the generally nonlinear dependence on with a quadratic approximation built from derivatives at the current model. In more complicated families, this local description can also be less expensive than repeatedly evaluating or optimizing the exact KL. To calculate the Taylor coefficients of , we therefore expand
and then average its terms under . Under the regularity conditions, expanding inside the expectation produces the same Taylor expansion as differentiating the complete KL function directly; the step-by-step derivation later in the tutorial shows this calculation explicitly. At , the distributions match and is at its minimum value of zero. Its constant and linear Taylor terms therefore vanish, leaving the quadratic term as the first term that can survive.
The two symbols in that equation play different roles. The KL divergence is one scalar assigned to the pair . The Fisher information is the Fisher information of the model family evaluated at the starting point . It describes how quickly KL grows when the parameters move away from that point in each possible direction. It is one number for a one-parameter family such as Bernoulli, and a matrix when contains several parameters.
The local picture: the bottom of a KL bowl
What Fisher information was built to answer
Fisher information began as a tool of statistical estimation, before its later geometric interpretation. The geometry did not invent a new quantity. Mathematicians recognized that the same object used to quantify parameter precision also supplies a natural local metric on a family of probability distributions.
Suppose an observable random variable is generated from a known family , but the parameter value is unknown. The estimation problem is to infer that hidden value from measurements . Fisher information asks: how well does an observation of locate the parameter value that generated it?It assigns a larger value when nearby parameter choices produce observably different distributions, and a smaller value when many parameter choices would produce nearly indistinguishable data.
How surprising or uncertain is the random state ?
How strongly does the distribution of change when changes?
Fisher information is therefore not a bit count and not the mutual information between two random variables. In its classical use, is an unknown fixed value rather than a random variable with a prior. Fisher information is local: describes the measurement model's sensitivity near a particular parameter value. The subscript reminds us that a different measurement procedure could carry a different amount of information about the same parameter.
A clean example: known Gaussian noise, unknown mean
Begin with a noise variable . The symbol means “is distributed according to”: the noise is Gaussian with known mean zero and known variance . Now define the measurement by , where is the unknown signal. Adding shifts the noise distribution from being centered at zero to being centered at , without changing its variance. Therefore the observation has one Gaussian measurement model, ; the first Gaussian described its noise, while this one describes the resulting observation.
Capital denotes the measurement before it is observed; lowercase denotes an actual observed value. Conditional on , the unknown mean is treated as one fixed constant; only varies from one possible observation to another. Expectation therefore shifts by , while variance is unchanged because adding a constant moves every possible value equally without changing any value's displacement from the center.
The following derivation makes both relationships explicit, applying the rules of conditional expectation and variance one step at a time.
Begin with a fixed signal μ plus random zero-centered noise ε.
Substitute the measurement equation Y = μ + ε for Y inside the conditional expectation.
Use linearity of conditional expectation: the expectation of a sum equals the sum of the expectations.
Conditioning on μ means that μ is held fixed, and the expectation of a fixed value is that value itself.
The model assigns the same zero-mean noise distribution to every fixed μ, so knowing μ does not change the average noise.
Combine the fixed signal μ with the zero expected contribution from the noise.
Subtracting the observation mean removes the constant shift and leaves exactly the noise.
Variance averages squared displacement from the mean, so the observation inherits the noise variance.
The noise therefore does not move the distribution's mean; it moves individual observations away from that mean. Small keeps likely observations near , so an observed value points back to a narrow range of plausible means. Large permits likely observations much farther from . The same observed value can then be explained by many candidate means combined with different plausible noise values, making the true mean harder to locate.
From a noisy observation to evidence about the mean
The equations above describe the forward generative process by which observations of are created: a fixed but unknown generating mean combines with fresh noise to produce each observation. Estimation reverses this by asking the question: once a particular value has been observed, which candidate values of could plausibly have generated it? The same expression becomes a likelihood over candidate means when is held fixed and is allowed to vary. Differentiating its logarithm with respect to those candidate means produces the score , a quantitative directional clue about the generating mean. If , the score is positive and recommends increasing the candidate mean; if , it is negative and recommends decreasing it. Its magnitude records the strength of that local recommendation. For known , the likelihood is a Gaussian-shaped curve centered at : the observation points most strongly to itself as the possible mean, while the noise level determines how wide a range of other means remains plausible.
Forward view: the unknown generating mean μ* is fixed, while repeated observations vary because of noise.
Inverse view: hold the observed value y fixed and compare how plausible it is under each candidate mean μ.
Take the logarithm of the likelihood; this preserves its peak while making derivatives and independent evidence easier to combine.
Differentiate with respect to the candidate mean. This log-likelihood slope is the score supplied by one observation.
One realized observation gives one score; Fisher information describes the expected strength of that clue across all observations the model could generate.
If μ is the generating mean, observations fall above and below it without a preferred direction, so their scores balance at zero.
Square the scores so opposite directions do not cancel, then average their strength. The Gaussian squared displacement averages to σ².
This is Fisher information from one observation. Small produces a narrow likelihood: moving the candidate mean slightly changes the observation's likelihood sharply, so is large. Large produces a broad likelihood and therefore less information about where the mean lies. Independent observations add information. With observations, , and their combined likelihood has standard deviation .
To turn those likelihoods into an estimate, multiply the likelihoods supplied by the observations—or, equivalently, add their log-likelihoods—and find the candidate mean at the resulting peak. At a smooth peak the total score, which is the slope of the combined log-likelihood, equals zero:
Independent observations multiply their likelihoods, so their log-likelihoods add.
Add the scores from all observations and rewrite their sum using the sample mean ȳ.
Set the combined slope to zero. This identifies the candidate mean at the stationary point.
The second derivative is negative everywhere, so the log-likelihood curves downward and that stationary point is its unique maximum.
The notation distinguishes the estimation rule from its realized answer. Before the data are observed, is a random variable, and names the estimator: the rule that will average whatever observations occur. After the particular values are observed, the rule returns the number . Averaged across repeated datasets, , so this estimator lands on the generating mean.
One noisy observation gives a clue; independent observations sharpen it
Why can we rely on the score being centered at zero?
The symmetry of the Gaussian model makes this centering plausible, but Fisher information is meant to work beyond Gaussians. The following argument establishes it for a broad class of models. The score is a random variable because it depends on the still-random observation . Its average is zero whenever three ordinary assumptions hold: changes smoothly with ; the set of possible observations does not change with ; and the parameter derivative may be moved through the integral. These assumptions are often bundled together under the name regularity conditions, and they hold for the Gaussian model above. They let us use the fact that the total probability remains equal to one for every parameter value. Moving the derivative through the integral means exchanging the order of these two operations: . In other words, differentiating each infinitesimal contribution and then adding them must give the same result as adding the whole density first and then differentiating its total. Smoothness, fixed support, and a sufficiently well-behaved density make that exchange valid.
Begin with the score: the parameter derivative of the log-density.
Write the expectation explicitly by weighting each possible score by its probability.
Use the chain rule: the derivative of ln u is (1/u) times the derivative of u.
The probability multiplying the score cancels its reciprocal.
A regularity condition permits moving the parameter derivative outside the integral.
Every probability density integrates to one, and changing θ cannot change that total.
This result establishes the needed center point. Changing the parameter may increase the log-likelihood slope for some possible observations, but normalization forces compensating decreases elsewhere. When weighted by the model itself, those positive and negative scores balance to zero. The score spread is therefore centered on “no preferred direction,” allowing its spread to measure how strongly observations separate nearby parameter values rather than how strongly they collectively recommend moving somewhere else.
From balanced scores to Fisher information
The result above explains why the score can indicate a direction for one particular observation without favoring any direction across all possible observations generated at . To measure how strongly a typical observation distinguishes nearby parameter values, the opposing scores must be combined without allowing their signs to cancel. Squaring accomplishes this. Because and the expected score is zero, the score variance becomes . This is the scalar Fisher information already calculated for the Gaussian above. A large value means that observations typically give strong local evidence for distinguishing nearby parameter values; a small value means that nearby values remain difficult to tell apart.
The covariance of the log-likelihood slopes.
The average sharpness of the log-likelihood peak.
A lower bound on unbiased-estimator uncertainty.
The Fisher matrix is not itself the gradient of a distribution. The score is one observation's log-likelihood gradient; the first formula above is its covariance across possible observations. In full, that covariance is . Because the expected score is zero, it reduces to . The second formula is not another covariance formula: it is the equivalent curvature view. It uses the Hessian, the matrix of second derivatives of the log-likelihood. In one dimension, the Hessian is a single ordinary second derivative , or equivalently a matrix. Fisher information is the negative expected value of that Hessian, not generally the Hessian produced by one particular observation. The equality between the score and curvature views follows from probability normalization under these same assumptions; Step 4 of the later KL Taylor derivation proves the identity explicitly.
The estimation view in the panel above now follows from the same zero-score identity. Suppose is unbiased, meaning across repeated datasets. Differentiating this equality, then applying the Cauchy–Schwarz inequality, connects estimator uncertainty to Fisher information:
Unbiasedness says that the estimator averages to the true parameter; differentiate both sides with respect to that parameter.
Move the derivative through the expectation and use the zero expected score. Here Uₙ is the score of the complete dataset.
Cauchy–Schwarz bounds the squared relationship between estimator error and score by the product of their squared spreads.
Rearrange to obtain the general scalar Cramér–Rao bound for an unbiased estimator.
Only this final substitution is specific to the Gaussian mean model. Its sample mean attains the bound.
More observations accumulate more Fisher information, which reduces uncertainty about the value of the generating mean.
From one parameter to a parameter space
With several parameters, the score becomes a gradient vector and Fisher information becomes its covariance matrix. Large curvature in a direction means observations distinguish movements in that parameter combination well; small curvature means a poorly identified direction. A smoothly parameterized, identifiable family of distributions is a statistical manifold: each parameter choice names a point, and nearby parameters name nearby models. A categorical family is the special case that can be drawn as a probability simplex; a Gaussian family has a different parameter space. Attaching the Fisher matrix to every point equips the statistical manifold with a metric—a local rule for assigning statistical size to movements in each parameter direction.
Both constructions ask how sensitively a probability model responds to a small parameter change. Estimation theory measures that sensitivity through score variance or expected log-likelihood curvature. Local KL measures how quickly a nearby model becomes distinguishable from the current one. When KL is Taylor-expanded, normalization removes the linear score term and the first surviving coefficient is the negative expected log-density Hessian—the same defined above. The derivation that follows proves this identification explicitly.
Estimation perspective and equivalent formulas: measurement intuition, score and curvature visualization, and normalization-based derivation.
The full derivation of the local Fisher approximation to KL
We'll now show the full derivation of the local Fisher approximation to KL.
Let . Natural logarithms measure information in nats and give the standard Fisher matrix without an extra constant. KL in bits is the same quantity divided by .
Insert the nearby model into the cross-entropy definition
Set and . Both expectations are over data drawn from the unchanged distribution .
Start with KL as the extra coding cost: cross-entropy minus entropy.
Write out cross-entropy: average Q’s negative log-probability over outcomes generated by P.
Write out entropy: average P’s own negative log-probability over the same outcomes.
Replace P by pθ and Q by the nearby model. The averaging distribution remains pθ.
Make the same replacement in the entropy term.
Substitute those two expanded definitions back into cross-entropy minus entropy.
Use ℓϑ(x) = ln pϑ(x) as shorthand for each pointwise log-density.
Use linearity to combine the averages and simplify the minus signs.
The nearby log-density is a value assigned to the random outcome ; it is not itself an entropy or cross-entropy. Only —the negative log-density averaged over data from —is the cross-entropy. Likewise, is the entropy of the current model.
Taylor-expand the nearby model's log-density
The general problem a Taylor expansion addresses is this: when a smooth function is difficult to evaluate directly, but its value and derivatives are known at one input, how can we estimate the value of different inputs that are nearby? It replaces the difficult function locally with a polynomial built from its value, slope, curvature, and higher derivatives at that known input. Here the known input is and the nearby input is . In the exact KL expression above, all dependence on the nearby model sits inside , so this is the term we expand.
Define the score , the vector of first derivatives, and the log-density Hessian . With one parameter, the Hessian is simply the second derivative. With several parameters, it is the matrix of every second partial derivative, recording curvature along—and interactions between—the parameter directions. Then
Apply the multivariable Taylor expansion to the log-density around θ.
Return to the expression for KL obtained in Step 1.
Replace the nearby log-density inside the exact KL formula by its Taylor expansion.
The two copies of ℓθ(X) cancel inside the expectation.
Take the expectation term by term; Δθ is fixed, so it passes through the expectation.
The complicated change in log-density has now become a local slope term and a local curvature term, plus an error that begins at third order. To learn the actual local shape of KL, we next determine what happens to each coefficient after averaging over .
The linear term vanishes because every distribution normalizes to one
Carry the result from Step 2 forward. Its first coefficient is the expected score :
This is the KL approximation obtained at the end of Step 2; we now evaluate its linear coefficient.
Expand the expectation of the score as an integral over pθ.
Use p∇ ln p = ∇p, which follows from the chain rule.
Move the parameter derivative outside the integral under the regularity assumptions below.
Every probability distribution is normalized: its total probability is one.
Differentiate the constant one. The score therefore has zero mean.
Substitute Eθ[sθ] = 0 back into KL. The entire linear term disappears; the Hessian term remains.
This normalization identity is the algebraic reason “KL is minimal where the models match” removes the first-order term. We have not left the original KL formula; we have simplified its Taylor approximation one coefficient at a time.
The remaining Hessian is the Fisher information matrix
Step 3 has already completed the local KL approximation in Hessian form. If all we wanted were a quadratic coefficient, we could stop at . The remaining task is to show that this coefficient is the same Fisher information introduced earlier as the expected score outer product . That identification connects the local curvature of KL to the variability of the score.
Step 3 differentiated normalization once because its unwanted coefficient contained a first derivative, the score. The coefficient that remains now contains a second derivative, the Hessian. Differentiating normalization twice is therefore how we produce an identity involving that second derivative:
Carry forward the quadratic KL expression obtained at the end of Step 3.
State what remains to be proved: the Hessian coefficient in KL equals the score-based definition of Fisher information.
Normalization holds for every θ. Differentiate it twice because the coefficient we need to identify contains second derivatives.
Move the second parameter derivative through the integral under the regularity assumptions.
Rewrite the first derivative of the density using the score.
To obtain one entry of the density Hessian, differentiate the first-derivative identity again.
Apply the product rule: one term differentiates pθ, while the other differentiates the score component.
Use ∂ᵢpθ = pθsθ,ᵢ and ∂ᵢsθ,ⱼ = Jθ,ᵢⱼ in the two product-rule terms.
Collect all component identities into matrix form. The density Hessian contains both the score outer product and the log-density Hessian.
Substitute the expanded density Hessian into the twice-differentiated normalization identity.
Recognize each probability-weighted integral as an expectation under pθ.
Move the expected Hessian to the other side. The remaining score outer product is the Fisher information matrix.
In one dimension, this identity says . The average downward curvature of the log-likelihood and the average squared strength of its slope are two measurements of the same local sensitivity. We can now replace the Hessian coefficient in KL by the Fisher information matrix:
Return to the Hessian form of the local KL approximation.
Use the identity just derived to rename the quadratic coefficient.
Substitute I(θ) into KL. This is the local Fisher approximation.
Convert nats to bits by dividing by ln 2.
This calculation assumes the model is smooth, its support does not change with , and differentiation may pass through the integral. For discrete outcomes, replace each integral by a sum.
From local KL to a geometric length
The derivation has produced a quadratic form. For any chosen parameter movement, multiplying the movement by the Fisher matrix in this way produces one scalar:
The three objects in this expression have separate roles:
The Taylor derivation uses for a small, finite parameter change. Geometry takes the infinitesimal limit and writes that movement as . The symbol denotes statistical path length, so information geometry defines its infinitesimal squared length by
With one parameter, the matrix has one entry and the construction reduces to . With two parameters, the multiplication expands explicitly:
The diagonal entries measure sensitivity along each coordinate direction, while the off-diagonal entry records how the two parameter directions interact. In every dimension, the complete multiplication returns one squared length.
KL has not become a global distance: it is still asymmetric for separated distributions. What loses orientation is only the second-order term, because the quadratic form is symmetric under . The higher-order terms retain KL's directional information. This symmetric microscopic part is enough to supply a local metric; the directional higher-order part returns later when we reach dual connections.
What “zooming in” and “ruler” mean
Zooming in means holding one distribution fixed, restricting attention to nearby members of its parameterized family , and taking small enough that cubic and higher terms are negligible. We are studying how the entire probability output changes with its parameters, not merely how the parameter numbers change on paper.
The Fisher line element converts a small coordinate displacement into the leading-order KL distinguishability of the resulting distributions. Equal-sized parameter changes can therefore have different statistical sizes at different models or in different directions. This ruler is local: measuring a long route requires attaching it at every distribution along the path and adding the resulting infinitesimal lengths.
The family becomes a statistical manifold
Collect every distribution in the model family into one space . Each distribution is a point, its parameters are coordinates, and is a tangent direction—an infinitesimal way to change the distribution. Attaching the Fisher matrix to every point gives the Fisher metric.
A manifold is a space that looks like ordinary Euclidean space when viewed locally. The surface of Earth is curved globally, but a neighborhood admits an ordinary flat map. Likewise, a family can be described locally by its parameter coordinates .
A family is a smoothly parameterized collection with a common mathematical form: all Bernoulli coins as varies, all Gaussians as vary, or all Beta distributions as vary. Paths and distances remain inside one chosen family, where the required derivatives are defined. Differently named model classes can be compared geometrically when they are embedded in a larger common statistical manifold, but unrelated parameterizations do not automatically provide a path between them.
From points to paths
A continuously changing distribution traces a path through the manifold. If its parameters follow , their derivative is a tangent direction: it records how the entire distribution is changing at that instant, just as the velocity of an ordinary curve records how a point is moving.
The Fisher metric assigns that tangent a statistical speed. Adding those infinitesimal lengths along the path gives its total Fisher–Rao length:
Metric distance is obtained by comparing the lengths of paths joining two distributions within the chosen manifold. This is where the familiar shortest-path intuition enters—but it must be separated from the more general meaning of a geodesic.
Changing coordinates changes the numbers in the Fisher matrix, but not the intrinsic length . That coordinate independence is what earns Fisher information the word metricrather than merely “a useful Hessian.” Rao made this geometric viewpoint explicit.
Two statistical notions of straightness appear
Information geometry supplies two natural connections. The mixture connection calls a path straight when probabilities change at a constant rate. The exponential connection calls it straight when log-probability ratios change at a constant rate. They disagree about the route, but the Fisher metric pairs them as dual descriptions.
Two routes between the same distributions
Probabilities change linearly. In probability coordinates, this route looks visually straight.
Log ratios change linearly. In probability coordinates, this route usually looks curved.
The Fisher–Rao geodesic is locally distance-minimizing. It is generally a third route.
Where KL asymmetry enters
The asymmetry is not the entire definition of dual geometry; it is the visible clue. Expanding a divergence around produces one symmetric metric from its second-order term. Its third-order terms retain orientation and generate a pair of dual connections. Reversing KL swaps their roles.
Dual connections and divergence geometry: Amari & Nagaoka (2000); Nielsen (2020).
Fisher information: zoom into KL
KL divergence compares separated distributions. Now place two models extremely close together: and . As derived in the bridge above, normalization makes the first-order score average vanish; the leading term is quadratic. Its coefficient is Fisher information.
The formula for depends on the family being studied. A Bernoulli family has one parameter , so its Fisher information is one number. A Gaussian family parameterized by has a Fisher matrix; a Beta family parameterized by has another. In every case, the entries describe how sensitive that particular family is to small movements in its own parameter directions.
How distinguishable are two nearby coins?
Try moving toward 0 or 1. The same numerical change becomes more informative because a rare outcome changes by a large proportion. That is why grows near the edges.
Fisher information versus the Fisher information metric
is one local sensitivity value—or a matrix when there are multiple parameters.
Attach that matrix to every point. The smoothly varying field defines .
Statistical information and its geometry: Fisher (1922); Rao (1945).
Bonus: natural-gradient variational inference
Fisher geometry becomes operational when a probability distribution is itself being optimized. Variational inference does exactly that: it adjusts an approximate posterior until it resembles the Bayesian posterior over the hidden state . The subscript names the adjustable coordinates used to represent the beliefs. If is the vector of probabilities, changing changes those probabilities directly. If is a vector of logits, the logits change first and changes through a softmax.
These roles should not be collapsed. Inferring with does not require learning the generative parameters . Those parameters may be supplied mechanically, estimated from previous data, or placed under their own prior and inferred in a larger model. Merely writing says that the state distribution depends on ; it does not make an inferred quantity. Parameter inference additionally requires a prior and data, producing a posterior such as or a variational approximation .
From a free-energy gradient to a belief update
A gradient is a vector: an arrow through the coordinate space. At the current coordinates , the free-energy gradient points in the direction where a small movement increases free energy fastest. Multiplying a vector by reverses its arrow, so points in the direction where free energy decreases fastest locally. The components of this reversed vector may be positive, negative, or zero, depending on the current location. Ordinary gradient descent scales the reversed vector by a positive learning rate :
The gradient magnitude and together determine how far the coordinates move. The resulting belief update is . But coordinate distance is not yet belief distance. A useful belief distance should describe how differently two models predict observations—how readily observations could distinguish them—not merely how far their parameter labels moved. Consider what happens if we try to define the distance between distributions using only the distance between their coordinates.
Write a binary distribution as , where the single number is its coordinate within the binary family. Consider and . Their coordinates are and , so the signed coordinate displacement from to is and its coordinate distance is . Component by component, the probability vector changes by .
This coordinate distance does not yet say how distinguishable the two distributions are. To see the problem, compare two movements in the same probability coordinate with exactly the same numerical displacement, :
Near the center of the family, the first probability decreases by 0.001.
These two nearly balanced distributions are extremely difficult to distinguish.
Near the edge of the family, the first probability again decreases by exactly 0.001.
The same parameter step causes more than thirteen times as much distributional change near the rare-event edge.
KL is useful here because it compares the probabilities that the two models assign to the same possible observations: . The expected log-ratio measures how much evidence an observation generated by provides for over ; equivalently, it is the expected excess coding cost of using for data generated by . Models that make nearly identical predictions have a small KL divergence, while models whose predictions are easier to distinguish have a larger one.
If we naively use coordinate distance as the distance between distributions, both pairs are exactly apart. Their KL divergences, however, are and nats. KL therefore distinguishes distributional changes that coordinate distance treats as identical.
Raw coordinate displacement has another limitation: its numerical size depends on how the family is parameterized. The same binary family can instead be parameterized by the log-odds . For example, here is how we calculate the log-odds coordinates for distributions and :
The 50/50 distribution has odds of one to one, so its log-odds coordinate is zero.
The 25/75 distribution has odds of one to three, which gives the negative log-odds coordinate.
The same two distributions are now separated by about 1.10 units of log-odds rather than 0.25 units of probability.
The identical change from to therefore has displacement in probability coordinates but in log-odds coordinates. The distributions did not change; only the coordinates used to describe them changed. Together, the two examples expose both problems with raw coordinate distance: different distributional changes can produce equivalent coordinate distances, and these coordinate distances change depending on the particular parameterization.
KL divergence avoids both problems by comparing the probability distributions themselves rather than their coordinate labels. For a sufficiently small movement from to , the local KL expansion approximates that distributional change. The Fisher matrix supplies the location-dependent conversion from coordinate displacement to local statistical change: it records how sensitively the current distribution responds to movement in each parameter direction.
KL is not the only useful global comparison between distributions; Jensen–Shannon and Hellinger divergences, for example, answer related questions. Information geometry supplies the deeper local result: KL's quadratic term is the Fisher metric, and a broad class of other smooth statistical divergences produce that same metric locally, up to an overall constant.
Canonical Fisher geometry: Amari & Nagaoka (2000); Nielsen (2020).
For the binary family in probability coordinates, . Substituting the two starting locations and the shared step shows how Fisher information produces the different local KL changes:
At the balanced distribution, Fisher information assigns relatively low sensitivity to movement in p.
The local approximation reproduces the tiny KL change near the center.
At the rare-event distribution, the same probability coordinate is much more sensitive.
The parameter step is unchanged; the larger Fisher information makes its statistical effect much larger.
A small coordinate movement already causes a large statistical change, so the inverse Fisher suppresses movement in that direction.
A larger coordinate movement is needed to cause the same statistical change, so the inverse Fisher permits more movement.
Imagine every possible small parameter movement of the same length and ask which direction decreases most. That is precisely the question answered by the ordinary gradient, and it can be visualized as equally long arrows extending from the current point on the statistical manifold. The negative gradient selects the arrow that produces the greatest predicted decrease in free energy.
Equal coordinate lengths, however, need not produce equal changes in the represented distribution. A short movement in a Fisher-sensitive direction may change substantially, while a longer movement in an insensitive direction may change it very little. To make “equal coordinate length” precise, suppose describes a candidate arrow through the parameter coordinates. Its ordinary Euclidean length is . Giving every candidate arrow the same length therefore means , written more compactly as . The subscript names the Euclidean, or, norm. These are unit arrows only when .
Fisher information lets us replace “equal coordinate length” with “equal local belief change.” Instead of placing every candidate on that Euclidean circle, we give every candidate the same locally predicted KL budget:
The earlier local-KL derivation explains where this new constraint comes from. Taylor-expanding the nearby model's log-density introduces the score as its linear term and the log-density Hessian as its quadratic term. After averaging inside KL, the expected score vanishes and the quadratic coefficient becomes the Fisher information matrix:
The Fisher ellipse is therefore the local quadratic approximation to an exact equal-KL boundary. Choosing the point where the lowest reachable linearized free-energy contour touches that ellipse produces the natural-gradient update.
The distributions determine the gradient, Fisher ellipse, and selected update
[0.460, 0.340, 0.200][0.180, 0.640, 0.180][0.246, 0.647, 0.107][0.547, 0.182, 0.271]Each row below shows the new approximate posterior obtained by adding the displayed step to the current logits. Both steps use the same Fisher-predicted KL budget . The “actual KL” is then recalculated directly between the current and updated distributions; its departure from shows the error in the local quadratic approximation.
[0.464, 0.257, 0.279][0.495, 0.266, 0.238]Variational inference contains two nested questions. The outer problem is to find the coordinates that minimize . At the current coordinates, the inner step-selection problem asks which nearby displacement should be taken next. Write the current free-energy gradient as . For a small candidate step, the predicted change in free energy is .
The question becomes: among the steps allowed to change the belief distribution by this amount, which one produces the greatest local decrease in free energy? This is written compactly as:
Read the expression from left to right. The symbol means “search over the possible candidate steps and choose the one that makes the following quantity as small as possible.” Each part then has a direct interpretation:
This dot product predicts the first-order change in free energy. Making it as negative as possible gives the greatest local decrease.
This quadratic form predicts how much the entire belief distribution changes under the candidate step.
The constraint rejects steps whose predicted belief change exceeds the small budget ε. Unless the gradient is already zero, the best step uses the available budget.
The solution has this direction: the inverse Fisher transforms the ordinary gradient before its sign is reversed to point downhill. The next calculation shows why.
The proportionality above states the direction of the answer, but it does not yet show how the constraint produces that direction or determine the step's length. The obstacle is that the same candidate appears in two requirements at once: we want to make as negative as possible, while keeping within the budget . A standard way to solve an optimization problem with such a constraint is to introduce one temporary number called a Lagrange multiplier, written . It combines the objective and constraint into a single expression that can be differentiated. is not a parameter of the probability model and is not chosen independently; solving the equations determines the value that places the optimal step on the budget boundary.
The first term rewards a predicted decrease in free energy. The expression in parentheses is zero when the KL budget is used exactly.
At the optimum, no infinitesimal change in d can improve the combined objective. Differentiate with respect to the candidate step d and set the result to zero.
Move g to the other side, then undo multiplication by the Fisher matrix. This reveals the natural-gradient direction before its length has been determined.
Substitute the proposed step back into the constraint. The remaining unknown λ controls how far to travel along the natural-gradient direction.
Solve the budget equation for the scale 1/λ. A larger permitted KL change produces a larger step.
Insert that scale into the natural-gradient direction. The star marks the candidate step that solves this constrained local problem.
The calculation has now produced three related but distinct objects. The ordinary gradient is . Applying the inverse Fisher matrix gives the natural gradient ; like an ordinary gradient, it points toward increasing free energy, but its direction and scale are defined using the Fisher geometry. Reversing it gives the downhill natural-gradient direction . Finally, is the particular downhill update obtained by scaling that direction until it uses exactly the chosen local KL budget . Thus the natural gradient supplies the direction, while is the budget-sized step actually selected by this constrained problem.
In the spending analogy, is the available budget and is the price of using it. A large makes small and suppresses the step; a small permits a larger step. If the update is instead written , then the learning rate determines the locally predicted expenditure:
The goal is therefore not to find the step that changes the beliefs as little as possible. A zero step would win that trivial contest while learning nothing. The goal is to obtain the greatest predicted reduction in free energy for a fixed small budget of belief change.
Rather than solving for the precise scale that exhausts a prescribed at every iteration, an algorithm may use a positive learning rate to scale the downhill natural-gradient direction. The resulting update can be written in two steps:
With one parameter, is a single positive number. It can only rescale the ordinary gradient: large Fisher information means that a small coordinate movement would cause a large belief change, so its small inverse suppresses the step; small Fisher information has a larger inverse and permits a larger coordinate movement. In one dimension it cannot steer left or right independently of the gradient.
With several parameters, is a matrix. It can reweight and mix the gradient components, so the natural gradient can point in a different coordinate direction from the ordinary gradient. Imagine ordinary gradient descent as a skater dropping straight down a ramp according to the ramp's coordinate grid. Fisher geometry recognizes that equal movements in different directions on that grid may produce very unequal changes in the represented beliefs. The natural gradient redirects the local descent toward the greatest drop in free energy allowed by the belief-change budget. Because the gradient and Fisher matrix are recalculated along the way, successive steps may trace a curve across the ramp rather than the ordinary straight-down path. The path can approach a minimum from a different side; the geometry changes the route, not the objective being minimized.
What changes if we use exact KL?
The natural-gradient direction above came from replacing the exact KL boundary with its local Fisher approximation. We can instead retain the exact KL divergence in the step-selection problem:
Here “best” means the best nearby endpoint according to the local prediction —not the globally optimal posterior found in one step. Applying the same Lagrange multiplier method now gives:
The exact, curved KL boundary now replaces the Fisher ellipse.
The derivative of exact KL depends nonlinearly on d through the updated distribution qφ+d, so this equation usually requires an iterative numerical solution.
For a sufficiently small step, the derivative of exact KL is approximated by I(φ)d. The O(‖d‖²) term collects the omitted contributions whose magnitude shrinks at least quadratically as d approaches zero.
With that local replacement, the nonlinear exact-KL condition becomes the solvable natural-gradient condition.
In the three-state visualization, exact KL is easy to evaluate for any proposed step; that is how the solid gold boundary and the reported “actual KL” are calculated. Evaluation and optimization are different tasks, however. Evaluating one candidate tells us its KL cost, while finding the best candidate anywhere on the curved boundary requires solving the constrained problem. The Fisher approximation replaces that boundary locally with an ellipse, which is why the natural-gradient solution has a closed form.
Variational inference uses to approximate a posterior that may be difficult to compute or represent exactly. Natural-gradient variational inference keeps that same approximate posterior family and the same free-energy objective. Its additional approximation concerns only the next optimization step: it uses the Fisher quadratic to approximate the KL change from to a nearby . It is therefore a method for navigating the variational family, not a second target for inference.
An implementation normally does not construct a Taylor polynomial at every iteration or explicitly calculate a matrix inverse. It computes the ordinary gradient and Fisher matrix , solves the linear system for , and then updates in the direction . A learning rate may set the step directly, or the budget formula above may scale it to a chosen :
The three-state categorical example
Consider one observation and one hidden state with three possible values. Write the approximate posterior as . The likelihood times the prior is simply the joint probability , so its variational free energy is:
Differentiating directly with respect to each probability gives . An ordinary additive step proposes . Because this calculation treats the probabilities as unrestricted coordinates, its proposal need not remain a valid probability distribution: an entry may become negative, or the entries may no longer sum to one.
Three ways to keep a probability update on the simplex
The probability simplex is the set of valid probability vectors: . Begin with , gradient , and learning rate . The ordinary additive proposal is:
The first proposed probability is , so lies outside the simplex. The following methods answer the same practical question in different ways: how should this proposed movement be converted into a valid probability distribution?
1. Clip to zero, then renormalize
First replace each negative entry by zero. The surviving entries then sum to , so divide every entry by to restore a total of one:
The impossible negative probability is replaced by zero.
Dividing by the new total rescales the surviving entries so they sum to one.
This is the repair used by the toy implementation. It is simple, but the clipping changes the proposed direction, and an exact zero is awkward when later calculations contain . Adding a tiny positive constant avoids evaluating , but does not change the fact that this is an after-the-step repair.
2. Project to the nearest valid probability vector
Euclidean projection searches the entire simplex and chooses the valid vector closest to the invalid proposal . “Closest” means the smallest sum of squared coordinate differences:
Here ranges over candidate valid distributions. The expression after assigns each candidate a squared distance from . Unlike , which returns the smallest distance, returns the candidate at which that smallest distance occurs. The star labels the selected solution: is the whole projected vector, while is its th entry. Read the equation as: “Among every valid in , return the that makes smallest.”
The solution subtracts one shared threshold from the entries that can remain positive and sets the rest to zero. The threshold is chosen so the result sums to one:
For , the first entry remains zero. The other two exceed a total of one by , so the closest solution subtracts from each of them:
Projection therefore changes the coordinates additively by the shared threshold. Clip-and-renormalize instead rescales the surviving coordinates multiplicatively, which is why it produced the slightly different vector .
3. Use an exponentiated-gradient update
Exponentiated gradient avoids leaving the simplex rather than repairing an invalid additive proposal. It multiplies each old probability by a positive factor and then normalizes:
The positive first gradient decreases the first category’s weight.
The negative second gradient increases the second category’s weight.
The negative third gradient increases the third category’s weight.
Every weight is positive; normalizing them returns a valid probability vector.
In log-probability coordinates, multiplication becomes addition: . This is why the same update can be written as a softmax. It is also called a multiplicative-weights or entropic mirror-descent update: it limits relative change using KL geometry rather than finding the nearest repair by ordinary Euclidean distance.
Simplex projection: J. Duchi et al. (2008), “Efficient Projections onto the ℓ₁-Ball for Learning in High Dimensions”; exponentiated gradient: J. Kivinen and M. Warmuth (1997), “Exponentiated Gradient versus Gradient Descent”.
The toy model's clip-and-renormalize method is therefore one possible way to keep direct probability updates valid. In the tiny one-factor model it serves as a didactic optimization heuristic, but the repair is not the same as solving the constrained gradient problem and need not converge to the exact posterior. That limitation motivates the projection, exponentiated-gradient, and natural-gradient alternatives.
Natural-gradient variational inference takes another route: represent the same categorical beliefs by unconstrained logits and use the distribution's Fisher geometry to scale their update. Softmax converts those logits into probabilities:
The Fisher matrix for these categorical beliefs follows from the score definition already developed earlier. If the sampled category is , let denote its one-hot vector: for example, gives . Differentiating the categorical log-probability with respect to every logit gives the score vector . Averaging its outer product produces:
Softmax assigns the observed category its logit and subtracts the shared log-normalizer.
The indicator is one for the observed category and zero for every other category; differentiating the normalizer contributes -q_j.
Collecting those derivatives gives the categorical score vector.
Fisher information is the expected outer product of the score vector.
Expand the outer product before taking its expectation.
The mean one-hot vector is the probability vector, while its outer product places one only on the sampled category’s diagonal.
Substitute those two expectations and combine the three outer-product terms.
This matrix has diagonal entries and off-diagonal entries . It depends on the current distribution : as the logits move and the probabilities change, the local Fisher geometry changes with them.
The exact Bayesian posterior is the softmax of the prior log-probability plus the log-likelihood. Define its target logits by . The formula for the ordinary logit gradient can now be derived rather than introduced as a new identity. Exponentiating and normalizing those target logits gives Bayes' rule directly:
The derivative of free energy with respect to the probabilities is . Next, because depends on , the chain rule passes this derivative through the softmax Jacobian. That Jacobian is the same matrix derived above:
Differentiating softmax shows how moving logit j changes probability i.
Collecting those derivatives produces the softmax Jacobian, which is exactly the categorical Fisher matrix derived above.
The chain rule converts a derivative with respect to probabilities into one with respect to the logits that produce them.
Substitute the Fisher matrix for the symmetric softmax Jacobian and the previously derived probability gradient.
Every log-probability is its logit minus the same log-normalizer c.
The Fisher matrix removes terms shared equally by every logit, leaving only the meaningful relative differences.
The last cancellation follows directly from normalization: and , so their difference is zero. The ordinary logit gradient is therefore:
Multiplying by the inverse Fisher removes this coordinate-induced scaling. Strictly, the categorical Fisher matrix has one redundant direction because adding the same constant to every logit leaves the softmax unchanged; fixing one reference logit or using a pseudoinverse gives the same probability update. Up to that irrelevant shared constant:
The numerical step depends on probability coordinates and may leave the simplex before being repaired.
The softmax always produces a valid distribution, while Fisher scaling measures the step by its effect on beliefs.
What changes under a mean-field approximation?
For several hidden-state factors, mean field restricts the approximate posterior to a product family:
Because the score of factor depends only on that factor, score covariances between different factors vanish under the product distribution. The Fisher matrix is therefore block diagonal, with one block for each factor:
In a conditionally conjugate exponential-family model, holding every other factor fixed produces an analytic target for factor . In categorical logit coordinates it has the form:
With , this is the familiar closed-form coordinate-ascent mean-field update. It can also be read as a full natural-gradient step for that factor. Thus conjugate mean-field coordinate ascent already uses the factor's Fisher geometry implicitly; damping with takes only part of that natural step.
Natural gradients and variational inference: S. Amari (1998), “Natural Gradient Works Efficiently in Learning”; M. Sato (2001), “Online Model Selection Based on the MDL Principle”; M. Hoffman et al. (2013), “Stochastic Variational Inference”.
