Scalable Thermodynamic Second-order Optimization

Kaelan Donatella, Samuel Duffield, Denis Melanson, Maxwell Aifer, Phoebe Klett, Rajath Salegame, Zach Belateche, Gavin E. Crooks, Antonio J. Martinez, Patrick J. ColesarXiv 2025 · DOI

Training modern AI models is a massive computational challenge. Most researchers rely on first-order optimizers like SGD or Adam because they are computationally "cheap," even though they often require many iterations to converge. In contrast, second-order methods, such as Natural Gradient Descent (NGD), are mathematically superior—they understand the "curvature" of the loss landscape and can reach the optimum in far fewer steps.

However, second-order methods have a fatal flaw on digital hardware: they require inverting massive matrices (the Fisher Information Matrix), a process that scales cubically ($O(n^3)$) with the number of neurons. This paper proposes Thermodynamic K-FAC, a scalable algorithm that offloads these expensive matrix inversions to physics-based "thermodynamic" computers, potentially making high-performance second-order optimization as fast as standard first-order methods.

Thermodynamic K-FAC: Physics as a Solver

The authors introduce a framework that moves away from digital logic toward physics-based computing using a Stochastic Processing Unit (SPU)—a physical system of coupled harmonic oscillators.

Instead of using a digital CPU or GPU to crunch numbers, the algorithm computes "Kronecker factors" (smaller sub-matrices representing layer curvature) on a digital device and sends them to the thermodynamic solver. When a "force" (input data) is applied to this physical system, it naturally relaxes toward thermodynamic equilibrium. The steady-state voltages in the circuit represent the solution to a linear system ($Mx=b$), and the fluctuations represent the matrix inverse.

Overview of the thermodynamic K-FAC algorithm. Kronecker factors are computed digitally and sent to a physical solver that "relaxes" to find the update weights.

Breaking the Complexity Barrier

The most striking insight is the "Linear Advantage." While digital inversion is $O(n^3)$, the thermodynamic solver can find the solution in roughly $O(n^2)$ or even $O(n)$ time, depending on the hardware configuration. As models get wider and the number of neurons ($n$) increases, the gap between digital and thermodynamic performance widens, making this technology increasingly valuable for massive future models.

Scaling analysis for MLP and GPT architectures. The plots illustrate how different components of the training process, particularly inversion, scale with model width (n) and vocabulary size.

By applying this to K-FAC (Kronecker-factored Approximate Curvature), which breaks the problem into layer-wise blocks, the authors have made thermodynamic computing practical for billion-parameter models. In digital K-FAC, matrix inversion can consume up to 27% of total training time; thermodynamic hardware reduces this to a negligible constant.

Key Results and Robustness

The authors evaluated their approach using the AlgoPerf benchmark suite across various workloads, including ImageNet (Vision Transformers) and ogbg-molpcba (Graph Neural Networks).

  • Wall-clock Speedups: The authors predict an overall 50% speedup in time-to-convergence compared to tuned digital baselines like Adam.
  • Robustness to Noise: Analog hardware is inherently noisy, but the authors found that second-order optimization is surprisingly resilient. Even with significant "quantization noise" (simulating low-precision 8-bit hardware), K-FAC still outperformed full-precision Adam.

Future Outlook

While these results are based on high-fidelity simulations, they point toward a future where AI training is no longer bottlenecked by digital matrix operations. Future work involves exploring non-quadratic physical systems to approximate loss landscapes even more accurately and integrating these solvers directly into popular pipelines like PyTorch or JAX. By leveraging the natural tendency of physical systems to reach equilibrium, we may soon train AI at the speed of physics.

Summary updated

BibTeX
@misc{donatella2025scalable,
  author = {Kaelan Donatella and Samuel Duffield and Denis Melanson and Maxwell Aifer and Phoebe Klett and Rajath Salegame and Zach Belateche and Gavin E. Crooks and Antonio J. Martinez and Patrick J. Coles},
  title = {{Scalable Thermodynamic Second-order Optimization}},
  year = {2025},
  eprint = {2502.08603},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.08603},
}
Figure