Understanding Sharpness Dynamics in NN Training with a Minimalist Example: The Effects of Dataset Difficulty, Depth, Stochasticity, and More

Geonhui Yoo, Minhak Song, Chulhee Yun

Introduction

In the training of deep neural networks, "progressive sharpening" is a widely observed phenomenon where the sharpness of the loss landscape—defined as the maximum eigenvalue of the Hessian—increases steadily during the early stages of optimization. This process typically continues until it reaches the "Edge of Stability" (EoS), a regime where sharpness hovers around $2/\eta$ (where $\eta$ is the learning rate). Despite its ubiquity in modern architectures like Transformers and ResNets, the high-dimensional and non-convex nature of these models makes a rigorous theoretical analysis of sharpness dynamics extremely challenging.

This research addresses this gap by introducing a "minimalist" model: a deep linear network (DLN) with only one neuron per layer. Surprisingly, this simple architecture is sufficient to replicate the complex sharpness dynamics of massive neural networks, providing a tractable framework to study the effects of depth, dataset difficulty, and optimizer stochasticity.

The Minimalist Model and Dataset Difficulty

The authors propose a DLN-1 architecture defined as $f(x; \theta) = (x^\top u) \prod_{i=1}^{D-1} v_i$, where $D$ represents the network depth. To analyze this model, they introduce a novel metric called Dataset Difficulty ($Q$), defined as:

$$Q = \sum_{i=1}^{r} \frac{d_i^2}{\sigma_i^2}$$

Here, $d_i$ represents the label components and $\sigma_i$ are the singular values of the training data. $Q$ effectively quantifies the "effort" required for a model to fit a specific dataset. By reparameterizing training dynamics through the Singular Value Decomposition (SVD) of the data matrix, the authors provide rigorous bounds for sharpness at both initialization and convergence.

Key Drivers of Sharpness Dynamics

The Role of Depth and Difficulty

A central finding of the study is that the relationship between network depth and sharpness is governed by the dataset difficulty $Q$. The theory predicts that if a dataset is "difficult" ($Q > 1$), increasing the depth $D$ leads to higher sharpness at convergence. Conversely, for very simple datasets where $Q < 1$, sharpness actually decreases as depth increases. Given that most practical datasets satisfy $Q \gg 1$, this explains why deeper models in real-world applications tend to exhibit sharper loss landscapes.

Layer Imbalance and Optimizer Stochasticity

The research identifies "layer imbalance" ($C$)—the difference in weight magnitudes across layers—as a critical regulator of training dynamics. While Gradient Flow (GF) preserves initial imbalance, discrete optimizers like Gradient Descent (GD) and Stochastic Gradient Descent (SGD) gradually increase it.

Notably, the paper provides a theoretical explanation for why SGD often leads to "flatter" (less sharp) solutions than GD. The analysis demonstrates that the stochasticity inherent in SGD increases layer imbalance more rapidly than GD. Because higher imbalance is mathematically correlated with lower final sharpness, SGD naturally drifts toward flatter regions of the loss landscape.

Numerical Precision at the Edge of Stability

The study also reveals that the stability of the EoS regime is sensitive to numerical precision. While complex models often show "decaying oscillations" at the EoS, the minimalist model shows that high-precision training (e.g., float64) can lead to loss divergence rather than stabilization. This suggests that the "stability" observed in practice may partially stem from the inherent limitations of numerical precision in standard hardware.

Empirical Validation

The minimalist theory was validated against standard benchmarks, including CIFAR-10, SVHN, and Google Speech Commands. The authors derived a formula for Predicted Sharpness:

$$\hat{S}_D := \frac{\sigma_1^2}{N} Q^{\frac{D-1}{D}}$$

In experiments using 5-layer networks on CIFAR-10, this theoretical prediction achieved a remarkable 0.99 correlation with empirical sharpness. Furthermore, the DLN-1 model successfully captured the non-monotonic loss decreases and occasional spikes characteristic of EoS training in Transformers.

Conclusion and Future Directions

By stripping neural networks down to their most basic linear components, this work demonstrates that the fundamental drivers of sharpness dynamics are not necessarily tied to non-linearity or high width, but rather to the interplay between depth, dataset structure, and optimization stochasticity.

While the current analysis focuses on Mean Squared Error (MSE) and linear architectures, it lays the groundwork for future explorations into non-linear "minimalist" models and different loss functions, such as Cross-Entropy, where sharpness dynamics may behave differently due to margin maximization.

Summary updated

BibTeX
@inproceedings{yoo2025understanding,
  author = {Geonhui Yoo and Minhak Song and Chulhee Yun},
  title = {{Understanding Sharpness Dynamics in NN Training with a Minimalist Example: The Effects of Dataset Difficulty, Depth, Stochasticity, and More}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=XfjrLEPOQV},
}
Figure