Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The differential geometric perspective on Laplace

Linearised Laplace approximations (Section Linearisation), and specifically their covariance structure, have interpretations in Riemannian and information geometry. They encode the neural network’s parameter space geometry, as informed by the loss.

The GGN Metric

In the previous chapter, we discussed in detail the curvature matrix defined in Equation (4), called the Generalised Gauss-Newton matrix (GGN). It is the precision term from the likelihood and, combined with the precision term from the prior and inverting, it yields the covariance matrix of a linearised Laplace approximation.

Recall that the GGN matrix at the parameters θ∈RP\theta\in\mathbb{R}^{P} is given by (Equation (22))

G(θ)=∇θ∇θ⊤Lθ(θ)=∑n=1N(Jθf(xn,θ))⊤(∇z∇z⊤ℓ(z,yn)∣z=f(xn,θ))Jθf(xn,θ).G(\theta) = \nabla_\theta \nabla_\theta^{\top} \mathcal{L}^{\theta}(\theta) = \sum_{n = 1}^{N} \left(\jaclogit(x_n, \theta)\right)^{\top} \left(\nabla_{z}\nabla_{z}^{\top} \ell(z, y_n)\big|_{z = f(x_n, \theta)}\right) \jaclogit(x_n, \theta).

We will now see how the GGN arises as a metric on the parameter space. Recall our training data D={(xn,yn)}n=1,…,N\mathcal{D}=\{(x_n,y_n)\}_{n=1,\dots,N}. We restrict the neural network f ⁣:RD×RP→RCf\colon \mathbb{R}^D\times\mathbb{R}^P \to \mathbb{R}^C to the training set, to obtain the function

fX ⁣:RP→(RC)Nθ↦(f(xn,θ))n=1N.\begin{aligned} f_X\colon \mathbb{R}^P &\to \left(\mathbb{R}^C\right)^N \\ \theta &\mapsto (f(x_n, \theta))_{n=1}^N. \end{aligned}

For a single input-label pair (xn,yn)(x_n, y_n), assuming ℓ(z,yn)\ell(z,y_n) is strictly convex (which is the case, for example, for the squared loss in regression), the positive definite loss Hessian

Hn(z):=∇z∇z⊤ℓ(z,yn)H_n(z):=\nabla_{z}\nabla_{z}^{\top} \ell(z, y_n)

characterises a Riemannian metric in the output space RC\mathbb{R}^{C}. That is, it defines a symmetric positive definite bilinear form (v1,v2)↦v1⊤Hn(z)v2(v_1,v_2)\mapsto v_1^\top H_n(z)v_2 at each point z∈RCz\in \mathbb{R}^{C}. Such a metric encodes the curvature of the loss given the target yny_n. Note that if the likelihood is an exponential family, then HnH_n is independent of the target yny_n (Proposition 2).

In fact, we only require ℓ(z,yn)\ell(z,y_n) to be (not necessarily strictly) convex, in which case HnH_n is only positive semidefinite. This is the case for the cross-entropy loss in classification, where the Hessian is rank-deficient. In this case, HnH_n defines a degenerate Riemannian metric on RC\mathbb{R}^{C}.

We can then equip the image of fXf_X, (RC)N(\mathbb{R}^C)^N, with the block diagonal (degenerate) Riemannian metric

H(z)=[H1(z1)0⋯00H2(z2)⋮⋮⋱00⋯0HN(zN)]H(z) = \begin{bmatrix} H_1(z_1) & 0 & \cdots & 0 \\ 0 & H_2(z_2) & & \vdots \\ \vdots & & \ddots & 0 \\ 0 & \cdots & 0 & H_N(z_N) \end{bmatrix}

in standard coordinates, where z=(z1,…,zN)z = (z_1,\dots , z_N). This metric characterises the curvature of the loss on the training set. It can then be pulled back through fXf_X to the parameter space:

