Phiacta
ExplorePostDocsGuidesContributingAbout

Phiacta

The knowledge backend.

Contact Us
ExploreInduced-Metric Optimizer: Off-Diagonal Metric

Induced-Metric Optimizer: Off-Diagonal Metric

Induced-metric optimizer with non-zero off-diagonal blocks in the ambient metric: h = [[γI, a], [bᵀ, 1]]. The pullback becomes G = γI + ξ(alᵀ + lbᵀ + llᵀ) where l, a, b can be gradient, momentum, parameters, or zero. Inverse via rank-2 Woodbury or Sherman-Morrison. Setting a=b=l recovers the original metric.

ContentIssuesEditsHistoryFilesReferences3

Off-Diagonal Induced Metric

The induced metric is derived from a particular ambient inner product on RN+1\mathbb{R}^{N+1}RN+1: block-diagonal, h=diag(γIN,ξ)h = \mathrm{diag}(\gamma I_N, \xi)h=diag(γIN​,ξ). Parameter space and the loss dimension are orthogonal in the ambient view. There is no geometric reason for this choice, and dropping the orthogonality assumption yields a strictly more expressive family of optimizers.

This entry derives the metric, the inverse via Woodbury, the resulting update rule, the combinatorial space of design choices, and the empirical results on MNIST MLP. The headline empirical finding is that the off-diagonal variant beats Adam on best-run accuracy but is dominated by the learnable diagonal on both best and median, suggesting that per-parameter adaptation matters more than off-diagonal coupling at the tested scale.

1. The off-diagonal ambient metric

Replace the block-diagonal ambient metric with

h=(γINξ aξ b⊤ξ),h = \begin{pmatrix} \gamma I_N & \xi\, a \\ \xi\, b^\top & \xi \end{pmatrix},h=(γIN​ξb⊤​ξaξ​),

where a,b∈RNa, b \in \mathbb{R}^Na,b∈RN are vectors that introduce off-diagonal coupling between parameter space and the loss dimension. The factor ξ\xiξ scales the entire loss-dimension block. When a=b=0a = b = 0a=b=0, h=diag(γIN,ξ)h = \mathrm{diag}(\gamma I_N, \xi)h=diag(γIN​,ξ), the original ambient metric, and we recover the standard induced metric.

The embedding is unchanged: φ(θ)=(θ,L(θ))\varphi(\theta) = (\theta, L(\theta))φ(θ)=(θ,L(θ)) with Jacobian J=(IN; ∇L⊤)⊤J = \bigl(I_N;\, \nabla L^\top\bigr)^\topJ=(IN​;∇L⊤)⊤. The pullback metric is

Gij=γ δij+ξ(ai ∂jL+∂iL bj+∂iL ∂jL),G_{ij} = \gamma\,\delta_{ij} + \xi\bigl(a_i\, \partial_j L + \partial_i L\, b_j + \partial_i L\, \partial_j L\bigr),Gij​=γδij​+ξ(ai​∂j​L+∂i​Lbj​+∂i​L∂j​L),

which in matrix form, writing ℓ=∇L\ell = \nabla Lℓ=∇L, is

G=γI+ξ(a ℓ⊤+ℓ b⊤+ℓ ℓ⊤).G = \gamma I + \xi\bigl(a\,\ell^\top + \ell\, b^\top + \ell\,\ell^\top\bigr).G=γI+ξ(aℓ⊤+ℓb⊤+ℓℓ⊤).

This is a rank-two perturbation of γI\gamma IγI in general, rank-one when a=0a = 0a=0 or b=0b = 0b=0, and rank-zero (returning to γI\gamma IγI) when a=b=0a = b = 0a=b=0 and ℓ=0\ell = 0ℓ=0. The structure a ℓ⊤+ℓ b⊤a\,\ell^\top + \ell\, b^\topaℓ⊤+ℓb⊤ is a sum of outer products with a shared vector ℓ\ellℓ, which keeps the inverse tractable.

2. The inverse via Woodbury

Decompose G=γI+ξ UV⊤G = \gamma I + \xi\, U V^\topG=γI+ξUV⊤ with

U=(aℓ)∈RN×2,V=(ℓb+ℓ)∈RN×2.U = \begin{pmatrix} a & \ell \end{pmatrix} \in \mathbb{R}^{N \times 2}, \qquad V = \begin{pmatrix} \ell & b + \ell \end{pmatrix} \in \mathbb{R}^{N \times 2}.U=(a​ℓ​)∈RN×2,V=(ℓ​b+ℓ​)∈RN×2.

The Woodbury identity gives

G−1=1γ ⁣(I−ξγ U (I2+ξγ V⊤U)−1 V⊤).G^{-1} = \frac{1}{\gamma}\!\left(I - \frac{\xi}{\gamma}\, U\,\bigl(I_2 + \tfrac{\xi}{\gamma}\, V^\top U\bigr)^{-1}\, V^\top\right).G−1=γ1​(I−γξ​U(I2​+γξ​V⊤U)−1V⊤).

