In deep learning, not all minima are created equal. "Flat" minima—broad, shallow valleys in the loss landscape—are known to generalize well to unseen data, while "sharp" minima—narrow, steep pits—often lead to overfitting. While Stochastic Gradient Descent (SGD) is famously effective at finding these flat regions, the precise mechanism behind this "magic touch" has long been a subject of intense research.
A unified theory has emerged across recent work, framing SGD not just as an optimizer, but as a dynamical system governed by escape time. By modeling SGD through the lens of diffusion and stochastic differential equations, researchers have shown that the algorithm’s success is rooted in its ability to exit sharp minima exponentially faster than flat ones.
The Exponential Escape Mechanism
The core intuition behind SGD’s preference for flatness lies in how long it takes to leave a local minimum. Zeke Xie, Issei Sato, and Masashi Sugiyama demonstrate in A Diffusion Theory for Deep Learning Dynamics that the time required to escape a minimum scales exponentially with the ratio of the batch size ($B$) to the learning rate ($\eta$).
Mathematically, this is often described using the Eyring-Kramers formula, which relates the escape rate to the geometry of the loss landscape. As Xiaowu Dai and Yuhua Zhu explain in On Large Batch Training and Sharp Minima, the noise inherent in small-batch SGD provides the "energy" needed to tunnel out of narrow pits. Because sharp minima have smaller volumes and steeper walls, the probability of the optimizer being kicked out is significantly higher than in a flat minimum, where the gradient noise is lower and the basin is wider.
Why Large Batches Fail
This exponential relationship provides a rigorous answer to the "large-batch generalization gap." When the batch size increases, the stochastic noise decreases. According to the diffusion theory:
- Stability: Large batches make sharp minima more stable. The time required to escape them increases exponentially, trapping the model in suboptimal regions.
- Timescales: While SGD might eventually find a flat minimum regardless of batch size, Yi Wang and Zhiren Wang argue in Three-stage Evolution and Fast Equilibrium for SGD that this process happens on a timescale far exceeding practical training limits.
- Convergence Traps: Waïss Azizian and colleagues show in The Global Convergence Time of SGD that convergence time is dominated by the deepest "traps" in the landscape, making the ratio of $\eta/B$ the critical lever for navigating non-convexity.
Beyond Simple Noise
Recent refinements suggest that the noise in SGD is more complex than simple Gaussian fluctuations. Barak Battash and Ofir Lindenbaum in Revisiting the Noise Model of SGD propose that SGD noise is heavy-tailed (Lévy-driven), meaning it occasionally produces very large jumps that are particularly effective at clearing sharp ridges.
Furthermore, Chengli Tan and Jiangshe Zhang suggest in Understanding Long Range Memory Effects that this noise possesses short-range memory, modeled as Fractional Brownian Motion. This memory allows the optimizer to "remember" the local curvature, further biasing it toward stable, flat regions.
Summary of Intuition
SGD works because it is a "leaky" optimizer. It constantly tries to escape its current location. Because the difficulty of escaping is tied exponentially to the flatness of the basin and the noise-to-step-size ratio, the algorithm naturally filters out sharp, brittle solutions. It doesn't just find a minimum; it finds the most "inescapable" flat region available within the training budget.