(fX∗H)(θ)=JθfX(θ)⊤H(fX(θ))JθfX(θ)=∑n=1NJθf(xn,θ)⊤Hn(f(xn,θ))Jθf(xn,θ)=∑n=1N(Jθf(xn,θ))⊤(∇z∇z⊤ℓ(z,yn)∣z=f(xn,θ))Jθf(xn,θ)=G(θ),\begin{aligned} (f_X^*H)(\theta) &= J_\theta f_X(\theta)^{\top} H(f_X(\theta)) J_\theta f_X(\theta) \\ &= \sum_{n=1}^N \jaclogit(x_n, \theta)^{\top} H_n(f(x_n,\theta))\jaclogit(x_n, \theta) \\ &= \sum_{n = 1}^{N} \left(\jaclogit(x_n, \theta)\right)^{\top} \left(\nabla_{z}\nabla_{z}^{\top} \ell(z, y_n)\big|_{z = f(x_n, \theta)}\right) \jaclogit(x_n, \theta) = G(\theta), \end{aligned}

i.e., the pullback fX∗Hf_X^*H corresponds exactly to the GGN GG.

Due to symmetries in the neural network architecture (see Part 7 — Identifiability and symmetries) and overparametrisation, the GGN is rank-deficient and only positive semidefinite. It therefore defines again a degenerate Riemannian metric on the parameter space.[1] Thus, damping is needed to get a proper Riemannian metric on the parameter space. The strictly convex regulariser term Ω(θ)\Omega(\theta) is such a dampener: adding its Hessian to the GGN results in a positive definite matrix (cf. Equation (43))

∇θ∇θ⊤LΩθ(θ)=∇θ∇θ⊤Lθ(θ)+∇θ∇θ⊤Ω(θ).\nabla_\theta \nabla_\theta^{\top} \regrisk^{\theta}(\theta) = \nabla_\theta \nabla_\theta^{\top} \mathcal{L}^{\theta}(\theta) + \nabla_\theta\nabla_\theta^{\top} \Omega(\theta).

Using this as a preconditioner in second-order optimisation means we perform Riemannian (stochastic) gradient descent in the parameter space.

Left: A fiber manifold \mathcal M(\theta_0) in the parameter space, and its tangent space T_{\theta_0}\mathcal M(\theta_0) at \theta_0. The fiber manifold consists of the parameters yielding the same output values on the training data as \theta_0 (Equation ), the tangent space consists of the kernel directions of the GGN at \theta_0. Right: A collection of three fibers in parameter space. The parameter space is partitioned into a disjoint union of such fibers.

(a)

Left: A fiber manifold \mathcal M(\theta_0) in the parameter space, and its tangent space T_{\theta_0}\mathcal M(\theta_0) at \theta_0. The fiber manifold consists of the parameters yielding the same output values on the training data as \theta_0 (Equation ), the tangent space consists of the kernel directions of the GGN at \theta_0. Right: A collection of three fibers in parameter space. The parameter space is partitioned into a disjoint union of such fibers.

(b)

Figure 1:Left: A fiber manifold M(θ0)\mathcal M(\theta_0) in the parameter space, and its tangent space Tθ0M(θ0)T_{\theta_0}\mathcal M(\theta_0) at θ0\theta_0. The fiber manifold consists of the parameters yielding the same output values on the training data as θ0\theta_0 (Equation (7)), the tangent space consists of the kernel directions of the GGN at θ0\theta_0. Right: A collection of three fibers in parameter space. The parameter space is partitioned into a disjoint union of such fibers.

But how do we interpret the GGN metric? We base our presentation on Roy et al. (2024). Fixing a parameter vector θ0\theta_0, consider the set

M(θ0)={θ∈RP:fX(θ)=fX(θ0)}\mathcal M(\theta_0) = \{\theta\in\mathbb{R}^P: f_X(\theta) = f_X(\theta_0)\}

i.e., the set of parameters θ\theta for which the neural network defines the same function on the training data as θ0\theta_0. This is an equivalence class of parameters, called a fiber. By the preimage theorem Tu, 2011, Theorem 9.9, it is (locally) a manifold of dimension P−NCP-N C if fXf_X is (locally) continuously differentiable and the Jacobians JθfX(θ)J_\theta f_X(\theta) are surjective for all (local) θ∈M(θ0)\theta\in \mathcal M(\theta_0). Intuitively, the parameter space is PP-dimensional but we constrain the model’s prediction on the training set of NN samples, meaning we put NCN C scalar constraints on the output. This eliminates NCN C degrees of freedom, yielding a (P−NC)(P - N C)-dimensional manifold. The surjectivity condition holds in particular when the eigenvalues of the neural tangent kernel matrix over the entire training set are bounded away from 0, a common assumption for overparametrised models, see Roy et al. (2024, Appendix A) and the references therein.