The inner matrix M=I2+ξγ V⊤UM = I_2 + \tfrac{\xi}{\gamma}\, V^\top UM=I2​+γξ​V⊤U is 2×22 \times 22×2. Writing α=ξ/γ\alpha = \xi/\gammaα=ξ/γ for brevity,

M=(1+α ⟨ℓ,a⟩α ∥ℓ∥2α ⟨b+ℓ,a⟩1+α ⟨b+ℓ,ℓ⟩).M = \begin{pmatrix} 1 + \alpha\,\langle \ell, a\rangle & \alpha\,\lVert \ell\rVert^2 \\ \alpha\,\langle b + \ell, a\rangle & 1 + \alpha\,\langle b + \ell, \ell\rangle \end{pmatrix}.M=(1+α⟨ℓ,a⟩α⟨b+ℓ,a⟩​α∥ℓ∥21+α⟨b+ℓ,ℓ⟩​).

The inverse uses Cramer's rule: compute det⁡(M)=M11M22−M12M21\det(M) = M_{11} M_{22} - M_{12} M_{21}det(M)=M11​M22​−M12​M21​ and four dot products (⟨ℓ,a⟩\langle \ell, a\rangle⟨ℓ,a⟩, ∥ℓ∥2\lVert \ell\rVert^2∥ℓ∥2, ⟨b+ℓ,a⟩\langle b + \ell, a\rangle⟨b+ℓ,a⟩, ⟨b+ℓ,ℓ⟩\langle b + \ell, \ell\rangle⟨b+ℓ,ℓ⟩). When ∣det⁡(M)∣<10−8\lvert\det(M)\rvert < 10^{-8}∣det(M)∣<10−8 the metric is near-singular and the implementation falls back to identity scaling to avoid numerical instability.

The total cost per step is dominated by the dot products and the matrix-vector products U⊤ (vector)U^\top\,\text{(vector)}U⊤(vector) and V⊤ (vector)V^\top\,\text{(vector)}V⊤(vector), all of which are O(N)O(N)O(N). No matrix factorisation of GGG itself is required.

Special cases.

  • a=0a = 0a=0: G=γI+ξ ℓ (b+ℓ)⊤G = \gamma I + \xi\,\ell\,(b + \ell)^\topG=γI+ξℓ(b+ℓ)⊤ is rank-one. The Sherman-Morrison identity applies directly.
  • b=0b = 0b=0: G=γI+ξ (a+ℓ) ℓ⊤G = \gamma I + \xi\,(a + \ell)\,\ell^\topG=γI+ξ(a+ℓ)ℓ⊤ is rank-one. Sherman-Morrison applies directly.
  • Both nonzero: full rank-two Woodbury with Cramer's rule.

3. The combinatorial design space

The three vectors in the off-diagonal metric (ℓ\ellℓ, aaa, bbb) can each be set to one of several observables available at each step. The naming convention uses the pair (a,b)(a, b)(a,b).

ChoiceVectorInterpretation
zero000drops that off-diagonal term
gradientgtg_tgt​current minibatch gradient
momentumm^t\hat m_tm^t​bias-corrected momentum (smoothed gradient)
parametersθt\theta_tθt​current parameter values

Three "modes" are exposed per vector (aaa, bbb, and the base direction ℓ\ellℓ), giving 43=644^3 = 6443=64 combinations in principle. The implementation registers the most physically motivated subset, with bbb defaulting to "same as aaa" to reduce the combinatorial explosion. The remaining sweep dimensions are a∈{gradient,momentum,zero}a \in \{\text{gradient}, \text{momentum}, \text{zero}\}a∈{gradient,momentum,zero} with b=ab = ab=a, plus the base ℓ\ellℓ (typically the gradient).

4. Why the choices matter: the role of aaa vs bbb, and what kind of object GGG is

The expression

G=γI+ξ(a ℓ⊤+ℓ b⊤+ℓ ℓ⊤)G = \gamma I + \xi\bigl(a\,\ell^\top + \ell\, b^\top + \ell\,\ell^\top\bigr)G=γI+ξ(aℓ⊤+ℓb⊤+ℓℓ⊤)

is not symmetric unless a=ba = ba=b. Direct check: the antisymmetric part is

Gij−Gji=ξ[(ai−bi) ℓj−(aj−bj) ℓi],G_{ij} - G_{ji} = \xi\bigl[(a_i - b_i)\,\ell_j - (a_j - b_j)\,\ell_i\bigr],Gij​−Gji​=ξ[(ai​−bi​)ℓj​−(aj​−bj​)ℓi​],

which is nonzero whenever a−ba - ba−b is not parallel to ℓ\ellℓ. A concrete counterexample: with a=(1,0)a = (1, 0)a=(1,0), b=(0,1)b = (0, 1)b=(0,1), ℓ=(1,1)\ell = (1, 1)ℓ=(1,1), γ=ξ=1\gamma = \xi = 1γ=ξ=1, the formula gives G=(3313)G = \bigl(\begin{smallmatrix} 3 & 3 \\ 1 & 3 \end{smallmatrix}\bigr)G=(31​33​), which is not symmetric.

