Induced-metric optimizer where the inverse metric γ⁻¹ = diag(exp(s)) is a learnable per-parameter diagonal, updated online each step. Each parameter gets its own scale factor exp(s_i), with mean-centering to avoid scale degeneracy with ξ. O(N) learnable state. Best peak accuracy on MNIST (97.99%).
The induced metric with a fixed base gives a uniform damping of the Euclidean step. The learnable scalar variant replaces the identity by for a single learnable scalar . The diagonal generalisation goes one step further: give every parameter its own learnable scale factor . This is the most expressive diagonal extension of the original framework, and the variant with the highest peak accuracy on the project's 1000-trial MNIST MLP sweep.
This entry derives the metric, the online learning rule, the Riemannian Hessian of the resulting (now -dependent) metric, the hierarchy among scalar and diagonal variants, the optimal curvature correction, the curvature-aware update rule, and the empirical results. The headline structural observation is that the learnable diagonal sits in the highest tier of the geodesic convexity hierarchy: it has enough degrees of freedom to flip eigenvalue signs of the Riemannian Hessian, which the scalar variant can do only when and the fixed metric cannot do at all. The headline empirical observation is that the variant's best-run accuracy is the highest on MNIST MLP but its median is well below Adam's, exposing a robustness gap that is the principal open problem.
Parameterise the inverse base metric by
where is a vector of per-parameter log-scale factors that evolves under its own learning rule (Section 4). Working in log space ensures positive-definiteness by construction. The induced metric becomes
Setting recovers the original induced metric with . The base metric is now -dependent through , which makes the Christoffel symbols nonzero and produces a curvature correction in the Riemannian Hessian (Section 3).
Sign convention for . This entry parameterises the inverse metric (equivalently, the preconditioner applied to the gradient): increasing inflates the preconditioner and increases the parameter step in direction . The geodesic convexity entry parameterises the metric itself (), so its has the opposite sign: increasing in that entry's convention means more metric weight and a smaller step in direction . The underlying object is the same; when porting a formula from there to here (or vice versa), substitute .
The preconditioned gradient is
each gradient component scaled by its own factor. The metric trace, which determines the global damping factor of the Sherman-Morrison denominator, is
This is where the global coupling enters: every parameter contributes to the single scalar , which determines the global scaling factor . A parameter with large and large gradient dominates the trace, and therefore influences the step size for every other parameter. Adam has no such mechanism: each Adam coordinate is scaled independently.
The full update is
where is the bias-corrected momentum and the last term is decoupled weight decay (AdamW-style; the Riemannian-correct coupled version is implementable but not what the production code uses).
Metric field versus trajectory state. The Riemannian Hessian formula below assumes that is an actual metric field on parameter space, i.e., that is a smooth function with well-defined Jacobian . In the online optimizer, is trajectory state updated step by step from observables; the Jacobian is not directly available, and there is no guarantee that the trajectory state is the value of some smooth global field at . The pointwise-feasibility analysis of geodesic convexity §4.3 makes this explicit: the SDP/Gershgorin theorems are statements about pointwise first-jet feasibility, not about a global metric field. The bridge from theory to optimizer is therefore: the theory tells us what kind of would help if it existed; the online rule produces a from local observables that approximates this in spirit; whether the produced is the Jacobian of any global is generally unknown and not strictly required for the optimizer to work.
When depends on , the Riemannian Hessian theorem for fixed metric generalises. The Christoffel bracket decomposes additively into a -part (involving ) and a -part (involving and similar). Each piece is treated separately under the Sherman-Morrison inverse .
Define the curvature correction
where the Christoffel symbols are computed using , not . A clean algebraic cancellation (verified symbolically in the geodesic convexity entry's Appendix A) gives
where . The formula is exact, no approximation.
The key structural fact: depends on and but not on . Therefore can have eigenvalue structure completely different from and can, in principle, cancel negative eigenvalues, making the corrected positive semidefinite. This is the mechanism that allows the learnable variants to do something the fixed metric cannot: convert saddle directions into convex ones.
The denominator is always a positive scalar, so it does not affect eigenvalue signs. The sign structure of the Riemannian Hessian is determined entirely by .
The metric trace serves as a surrogate for the metric's adaptive utility. The per-parameter gradient of the surrogate with respect to is
The interpretation. Parameters with large gradient magnitudes get their scale factors pushed upward, increasing their influence on the metric trace and their effective preconditioning strength. Parameters with small gradients have their factors driven toward zero (and thus toward unity).
The base online update mirrors the scalar case:
Two numerical safeguards.
Mean-centering per leaf. . Without this, the overall scale of is degenerate with : doubling all and halving gives the same trace. Mean-centering removes the degree of freedom by keeping the geometric mean of the diagonal at .
Clipping. with by default. Bounds the condition number of the preconditioner at and prevents the metric from collapsing or diverging in pathological cases.
The base rule has been the production version for most of the project's sweep results. Section 6 below shows that it is structurally suboptimal as a curvature corrector, motivating the curvature-aware variant of Section 7.
| Property | Learnable diagonal | Adam |
|---|---|---|
| Per-parameter scaling | , learned by gradient ascent on | , EMA of |
| Global coupling | Yes: scalar from damps all parameters | None: each coordinate is independent |
| Adaptation mechanism | Explicit gradient ascent on a surrogate | Implicit via second-moment EMA |
| Memory | for plus for the metric trace | for |
| Geometric interpretation | Riemannian gradient flow with learned metric | Coordinate-wise rescaling |
| Curvature correction | Yes (Section 3, nonzero ) | No (Adam is not a pullback metric) |
The crucial distinction is global coupling. The per-parameter scales feed into a shared scalar that modulates the entire update, so the optimizer can detect when the overall landscape is steep and dampen accordingly, even when individual parameters look tame. The curvature correction from Section 3 is a second structural advantage: it allows the metric to bend convergence away from sharp regions, a mechanism Adam lacks entirely.
The geodesic convexity question (when can the metric convert a non-convex landscape into a Riemannian convex one?) splits cleanly across three levels of metric complexity. The geodesic convexity entry gives the full theorem; this section summarises the part directly relevant to the learnable diagonal.
identically. The Riemannian Hessian is the Euclidean Hessian divided by a positive scalar. Eigenvalue signs are preserved. Saddle points cannot be fixed.
The Christoffel symbols are . Contracting with :
The trace is
This is dimension-dependent.
: . The correction is trace-free. It can redistribute eigenvalues but not change the total. For an indefinite with , the trace-free can shift one eigenvalue up and the other down by equal amounts, equalising them at (a clean construction: the optimal solves a linear system with determinant , always solvable when ). When , the trace-free constraint forces , making positive-definiteness impossible.
: depends on , whose sign the learner controls. The scalar's degrees of freedom (the components of ) control an -dimensional space of symmetric matrices, with the additional structural constraint that is rank-two plus a scalar multiple of the identity. Sign-flipping becomes increasingly constrained as grows.
The Christoffel symbols of a diagonal metric involve cross-terms with factors . The exponential anisotropy is what unlocks the trace constraint:
| Variant | structure | Sign-flip capability |
|---|---|---|
| Constant | None | |
| Scalar learnable | rank-two plus scalar , trace constrained | : iff ; : increasingly constrained |
| Diagonal learnable | independent degrees of freedom, unrestricted trace | All tested cases; arbitrary proven in geodesic convexity entry |
Each level strictly contains the previous one (setting all equal in the diagonal case recovers the scalar). This hierarchy gives a geometric explanation for the empirical observation that the diagonal learnable outperforms the scalar learnable on best-run ceilings: it has the richest curvature-correction capability available within the framework's diagonal class.

The base online rule (Section 4) was designed to maximise adaptive step-size calibration via the metric trace, not to optimise the curvature correction . As a result, the rule's equilibrium does not match the structure of the optimal correction.
For at , and . With and , the diagonal optimisation gives the following budget-constrained optima for .
| Frobenius budget on | Sign-flip? | |
|---|---|---|
| no | ||
| no | ||
| yes | ||
| yes | ||
| yes |
The sign-flip threshold is . The optimal at large has a characteristic anti-correlation structure: (shrink the scale along the positive-curvature direction) and (grow the scale along the negative-curvature direction). The asymmetry between and is what produces the nonzero trace shift that the scalar case cannot achieve.
At the same saddle with the base online rule and , the equilibrium reasoning is more subtle than a single linearisation because the trajectory state is not literally the gradient of a global potential (see §3 and §10 for the metric-field-vs-trajectory-state distinction). For a fixed-point analysis at the canonical saddle, treat the gradient as constant locally (); the equilibrium is , the same value for both coordinates (4/6 = 2/3) because . With both equal, the metric is uniform across coordinates, the Christoffel-correction symmetry forces , and keeps one positive and one negative eigenvalue. The diagonal degree of freedom is wasted at this symmetric saddle: the rule drives both scales identically because it responds to gradient magnitudes (, equal at this saddle), not to curvature signs (, opposite). For asymmetric saddles where differs across coordinates, the rule produces an asymmetric , but the produced derived from the spatial variation of still does not match the optimal anti-correlation structure of Section 7.
The qualitative conclusion (base rule wastes the diagonal degree of freedom at the symmetric saddle, produces a that is suboptimal but not as bad as no correction) is robust; the exact value quoted in the table below depends on a specific linearisation that is recorded in the accompanying notebook notebooks/optimal-correction.nb.
For the canonical saddle with .
| Method | Geodesically convex? | |
|---|---|---|
| No correction (constant ) | no | |
| Base online rule (, linearised at ) | no | |
| Optimal (diagonal, ) | yes |
The base rule reduces the negative eigenvalue but never eliminates it. The optimal achieves strict positive-definiteness. The pattern persists across all tested saddles (asymmetric, monkey, Rosenbrock): the base rule is suboptimal, and the optimal with sufficient budget achieves sign-flipping.
The key insight from Section 7: the update must distinguish directions by their curvature sign, not just by gradient magnitude. The proposed curvature-aware rule, in this entry's "inverse-metric" convention (, so increasing means larger step in direction ),
The first term () is the existing adaptive step-size calibration. The second term () creates the anti-correlation we want: it shrinks where curvature is positive (so the step in that direction is smaller, the Newton direction) and grows where curvature is negative (a larger step in the saddle-escape direction). Setting recovers the base rule.
Sign-convention check. The "optimal " structure derived in Section 7 was stated in the form " in positive-curvature directions, in negative-curvature directions." That statement uses the geodesic-convexity convention where (so means smaller metric weight, smaller step). In this entry's inverse-metric convention, the same physical behaviour ("smaller step in high-curvature directions") corresponds to decreasing when . The curvature-aware rule above does decrease when (because of the minus sign on the term), so the sign convention is internally consistent. The Section 7 derivation, transposed to this convention, would read "the optimal (under the inverse-metric convention) is positive in positive-curvature directions and negative in negative-curvature directions," that is, co-correlates with in this convention.
The diagonal Hessian entries are approximated by secant differences between consecutive gradient evaluations:
The cost is one extra gradient snapshot ( memory) and computation per step. No additional backward passes are needed.
Bias from off-diagonal Hessian. The secant formula estimates , not . When has significant off-diagonal entries and the step is not axis-aligned, the estimate is biased. The operation provides partial robustness: only the sign matters, not the magnitude, so moderate bias is tolerable as long as it does not flip the sign. The Hutchinson-based estimator analysed in the derived optimizer has a stronger robustness property ((1+δ)/(1-δ) relative-error bound, independent of dimension and condition number), but it requires the relative error to stay bounded below 1; the secant estimator does not satisfy this hypothesis in practice (the derived-optimizer entry §5.4 shows the initial relative error is an order of magnitude above the theorem's domain), so the formal bound does not apply to secant. Sign-robustness is the only formal guarantee available for the secant version.
Near . The function is discontinuous and the secant estimate is noisy, so the curvature-sign estimate is unreliable in the transition region. Smoothing via instead of would help; the derived optimizer entry Section 5 discusses why the smoothing is insufficient on its own to recover the Newton target.
Small steps. When is small, the secant denominator becomes ill-conditioned. The implementation uses a minimum step-size threshold and EMA smoothing of the estimate.
No convergence proof. The curvature-aware rule is motivated by the structure of the optimal but has not been proven to converge to it. The empirical results in Sections 9 and 10 are the evidence base.
A more aggressive principled version replaces both terms with the Newton target
which by the diagonal minimax theorem (see the derived optimizer entry) is the unique minimax-optimal log-diagonal preconditioner on diagonal quadratics. This is the basis of the principled diagonal Newton variant explored in the derived optimizer entry. Its empirical fate on real architectures is the cautionary tale of that entry: the principled rule is structurally misspecified against the Kronecker structure of neural-network Hessians, and full-batch ablation shows that more aggressive preconditioning yields worse MNIST accuracy. The lesson is that local diagonal optimality is not enough; the structural class matters more than the choice within the class.
Setup: 2-layer MLP (784, 64, 64, 10), batch size 1024, 200 epochs, 1000 Optuna trials per optimizer. Raw runs in results/mnist_mlp/<optimizer>/itr_4/. The rows below are the learnable-diagonal variants and the Adam, SGD, and Muon baselines, all from the same sweep.
| Variant | Best | Median | Mean | Worst |
|---|---|---|---|---|
sgd_learn_diag (base rule) | 98.41% | 86.57% | 64.36% | 2.24% |
sgd_learn_diag_curv (curvature-aware) | 98.39% | 78.04% | 60.88% | 5.36% |
sgd_learn_diag_curv_log | 98.38% | 57.89% | 57.27% | 4.11% |
sgd_learn_diag_log | 98.36% | 84.63% | 62.04% | 5.30% |
| Adam | 98.09% | 94.73% | 72.69% | 9.80% |
| SGD | 98.04% | 78.19% | 58.43% | 2.57% |
| Muon | 98.39% | 93.73% | 70.53% | 9.29% |
Two things to note.
Best-run ceiling. The base learnable diagonal finds the highest single-trial accuracy across all 28 swept optimizers (98.41%, narrowly ahead of Muon and the curvature-aware variants). This is a real ceiling signal: with sufficient hyperparameter search, the variant can reach an accuracy that Adam does not match.
Robustness gap. The median is for the base rule and for the curvature-aware variant. Adam's median is . The learnable variants are substantially more hyperparameter-sensitive than Adam. The hyperparameter search range includes regions where the variants behave pathologically, which is the source of the long left tail.
The honest summary: the learnable diagonal raises the best-run ceiling but does not produce a robust improvement under random hyperparameter draws.

A controlled measurement of Hessian sharpness during training shows that the learnable diagonal reaches matched loss levels at substantially flatter minima than Adam.
Setup: 2-layer MLP (8-16-4, 212 parameters), synthetic 200-sample classification.
| Loss threshold | SGD max eig | Adam max eig | Learn-Diag max eig | LD vs Adam |
|---|---|---|---|---|
| 0.7011 | 4.4479 | 0.6831 | 84.6% flatter | |
| 0.7011 | 2.2586 | 0.6831 | 69.8% flatter | |
| 0.3629 | 0.6943 | 0.2946 | 57.6% flatter |
The likely mechanism is a combination of two components, both present in the base learnable diagonal variant (the variant used in this measurement; the curvature-aware variant was not the one tested). First, the damping factor shrinks the step in directions where is large, which empirically correlates with sharper regions, preventing entry into sharp basins. Second, the metric update amplifies weight on high-gradient-magnitude directions, which geometrically stretches the step along those directions and (combined with the damping) effectively compresses the step in high-curvature directions where gradients spike sharply. The net behaviour resembles what SAM (Foret et al., 2021) achieves via adversarial perturbation.
This attribution is a hypothesis: the experiment shows that the learnable diagonal reaches flatter minima at matched loss levels, but it does not isolate which mechanism (damping, metric update, or both, or something else) is responsible. The fully principled Riemannian-Hessian curvature correction from Section 3 is a third candidate mechanism that would apply once the curvature-aware variant is tested with sharpness measurement; that experiment has not been done.
The qualitative comparison.
| Property | SAM | Learnable diagonal metric (base) |
|---|---|---|
| Mechanism | adversarial perturbation | candidate mechanisms: damping factor plus learned-diagonal scaling; curvature correction is a candidate not isolated in this experiment |
| Extra cost per step | (two forward-backward) | (metric update) |
| Theoretical backing | PAC-Bayes generalisation bound | Riemannian Hessian formula (Section 3) for the curvature-correction candidate; no formal backing for the damping mechanism |
| Explicit sharpness penalty | yes | no (implicit through geometry, mechanism not yet isolated) |
This is the most plausible positive mechanism for why the learnable diagonal reaches higher peak accuracy than Adam on best-run comparisons, despite the analysis showing that its preconditioning direction is anti-Newton. The hypothesis is that the variant wins not because of better preconditioning (the preconditioning is actively wrong) but because of implicit sharpness regularisation that biases convergence toward flatter, better-generalising minima. Confirming this requires the controlled experiments listed in Section 10 (matched-cost comparison against explicit SAM, scaled-up sharpness measurement, and ablation of the two candidate mechanisms above).

Note on baseline values. The sharpness experiment above uses a 212-parameter network and is a small-scale controlled measurement, not part of the 1000-trial MNIST sweep. The "Adam 98.09%" baseline cited in Section 9.1 (from the 1000-trial Optuna sweep on the 55k-parameter MNIST MLP) is a different setting from the older "Adam 97.17%" baseline that appears in the derived optimizer's full-batch ablation (smaller network, full-batch gradients). The two are not directly comparable. The implicit-SAM result here uses neither; it is its own controlled measurement on a third (smaller) network.
A focused sweep on standard 2D test functions (raw runs in results/small_examples_*/, itr_4) isolates where the curvature-aware diagonal helps. On rugged, multimodal landscapes it is genuinely useful; on smooth ones Adam remains strongest.
| Function | Best optimizer | Notable result |
|---|---|---|
| Rastrigin | sgd_learn_diag_curv | trials converged vs Adam's |
| Ackley | sgd_learn_diag_curv | best value ; the log variant sgd_learn_diag_curv_log converged vs for the non-log version (earlier itr_3 sweep) |
| Beale / Himmelblau / Rosenbrock | Adam | strongest on both best value and median; curvature-aware variant converges often but is less robust |
The supportable claim is narrow: the curvature-aware diagonal converges far more often than Adam on rugged multimodal functions (Rastrigin, and Ackley with the log embedding) and is competitive but not dominant on smooth functions. The older "log embedding solves Ackley when all baselines fail" framing is too broad and is not quoted as a general result.
Closing the robustness gap. The median accuracy of the learnable variants is well below Adam's on MNIST MLP. The structural causes are not pinned down. Candidate explanations include (i) the curvature-aware secant estimator's noise on the long left tail of the hyperparameter distribution, (ii) the mean-centering operation interacting poorly with weight decay at certain LR-decay combinations, and (iii) the metric clip () being too tight in some regimes and the metric saturating. A diagnostic study (which hyperparameter draws produce the divergent trials, and what feature of the learning dynamics distinguishes them) has not been done.
Implicit-SAM at scale. The sharpness measurement in Section 9.2 was on a 212-parameter network. Direct sharpness measurement on a realistic-scale task (MNIST CNN, CIFAR-10 SmallCNN) compared against explicit SAM at matched computational cost would be the next test.
Curvature-aware variant vs base rule. Empirically the two variants have the same peak ( vs ) and similar medians. The theoretical advantage of the curvature-aware rule (anti-correlation with , motivated by Section 7) does not translate into a measurable empirical edge on this task. Whether it does on harder landscapes (Rastrigin and other multimodal small functions) is positive: the curvature-aware variant converged in Rastrigin trials versus Adam's (Section 9.3).
Coupled weight decay. The Riemannian-correct weight decay (passed through ) is implementable but has not been swept. The off-diagonal metric entry notes the same open question for the off-diagonal variant.
Combination with off-diagonal. The learnable diagonal and off-diagonal generalisations are structurally orthogonal (different mechanisms for enriching the metric). A combined variant has not been registered or swept.
Convention used in this appendix. This appendix derives the Christoffel symbols of the metric itself, using the convention (the geodesic-convexity-entry convention). This is opposite to the main-text convention of Section 1, which parameterises the inverse metric as . To apply any formula from this appendix to the main-text parameterisation, substitute throughout. The derivation is reproduced here in the geodesic-convexity convention because that is the natural setting for the Christoffel calculus; the main text's sign convention is the natural setting for the online optimizer (preconditioner-multiplies-gradient).
For (no sum), the inverse is and the derivatives are . The Christoffel symbols of are
Case : .
Case : .
Case , : .
Case , : .
Case all distinct: .
The exponential ratios in the off-diagonal terms are what generate the asymmetric amplification mentioned in Section 6: when , the contribution of to is exponentially amplified. This is the structural ingredient that lets the diagonal learnable achieve sign-flipping that the scalar cannot.
The full for the diagonal case is a sum over the five cases above, contracted with . The diagonal entries (used in the trace identity discussion in the main text) come from cases (i) and (ii),
and the off-diagonal entries () come from cases (iii) and (iv),
The full case-by-case expression is reproduced in the geodesic convexity entry's Appendix C.
For with scalar , the Christoffel symbols are
Contracting with :
The trace is
The factor is the source of the dimension-dependent trace constraint discussed in Section 6. For the correction is trace-free. For the factor is negative, so Cauchy-Schwarz gives as an upper bound on the magnitude of the (sign-controllable) trace shift. A positive trace shift requires ; a negative shift requires . The bound on magnitude constrains how much shift the scalar learnable can produce in either direction.
The damping factor with has a geometric interpretation. Near (but not at) a sharp minimum, at a comparable displacement from the basin centre, the gradient is large in the high-curvature directions (the directions in which is large), and the metric weight tracks the gradient magnitude (the metric update pushes up where is large). Both factors combine: is large in directions that are both sharp and currently being traversed quickly. The sum produces a large , which shrinks the step.
This is structurally what the Sherman-Morrison denominator on the loss embedding does for the rank-one metric: it bounds the step at regardless of the parameter-space gradient. With a learnable diagonal underneath, the bound becomes direction-aware: the directions that contribute most to (sharp and active) are the directions that get most damped.
Combined with the candidate curvature correction from Section 3 (which would, if it were the active mechanism, bias the Riemannian Hessian to be more positive-definite), the qualitative picture is implicit sharpness-aware behaviour: the metric prevents entry into sharp basins (via ) and (under the curvature-correction mechanism) bends the effective curvature toward flatter regions (via ). The empirical sharpness measurement in Section 9.2 is consistent with these mechanisms but does not isolate them; the curvature-aware variant was not the one tested, so is a candidate mechanism rather than a confirmed one.
Scripts (scripts/):
scripts/jax_learn_diag.py: JAX implementation of the base learnable diagonal optimizer.scripts/jax_learn_diag_curv.py: implementation with the curvature-aware update rule.scripts/mnist_mlp_sweep.py: Optuna sweep entry point for the MNIST MLP results.scripts/sharpness_comparison.py: the Section 9.2 sharpness measurement.scripts/make_figures.py: reproduces every figure shown in this entry (PDF and PNG written to figures/).Notebooks (notebooks/):
notebooks/optimal-correction.nb: symbolic derivation of the optimal for sign-flipping, including the canonical-saddle worked example.notebooks/hierarchy-verification.nb: numerical verification that the diagonal learnable achieves sign-flipping where the scalar cannot, across the four test saddles.