TL;DR
Second-order optimization promises to navigate the bumpy loss landscapes of deep learning far better than standard gradient descent, except its core ingredient—a massive curvature matrix—is completely impossible to build or invert at modern scales. This paper introduces the Stochastic Truncated Metric (STM), an architecture-agnostic optimizer that replaces that gigantic matrix with a rolling buffer of just $K$ parameter-sized "probe" vectors. By inverting this tiny subspace exactly at every step, STM brings true natural gradient geometry to modern neural networks in linear time and memory—no layer-by-layer structural hacks required.
What Problem Does This Paper Address?
Standard optimizers like SGD and Adam step downhill in parameter space, blind to how much a tiny tweak in weights actually alters the network's output distribution. Natural Gradient Descent (NGD) fixes this by measuring distance using the Fisher Information Matrix (FIM)—a local map of the probability manifold's curvature.
There’s just one catch: for a network with $d$ parameters, the FIM is a $d \times d$ matrix. When $d$ is in the millions or billions, $O(d^2)$ storage and $O(d^3)$ inversion time are non-starters. Existing workarounds like K-FAC or Shampoo chop the matrix into layer-wise blocks or Kronecker factors. While effective, these impose rigid, architecture-dependent assumptions on the network's geometry (for instance, struggling with or skipping certain Transformer layers) and still carry heavy computational overhead. Can we get an unbiased, faithful natural gradient without explicit matrices or architectural assumptions?
Methods
STM strips NGD down to a strict matrix-free budget using three clever mechanisms:
- Unbiased Hutchinson Probes: Instead of building the batch FIM, STM runs one extra backward pass per step using random $\pm 1$ (Rademacher) noise injected at the output probabilities. This produces a single parameter-shaped vector $g_t$ whose outer product $g_t g_t^\top$ is a mathematically unbiased rank-1 estimate of the batch FIM.
- Truncated Moving Average: STM accumulates these noisy rank-1 snapshots over time via an exponential moving average (decay $\beta$), anchored by a constant damping floor ($\gamma I$). Crucially, it truncates history, storing only the past $K$ probes (e.g., $K = 20$) in a ring buffer.
- Exact Woodbury Inversion: Because the metric is just an identity matrix plus $K$ rank-1 updates, STM doesn't need iterative solvers. Using the classic Woodbury matrix identity, it inverts the metric algebraically and exactly by solving a tiny $K \times K$ Cholesky system maintained incrementally.
For a small fixed $K$, parameter updates take $O(Kd)$ time and auxiliary memory—linear in model size $d$.
Datasets
The author evaluates STM on two standard benchmarks (no new datasets are introduced):
- CIFAR-10 image classification trained with a small ResNet ($d \approx 272\text{k}$ parameters).
- Character-level Shakespeare language modeling trained with nanoGPT ($d \approx 10.7\text{M}$ parameters).
Key Insights and Ideas
- The "Stochastic Spotlight" Effect: STM acts as a hybrid optimizer. The $K$ stored probes illuminate a $K$-dimensional subspace with true second-order Fisher preconditioning, while the remaining $d - K$ orthogonal directions stay "in the dark" and fall back to standard Euclidean gradient descent scaled by $1/\gamma$. Thus, $\gamma$ isn't just numerical damping—it directly sets the learning rate for unprobed directions.
- Temporal Variance Reduction: Natural gradient usually demands huge batch sizes to tame curvature noise. STM trades spatial averaging (giant batches) for temporal averaging, blending curvature across $K$ small-batch steps.
- Geometric Error Decay: You might worry that throwing away history past $K$ steps ruins the metric. The author proves that the error from truncating the infinite moving average decays geometrically ($\propto \beta^K$), meaning a modest buffer like $K = 20$ captures the lion's share of the historical signal.
- Zero Extra Distributed Overhead: In multi-GPU setups, workers only need to sync the standard gradient and the single probe vector $g_t$—an $O(d)$ communication cost identical to SGD, unlike K-FAC which must sync layer-wise matrix factors.
Key Results
STM ($K=20$) was benchmarked against SGD, AdamW, and K-FAC across three random seeds on a single NVIDIA L4 GPU:
- CIFAR-10 / ResNet: STM achieves 88.70% test accuracy—within 0.26 percentage points of K-FAC (88.96%), though slightly behind SGD (89.83%) and AdamW (90.07%). Notably, STM runs ~3x faster than K-FAC (9.80s vs. 29.39s per epoch), despite refreshing its inverse every step while K-FAC updates every 10 steps.
- Shakespeare / nanoGPT: STM reaches 49.71% test accuracy, beating SGD (49.16%) and landing within 0.61 points of K-FAC (50.32%), while matching K-FAC's per-epoch speed (~23.4s vs. 23.0s)—even though K-FAC had to be configured to skip embedding, attention, and head layers, whereas STM preconditioned the entire network seamlessly.
Limitations and Future Work
- Memory Bottleneck at LLM Scale: While $O(Kd)$ is linear in $d$, storing $K = 20$ full-precision copies of a 70-billion-parameter model is still prohibitively expensive (as seen on nanoGPT, where STM used 3865 MiB of VRAM vs. K-FAC's 3226 MiB).
- Blind Directions: When critical curvature lies outside the tiny $K$-dimensional probe span, performance degrades to basic gradient descent. Furthermore, STM trailed AdamW in raw test accuracy on both tasks.
- Future Directions: To scale to LLM pre-training and fine-tuning, the author suggests compressing the probe buffer to BF16, or combining the Woodbury setup with sharded, Kronecker, or random-sketched buffers. Extending the theoretical concentration bounds from fixed trajectories to full, non-convex training dynamics also remains an open problem.
Summary updated