Two consequences need to be acknowledged explicitly, because they bear on how the construction should be interpreted.

(i) For a=ba = ba=b, the construction is a pullback bilinear form that is symmetric, but symmetry alone is not enough. A Riemannian metric also requires positive-definiteness. The ambient h=(γIξaξa⊤ξ)h = \begin{pmatrix}\gamma I & \xi a \\ \xi a^\top & \xi\end{pmatrix}h=(γIξa⊤​ξaξ​) is symmetric when a=ba = ba=b. It is positive-definite iff γ>0\gamma > 0γ>0, ξ>0\xi > 0ξ>0, and the Schur complement is positive: ξ−ξ2 a⊤(γI)−1a>0\xi - \xi^2\,a^\top (\gamma I)^{-1} a > 0ξ−ξ2a⊤(γI)−1a>0, which under γ,ξ>0\gamma, \xi > 0γ,ξ>0 reduces to ξ⋅∥a∥2<γ\xi \cdot \lVert a\rVert^2 < \gammaξ⋅∥a∥2<γ (in the scalar-γ\gammaγ case). When this fails the ambient bilinear form is indefinite, and the pullback GGG can be indefinite as well. The Christoffel symbols, geodesics, and the geodesic convexity machinery apply when all three conditions hold.

(ii) For a≠ba \ne ba=b, the construction is a non-symmetric bilinear form rather than a metric. The "update rule" δθ=−η G−1∇L\delta\theta = -\eta\,G^{-1} \nabla Lδθ=−ηG−1∇L is still well defined whenever GGG is invertible, but the resulting flow is not a Riemannian gradient flow. It is a preconditioned gradient descent with a non-symmetric preconditioner. There is no Riemannian Hessian, no notion of geodesic convexity, and no second-fundamental-form interpretation.

This is the honest framing. The empirical asymmetry between (a,b)=(momentum,gradient)(a, b) = (\mathrm{momentum}, \mathrm{gradient})(a,b)=(momentum,gradient) and (a,b)=(gradient,momentum)(a, b) = (\mathrm{gradient}, \mathrm{momentum})(a,b)=(gradient,momentum) reported in Section 6 is not a feature of the geometry; it is a feature of the non-symmetric preconditioner. When swapping aaa and bbb the preconditioner GGG is replaced by its transpose, which produces a different update rule. The transpose has the same eigenvalues as GGG but acts on the gradient differently in a way that depends on the gradient's specific direction.

Empirically (Section 6), the asymmetry is large enough that the a≠ba \ne ba=b variants are worth keeping as engineering tools. Their theoretical status is more constrained than the symmetric case, and any claims that invoke the geodesic-convexity framework must restrict to a=ba = ba=b.

5. Three structural identities

5.1 a=b=ℓa = b = \ella=b=ℓ recovers the rank-one metric

Setting a=b=ℓa = b = \ella=b=ℓ (both off-diagonal vectors equal to the base direction) gives

G=γI+ξ (ℓ ℓ⊤+ℓ ℓ⊤+ℓ ℓ⊤)=γI+3ξ ℓ ℓ⊤.G = \gamma I + \xi\,(\ell\,\ell^\top + \ell\,\ell^\top + \ell\,\ell^\top) = \gamma I + 3\xi\,\ell\,\ell^\top.G=γI+ξ(ℓℓ⊤+ℓℓ⊤+ℓℓ⊤)=γI+3ξℓℓ⊤.

This is the original induced metric, with ξ\xiξ rescaled to 3ξ3\xi3ξ. The rank-one metric is therefore recovered at two points in the (a,b)(a, b)(a,b) design space: trivially at a=b=0a = b = 0a=b=0 (with ξ\xiξ), and along the aligned diagonal a=b=ℓa = b = \ella=b=ℓ (with 3ξ3\xi3ξ).

5.2 Coupled routing of an externally-added regulariser

Given that one has added an L2 regulariser to the loss, the continuous-time Riemannian flow routes the resulting decay step through G−1G^{-1}G−1: the decay term θi\theta^iθi is contravariant (parameter-direction) while the metric GijG_{ij}Gij​ is covariant (cotangent direction), and the natural flow contracts them, giving a step −ηλG−1θ-\eta\lambda G^{-1}\theta−ηλG−1θ. This is a consequence of index placement, not a design choice — given the regulariser. The metric itself does not generate the decay; it determines how an externally-added decay is routed.

The current implementations use decoupled weight decay (AdamW-style) for practical reasons: the decay is added separately, outside G−1G^{-1}G−1. The Riemannian-correct version is implementable but has not been swept. Whether coupled weight decay would help in practice is an open question; the small-batch implicit-regularisation literature on AdamW suggests the answer is non-obvious and benchmark-dependent.

This section is about routing of an externally-added regulariser. It is logically distinct from §5.3 below, which is about a θ\thetaθ-direction term that the metric itself introduces into the update — with no regulariser added — when the params mode is selected for aaa. The two phenomena have opposite signs and are easy to conflate.