Further, when the Jacobians JθfX(θ)J_\theta f_X(\theta) are surjective locally around θ0\theta_0, the preimage theorem further tells us that ker⁡JθfX(θ0)=Tθ0M(θ0)\ker J_{\theta}f_X(\theta_0) = T_{\theta_0}\mathcal M(\theta_0), the tangent space of M(θ0)\mathcal M(\theta_0) at θ0\theta_0 (see Figure 1). If the Hessians ∇z∇z⊤ℓ(z,yn)\nabla_{z}\nabla_{z}^{\top} \ell(z, y_n) are full rank (for example, when ℓ(z,yn)=∥z−yn∥2\ell(z,y_n) = \|z-y_n\|^2 the squared loss), we get ker⁡G(θ0)=Tθ0M(θ0)\ker G(\theta_0) = T_{\theta_0}\mathcal M(\theta_0). These are directions in which the training data gives us no information about the parameters. Thus, in such directions, linearised Laplace approximations solely rely on the prior. The orthogonal complement of this null space consists of the directions in which the training data gives us information.

Now having defined the fibers in parameter space, we can quotient them out to obtain the effective parameter space: RP/∼\mathbb{R}^P/\sim where ∼\sim is the equivalence relation induced by fXf_X, θ0∼θ1⇔fX(θ0)=fX(θ1)\theta_0 \sim \theta_1 \Leftrightarrow f_X(\theta_0) = f_X(\theta_1). The effective parameters are parameters for which the neural network ff takes distinct values on the training data. Formally, the effective parameter space is a fiber bundle over the parameter space. It can be thought of as a manifold perpendicular to the fibers M(θ)\mathcal M(\theta); Roy et al. (2024) construct such a manifold explicitly. We note, however, that this is an arbitrary choice, as there is no canonical way to choose representatives for the equivalence classes and hence such a manifold. As a consequence, the non-linear effective parameter space is difficult to leverage computationally. However, the GGN’s degenerate metric on the original parameter space RP\mathbb{R}^P captures the similarity of training outputs between different parameters. One therefore does not have to construct the effective parameter space explicitly, but rather use the GGN’s geometry in the parameter space.

The Fisher Metric

In the previous chapter we saw that the GGN metric can be seen as the pullback of the loss curvature metric on the training outputs. We now ask whether there is a more intrinsic, parametrisation-independent justification for this metric. We offer a such a perspective on the GGN metric via information geometry.

Recall from Chapter Linearised Laplace approximations, Equation (26) the Fisher information metric

F(θ)=Ep(x,y∣θ)[−∇θ∇θ⊤log⁡p(x,y∣θ)]=Ep(x,y∣θ)[∇θlog⁡p(x,y∣θ)(∇θlog⁡p(x,y∣θ))⊤]\begin{aligned} F(\theta) &= \mathbb{E}_{p(x, y \mid \theta)}\left[-\nabla_{\theta}\nabla_{\theta}^{\top} \log p(x, y \mid \theta)\right] \\ &= \mathbb{E}_{p(x, y \mid \theta)}\left[\nabla_{\theta} \log p(x, y \mid \theta)(\nabla_{\theta} \log p(x, y \mid \theta))^{\top}\right] \end{aligned}

which we now view as a degenerate Riemannian metric on the parameter space RP\mathbb{R}^P. If we take the empirical distribution on the xx, 1N∑n=1Nδxn\frac{1}{N}\sum_{n=1}^N \delta_{x_n}, we get (Equations (35) and (38))

F~(θ)=1N∑n=1NEp(y∣x,θ)[−∇θ∇θ⊤log⁡p(y∣x,θ)]=1N∑n=1N∇θlog⁡p(yn∣xn,θ)(∇θlog⁡p(yn∣xn,θ))⊤.\begin{aligned} \tilde{F}(\theta) &= \frac{1}{N} \sum_{n=1}^{N} \mathbb{E}_{p(y \mid x, \theta)}\left[-\nabla_{\theta}\nabla_{\theta}^{\top} \log p(y \mid x, \theta)\right] \\ &= \frac{1}{N} \sum_{n=1}^{N} \nabla_{\theta}\log p(y_n \mid x_n, \theta) \left(\nabla_{\theta} \log p(y_n \mid x_n, \theta)\right)^{\top}. \end{aligned}

