Speed Limits for Deep Learning

Inbar Seroussi, Alexander A. Alemi, Moritz Helias, Zohar Ringel · DOI

Abstract

Training state-of-the-art neural networks requires immense computational resources, yet the fundamental physical constraints on training speed remain poorly understood. This paper applies principles from stochastic thermodynamics to derive "speed limits" for neural network training. By treating the evolution of weights as a physical system out of equilibrium, the authors utilize the Benamou-Brenier formula to establish a lower bound on training time. The analysis reveals that deep learning—particularly in the Neural Tangent Kernel (NTK) regime—is remarkably efficient, often operating within a constant factor of the theoretical physical limit. The study identifies a characteristic "entropy burn" at the onset of training and demonstrates that standard optimization paths are surprisingly direct, suggesting that current training methodologies are already approaching fundamental physical bounds.

Introduction

As the energy and time requirements for training large-scale models continue to escalate, a critical question emerges: Are we training these models as fast as the laws of physics allow? In thermodynamics, "speed limits" define the minimum time required for a system to transition between states given a specific amount of entropy production or "effort." This research bridges the gap between machine learning theory and stochastic thermodynamics by mapping the movement of weights $\theta$ through a loss landscape to the dynamics of physical particles.

Theoretical Framework: The Benamou-Brenier Bound

To quantify the efficiency of learning, the researchers employ the Benamou-Brenier formula, a cornerstone of optimal transport. They establish a lower bound on the training time ($T_{SL}$):

$$T \ge T_{SL} \equiv \frac{W_2(p_0, p_T)}{\beta^{-1}R}$$

In this framework:

  • $W_2$ (Wasserstein-2 distance): Represents the geometric distance between the initial weight distribution $p_0$ and the final distribution $p_T$.
  • $R$ (Entropy Production): Measures the irreversibility of the training process, which is closely linked to the rate of decrease in training loss.
  • $\beta^{-1}$: Corresponds to the noise level or "temperature" of the training algorithm (e.g., the stochasticity in Langevin dynamics).

By analyzing this ratio, the authors can determine the "velocity" of learning and identify where the process deviates from physical optimality.

Experimental Methodology

The framework was validated across three distinct environments:

  1. High-dimensional Linear Regression: A controlled "teacher-student" setup allowing for exact analytical calculations of the bounds.
  2. Neural Tangent Kernel (NTK) Regime: An investigation into linearized deep networks where the kernel remains constant, providing a theoretical baseline for deep architectures.
  3. Empirical CNNs: Training a "Myrtle-5" (5-layer CNN) on the CIFAR-10 dataset to observe how real-world dynamics compare to the theoretical limits.

Key Insights

The "Entropy Burn"

The research identifies a phenomenon termed the "entropy burn" occurring at the very beginning of the training process. During this phase, there is a massive spike in entropy production where the training loss drops precipitously without a commensurate increase in test accuracy. From a thermodynamic standpoint, this initial phase is highly non-optimal, representing a significant expenditure of "effort" for relatively little gain in generalization.

Scaling Optimality in the NTK Regime

One of the paper's most significant findings is that for networks with power-law spectra—a characteristic of many real-world architectures—learning is "optimal in a scaling sense." This means that the actual training time is only an $O(1)$ factor away from the theoretical physical limit. If the target labels are relatively uniform relative to the NTK's spectral components, the network achieves near-perfect efficiency.

The Geometry of the Weight Path

Contrary to the intuition that gradient descent might follow a highly convoluted path, empirical tests on CIFAR-10 showed that the path weights travel is surprisingly straight. The ratio of the actual path length to the optimal straight-line distance (geometric inefficiency) was found to be a small constant, regardless of the dataset size. This suggests that the inefficiency in training is not due to a "twisted" path, but rather inconsistent velocity along that path.

Results and Empirical Validation

  • Linear Regression: In the large-sample limit ($n \gg d$), the speed limit $T_{SL}$ converges to $2\lambda\alpha$, where $\lambda$ is the regularization parameter and $\alpha$ is the variance of the true weights.
  • CNN Efficiency: For the Myrtle-5 CNN, after the initial entropy burn, the inefficiency ratio stabilizes. This indicates that once the model moves past the initial chaotic phase, standard training techniques are physically efficient.
  • Warm-Starting: The authors found that "warm-starting" a model—beginning measurements after the initial entropy burn—results in a training regime that is almost perfectly optimal. This process makes the residual errors more uniform across the network's spectral components.

Discussion and Future Work

While this work establishes a rigorous physical foundation for training efficiency, several avenues for future research remain:

  • Discrete vs. Continuous Time: The current theory relies on continuous-time stochastic differential equations (SDEs). Extending this to the discrete steps used in actual practice (finite learning rates) is a necessary next step.
  • Feature Learning: The NTK analysis assumes a fixed kernel ("lazy training"). Future work should investigate how these speed limits evolve in models where the kernel adapts, as is common in large-scale transformer models.
  • Scaling to Transformers: Empirical validation was limited to small-scale CNNs. Determining if these thermodynamic bounds hold for massive architectures like LLMs remains an open question.

In conclusion, this research suggests that we are not as far from the physical limits of learning as previously thought. Modern deep learning optimization, despite its complexity, appears to follow a trajectory that is remarkably close to the most efficient path allowed by the laws of stochastic thermodynamics.

Summary updated

BibTeX
@misc{seroussi2023speed,
  author = {Inbar Seroussi and Alexander A. Alemi and Moritz Helias and Zohar Ringel},
  title = {{Speed Limits for Deep Learning}},
  year = {2023},
  eprint = {2307.14653},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.14653},
}
Figure