5.3 The params mode introduces structural anti-decay

When aaa is set to θ\thetaθ (the params mode of Appendix B), the metric explicitly depends on θ\thetaθ, and the update δθ=−ηG−1ℓ\delta\theta = -\eta G^{-1}\ellδθ=−ηG−1ℓ acquires a θ\thetaθ-direction component for free. The structural fact, from the Woodbury form G=γI+ξ UV⊤G = \gamma I + \xi\,U V^\topG=γI+ξUV⊤ with U=(a,ℓ)U = (a,\ell)U=(a,ℓ) and V=(ℓ,b+ℓ)V = (\ell, b+\ell)V=(ℓ,b+ℓ):

G−1ℓ∈span(a,ℓ).G^{-1}\ell \in \mathrm{span}(a, \ell).G−1ℓ∈span(a,ℓ).

The output is a linear combination of the columns of UUU. Therefore a θ\thetaθ-direction component in the update appears iff a=θa = \thetaa=θ. Setting b=θb = \thetab=θ alone puts θ\thetaθ into VVV, where it only multiplies things and never appears as an output direction. The role of aaa and bbb is asymmetric in a sharper way than §4's antisymmetric-part argument captures.

When a=θa = \thetaa=θ, the coefficient of θ\thetaθ in δθ\delta\thetaδθ works out to

+η α ∥ℓ∥2γ det⁡M,+\eta\,\frac{\alpha\,\lVert\ell\rVert^2}{\gamma\,\det M},+ηγdetMα∥ℓ∥2​,

where M=I2+(ξ/γ) V⊤UM = I_2 + (\xi/\gamma)\,V^\top UM=I2​+(ξ/γ)V⊤U is the inner 2×22\times 22×2 matrix from §2 and α\alphaα is the corresponding coefficient of ℓ\ellℓ in G−1ℓG^{-1}\ellG−1ℓ. In the positive-definite regime (det⁡M>0\det M > 0detM>0, which is exactly the condition under which GGG is a Riemannian metric), this coefficient is strictly positive: the update adds a positive multiple of θ\thetaθ, producing weight growth, not decay. The sign can only flip outside the PD regime, where the construction is no longer a Riemannian metric.

Combined with AdamW-style decoupled decay −ηλθ-\eta\lambda\theta−ηλθ, the effective weight-decay coefficient becomes

λeff=λ−α ∥ℓ∥2γ det⁡M.\lambda_{\mathrm{eff}} = \lambda - \frac{\alpha\,\lVert\ell\rVert^2}{\gamma\,\det M}.λeff​=λ−γdetMα∥ℓ∥2​.

Across the sweep bounds in Appendix A (λ≤10−1\lambda \le 10^{-1}λ≤10−1, ξ/γ\xi/\gammaξ/γ reaching 10510^5105), the structural anti-decay term typically dominates the configured decay, so the a=θa = \thetaa=θ variants effectively run with net weight growth. The empirical signature is documented in §6.1.

The detailed derivation lives in notebooks/params-mode-analysis.nb.

6. Results on MNIST MLP

Setup: 2-layer MLP (784, 64, 64, 10), 200 epochs, batch size 1024, 5 trials per configuration with Optuna. The same sweep ranges as the project MNIST MLP sweep (Appendix A).

(Provenance: the 5-trial figures in the table below come from a one-off local run recorded in notes/offdiag-benchmark-results.md. The 1000-trial sweep numbers cited in §6.1 are from the project MNIST MLP sweep, results/mnist_mlp/.)

Configuration (a,b)(a, b)(a,b)BestMeanNotes
a=momentum, b=gradienta = \mathrm{momentum},\, b = \mathrm{gradient}a=momentum,b=gradient96.63%94.03%most consistent
a=gradient, b=momentuma = \mathrm{gradient},\, b = \mathrm{momentum}a=gradient,b=momentum96.43%86.20%1 of 5 trials diverged (57.26%)
a=b=loss  gradienta = b = \mathrm{loss\;gradient}a=b=lossgradient91.42%91.42%only 1 trial
sgd_learn_diag (best baseline)97.99%n/abest peak overall
sgd_metric (rank-one)97.98%n/aclose second
Adam95.89%95.2%most consistent baseline

