At \(w=1/2\), the predicted probability is \(p=\sigma(1/4)=0.5621765009\). Four quantities that are routinely called “curvature” give
\[
\begin{aligned}
H &= -0.6295129155, &\qquad
G &= 0.2461340827,\\
F &= 0.2461340827, &\qquad
\widetilde F &= 0.1916894164.
\end{aligned}
\tag{12.2}\]
The first object says the realized loss bends downward. The other three are nonnegative. Two agree exactly; the third does not. No floating-point format, batch, parameter, or label changed. Only the mathematical question changed.
ImportantPrediction
Which term makes \(H\) negative? Why do \(G\) and \(F\) agree here? What distribution would have to change before \(\widetilde F\) became an empirical estimate of \(F\)?
12.1 Hold the problem fixed; change the object
The one-observation arithmetic is short enough to expose. For Bernoulli negative log likelihood,
The first term is \(0.2461340827\). The second is \(-0.8756469982\). Their sum is the negative Hessian in Equation 12.2. The Fisher and empirical-Fisher values require different averaging contracts; they arrive in Section 12.3.
The next witness adds an intercept and four observations. It compares an affine logit \(z=ax+b\) with a composed logit \(z=a^2x+b\) while holding the parameter, labels, and Bernoulli loss fixed.
Load the chapter-pinned curvature instruments.
Fix four inputs, four labels, and one parameter vector.
Compute the realized Hessian, GGN, model Fisher, and empirical Fisher.
Repeat for affine and composed logits.
Compare eigenvalues rather than collapsing each matrix to one norm.
Check the committed claim artifact before interpreting the plot.
Figure 12.1: The same Bernoulli loss produces different curvature spectra. With an affine logit, the realized Hessian, GGN, and model Fisher coincide. Curving the parameter-to-logit map adds an indefinite model-curvature term; the empirical Fisher remains a distinct observed-label outer product in both controls.
The affine control removes every Hessian of the parameter-to-logit map. The realized Hessian then equals GGN. The composed control restores one omitted term and one Hessian eigenvalue crosses zero. This is not a contest in which one matrix is universally correct. Each answers a different question.
12.2 The term a positive-semidefinite surrogate drops
Let \(f_{\vect{\theta}}\in\mathbb{R}^q\) be the model output, let \(\ell(y,\vect{z})\) be a local loss, and define \(\matr{J}=\partial f_{\vect{\theta}}/\partial\vect{\theta}\). Dimensions are \(\matr{J}\in\mathbb{R}^{q\times p}\) and \(\matr{H}_{\vect{z}}\ell\in\mathbb{R}^{q\times q}\).
Theorem 12.1 (Composite Hessian decomposition) If \(f_{\vect{\theta}}\) and \(\ell\) are twice differentiable, then
If \(\ell\) is convex in \(\vect{z}\), then \(\matr{G}\) is positive semidefinite. The residual term \(\matr{R}\) can have either sign.
Proof
The gradient is \(\nabla_{\vect{\theta}}\ell=\matr{J}^{\mathsf T}
\nabla_{\vect{z}}\ell\). Differentiate its \(r\)-th coordinate with respect to \(\theta_s\). Differentiating \(\nabla_{\vect{z}}\ell\) produces \([\matr{J}^{\mathsf T}\matr{H}_{\vect{z}}\ell\matr{J}]_{rs}\); differentiating the entries of \(\matr{J}\) produces \(\sum_j(\partial\ell/\partial z_j)
\partial^2 f_j/(\partial\theta_r\partial\theta_s)\). That is Equation 12.5. If \(\matr{H}_{\vect{z}}\ell\succeq0\), then \(\vect{v}^{\mathsf T}\matr{G}\vect{v}=
(\matr{J}\vect{v})^{\mathsf T}\matr{H}_{\vect{z}}\ell
(\matr{J}\vect{v})\geq0\).
The theorem explains both panels. In the affine model, \(\nabla^2_{\vect{\theta}} f_j=\matr{0}\) and \(\matr{R}=\matr{0}\). In the composed model, the observed residual multiplies the curvature of \(a^2x+b\).
WarningNamed wrong answer: GGN is the Hessian made safe
GGN is not the Hessian with negative eigenvalues clipped. It is the Hessian of a locally linearized model composed with the declared output loss. It can omit positive as well as negative model curvature, and it changes if the boundary between model and output loss changes.
12.3 Three expectations hiding behind two words
For a conditional statistical model \(p_{\vect{\theta}}(y\mid x)\), define the score \(\vect{s}_{\vect{\theta}}(y,x)=\nabla_{\vect{\theta}}\log
p_{\vect{\theta}}(y\mid x)\). Fixing the observed inputs, the model Fisher is
Both are positive semidefinite sums of outer products. That shared algebra does not make their averaging distributions the same.
Theorem 12.2 (Score identity and qualified GGN equality) Suppose the support of \(p_{\vect{\theta}}(y\mid x)\) does not depend on \(\vect{\theta}\) and differentiation may pass through its integral or sum. Then
When the output variable in the GGN is a compatible natural parameter for the negative log likelihood, the model Fisher equals that GGN.
Proof of the score identity
Differentiate normalization: \(\int p_{\vect{\theta}}(y\mid x)\,dy=1\). The first derivative gives \(\E[\vect{s}_{\vect{\theta}}]=\vect{0}\). Differentiating the score mean once more gives
which proves Equation 12.8. For an exponential-family likelihood in its natural output parameter, the conditional score covariance is the output negative-log-likelihood Hessian. Pulling it through \(\matr{J}\) gives \(\matr{J}^{\mathsf T}\matr{H}_{\vect{z}}\ell\matr{J}\); see Martens (2020) for the precise qualified equivalence.
For the Bernoulli logit, the model averages \((Y-p)^2\) under \(Y\sim\operatorname{Bernoulli}(p)\), producing \(p(1-p)\). The observed-label outer product uses \((y-p)^2\). At \(p=0.5622\) and \(y=1\), those are different numbers. The adjective “empirical” does not repair the change of measure (Kunstner et al. 2019).
Object
What is averaged?
Definite?
What it can diagnose
Realized Hessian \(\matr{H}\)
derivatives of the observed objective
indefinite
local Taylor curvature of that objective
GGN \(\matr{G}\)
observed examples; linearized model, curved output loss
PSD under output convexity
curvature retained by the declared split
Model Fisher \(\matr{F}\)
model-generated labels at observed inputs
PSD
local statistical-model geometry
Empirical Fisher \(\widetilde{\matr{F}}\)
observed-label score outer products
PSD
gradient outer-product geometry; not generally \(\matr{F}\)
TipField note: name the expectation
A paper that writes “the Fisher” without naming what is random has left the operator underspecified. Ask whether the expectation is over model-generated labels, observed examples, inputs from a population, or some combination. Then ask which of those expectations the code actually estimates.
12.4 Ask for an action, not a dense matrix
A dense Hessian of a model with \(p\) parameters contains \(p^2\) entries. Most curvature algorithms do not need those entries. They need the action \(\matr{H}\vect{v}\) on a chosen direction.
Theorem 12.3 (Hessian–vector products) Let \(L:\mathbb{R}^p\to\mathbb{R}\) be twice differentiable and let \(\vect{v}\in\mathbb{R}^p\) be independent of \(\vect{\theta}\). Then
The right-hand side can be evaluated by composing derivative programs without forming the dense Hessian.
Proof
The scalar inside the gradient is \(\sum_j(\partial L/\partial\theta_j)v_j\). Its \(i\)th derivative is \(\sum_j(\partial^2L/\partial\theta_i\partial\theta_j)v_j\), the \(i\)th entry of \(\matr{H}\vect{v}\). The identity is exact. Its implementation cost depends on the derivative primitives, graph, and retained-state policy; it is not a universal timing constant (Pearlmutter 1994).
The opening model is only two-dimensional, so we can use its dense Hessian as a control while the iteration sees only an action function.
Reuse the verified composed-logit witness.
Define a function that accepts a vector and returns \(\matr{H}\vect{v}\).
Check one action against dense multiplication.
Run seeded power iteration through the action interface.
Compare the signed estimate with the dense eigendecomposition.
Figure 12.2: Matrix-free power iteration approaches the Hessian eigenvalue of largest magnitude. The estimate is negative because magnitude, not algebraic order, governs ordinary power iteration.
WarningNamed wrong answer: power iteration finds the largest eigenvalue
Ordinary power iteration targets the eigenvalue of largest magnitude when one is uniquely dominant. It does not automatically target the largest algebraic eigenvalue. Here that distinction is the difference between reporting negative curvature and erasing it.
The point of the operator interface is larger than this tiny witness. Lanczos iteration, conjugate gradients, trace estimators, and several second-order diagnostics can be written in terms of matrix–vector products. The matrix is then defined by what action the program computes. That makes the choice among \(\matr{H}\), \(\matr{G}\), \(\matr{F}\), and \(\widetilde{\matr{F}}\) an executable API decision.
12.5 Object, representation, and solver are separate choices
Three decisions are often compressed into the phrase “use second order”:
power iteration, conjugate gradients, damping, preconditioning
What action is taken with that representation?
A diagonal Hessian and a diagonal Fisher differ before either becomes diagonal. A low-rank approximation can be applied to an indefinite Hessian or a positive-semidefinite GGN. Damping changes the system being solved; it does not retroactively make an empirical Fisher into a model Fisher.
This separation is also a hardware boundary. A matrix-free action avoids storing \(p^2\) entries, but it can still reread activations, replay derivative graphs, and perform reductions. “Matrix free” is a storage statement until a measurement establishes more. CPU timing here would not establish accelerator performance.
Representation can also change the numerical problem before a solver takes a step. Let \(\matr{J}\in\mathbb{R}^{m\times p}\) have full column rank, with singular values \(\sigma_1\ge\cdots\ge\sigma_p>0\). The eigenvalues of \(\matr{J}^{\mathsf T}\matr{J}\) are \(\sigma_i^2\), so
Forming normal equations therefore squares the spectral condition number and can spend roughly twice the digits that the original least-squares operator made vulnerable. This is the C03 precision contract applied to a curvature representation, not a reason to declare one solver universally superior. QR avoids explicitly squaring the operator; LSQR uses products with \(\matr{J}\) and \(\matr{J}^{\mathsf T}\); matrix-free curvature products avoid forming the dense Gram matrix. Each alternative still owes a cost, stopping, precision, and residual contract. Damping replaces the system by a different one rather than undoing the squaring (Higham 2002).
12.6 One linear solver, two lenses
Suppose a positive-definite curvature operator \(\matr{A}\) defines the system \(\matr{A}\vect{x}=\vect{b}\). Conjugate gradients can be read dynamically as a sequence of mutually \(\matr{A}\)-conjugate search directions. It can also be read inferentially: under a Gaussian prior and exact linear observations, the same algebra updates a distribution over the unknown solution (Hennig 2015). These are two interpretations of one computation, not evidence that every iterative solver is Bayesian.
The seam matters because curvature estimation is itself an information problem. Secant pairs reveal actions of an unknown Hessian. Probabilistic quasi-Newton work asks what posterior over a matrix is compatible with those observations (Hennig and Kiefel 2013). This chapter keeps that as a branch from the trunk: students need the operator/observation distinction to read such work, but not the full probabilistic-numerics apparatus to diagnose the opening failure.
TipField note: a curvature card
Before accepting a curvature claim, record five fields: the mathematical object; every averaging distribution; the representation or approximation; the matrix action actually implemented; and the solver, damping, or preconditioning policy that consumes it.
NoteCheck yourself
For an affine logit with Bernoulli negative log likelihood, which term in Equation 12.5 vanishes? Does that equality make the empirical Fisher equal to the model Fisher for an arbitrary observed label? If a power iteration returns a negative Rayleigh quotient, what ordering of eigenvalues must you check before declaring the implementation wrong?
12.7 Okay, so —
Inherited: reverse accumulation supplies derivative programs, while Act I supplies the language for spectra and operator probes.
Changed: “the curvature” became a declared object with an averaging distribution, representation, and consumer.
Instrumented: the same loss and data produced an indefinite Hessian, a positive-semidefinite GGN/model Fisher, and a different empirical Fisher; an action-only power iteration recovered the signed dominant-magnitude mode.
Established: the Hessian splits into GGN plus model curvature; the Fisher identity requires a model expectation and regularity; dense Hessians are unnecessary when the diagnostic needs only \(\matr{H}\vect{v}\); forming \(\matr{J}^{\mathsf T}\matr{J}\) squares \(\matr{J}\)’s spectral condition number when \(\matr{J}\) has full column rank.
Unresolved: Even with the curvature object named, when does a stochastic gradient estimator predict descent rather than noise-dominated motion?
12.8 Sources and further reading
The matrix-free Hessian–vector identity and its implementation boundaries follow Pearlmutter (1994). The distinctions among the Hessian, generalized Gauss–Newton matrix, Fisher information, and empirical Fisher are checked against Martens (2020) and Kunstner et al. (2019). The inferential interpretation of conjugate gradients follows Hennig (2015); the quasi-Newton branch follows Hennig and Kiefel (2013). The normal-equations precision boundary follows the singular-value calculation on the page and the numerical linear algebra contract in Higham (2002). The ICML probabilistic-numerics tutorial supplied an intellectual seam, not the technical authority for these claims.
Reading order. Start with Martens (2020) and Kunstner et al. (2019) to name the curvature object, use Pearlmutter (1994) for action-only computation, and then read Hennig (2015) or Hennig and Kiefel (2013) for the bounded inferential branches.
12.9 Exercises
(Pencil.) Starting from Equation 12.1, derive all four numbers in Equation 12.2. Then replace \(y=1\) with \(y=0\) without changing \(w\). Which quantities change, and which remain fixed?
(Pencil.) Give a scalar example in which the model-curvature term \(\matr{R}\) in Equation 12.5 is positive. Explain why this disproves the claim that GGN merely deletes negative Hessian curvature.
(Code.) Replace the two-parameter witness by a small nonlinear model. Implement Hessian and GGN actions, then use the same Lanczos or power iteration driver on both. Report the signed extremal Ritz values and an operator-residual check.
(Code.) For Bernoulli logits, simulate labels from the current model and average observed-label score outer products. Show convergence toward the model Fisher, then repeat with labels from a misspecified distribution.
(Audit.) Paper audit: Select a paper that reports a Fisher, GGN, or Hessian spectrum. Complete the Mathematical object, Estimator and comparison contract, Evidence culture and interface, Assumption stress test, and Transfer verdict fields. Identify the expectation implemented by the code, whether the reported matrix is exact or approximated, and which conclusion would fail if the object were replaced by the empirical Fisher.
Hennig, Philipp. 2015. “Probabilistic Interpretation of Linear Solvers.”SIAM Journal on Optimization 25 (1): 234–60. https://doi.org/10.1137/140955501.
Higham, Nicholas J. 2002. Accuracy and Stability of Numerical Algorithms. 2nd ed. Society for Industrial; Applied Mathematics. https://doi.org/10.1137/1.9780898718027.
Martens, James. 2020. “New Insights and Perspectives on the Natural Gradient Method.”Journal of Machine Learning Research 21 (146): 1–76. https://www.jmlr.org/papers/v21/17-678.html.