A Scalable Measure of Loss Landscape Curvature for Analyzing the Training Dynamics of LLMs
Dayal Singh Kalra, Jean-Christophe Gagnon-Audet, Andrey Gromov, Ishita Mediratta, Kelvin Niu, Alexander H Miller, Michael Shvartsman
TL;DR
This work addresses the need for scalable metrics of loss-landscape curvature in large language models by introducing critical sharpness $λ_c = 2/η_c$, estimable with fewer than 10 forward passes along the update direction. It provides a theoretical link between $λ_c$ and Hessian sharpness under a quadratic loss and demonstrates that $λ_c$ captures progressive sharpening and Edge of Stability across pre-training and mid-training, including up to 7B-parameter models. The authors further introduce relative critical sharpness $λ_c^{1→2}$ to study cross-landscape effects and data-mixing strategies, revealing a sweet spot in pre-training data fraction that balances retention of pre-trained capabilities with downstream adaptation. Collectively, the results offer a practical, scalable toolkit for diagnosing curvature dynamics and guiding data composition in large-scale model training, with implications for optimization stability and transfer performance.
Abstract
Understanding the curvature evolution of the loss landscape is fundamental to analyzing the training dynamics of neural networks. The most commonly studied measure, Hessian sharpness ($λ_{\max}^H$) -- the largest eigenvalue of the loss Hessian -- determines local training stability and interacts with the learning rate throughout training. Despite its significance in analyzing training dynamics, direct measurement of Hessian sharpness remains prohibitive for Large Language Models (LLMs) due to high computational cost. We analyze $\textit{critical sharpness}$ ($λ_c$), a computationally efficient measure requiring fewer than $10$ forward passes given the update direction $Δ\mathbfθ$. Critically, this measure captures well-documented Hessian sharpness phenomena, including progressive sharpening and Edge of Stability. Using this measure, we provide the first demonstration of these sharpness phenomena at scale, up to $7$B parameters, spanning both pre-training and mid-training of OLMo-2 models. We further introduce $\textit{relative critical sharpness}$ ($λ_c^{1\to 2}$), which quantifies the curvature of one loss landscape while optimizing another, to analyze the transition from pre-training to fine-tuning and guide data mixing strategies. Critical sharpness provides practitioners with a practical tool for diagnosing curvature dynamics and informing data composition choices at scale. More broadly, our work shows that scalable curvature measures can provide actionable insights for large-scale training.