Three observations.

  1. Off-diagonal beats Adam on peak in this small probe, and the 1000-trial sweep agrees on best but not on robustness. In this 5-trial sweep, both (m,g)(m, g)(m,g) and (g,m)(g, m)(g,m) achieve higher peak accuracy than Adam (96.63%96.63\%96.63% and 96.43%96.43\%96.43% vs 95.89%95.89\%95.89%). The improvement is modest (0.540.540.54 to 0.740.740.74 percentage points). The genuinely rank-two 1000-trial sweep (§6.1) gives both orderings a best of 98.27%98.27\%98.27%, slightly above Adam's 98.09%98.09\%98.09% on the same sweep; the means collapse to 54.79%54.79\%54.79% for (m,g)(m, g)(m,g) and 48.74%48.74\%48.74% for (g,m)(g, m)(g,m), well below Adam's 72.69%72.69\%72.69%. The ceiling claim survives the larger sweep; the robustness claim does not.

  2. The asymmetry is large. (a=momentum,b=gradient)(a = \mathrm{momentum}, b = \mathrm{gradient})(a=momentum,b=gradient) achieves a mean of 94.03%94.03\%94.03% across 5 trials. The reversed (a=gradient,b=momentum)(a = \mathrm{gradient}, b = \mathrm{momentum})(a=gradient,b=momentum) has a mean of 86.20%86.20\%86.20% because one trial of five diverged to 57.26%57.26\%57.26%. The other four trials of the reversed configuration are in the 90%90\%90% to 96%96\%96% range, comparable to the forward configuration. The conclusion is that the choice of which observable plays the "direction" role and which plays the "cogradient" role matters substantially for training stability.

  3. Off-diagonal is dominated by the learnable diagonal at this scale. The best learnable diagonal run (97.99%97.99\%97.99%) is 1.41.41.4 percentage points above the best off-diagonal run (96.63%96.63\%96.63%). The off-diagonal variant adds rank-two correction to the ambient metric but does not give each parameter its own scale factor. The result suggests that per-parameter adaptation matters more than off-diagonal coupling for this task, although a fair direct comparison would require matching the sweep budget (5 trials for off-diagonal versus 1000 for learn-diag).

Off-diagonal asymmetry from the 1000-trial MNIST MLP sweep (itr_4, n=1000 each). The two operator orderings give different final-accuracy distributions: (a,b)=(m,g) (sgd_offdiag_m_l, mean 54.79\%) is more robust than the reversed (a,b)=(g,m) (sgd_offdiag_l_m, mean 48.74\%), which has more low-accuracy divergent trials.

6.1 The 1000-trial sweep

The project 1000-trial MNIST MLP sweep (results/mnist_mlp/, itr_4, sweep ranges as in Appendix A) covers every registered off-diagonal variant. The three rows that bear on the rank-two construction:

Variant(a,b)(a, b)(a,b)BestMedianMeanWorst
sgd_offdiag_m_l(momentum,grad)(\mathrm{momentum}, \mathrm{grad})(momentum,grad)98.27%57.77%54.79%4.78%
sgd_offdiag_l_m(grad,momentum)(\mathrm{grad}, \mathrm{momentum})(grad,momentum)98.27%40.34%48.74%4.99%
sgd_offdiag_l_l*(grad,grad)(\mathrm{grad}, \mathrm{grad})(grad,grad)98.37%41.48%49.72%4.42%

Baselines in the same sweep: Adam best 98.09%98.09\%98.09% / median 94.73%94.73\%94.73% / mean 72.69%72.69\%72.69%; SGD 98.04%98.04\%98.04% / 78.19%78.19\%78.19% / 58.43%58.43\%58.43%; Muon 98.39%98.39\%98.39% / 93.73%93.73\%93.73% / 70.53%70.53\%70.53%.

Three structural reads.

  1. The (m,g)/(g,m)(m,g) / (g,m)(m,g)/(g,m) asymmetry persists at scale. Both orderings hit the same best (98.27%98.27\%98.27%), but the median and mean differ by ≈17{\approx}17≈17 and ≈6{\approx}6≈6 percentage points, with (g,m)(g, m)(g,m) producing the longer left tail. This matches the qualitative signal from the 5-trial probe in Section 6 and shows the asymmetry is not a small-sample artefact.

  2. sgd_offdiag_l_l is not a genuinely off-diagonal experiment (the * row). Per §5.1, a=b=ℓa = b = \ella=b=ℓ collapses the construction to the rank-one induced metric with ξ→3ξ\xi \to 3\xiξ→3ξ. Its 1000-trial best of 98.37%98.37\%98.37% measures the rank-one metric with a particular ξ\xiξ scaling, not the rank-two mechanism, and should not be cited as evidence for the latter.

  3. The params-mode collapse asymmetry matches §5.3. Aggregating over the full set of registered variants, the divergent-trial rate (final accuracy <10%< 10\%<10%) separates cleanly by where θ\thetaθ appears in (a,b)(a, b)(a,b):

    GroupTrialsCollapse rate
    a=θa = \thetaa=θ (4 variants)400035.6%
    b=θb = \thetab=θ, a≠θa \ne \thetaa=θ (3 variants)300019.4%
    no θ\thetaθ (8 variants)800019.9%

    The a=θa = \thetaa=θ group collapses at nearly double the rate of the no-θ\thetaθ control; the b=θb = \thetab=θ group is statistically indistinguishable from it. This is the exact signature predicted by §5.3: a=θa = \thetaa=θ activates the structural anti-decay term (whose magnitude scales with ∥g∥2\lVert g\rVert^2∥g∥2 and so amplifies divergent trials), b=θb = \thetab=θ alone does not.

