Early-stopping for Transformer model training
Jing He, Hua Jiang, Cheng Li, Siqian Xin, Shuzhen Yang
TL;DR
This work tackles the challenge of costly Transformer training and overfitting by introducing a validation-free early-stopping criterion based on Random Matrix Theory. By focusing on the spectral tail of the first encoder self-attention Value matrix, en.0.s.a.V, and fitting it with a Power-Law, the authors identify a three-phase training dynamics and define a KS-based heavy-tailed metric with threshold $d^* = \frac{C}{\sqrt{n_{\text{tail}}}}$. The method triggers stopping at the epoch that maximizes $d^* - \tilde{d}$, achieving substantial training-time reductions (e.g., stopping around epoch 100 for several setups) with minimal loss-accuracy degradation compared to longer runs. This spectral-based, validation-set-free approach advances understanding of implicit regularization in Transformers and offers a practical pathway to more efficient LLM training, with potential generalization to other large models.
Abstract
This work, based on Random Matrix Theory (RMT), introduces a novel early-stopping strategy for Transformer training dynamics. Utilizing the Power Law (PL) fit to tansformer attention matrices as a probe, we demarcate training into three stages: structural exploration, heavy-tailed structure stabilization, and convergence saturation. Empirically, we observe that the spectral density of the shallow self-attention matrix $V$ consistently evolves into a heavy-tailed distribution. Crucially, we propose two consistent and validation-set-free criteria: a quantitative metric for heavy-tailed dynamics and a novel spectral signature indicative of convergence. The strong alignment between these criteria highlights the utility of RMT for monitoring and diagnosing the progression of Transformer model training.