We saw in Chapter Linearised Laplace approximations that F~(θ)=1NG(θ)\tilde{F}(\theta) = \frac{1}{N}G(\theta), a renormalisation of the GGN metric, under the mild condition that the Hessian of the negative log-likelihood loss does not depend on the target yy (see Equation (40)).

This gives an important connection between the covariance used in linearised approximation and the fundamental object from information geometry, which is the Fisher information metric. The goal of this chapter is to explain the importance of the Fisher information metric, why it can be seen as the natural metric for any probabilistic model, and its interpretation in deep learning.

A statistical manifold is a manifold M\mathcal M consisting of probability measures. Any parametric statistical model defines a parametrisation of a statistical manifold RP→M\mathbb{R}^P \to \mathcal M. What is M\mathcal M for a neural network? So far, we have viewed a neural network as a map f ⁣:RD×RP→RCf\colon \mathbb{R}^D\times \mathbb{R}^P \to \mathbb{R}^C. However, recall that we assume it induces probability distributions p(y∣x,θ)p(y\mid x,\theta), since the loss function ℓ(f(x,θ),y)\ell(f(x,\theta), y) is assumed to be the negative log-likelihood −log⁡p(y∣x,θ)-\log p(y \mid x,\theta). Therefore we implicitly viewed ff as a probabilistic model; for each x∈RDx\in \mathbb{R}^D, and θ∈RP\theta\in \mathbb{R}^P, we have a probability measure f(x,θ)∈P(Y)\mathrm f(x,\theta) \in \mathcal P(\mathcal{Y}) defined by the neural network, where Y\mathcal{Y} is the set of labels (RC\mathbb{R}^C for regression, {1,…,C}\{1,\dots,C\} for classification) and P(Y)\mathcal P(\mathcal{Y}) is the space of probability measures on the set of labels. f\mathrm f is given by the composition of ff with some appropriate g ⁣:RC→P(Y)\mathrm g\colon \mathbb{R}^C \to \mathcal P(\mathcal{Y}). In regression, we most often take g(z)=N(z,ϵ2I)∈P(RC)\mathrm g(z) = \mathcal N(z, \epsilon^2 I) \in \mathcal P(\mathbb{R}^C) for some fixed ϵ>0\epsilon>0, while in classification, most often g(z)=softmax⁡(z)∈ΔC−1≅P({1,…,C})\mathrm g(z) = \operatorname{softmax}(z) \in \Delta^{C-1} \cong \mathcal P(\{1,\dots,C\}). In Chapter Linearised Laplace approximations, we saw that both of these choices guarantee the equivalence between the Fisher and the GGN (Equation (40)).

So we have a map f ⁣:RD×RP→P(Y)\mathrm f\colon \mathbb{R}^D\times \mathbb{R}^P \to \mathcal P(\mathcal{Y}). Write p(y∣x,θ)p(y\mid x,\theta) for the density of f(x,θ)\mathrm f(x,\theta), so p(y∣x,θ)=12πϵexp⁡(−12ϵ2∥f(x,θ)−y∥2)p(y\mid x,\theta) = \frac{1}{\sqrt{2\pi}\epsilon}\exp\left(-\frac{1}{2\epsilon^2}\|f(x,\theta)-y\|^2\right) in regression, p(y∣x,θ)=softmax⁡(f(x,θ))yp(y\mid x,\theta) = \operatorname{softmax}(f(x,\theta))_y in classification. Then the statistical model m ⁣:RP→P(RD×Y)\mathrm m\colon \mathbb{R}^P \to \mathcal P(\mathbb{R}^D\times \mathcal{Y}) is defined as the joint distribution over xx and yy. Namely, if the distribution over the inputs xx has a density p(x)p(x), the density of m(θ)\mathrm m(\theta) is p(x,y∣θ):=p(x)p(y∣x,θ)p(x,y\mid \theta) := p(x)p(y\mid x,\theta). As discussed above, in practice we take the empirical distribution over xx. The statistical manifold M\mathcal M defined by the neural network ff is the image of m\mathrm m in P(RD×Y)\mathcal P(\mathbb{R}^D\times \mathcal{Y}).