The ceiling story for the genuinely rank-two variants holds in the larger sweep (98.27%98.27\%98.27% vs Adam 98.09%98.09\%98.09%), but the robustness gap is in the same direction as the other learnable-metric variants across the sweep: high best, low median, high hyperparameter sensitivity.

7. Position within the design space

The off-diagonal generalisation sits at one end of a hierarchy of extensions to the original rank-one induced metric.

VariantAmbient metric structurePullback rankParameter state
Original (rank-one)diag(γI,ξ)\mathrm{diag}(\gamma I, \xi)diag(γI,ξ)rank-one perturbationnone
Scalar learnablediag(esI,ξ)\mathrm{diag}(e^s I, \xi)diag(esI,ξ)rank-one perturbation111 (scalar sss)
Diagonal learnablediag(diag(esi),ξ)\mathrm{diag}(\mathrm{diag}(e^{s_i}), \xi)diag(diag(esi​),ξ)rank-one perturbationNNN (vector sss)
Off-diagonal (this entry)[γIξaξb⊤ξ]\bigl[\begin{smallmatrix}\gamma I & \xi a \\ \xi b^\top & \xi\end{smallmatrix}\bigr][γIξb⊤​ξaξ​]rank-two perturbation000 (vectors a,ba, ba,b are observables)
Output embedding (KFAC)diag(IN,ξ Σ)\mathrm{diag}(I_N, \xi\, \Sigma)diag(IN​,ξΣ), with CCC-dim outputrank-CCC perturbation (J⊤ΣJJ^\top \Sigma JJ⊤ΣJ)none

The off-diagonal variant occupies a niche: it raises the perturbation rank from one to two without introducing learnable per-parameter state, by using observables (gtg_tgt​, m^t\hat m_tm^t​, θt\theta_tθt​) as the off-diagonal vectors. This is structurally distinct from the learnable-diagonal direction, which keeps the perturbation rank at one but adds NNN learnable scalars.

Design space: rank of metric perturbation vs learnable state dimension

A head-to-head between "more rank" (off-diagonal) and "more state" (learnable diagonal) at matched 1000-trial budget on MNIST MLP: the state-rich variants win on best (sgd_learn_diag 98.41%98.41\%98.41% vs the rank-two off-diagonal best of 98.27%98.27\%98.27%) and dominate on median (86.57%86.57\%86.57% vs 57.77%57.77\%57.77% for (m,g)(m,g)(m,g)). Whether off-diagonal becomes competitive at larger model sizes where the per-parameter overhead of learnable diagonal becomes prohibitive is open.

8. Connection to the broader curvature framework

Restricting to the symmetric case a=ba = ba=b (Section 4), the off-diagonal construction is a genuine pullback metric, and the geodesic convexity machinery applies. Two further structural facts.

First, aaa and bbb are observables (functions of the gradient, momentum, or parameters), not learnable parameters with their own update rule. The metric is therefore parameter-dependent through a(θ)a(\theta)a(θ), b(θ)b(\theta)b(θ), and ℓ(θ)\ell(\theta)ℓ(θ), but not through any auxiliary state. Working out the Christoffel symbols for this θ\thetaθ-dependence is more involved than the loss-embedding case (where only ℓ\ellℓ depends on θ\thetaθ): the bracket carries contributions from ∂ka\partial_k a∂k​a and ∂kb\partial_k b∂k​b as well as ∂kℓ\partial_k \ell∂k​ℓ. The full derivation has not been carried out in the geodesic convexity entry; its Appendix B treats only the fixed off-diagonal case (constant aaa, bbb) for the symmetric subset.

Second, in the constant-a=ba = ba=b case (and assuming the Schur condition above so that the construction is actually a Riemannian metric), the off-diagonal correction contributes terms proportional to HHH in the Riemannian Hessian. The eigenvalue-sign structure of HHH is preserved up to a possible global flip if the proportionality scalar happens to be negative (a global flip exchanges minima and maxima but does not turn an indefinite Hessian into a definite one). In that case the off-diagonal metric is in the same theoretical class as the rank-one fixed metric: it cannot convert a non-convex landscape into a geodesically convex one.

The variable-a=a(θ)a = a(\theta)a=a(θ) case is open. Off-diagonal vectors that themselves depend on θ\thetaθ in principle add Christoffel-symbol corrections that could in principle change the eigenvalue structure. Whether they do is a calculation not yet completed.

The learnable diagonal variant, by contrast, sits in Level 2 of the geodesic convexity hierarchy and provably flips eigenvalue signs. This is one structural reason why the learnable diagonal dominates the off-diagonal variant empirically at the MNIST MLP scale: a richer and proven class of curvature corrections is available.

9. Implementation notes

The canonical implementation in repo/optimisers/jax_offdiag.py (custom_sgd_offdiag) handles the rank-two Woodbury inverse with a 2×22 \times 22×2 Cramer's-rule solve and a near-singular fallback, and applies AdamW-style decoupled weight decay outside G−1G^{-1}G−1.

