Layerwise LQR for Geometry-Aware Optimization of Deep Networks

Simon Dufort-Labbé, Pierre-Luc Bacon, Razvan Pascanu, Simon Lacoste-Julien, Aristide BaratinNeurIPS 2026

TL;DR

Second-order optimizers navigate neural network loss landscapes much more smartly than standard gradient descent, but to run on modern hardware, they usually have to chop the network into isolated layers and ignore how those layers interact. Layerwise LQR (LLQR) solves this by recasting a single optimization step as an optimal-control problem across the network's depth, keeping cross-layer physics intact before making any approximations. The result is a drop-in wrapper for standard optimizers like SGD, AdamW, and Muon that accelerates training and boosts final test performance with barely any extra compute time.

What Problem Does This Paper Address?

Imagine descending a winding, steep canyon in the dark. Standard first-order optimizers (like SGD) just feel the slope right under your feet. Geometry-aware or "second-order" methods (like Newton’s method or Natural Gradient Descent) measure the curvature of the canyon walls, allowing you to take much faster, better-aimed strides.

The catch? Capturing that curvature for a modern deep network requires building and inverting a massive, dense matrix that couples every parameter across every layer. At scale, that is computationally impossible. Existing scalable workarounds—like K-FAC or Shampoo—cheat early: they chop this dense curvature matrix into isolated, layer-by-layer blocks so it's easy to invert. While this makes the math tractable, it throws away crucial cross-layer interactions before figuring out the best parameter update. The authors ask: can we keep the true, coupled geometry of the network alive when computing our update, without ever building or inverting that giant matrix?

Methods

The authors bridge deep learning optimization and classical control theory in two distinct stages:

  1. Exact Equivalence via Optimal Control: Building on classical results linking Newton's method to control theory, the authors prove a broad new equivalence. Taking a steepest-descent step under almost any standard curvature model (Newton, Gauss–Newton, Fisher/Natural Gradient) is mathematically identical to solving a finite-horizon Linear Quadratic Regulator (LQR) problem—the same math used to keep rockets on trajectory. Here, the layers act as discrete time steps, forward activations act as system dynamics, and weight updates are the "control inputs."
  2. A Scalable Relaxation: Solving this LQR problem exactly (via Riccati recursions) is still too heavy for big networks. So, the authors introduce a clever relaxation: instead of solving for the exact step, they directly learn a structured inverse preconditioner $\mathbf{U}$ (using lightweight diagonal, K-FAC, or E-KFAC blocks) that minimizes the LQR objective.
Algorithm 1: The relaxed LLQR periodic preconditioner wrapper

Because $\mathbf{U}$ is learned directly as an inverse, there is no matrix inversion required. LLQR periodically updates $\mathbf{U}$ every $n$ steps (blending it smoothly via an Exponential Moving Average) and wraps cleanly around outer optimizers like SGDM, AdamW, or Muon.

Datasets

No new datasets are introduced; the authors evaluate LLQR across standard benchmarks spanning toy problems, vision, translation, and language modeling:

  • Synthetic / Algorithmic: 2D Rosenbrock function (formulated as a 2-layer network) and five modular arithmetic datasets (mod_division, mod_subtract, mod_mul, mod_exp, mod_sum) to test Transformer "grokking."
  • Computer Vision: CIFAR-10, CIFAR-100, and ImageNet.
  • Natural Language Processing: IWSLT14 German-to-English (machine translation) and WikiText-103 (autoregressive language modeling).

Key Insights and Ideas

  • Approximate the answer, not the question: Standard methods simplify the curvature matrix first and then invert it. LLQR flips the script: it writes down the exact, cross-layer coupled LQR objective first, and only restricts the structure of the learned inverse preconditioner at the very end. On the Rosenbrock toy problem, a diagonal Hessian approximation gets stuck because it ignores layer couplings, whereas diagonal LLQR smoothly tracks the true Newton path.
  • Direct inverse learning dodges cubic bottlenecks: By treating the inverse preconditioner as an optimization variable updated via automatic differentiation, LLQR avoids explicit matrix inversions entirely, updating only periodically and reusing the geometry across steps.
  • Orthogonal to modern optimizer tricks: You might expect an optimizer like Muon—which already orthogonalizes momentum updates—to make LLQR redundant. Instead, wrapping LLQR around Muon (and AdamW) yields clear additive gains, showing that global cross-layer curvature provides unique signal.

Key Results

Across ResNets, VGG, WideResNets, and Transformers, LLQR consistently speeds up training dynamics and improves generalization with minimal wall-clock overhead:

Figure 1: ImageNet and IWSLT14 training curves under NGD-induced divergence. Left: ResNet- 50 trained for 100 epochs on ImageNet with SGDM, comparing the baseline, LLQR+KFAC, and LLQR+E-KFAC. Right: a Fairseq Transformer trained on IWSLT14 De–En with AdamW, comparing the baseline and LLQR+E-KFAC.
  • ImageNet (ResNet-50, 100 epochs): Wrapping SGDM with LLQR (E-KFAC, Natural Gradient) boosts Top-1 accuracy from 77.42% to 78.05% while adding just 3.2% wall-clock overhead ($\times 1.032$).
  • Outperforming Scalable Second-Order Rivals: Under strict wall-clock–matched budgets on CIFAR-100 and ImageNet, LLQR achieves higher accuracy and runs faster per epoch than K-FAC ($\times 1.25$ vs. $\times 2.32$ overhead on CIFAR-100), Shampoo ($\times 10.82$), and AdaFisher ($\times 1.33$).
Table 4: Performance and wall-clock time comparison on ResNet-18/CIFAR–100 and ResNet- 50/ImageNet, with batch size set to 256 across experiments to match benchmarks. LLQR denotes an E-KFAC block structure with NGD updates. Results marked with †follow Gomes et al. [2025] and enable efficiency comparisons with other approximate second-order methods. We report time per epoch to reflect optimizer overhead; all baselines from Gomes et al. [2025] are trained under exactly matched wall-clock budgets (200 and 90 epochs), and LLQR remains strictly within them.
  • Translation & Language Modeling: On IWSLT14 De–En, LLQR lifts Transformer BLEU scores from 34.24 to 34.51 ($\times 1.16$ time). On WikiText-103 (291M GPT-3 Small), it lowers validation perplexity for both AdamW (29.71 to 29.35) and Muon (29.61 to 29.40), hitting the $<30$ perplexity milestone roughly an hour earlier with AdamW and 22 minutes earlier with Muon ($\sim 4\text{--}5\%$ time overhead).
  • Grokking: Across five algorithmic tasks, LLQR noticeably accelerates the sudden jump to $\ge 95\%$ test accuracy in iteration count while matching or beating baseline wall-clock times.

Limitations and Future Work

  • Expressivity vs. Memory Trade-off: Storing and periodically refitting $\mathbf{U}$ requires extra memory and compute. Diagonal blocks scale linearly in memory (great for Transformers in grokking) but offer minimal speedup on vision tasks, whereas Kronecker/E-KFAC blocks capture rich geometry at a higher memory cost (requiring batch-chunking strategies on deeper nets like PyramidNet-110).
  • Approximation Gap: Because $\mathbf{U}$ is only constrained along current gradient directions, periodically refitted for finite steps, and structurally restricted, it is not guaranteed to recover the exact theoretical LQR update.
  • Unproven at Frontier Scale: Autoregressive LLM tests stopped at a 291M-parameter model over 15,000 updates; testing LLQR on multi-billion-parameter pretraining runs remains open future work.

Summary updated

Abstract

Geometry-aware optimizers such as Newton and natural gradient can improve conditioning in deep learning, but scalable variants such as K-FAC, Shampoo, and related preconditioners usually impose structural approximations early, often discarding cross-layer interactions induced by the network computation. We introduce Layerwise LQR (LLQR), a framework for learning structured inverse preconditioners under a global layerwise optimal-control objective. The starting point is an exact equivalence: the steepest-descent step under a broad class of divergence-induced quadratic models—including Newton, Gauss–Newton, Fisher/natural-gradient, and intermediate-layer metrics—can be written as a finite-horizon Linear Quadratic Regulator (LQR) problem. This formulation serves as a reference that exposes the layerwise dynamics and cost matrices encoding the original dense geometry. We then derive a scalable relaxation that learns diagonal, (E-)Kronecker-factored, or other structured inverse preconditioners by minimizing the LQR objective and reusing them across iterations. The resulting optimizer wraps standard methods while retaining a principled connection to second-order geometry, without forming or inverting the global curvature matrix. Experiments on ResNets and Transformers show that LLQR improves optimization dynamics and often translates these gains into improved final test performance, while adding only modest wall-clock overhead. It establishes LLQR as a practical framework for geometry-aware second-order methods and a reference for evaluating scalable approximations.
BibTeX
@inproceedings{dufortlabbe2026layerwise,
  author = {Simon Dufort-Labbé and Pierre-Luc Bacon and Razvan Pascanu and Simon Lacoste-Julien and Aristide Baratin},
  title = {{Layerwise LQR for Geometry-Aware Optimization of Deep Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=xlQ8m3yAYM},
}
Figure