TL;DR
When we train modern neural networks with large learning rates, they don't quietly settle into a single optimal point; instead, they bounce around chaotically at the "edge of stability." Rather than treating this chaos as an optimization bug, this paper models the optimizer as a random dynamical system that settles onto a lower-dimensional fractal attractor. By measuring the intrinsic geometry of this entire attractor—via a new metric called the Sharpness Dimension—the authors explain why models operating on the brink of instability generalize so remarkably well.
What Problem Does This Paper Address?
Classical optimization textbooks tell us that if your learning rate ($\eta$) is too large relative to the curvature of the loss landscape (specifically, when the largest eigenvalue of the Hessian exceeds $2/\eta$), gradient descent becomes unstable and diverges. Yet, modern deep learning routinely violates this rule. Networks frequently train right at or above this threshold—a regime known as the Edge of Stability (EoS)—oscillating chaotically while training loss still decreases and test performance improves.
Historically, researchers tried to explain generalization by looking at the local curvature ("flatness" or "sharpness") of a single final weight vector. However, flat minima can generalize poorly, sharp minima can generalize well, and—most importantly—at the EoS, the optimizer never settles on a single point anyway! How do we explain generalization when the training trajectory is locally unstable, chaotic, and perpetually wandering?
Methods
The authors shift the focus from isolated parameter vectors to the geometry of the entire set of solutions the optimizer explores over time.
- Random Dynamical Systems (RDS) & Pullback Attractors: They formalize stochastic optimizers (like mini-batch SGD) as discrete-time RDS. Because fresh minibatch noise is injected at every step, trajectories don't converge forward in time; instead, they are analyzed via a pullback random attractor—a compact, often fractal set representing a noise-conditioned snapshot of where past trajectories settle.
- RDS Sharpness & Sharpness Dimension (SD): Inspired by Lyapunov exponents (which measure how fast nearby chaotic trajectories diverge), the authors define RDS Sharpness using the singular values of the optimizer's one-step Jacobian across the attractor. Combining these values yields the Sharpness Dimension (SD): a measure of the effective number of expanding directions on the attractor before contracting directions take over and squash the volume.
- Scalable Estimation (SLQ): Computing the full Hessian spectrum for millions of parameters is intractable with standard SVD. To compute SD in practice without needing the training trajectory, the authors adapt Stochastic Lanczos Quadrature (SLQ)—probing Hessian-vector products across independent minibatches to approximate the full eigenvalue density.
Datasets
No new benchmarks are introduced; the authors validate their theory across standard vision, algorithmic, and language modeling tasks:
- MNIST: Used to train 3-layer and 5-layer MLPs across grids of learning rates and batch sizes.
- Modular Arithmetic (Addition modulo 97): A classic synthetic task (using a 40%/60% train/test split of the $97^2$ pairs) used to induce and study grokking (sudden, delayed generalization).
- WikiText-2: Used to train 124M-parameter GPT-2 transformers from scratch using SGD, SGD with momentum, and AdamW.
Key Insights and Ideas
- Chaos compresses dimensionality: At the Edge of Stability, there is at least one expanding direction ($\lambda_1 > 0$), creating chaotic oscillations. However, because the vast majority of directions in parameter space are strongly contracting, the resulting fractal attractor has an effective dimension strictly smaller than the ambient parameter count ($\text{SD} < d$). Generalization is governed by this smaller intrinsic dimension, not the raw number of weights.
- The entire spectrum matters: Prior metrics rely on the Hessian's trace or its single largest eigenvalue. SD reveals that generalization in chaotic regimes depends on the delicate tug-of-war between all expanding and contracting directions across the complete Hessian spectrum.
- Trajectory-free dynamical insight: Unlike topological data analysis (TDA) baselines that require saving thousands of late-stage weight checkpoints to measure the trajectory's shape, SD extracts dynamical attractor properties directly from the local spectrum of a single model checkpoint.
- Grokking is a spectral phase transition: During grokking, SD tracks the sudden jump in test accuracy—even rising before generalization and dropping sharply right at the grokking transition—confirming that delayed generalization coincides with a structural reorganization of the Hessian spectrum.
Key Results
Across scales, SD and its scalable approximations (SD-SLQ, SD-KDE, SD-PS) consistently correlate with the empirical generalization gap better than classical sharpness or trajectory-based persistent homology (PH) dimensions.
- MLPs on MNIST: On the 3-layer MLP, exact SD achieves a 0.76 Kendall correlation with the generalization gap (and 0.83 with the loss gap), while SLQ-approximated SD reaches 0.61. Meanwhile, PH dimensions and top RDS-sharpness alone show negative correlations (-0.16 to -0.40). On the 5-layer MLP, SD-SLQ achieves the highest overall Kendall's $\tau$ across the hyperparameter grid.
- GPT-2 (124M) on WikiText-2: Under AdamW, classical sharpness fails dramatically, showing a strong negative correlation (-0.63 to -0.68) with loss gaps. Conversely, smoothed SD variants (SD-KDE and SD-PS) maintain positive, informative correlations across SGD, Momentum, and AdamW (reaching up to 0.75 with the loss gap under AdamW).
- Runtime: Spectral estimation via SLQ takes ~5 minutes for a 3-layer MLP, ~1 hour for a 5-layer MLP, and ~3 hours per model for GPT-2.
Limitations and Future Work
- Computational Bottleneck: Even with SLQ approximations, estimating the entire Hessian spectrum remains computationally heavy (~3 hours for a 124M GPT-2 model), making scaling to multi-billion-parameter LLMs challenging without coarser approximations.
- Theoretical Assumptions & Optimizers: The theoretical generalization bounds rely on smoothness and boundedness assumptions and primarily model simpler stochastic dynamics; extending the rigorous RDS theory to adaptive optimizers (like AdamW, where it already works empirically) and weaker regularity conditions remains open.
- Analytical Characterization: Future work aims to analytically derive how specific data distributions and optimizer choices shape SD in simplified theoretical models.
Summary updated