The sweep treats γ\gammaγ, ξ\xiξ, learning rate, momentum, and weight decay as free hyperparameters (Appendix A), along with the categorical base_mode and use_momentum_for_update. Earlier prototypes fixed γ=1\gamma = 1γ=1 on the grounds that the effective metric strength is ξ/γ\xi/\gammaξ/γ, but the registered sweep keeps both free.

Sweep coverage caveat for the params variants. Per §5.3, when a=θa = \thetaa=θ the metric itself contributes a θ\thetaθ-direction term to the update with effective coefficient −α∥ℓ∥2/(γdet⁡M)-\alpha\lVert\ell\rVert^2/(\gamma\det M)−α∥ℓ∥2/(γdetM) (anti-decay). Across the swept volume in Appendix A (λ≤10−1\lambda \le 10^{-1}λ≤10−1, ξ/γ\xi/\gammaξ/γ reaching 10510^5105), this structural term typically dominates the configured weight_decay, so the net weight-decay coefficient λeff\lambda_{\mathrm{eff}}λeff​ is usually negative for the sgd_offdiag_theta_* variants. The sweep therefore does not meaningfully exercise a net-decay regime for these four variants; reaching one would require either widening the weight_decay upper bound or restricting (ξ,γ)(\xi, \gamma)(ξ,γ) ranges.

10. What stays open

  1. Asymmetry mechanism. The aaa-vs-bbb asymmetry has two distinguishable pieces. For variants involving the params mode, §5.3 gives a clean mechanistic explanation: a=θa = \thetaa=θ activates a structural anti-decay term scaling with ∥g∥2\lVert g\rVert^2∥g∥2, b=θb = \thetab=θ alone activates nothing, and the §6.1 collapse-rate signature confirms this. For variants between (momentum,gradient)(\mathrm{momentum}, \mathrm{gradient})(momentum,gradient) and (gradient,momentum)(\mathrm{gradient}, \mathrm{momentum})(gradient,momentum), the divergence between configurations is empirically large but not mechanistically pinned down. The natural hypothesis is that the variance properties of a ℓ⊤a\,\ell^\topaℓ⊤ vs ℓ b⊤\ell\, b^\topℓb⊤ differ when aaa is the momentum (low variance) versus the gradient (high variance), but this has not been tested with a controlled-variance experiment.

  2. Coupled weight decay. The Riemannian-correct decay (passed through G−1G^{-1}G−1) has not been swept against the AdamW-style decoupled decay. A direct test would clarify whether the structural coupling is empirically beneficial.

  3. Scaling to larger models. The MNIST MLP results suggest that learnable diagonal dominates off-diagonal at this scale. Whether off-diagonal becomes competitive at scales where the NNN-dimensional learnable state of sgd_learn_diag becomes a memory or stability bottleneck is open.

  4. Combination with learnable diagonal. The off-diagonal mechanism and the learnable diagonal mechanism are structurally orthogonal: one raises the ambient-metric rank, the other adds learnable per-parameter state. A combined variant has not been registered. The closest registered variant is sgd_offdiag_l_l (off-diagonal with a=b=loss gradienta = b = \mathrm{loss\,gradient}a=b=lossgradient), which does not include the learnable diagonal.

Appendix A. Sweep configuration details

The MNIST MLP 1000-trial sweep uses the unified hyperparameter bounds from repo/parameters/optimizer_registry.py (single source of truth for both the Optuna and W&B backends). The same bounds apply to every registered off-diagonal variant; there are no per-task overrides. The ranges are confirmed against the raw itr_4 configs.

ParameterRangeScale
learning_rate[10−6,101][10^{-6}, 10^{1}][10−6,101]log-uniform
momentum[0,0.99][0, 0.99][0,0.99]uniform
xi (ξ\xiξ)[10−3,101][10^{-3}, 10^{1}][10−3,101]log-uniform
gamma (γ\gammaγ)[10−4,101][10^{-4}, 10^{1}][10−4,101]log-uniform
weight_decay[10−6,10−1][10^{-6}, 10^{-1}][10−6,10−1]log-uniform
base_mode{grad,momentum}\{\mathrm{grad}, \mathrm{momentum}\}{grad,momentum}categorical
use_momentum_for_update{True,False}\{\mathrm{True}, \mathrm{False}\}{True,False}categorical

The (a,b)(a, b)(a,b) pair is fixed per variant rather than swept inside an Optuna trial: e.g. sgd_offdiag_m_l is (a,b)=(momentum,grad)(a, b) = (\mathrm{momentum}, \mathrm{grad})(a,b)=(momentum,grad), sgd_offdiag_l_m is (grad,momentum)(\mathrm{grad}, \mathrm{momentum})(grad,momentum), sgd_offdiag_l_l is (grad,grad)(\mathrm{grad}, \mathrm{grad})(grad,grad). The full set of 16 registered (a,b)(a, b)(a,b) pairs (each over {0,grad,momentum,params}2\{0, \mathrm{grad}, \mathrm{momentum}, \mathrm{params}\}^2{0,grad,momentum,params}2 minus the redundant (0,0)(0, 0)(0,0)) is enumerated in repo/parameters/optimizer_registry.py; each is a separate Optuna study with the bounds above.

