Neural networks (NNs) are central to modern machine learning and achieve state-of-the-art results in many applications. However, the relationship between loss geometry and generalization is still not well understood. The local geometry of the loss function near a critical point is well-approximated by its quadratic form, obtained through a second-order Taylor expansion. The coefficients of the quadratic term correspond to the Hessian matrix, whose eigenspectrum allows us to evaluate the sharpness of the loss at the critical point. Extensive research suggests flat critical points generalize better, while sharp ones lead to higher generalization error. However, sharpness requires the Hessian eigenspectrum, but general matrix characteristic equations have no closed-form solution. Therefore, most existing studies on evaluating loss sharpness rely on numerical approximation methods. Existing closed-form analyses of the eigenspectrum are primarily limited to simplified architectures, such as linear or ReLU-activated networks; consequently, theoretical analysis of smooth nonlinear multilayer neural networks remains limited. Against this background, this study focuses on nonlinear, smooth multilayer neural networks and derives a closed-form upper bound for the maximum eigenvalue of the Hessian with respect to the cross-entropy loss by leveraging the Wolkowicz-Styan bound. Specifically, the derived upper bound is expressed as a function of the affine transformation parameters, hidden layer dimensions, and the degree of orthogonality among the training samples. The primary contribution of this paper is an analytical characterization of loss sharpness in smooth nonlinear multilayer neural networks via a closed-form expression, avoiding explicit numerical eigenspectrum computation. We hope that this work provides a small yet meaningful step toward unraveling the mysteries of deep learning.
Figures & tables
Fig. 1 : The NN architecture analyzed in this study.
Fig. 2 : Relationship between the maximum eigenvalues at various critical points and their respective upper bounds. The eigenvalues are calculated numerically, while the upper bounds are calculated analytically using the main theorem in Eq. ( 7 ). All critical points observed in the experiment ( N=3 ) described in Appendix C are plotted.
Fig. 3 : (Top) Decision boundaries in the input space for the NNs with the first and second largest upper bounds of the maximum eigenvalue λsup(θ) , observed at all critical points ( N=3 ) in the experiments of Appendix C . Data points represent the training data, where white and black indicate Class 0 and Class 1, respectively. (Bottom) One-dimensional visualization of the loss L along the directions of the eigenvectors u1,⋯,u4 .
Fig. 4 : Cases where the upper bound of the maximum eigenvalue, λsup(θ) , ranks first and second smallest. Other descriptions are the same as in Figure 3 .
Fig. 5 : Dynamics of L , λsup(θ) , and λ1 with respect to training epochs for the highest and lowest λsup(θ) cases.
Fig. 6 : Distribution of the maximum eigenvalue upper bounds at critical points. All critical points observed in the experiment ( N=3 ) described in Appendix C were used.
Fig. 7 : Relationship between the maximum eigenvalue upper bound and the Macro F1-score (test data). The boxes represent the 25th–75th percentile range, the whiskers indicate the 10th–90th percentile range, and the thick horizontal lines denote the medians. The p -value was calculated using the two-sided Mann-Whitney U test. Critical points from the experiment ( N=3 ) described in Appendix C were used.
Fig. 8 : Hessian (Matrix size: 13×13 ) of a single critical point obtained in the experiment in Appendix C . The left shows the analytical solution based on Eqs. ( 15 )–( 18 ), and the right shows the numerical solution obtained by the three-point central difference approximation. Thick lines indicate the boundaries of the block components. Top-left: HL(w,w) , top-right: HL(w,v) , bottom-left: HL(v,w) , and bottom-right: HL(v,v) .
Fig. 9 : Comparison of the trace between numerical solutions obtained via “numpy.trace” and analytical solutions derived from Theorems 2 and 5 . All critical points identified in Appendix C are employed.
Fig. 10 : Relationship between the Frobenius norm of the parameters and the upper bound of the maximum eigenvalue. A total of 353 critical points mentioned in Appendix C were utilized ( N=3 ).
Fig. 11 : Relationship between the upper bound of the maximum eigenvalue and the dimensionality of the hidden layer N . The boxes represent the 25–75% range, the whiskers indicate the 10–90% range, and the thick horizontal lines denote the median. The p -value is obtained from the two-sided Mann-Whitney U test.
Fig. 12 : Relationship between the Frobenius norm of the hidden layer and the upper bound of the maximum eigenvalue. The left part shows a scatter plot of all critical points, while the right part provides an enlarged view of the same plot. The critical points used were obtained as described in Appendix C ( N=3 ).
Fig. 13 : Activation function f(y) and its first and second derivatives.