This is where the Fisher information metric comes into play. The Fisher metric is an object intrinsic to the statistical manifold M\mathcal M, and is independent of how the manifold is parametrised by RP\mathbb{R}^P. Formally, suppose we have a different parametrisation m~ ⁣:RP→M\tilde {\mathrm m}\colon \mathbb{R}^P \to \mathcal M. Then m\mathrm m and m~\tilde {\mathrm m} differ by some diffeomorphism[2] of the parameter space, i.e. there is a diffeomorphism φ ⁣:RP→RP\varphi\colon \mathbb{R}^P\to \mathbb{R}^P such that m=m~∘φ\mathrm m = \tilde {\mathrm m}\circ \varphi. Then we see that for θ~=φ(θ)\tilde \theta = \varphi(\theta), m(θ)=m~(θ~)\mathrm m(\theta) = \tilde {\mathrm m}(\tilde \theta) or, abusing notation, p(x,y∣θ)=p(x,y∣θ~)p(x,y\mid \theta) = p(x,y\mid \tilde \theta). Therefore, from the definition of the Fisher information metric (Equation (9) or Equation (10)), the Fisher information metric on the two distinct parametrisations coincide Fm(θ)=Fm~(θ~)F_{\mathrm m}(\theta) = F_{\tilde{\mathrm m}}(\tilde \theta).

The fact that the Fisher metric does not depend on the parametrisation implies that it is intrinsic to M\mathcal M. Therefore, there should exist a way to define it directly on M\mathcal M in an abstract, measure-theoretic way. Doing this rigorously requires some mathematical groundwork, which the keen reader can find in Ay et al. (2017). Briefly, for μ∈M\mu\in \mathcal M and tangent vectors ν1,ν2∈TμM\nu_1,\nu_2\in T_\mu\mathcal M, which are signed measures integrating to 0, the intrinsic Fisher information metric is defined by

F(μ)[ν1,ν2]=∫ dν1 dμ dν2 dμ dμF(\mu)[\nu_1,\nu_2] = \int \frac{\,\mathrm{d}\nu_1}{\,\mathrm{d}\mu}\frac{\,\mathrm{d}\nu_2}{\,\mathrm{d}\mu}\,\mathrm{d}\mu

where  dνi dμ\frac{\,\mathrm{d}\nu_i}{\,\mathrm{d}\mu} is the Radon-Nikodym derivative of νi\nu_i with respect to μ\mu, i.e. the densities of νi\nu_i with respect to μ\mu. Then the degenerate metric on the parameter space RP\mathbb{R}^P is given by the pullback of this intrinsic metric onto RP\mathbb{R}^P (see Ay et al. (2017)).

There is an infinite number of ways to define an intrinsic Riemannian metric on M\mathcal M. So what makes the Fisher information metric special? It is not special for its invariance under transformations of the parameter space, but instead for its invariance under transformations of the data space.

The factorisation condition means that the likelihood depends on θ\theta only through T(x)T(x), since the factor h(x)h(x) has no θ\theta-dependence. Thus, all information about θ\theta contained in the full data point xx is also contained in the statistic T(x)T(x), justifying the term ‘sufficient’.

In our deep learning setting above, the data space is D=RD×Y\mathcal D = \mathbb{R}^D\times\mathcal Y, the product of the input space with the label space.

Note that, for a statistical manifold M\mathcal M over D\mathcal D, a statistic T ⁣:D→D′T\colon \mathcal D \to \mathcal D' induces a map T∗ ⁣:M→M′T_*\colon \mathcal M \to \mathcal M' acting by pushforwards: T∗μ=μ∘T−1T_*\mu = \mu\circ T^{-1}. So M′\mathcal M' is a statistical manifold over D′\mathcal D'. Then, under mild assumptions on M\mathcal M, we obtain the following theorem:

Up to a multiplicative constant, the Fisher information metric is the unique metric satisfying this. This is Chentsov’s theorem. We leave as an exercise to verify this theorem for the special case of the deep learning setting above.