Appendix B. Mode semantics

The four modes for the off-diagonal vector aaa (and bbb) correspond to the following physical observables.

ModeVectorCaptures
momentumm^t\hat m_tm^t​smoothed gradient direction
gradgtg_tgt​current minibatch gradient direction
paramsθt\theta_tθt​current parameter values
zero000drops the a ℓ⊤a\,\ell^\topaℓ⊤ term

With b=ab = ab=a (the default in the sweep), the metric becomes

G=γI+ξ (a ℓ⊤+ℓ a⊤+ℓ ℓ⊤).G = \gamma I + \xi\,(a\,\ell^\top + \ell\, a^\top + \ell\,\ell^\top).G=γI+ξ(aℓ⊤+ℓa⊤+ℓℓ⊤).

The symmetric case a=b=ℓa = b = \ella=b=ℓ collapses to the rank-one metric with ξ→3ξ\xi \to 3\xiξ→3ξ (Section 5.1). The case a=0a = 0a=0 recovers the rank-one metric exactly. The case a∈{momentum,grad}a \in \{\mathrm{momentum}, \mathrm{grad}\}a∈{momentum,grad} with b=ab = ab=a is the substantive new symmetric variant. The params mode is qualitatively different: when a=θa = \thetaa=θ, the metric depends explicitly on the parameter, and the update acquires a θ\thetaθ-direction component for free (a structural anti-decay; see §5.3).

Appendix C. Connection to nondiag-preconditioner literature

The off-diagonal generalisation is related to but distinct from the broader "nondiag-preconditioner" literature on neural-network Hessians. The classical observation (see the scenic-route note nondiag-preconditioner-scenic-route.md in the project repository) is that neural-network Hessians have substantial off-diagonal mass, so any diagonal preconditioner is structurally limited. The off-diagonal metric here is a different construction: it adds off-diagonal terms to the ambient metric on RN+1\mathbb{R}^{N+1}RN+1, which pull back to the rank-two correction on parameter space. It does not address the off-diagonal entries of the Hessian directly; it constructs a different preconditioner.

The structural answer to off-diagonal Hessian mass is the Kronecker factorisation discussed in the pullback unification entry, which targets per-layer Kronecker structure H≈A⊗BH \approx A \otimes BH≈A⊗B. The off-diagonal variant here targets a different signal (correlations between parameter directions and the loss covector), and the two are complementary in principle.

Appendix D. Attached materials

The canonical optimiser and sweep code live in the project repository, not in this entry. This entry attaches only the figure-reproduction script and the symbolic-derivation notebooks.

Scripts (scripts/):

  • scripts/make_figures.py: reproduces every figure shown in this entry (PDF and PNG written to figures/). Reads the project-level results/mnist_mlp/sgd_offdiag_{m_l,l_m}/itr_4/run_*.csv.

Notebooks (notebooks/):

  • notebooks/off-diagonal-derivations.nb: Mathematica derivation and numerical sanity-checks for §§1-5.1 (pullback, Woodbury inverse, Sherman-Morrison limits, antisymmetric part, a=b=ℓ→3ξa = b = \ell \to 3\xia=b=ℓ→3ξ collapse).
  • notebooks/params-mode-analysis.nb: Mathematica derivation backing §5.3 — master Woodbury formula, the G−1ℓ∈span(a,ℓ)G^{-1}\ell \in \mathrm{span}(a,\ell)G−1ℓ∈span(a,ℓ) structural fact, numerical confirmation across all 15 non-trivial (a,b)(a,b)(a,b) mode pairs, closed-form θ\thetaθ-coefficient in δθ\delta\thetaδθ, sign analysis in and out of the PD regime, interaction with AdamW decoupled decay, and the 1000-trial collapse-rate summary feeding §6.1.

Canonical sources (in the project repository, not duplicated here):

  • repo/optimisers/jax_offdiag.py — custom_sgd_offdiag (the implementation referenced in §9, with decoupled weight decay).
  • repo/parameters/optimizer_registry.py — unified hyperparameter bounds and the enumeration of registered (a,b)(a, b)(a,b) variants (source of truth for Appendix A).
  • repo/parameters/sweep_mnist_mlp.py, sweep_cifar.sbatch, sweep_shake.sbatch — the Optuna / W&B sweep drivers.

References

  • Harvey, T. R. (2025). The optimiser hidden in plain sight: training with the loss landscape's induced metric. arXiv:2509.03594.
  • Sherman, J., Morrison, W. J. (1950). Adjustment of an inverse matrix corresponding to a change in one element of a given matrix. Annals of Mathematical Statistics 21, 124-127.
  • Woodbury, M. A. (1950). Inverting modified matrices. Memorandum Report 42, Statistical Research Group, Princeton.

Metadata

Type
method
Visibility
public
Published
Mar 27, 2026
Last updated
Jun 3, 2026

Tags

induced-metricJAXoff-diagonaloptimizerrank-2Woodbury