As explained above, sufficient statistics should be thought of as maps of the data space which do not induce a loss of information on the parameters with respect toa given statistical model. The Fisher information metric, being invariant under such transformations, should be thought of as quantifying ‘information’, hence its name. Note in particular that it is invariant under diffeomorphisms of the data space (which are trivially sufficient statistics owing to their bijective nature), and so does not depend on how the data is ‘presented’. This makes it the natural metric for statistical manifold M\mathcal M.

Geometric Laplace Approximations

Laplace approximations, being Gaussian approximations to the neural network’s posterior, are limited in their expressivity. As a consequence, there have been attempts at leveraging the geometry of the parameter space to define more expressive variants of Laplace approximations.

A key observation is that the Laplace approximations are not diffeomorphism-invariant: given a diffeomorphism of the parameter space φ ⁣:RP→RP\varphi\colon \mathbb{R}^P\to \mathbb{R}^P, if such diffeomorphism is non-linear, then performing Laplace with respect to the parameters φ\varphi, i.e., a reparametrised Laplace approximation, yields a distinct posterior approximation than performing Laplace with respect to the parameters θ\theta. In the extreme case, one can show there exists a diffeomorphism φ\varphi for which the Laplace approximation with respect to the corresponding parameters is exact Costa et al., 2025. In practice, computing such φ\varphi is as difficult as computing the exact posterior itself. However, this result gives hope that one may be able to construct computationally feasible diffeomorphisms φ\varphi yielding high-quality Laplace approximations, see for instance MacKay (1998). An important note is that, while Laplace approximations are not invariant under diffeomorphisms of the parameter space, the predictives of linearised Laplace approximations are, up to changing the prior. We leave this as an exercise to the reader.

Another attempt at leveraging geometry for Laplace is to perform the Laplace approximation in the tangent space of the parameter space and then project it through an exponential map under some Riemannian metric Bergamin et al., 2023Yu et al., 2024, coined Riemannian Laplace approximations. The latter work uses the Fisher as the Riemannian metric. Work remains to be done to make the computation of the exponential map efficient and scalable. See Costa et al. (2025) for the relationship between such Riemannian Laplace approximations and the aforementioned reparametrised Laplace approximations.

Finally, diffusion Laplace approximations Roy et al., 2024 sample the approximate posterior through random walks with respect to a Riemannian metric in the weight space. Once again, while there are promising preliminary results, further work is needed to scale such approaches computationally. Moreover, the relationship between diffusion Laplace approximations and Riemannian Laplace approximations is yet to be described.

Footnotes
  1. Not to be confused with pseudo-Riemannian metrics.

  2. A diffeomorphism is a smooth bijection with smooth inverse.

References
  1. Roy, H., Miani, M., Ek, C. H., Hennig, P., Pförtner, M., Tatzel, L., & Hauberg, S. (2024). Reparameterization invariance in approximate Bayesian inference. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, & C. Zhang (Eds.), Advances in Neural Information Processing Systems (Vol. 37, pp. 8132–8164). Curran Associates, Inc.
  2. Tu, L. W. (2011). An Introduction to Manifolds. Springer.
  3. Ay, N., Jost, J., Lê, H. V., & Schwachhöfer, L. (2017). Information Geometry (Vol. 64). Springer International Publishing.
  4. Costa, N. D., Mucsányi, B., & Hennig, P. (2025). Geometric Gaussian Approximations of Probability Distributions.
  5. MacKay, D. J. C. (1998). Choice of Basis for Laplace Approximation. Machine Learning, 33(1), 77–86.
  6. Bergamin, F., Moreno-Muñoz, P., Hauberg, S., & Arvanitidis, G. (2023). Riemannian Laplace approximations for Bayesian neural networks. In A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, & S. Levine (Eds.), Advances in Neural Information Processing Systems (Vol. 36, pp. 31066–31095). Curran Associates, Inc.
  7. Yu, H., Hartmann, M., Williams Moreno Sanchez, B., Girolami, M., & Klami, A. (2024). Riemannian Laplace Approximation with the Fisher Metric. In S. Dasgupta, S. Mandt, & Y. Li (Eds.), Proceedings of The 27th International Conference on Artificial Intelligence and Statistics (Vol. 238, pp. 820–828). PMLR.