Manuscript Offprint
arXiv:2609.31101A Flatness-Generalization Relation in the Teacher-Student Tree-Committee Machine
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Brandon Livio Annesi, Davide Straziota, and Enrico M. Malatesta
Department of Quantitative Life Sciences, ICTP Trieste, Italy
Department of Computing Sciences, Bocconi University, 20136 Milano, Italy
Bocconi Institute for Data Science and Analytics (BIDSA), Bocconi University, 20136 Milano, Italy (Dated: September 28, 2026)
The flatness of the loss landscape at a minimizer is a widely used heuristic for reasoning about neural-network generalization, yet evidence for this relation is mostly empirical and controversial. We study this relation in a teacher-student tree committee machine, where both the ERM estimator and the Hessian spectrum are analytically tractable in the proportional high-dimensional limit. First, we use a zero-temperature Gibbs formulation to obtain predictions for the observables of the typical minimizers of the empirical loss. Secondly, we use Edwards-Jones formalism to derive the limiting Hessian resolvent around these typical minimizers. All predictions agree with finite-size gradient-descent simulations. Finally, we study three measures of flatness, namely the left and right edges and the spectral mean, and check if a decrease in generalization error as the dataset size is increased corresponds to an increase in flatness. We find that the answer strongly depends on the learning task and on the ratio of the number of parameters to the number of data points. In regression, the spectral mean and right edge correlate with the generalization error, while the left edge does so only in the overparametrized regime. In classification this correlation reliably holds only in the highly overparametrized phase, while for underparametrized networks it can even reverse.
I. INTRODUCTION
Why do overparametrized neural networks generalize after fitting high-dimensional training data? Among the many theoretical approaches that theoreticians have proposed to answer this question, a classic one has been to study the geometry of the loss landscape, in particular relating the generalization capacity of a network to the flatness of the minimizer [1–4]. The simple and heuristic argument is that if the difference between the population and empirical loss is not too big, then a function that minimizes the empirical loss and is also flat should also perform well on the population. This argument has been supported by many empirical works. For example [5] show that increasing the batch size of SGD leads to both worse generalization and sharper minima. Furthermore, the notion of flatness has been used to propose new optimization algorithms that favor flat solutions, which typically perform better in terms of generalization [6, 7].
Although this flatness-generalization relation is deeply rooted in machine learning lore, many subsequent works have found settings where this relation is broken [8–10]. For example [11] show that fully connected networks with ReLU activations can be reparametrized in a way that keeps the output invariant but varies many Hessian-based measures of flatness, thus potentially breaking this relation for any such measure. In an attempt to restore the relation, many works have come up with alternative measures of flatness that are invariant to this rescaling [9, 12–15]. Another line of research has compared the flatness of all minimizers of a loss, showing in some cases that minimizers with bad generalization properties can never be the flattest, even under reparametrization [16, 17].
A widely used tool for quantifying local flatness is the Hessian of the empirical loss. Its largest eigenvalue measures the curvature along the sharpest direction and arises from a quadratic approximation to worst-case neighborhood-based sharpness, whereas its trace measures the average curvature over parameter-space directions. Early empirical investigations found that the Hessian spectra of trained neural networks typically consist of a highly degenerate bulk concentrated near zero together with a small number of isolated eigenvalues [18, 19]. Subsequent work developed scalable methods for estimating the entire spectrum and studied its evolution during training, revealing that the gradient can become strongly aligned with the eigenspaces associated with the largest eigenvalues [20]. Other studies connected these spectral structures to batch size and robustness [21], and showed that outliers and secondary bulks can encode class and cross-class structure in the data [22, 23]. A unified phenomenological model proposed by [24] connected several of these observations: the emergence of a small number of directions with large positive curvature, the alignment of the gradient with the corresponding eigenspace, and the non-monotonic evolution of the largest
This work was conducted prior to the author’s employment at Amazon and is unrelated to his Amazon role.
Hessian eigenvalue during training.
On the theoretical side, random-matrix methods have been used to characterize the Hessian spectrum of simple neural network models [25–29]. In the case of networks with quadratic activations, related analyses have shown that spectral transitions of the Hessian can mark changes in the stability or informativeness of stationary points [30–32]. However, in none of these works has the Hessian been studied from a flatness-generalization perspective.
The advantage of these models is that they offer a controlled setting in which macroscopic observables can be characterized analytically. For example, in teacher-student settings, data is labeled by a teacher network and used to train a student, so that generalization is determined by a small number of teacher-student and student-student overlaps. Statistical-mechanics methods have long been used in this setting to derive learning curves, phase transitions, and asymptotically exact dynamical equations [33–36]. Among the architectures studied in this framework, committee machines are particularly useful because they combine analytical tractability with important features of more complex models, including non-convexity and hidden-unit specialization. Both classical and modern works have used the replica method to uncover interesting learning phenomena such as SAT/UNSAT transitions [37–42], specialization [43–46], and statistical-to-computational gaps [47].
Contributions. In this work, we investigate the flatness–generalization relation in teacher–student tree committee machines in the proportional high-dimensional limit for two different learning tasks, regression and classification. We first use the replica method to characterize typical minimizers of the loss and derive analytical predictions for the order parameters that describe them. Depending on the learning task, the dataset size and dimensionality, and the regularization strength, we find that the solution is either replica symmetric (RS) or exhibits full replica symmetry breaking (FRSB). Intuitively, this means that in the first case the set of minimizers is connected, while in the latter, the low-loss configurations are organized into a continuous hierarchy of clusters characterized by different mutual overlaps, as in Parisi's solution of mean-field spin glasses [48]. Although we are able to solve the FRSB equations for a set of parameters of the model, we then approximate it with a 1RSB solution, which is numerically easier to handle, and which we confirm to be a good approximation of FRSB observables [40].
Secondly, we use the Edwards-Jones replica formalism [49] to derive the spectrum of the Hessian matrix calculated on these minimizers. For square loss the resolvent is obtained from a scalar cubic equation whose coefficients are functions of the same order parameters that describe learning. From this, we calculate a set of scalar observables which are commonly used in the literature to quantify the flatness of a minimum, mainly the edges of the spectral distribution and its mean. Then, by varying dataset size, we check if a flatness-generalization correlation holds for some of these observables.
We find that whether this relation holds or not is highly dependent on the observable, the learning task, and the parameters. For regression, we find that the relation holds both for the right edge (known in the literature as sharpness) and for the trace, while it holds for the left edge only in the overparametrized phase. For classification instead, we find that it holds for all three observables only in the overparametrized phase: in all other phases the relation is broken, and in some cases flatness can also anticorrelate with generalization.
Finally, we validate all our theoretical predictions with an extensive set of gradient descent simulations. We find good agreement with the theory even in the replica symmetry broken regime, where the exact equilibrium sampling is known to be challenging for stable algorithms in related mean field spin glass models [50].
where we have used the indexing convention . The unknown teacher first-layer weights are drawn from a Gaussian distribution , the known second layer weights are chosen such that and , and the output function depends on the task: for regression it is simply , while for binary

Figure 1. Schematic representation of a tree committee machine.
classification it is . The labels are generated by the teacher network, while the student has the same architecture and has to learn the first layer weights:
Note how the student shares the same instance of the second layer weights as the teacher.
The student learns the weights w by minimizing the -regularized empirical loss
The factor ensures that the data-fitting and regularization terms are both of order N as is varied. We define the set of regularized empirical risk minimizers (ERM) by
To study its properties analytically, we introduce the Gibbs measure
In the limit, this measure concentrates on the set of ERM estimators.
The Gibbs formulation of the ERM (5) can be used also to access its generalization ability. For a fresh Gaussian input , let be the teacher label and the student's preactivation. In regression we use the test mean-squared error
Here denotes the average over the Gibbs measure (5). In classification we use the probability that teacher and student disagree
The next section describes how the set of ERM estimators can be characterized by a finite set of macroscopic order parameters.

Figure 2. Generalization error and order parameters for regression. The RS theory predicts the test error , squared norm , and teacher-student overlap as functions of sample complexity and regularization strength . Curves are theoretical predictions; markers report finite-size ( , ) GD simulations, averaged over 20 seeds. Error bars are not shown because they are very small.
III. THE ERM ESTIMATOR
A. Replica description and generalization error
We characterize typical ERM estimators in the proportional limit with fixed. The hidden-unit number is kept fixed while this thermodynamic limit is taken, and only afterwards we send . In this regime the quantity concentrates, so its typical (or most probable) value is given by the quenched average, which is called the free entropy density
Here the notation denotes the average over the training set that depends on the particular realization of the inputs and the teacher weights .
We evaluate the free entropy using the replica method [48], which expresses it in terms of a finite set of order parameters. These order parameters have a direct physical interpretation: they describe, after averaging over the dataset , the typical mutual overlap between independently sampled weights from and their typical alignment with the teacher. For hidden unit , let us define:
where are iid samples of the Gibbs distribution (5). Thus is the overlap between two Gibbs samples, is the squared norm of one sampled weight, and is the teacher-student alignment. Since the hidden units are statistically equivalent and their receptive fields involve disjoint, statistically independent subsets of the inputs, we can drop the hidden-unit index : and .
Although these quantities are averaged over , they are still random variables that depend on the draws from the Gibbs distribution, and could therefore have a non-trivial distribution. While it can be shown that both the norm and the teacher-student overlap have a trivial delta function distribution, this does not necessarily happen for the overlap . The remaining choice is how to approximate the distribution of this quantity.
Under the replica symmetric (RS) ansatz this distribution is a single delta peak centered around a quantity : . In other words, all pairs of independently sampled students have the same typical overlap . The overlaps thus behave similarly to the norm and the teacher-student overlap .
Replica symmetry breaking (RSB) ansatzes allow the same distribution to have more complicated shapes. The simplest one corresponds to the one-step replica symmetry breaking (1RSB) ansatz, which parametrizes the overlap distribution by two values : . This can be interpreted by imagining samples that are organized into clusters: two samples in the same cluster have overlap , while samples in different clusters have overlap . The Parisi parameter encodes the probability of observing the inter-cluster overlap . More elaborate RSB ansatzes introduce additional overlap scales, and in the full-RSB limit the discrete set of peaks

α
α
α
Figure 3. Classification order parameters. Solid curves denote RS solutions, while dashed curves denote 1RSB solutions. Markers report finite-size GD simulations for N = 2000, K = 20, averaged over 20 seeds. Error bars are not shown because they are very small.
becomes a continuous probability distribution over overlaps. We discuss in the next subsection which of these ansatzes is selected, depending on the task and the particular region of the phase diagram examined. The value of the order parameters that parametrize the probability distributions is then obtained by solving a set of saddle point equations; see discussion in appendix B.
From these order parameters we can also access the generalization performance of the network. In particular, the definitions in Eqs. (6) and (7) can be evaluated from the joint Gaussian law of the teacher and student outputs on a fresh test input. In the limit these errors become explicit functions of the order parameters Q and r:
The quantities , and the function appearing in (10) are written in terms of the infinite-width NNGP kernel
where and denote standard Gaussian measures. We use the shorthand , , and .
In the rest of the paper, we will focus on the square loss function
Although for classification tasks other losses may achieve better performance, the square loss allows a Gaussian integral entering the replica calculation to be evaluated analytically (see appendix B for additional detail). It therefore gives a tractable high-dimensional landscape in which to study the properties of the ERM estimator. For a generic loss, the same integral must instead be evaluated numerically. We will also choose since the NNGP kernel in (11) can be evaluated analytically.
B. Regression: a replica symmetric phase diagram
First of all, we analyze the properties of the ERM estimator in the regression task, where the teacher output function is the identity. In this case, teacher and student architectures are fully matched, and we find that the full phase diagram is captured by a Replica Symmetric ansatz. Let us stress that a priori there is no theoretical guarantee that this should be the case: Replica Symmetry is only guaranteed for convex losses or in Bayesian-optimal settings, neither of which applies here.
The test error, norm and overlap with the teacher are shown in Figure 2 as a function of for various values of . The behavior of the estimator is very similar to the Ridge Regression estimator: as long as the regularization is

Figure 4. Empirical spectrum vs theoretical spectrum for , and . The left panel shows regression; the middle and right panels show classification.
low enough, for the test error drops close to zero, and the teacher is almost fully recovered. For we find that the test error is non-monotonic in (not shown in the plot), while for it is monotonically decreasing with decreasing .
We then validate this RS ansatz by performing Gradient Descent experiments, and obtain an excellent match with our theory. More information on the numerics can be found in the appendix D.
C. Classification: Replica Symmetry Breaking
In the classification task, the ERM estimator displays a much richer phase diagram than its regression counterpart. The test error and the associated order parameters are shown in Fig. 3. At sufficiently low sample complexity, the system is well described by a replica symmetric (RS) saddle point for any value of the regularization strength .
As increases, however, the shape of the landscape changes. For sufficiently small , an intermediate window of opens in which the correct equilibrium description requires breaking the replica symmetry. Although the exact description of this phase involves full replica symmetry breaking (see Appendix B3 for detail), we use a 1RSB approximation, which captures the relevant observables with only small corrections from higher RSB levels.
Finally, once exceeds a threshold that depends explicitly on , the system exits the RSB phase and returns to a replica symmetric description, but of a qualitatively different character than the one found at small . We refer to this final regime as the recovery phase. Here the test error drops sharply and the teacher-student cosine similarity increases markedly, indicating that the Gibbs measure has become dominated by a single, well-recovered minimum with substantially better generalization properties than the states populating the RSB region. The character of the transition connecting the RSB phase to the recovery phase itself depends sensitively on : for sufficiently small regularization (for instance in Fig. 3) the transition is discontinuous, with the order parameters jumping abruptly between the RSB branch and the recovery-phase branch, consistent with a first-order transition and an associated coexistence region. For larger values of the transition instead becomes continuous, with the RSB branch merging smoothly into the recovery phase as is increased.
IV. HESSIAN SPECTRUM IN MINIMIZERS
Having described the macroscopic properties of typical minimizers, we turn to computing their local curvature. Let denote the Hessian of the data term in (3) evaluated at a typical trained configuration.
We are interested in computing the limiting spectral distribution of this matrix, where are its eigenvalues. To this end we compute the Stieltjes transform

Figure 5. Flatness observables versus generalization error in regression. Markers are given by GD simulations with N = 2000, K = 20. In the phases where the empirical spectrum develops outliers, we show the smallest eigenvalue of the continuous bulk.
from which the limiting spectral distribution can be obtained via the Stieltjes inversion formula
The Stieltjes transform can in turn be written as
which, using a Gaussian integral representation of the determinant, allows us to use the replica method [49], see Appendix C for additional detail.
In the case of the square loss function (12), the Stieltjes transform satisfies a cubic equation
where the coefficients , , are explicit functions of , the activation kernel and its derivatives, and the order parameters and can be found in Appendix C5. Consequently, the Hessian spectrum is determined by the same macroscopic state variables that were calculated above.
In Figure 4 we compare the theoretical spectrum with finite-N Gradient Descent simulations. The agreement is excellent in the RS phases, while a small discrepancy remains in the detailed spectral shape in the RSB phase. Since higher-order RSB corrections to the equilibrium order parameters are small (see Appendix B3), we expect this mismatch to be more likely related to the extremely slow equilibration times characteristic of full-RSB landscapes [51–53].
Finally, note that in the high- recovery phase, finite-N simulations show a set of K eigenvalues detaching from the left side of the continuous bulk (right panel of Fig. 4), with corresponding eigenvectors highly aligned to the teacher network. These modes are not captured by our limiting spectral density, since the large N limit is taken with fixed K and hence their spectral weight is . We therefore exclude them when comparing the theoretical bulk edge with simulations, and report the edge of the continuous part of the spectrum. We also note that those isolated Hessian eigenvalues can have important dynamical consequences in other models. In phase retrieval, for example, an outlier eigenvalue can be associated with an eigenvector aligned with the planted signal, and its appearance or disappearance through a BBP transition is closely tied to whether gradient descent can escape marginal minima and recover the signal [31].
V. FLATNESS IS PHASE-DEPENDENT
We now ask which Hessian observables track generalization. We focus on three basic spectral summaries: the mean curvature

Figure 6. Flatness observables versus generalization error in classification. Solid curves are RS branches and dashed ones are 1RSB branches. Markers are given by GD simulations with N = 2000, K = 20. In the phases where the empirical spectrum develops outliers, we show the smallest eigenvalue of the continuous bulk.
and the left and right spectral edges and . The right edge is a sharpness proxy, the trace measures the average curvature scale, and the left edge probes soft or marginal directions. Let us point out that our model possesses neither reparametrisation nor permutation symmetries, and therefore these flatness measures are not subject to the inconsistencies pointed out by [11]. As we vary , the generalization properties of the minimizers change. To check if a flatness-generalization relation holds in this setting, we plot these spectral observables as a function of the generalization error as is varied, and visually inspect if a positive correlation holds.
Regression. We first address this question in the regression task. Figure 5 shows the relation between test error and the three flatness observables. Across the range of regularization strengths that we explored, the spectral mean and the right edge are positively correlated with the test loss. In other words, both the average curvature and the largest curvature provide a geometric quantity that correlates with generalization.
The left edge behaves differently. It correlates with the test error only in the overparametrized regime (where ) and with a degree that depends on the regularization , higher giving a higher correlation. In the underparametrized phase, instead, this relation breaks down, the left edge becoming anticorrelated with the test error.
Classification. A similar analysis can be performed for classification, using the 1RSB solution as the best available description of the relevant minimizers. In Fig. 6 we show the relation between spectral observables and test error for three values of the regularization , one for which the transition from the RSB phase to the recovery RS phase is continuous, and one for which it is discontinuous, and one for which the full phase diagram is RS. The resulting picture is qualitatively consistent with regression only within the first overparametrized RS phase, where both the spectral mean and the left and right edges remain reliably correlated with generalization. The correspondence breaks down in the other two phases: in the RSB regime, spectral observables are essentially uncorrelated with the generalization error, while in the recovery phase the correlation can in some cases reverse sign, with flatter minima associated with worse generalization. Hessian-based flatness measures are therefore phase-dependent diagnostics in classification, rather than universal proxies for predictive performance.
An interesting remark is that the left edge in the RSB phase is constant and equal to . Indeed, the left edge cannot go below this value, since we are studying the Hessian of minimizers, and therefore the eigenvalues of the Hessian of the full loss (which contains a shift compared to the Hessian we are studying) cannot be negative. Our observation is thus that the RSB states predicted by our theory are marginal, a prediction which is matched by our simulations.
VI. DISCUSSION AND LIMITATIONS
We have studied Hessian-based flatness measures of empirical-risk minimizers in a teacher-student tree committee machine model. The ERM estimators are characterized by a finite set of order parameters, which determine both their learning performance and the limiting Hessian spectrum around the learned solution. We focused on three standard flatness measures: the spectral mean, which captures the average curvature, and the left and right spectral edges, which probe the softest and sharpest directions. We validated the resulting predictions against finite-size gradient-descent simulations, finding quantitative agreement for all observables considered.
The central conclusion is that the flatness–generalization relation is phase-dependent rather than universal. In regression, where the phase diagram is replica symmetric, the spectral mean and right edge correlate with the test error across the regularizations we consider, while the left edge tracks it only for . In classification the same observables predict generalization only in the overparametrized phase; in the intermediate RSB phase they are essentially uncorrelated with it, and in the high replica symmetric recovery phase the correlation can reverse.
Two features of the RSB phase are worth isolating. First, the left edge is pinned at throughout this phase. Since the full regularized loss is minimized, its Hessian is positive semidefinite, so the data-term Hessian cannot have eigenvalues below ; our solution saturates this bound, indicating that these minimizers are marginal. This is reproduced by the simulations. Second, at large the empirical Hessian develops a finite number of outlier eigenvalues to the left of the bulk. These are invisible to the limiting spectral density, which sees only eigenvalues; their origin, and their relation to the class-structured Hessian outliers reported in deep classifiers, lies outside the present framework.
Finally, the context in which we analyze the flatness-generalization relation is slightly different from the one that is typically found in empirical works: there the relation is observed with a fixed dataset among different minimizers of the same loss landscape. In our setting, instead we modify the loss landscape by varying the dataset size to input dimension ratio. Strictly speaking, our results concern how curvature and generalization co-vary, and need not transfer directly to the fixed-data setting in which the relation is usually probed. Nevertheless, studying this relation as the landscape is varied provides a complementary perspective on the interplay between curvature and generalization. Furthermore, varying has the advantage of sweeping across the RS, RSB, and recovery phases, which exposes the phase dependence we report. A similar analysis at fixed , tracking distinct minimizers of a single landscape, would be needed to establish whether the same phase-conditioned picture holds within a landscape as well as across a family of them; we leave this to future work.
VII. AI DISCLOSURE
In this work, we used generative AI tools for small steps in the replica computation, which were then independently verified. Additionally, we used generative AI tools for some of the plots, and for polishing the final version of this manuscript. We have reviewed all AI-assisted work. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.
[1] S. Hochreiter and J. Schmidhuber, Neural Computation 9, 1 (1997).
[2] D. J. C. MacKay, Neural Computation 4, 448 (1992).
[3] G. E. Hinton and D. van Camp, in Proceedings of the Sixth Annual Conference on Computational Learning Theory (1993) pp. 5–13.
[4] S. Hochreiter and J. Schmidhuber, in Advances in Neural Information Processing Systems, Vol. 7 (1994).
[5] N. S. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. T. P. Tang, CoRR abs/1609.04836 (2016), arXiv:1609.04836.
[6] P. Foret, A. Kleiner, H. Mobahi, and B. Neyshabur, in International Conference on Learning Representations (2021).
[7] P. Chaudhari, A. Choromanska, S. Soatto, Y. LeCun, C. Baldassi, C. Borgs, J. Chayes, L. Sagun, and R. Zecchina, Journal of Statistical Mechanics: Theory and Experiment 2019, 124018 (2019).
[8] S. Zhang, I. Reid, G. V. Pérez, and A. Louis, arXiv preprint arXiv:2103.06219 (2021).
[9] N. Shoham, L. Mor-Yosef, and H. Avron, arXiv preprint arXiv:2506.17809 (2025).
[10] M. Andriushchenko, F. Croce, M. Müller, M. Hein, and N. Flammarion, arXiv preprint arXiv:2302.07011 (2023).
[11] L. Dinh, R. Pascanu, S. Bengio, and Y. Bengio, in Proceedings of the 34th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 70 (2017).
[12] Y. Tsuzuku, I. Sato, and M. Sugiyama, in International Conference on Machine Learning (PMLR, 2020) pp. 9636–9647.
[13] H. Petzka, M. Kamp, L. Adilova, C. Sminchisescu, and M. Boley, arXiv preprint arXiv:2001.00939 (2020).
[14] F. Pittorino, A. Ferraro, G. Perugini, C. Feinauer, C. Baldassi, and R. Zecchina, Journal of Statistical Mechanics: Theory and Experiment 2022, 114007 (2022).
[15] J. Kwon, J. Kim, H. Park, and I. K. Choi, in International conference on machine learning (PMLR, 2021) pp. 5905–5914.
[16] H. Vardhan, H. Taheri, and A. Mazumdar, arXiv preprint arXiv:2606.04429 (2026).
[17] L. Ding, D. Drusvyatskiy, M. Fazel, and Z. Harchaoui, Information and Inference: A Journal of the IMA 13, iaae009 (2024).
[18] L. Sagun, U. Evci, V. U. Güney, Y. Dauphin, and L. Bottou, arXiv preprint arXiv:1706.04454 (2017).
[19] C. Baldassi, F. Pittorino, and R. Zecchina, Proceedings of the National Academy of Sciences 117, 161 (2020).
[20] B. Ghorbani, S. Krishnan, and Y. Xiao, in Proceedings of the 36th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 97 (2019) pp. 2232–2241.
[21] Z. Yao, A. Gholami, Q. Lei, K. Keutzer, and M. W. Mahoney, Advances in Neural Information Processing Systems 31 (2018).
[22] V. Papyan, Journal of Machine Learning Research 21, 1 (2020).
[23] M. Sabanayagam, F. Behrens, U. Adomaityte, and A. Dawid, arXiv preprint arXiv:2306.07104 (2023).
[24] S. Fort and S. Ganguli, arXiv preprint arXiv:1910.05929 (2019).
[25] J. Pennington and Y. Bahri, in Proceedings of the 34th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 70 (2017) pp. 2798–2806.
[26] Z. Liao and M. W. Mahoney, in Advances in Neural Information Processing Systems, Vol. 34 (2021).
[27] S. Franz, G. Parisi, P. Urbani, and F. Zamponi, Proceedings of the National Academy of Sciences 112, 14539 (2015).
[28] K. Asgari, A. Montanari, and B. Saeed, arXiv preprint arXiv:2502.01953 (2025).
[29] A. Montanari and B. Saeed, arXiv preprint arXiv:2602.14969 (2026).
[30] S. Sarao Mannelli, G. Biroli, C. Cammarota, F. Krzakala, P. Urbani, and L. Zdeborová, in Advances in Neural Information Processing Systems (2020).
[31] T. Bonnaire, G. Biroli, and C. Cammarota, arXiv preprint arXiv:2403.02418 (2024).
[32] B. L. Annesi, D. Bocchi, and C. Cammarota, arXiv preprint arXiv:2510.18435 (2025).
[33] T. L. H. Watkin, A. Rau, and M. Biehl, Reviews of Modern Physics 65, 499 (1993).
[34] A. Engel and C. Van den Broeck, Statistical Mechanics of Learning (Cambridge University Press, 2001).
[35] M. Biehl and H. Schwarze, Journal of Physics A: Mathematical and General 28, 643 (1995).
[36] D. Saad and S. A. Solla, Physical Review E 52, 4225 (1995).
[37] E. Barkai, D. Hansel, and H. Sompolinsky, Phys. Rev. A 45, 4146 (1992).
[38] E. Barkai, D. Hansel, and I. Kanter, Physical review letters 65, 2312 (1990).
[39] A. Engel, H. M. Köhler, F. Tschepke, H. Vollmayr, and A. Zippelius, Phys. Rev. A 45, 7590 (1992).
[40] B. L. Annesi, E. Malatesta, and F. Zamponi, SciPost Physics 18, 118 (2025).
[41] J. A. Zavatone-Veth and C. Pehlevan, Phys. Rev. E 103, L020301 (2021).
[42] C. Baldassi, E. M. Malatesta, and R. Zecchina, Physical review letters 123, 170602 (2019).
[43] H. Schwarze and J. A. Hertz, in Advances in Neural Information Processing Systems, Vol. 5 (1992) pp. 523–530.
[44] M. Biehl, E. Schlösser, and M. Ahr, Europhysics Letters 44, 261 (1998).
[45] M. Ahr, M. Biehl, and R. Urbanczik, The European Physical Journal B 10, 583 (1999).
[46] J. Barbier, F. Gerace, A. Ingrosso, C. Lauditi, E. M. Malatesta, G. Nwemadji, and R. Pérez Ortiz, arXiv preprint arXiv:2507.00629 (2025).
[47] B. Aubin, A. Maillard, J. Barbier, F. Krzakala, N. Macris, and L. Zdeborová, in Advances in Neural Information Processing Systems 31 (2018) pp. 3227–3238.
[48] M. Mézard, G. Parisi, and M. Virasoro, Spin glass theory and beyond: An Introduction to the Replica Method and Its Applications, Vol. 9 (World Scientific Publishing Company, 1987).
[49] S. F. Edwards and R. C. Jones, Journal of Physics A: Mathematical and General 9, 1595 (1976).
[50] A. El Alaoui, A. Montanari, and M. Sellke, in 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS) (IEEE, 2022) pp. 323–334.
[51] H. Sompolinsky and A. Zippelius, Phys. Rev. Lett. 47, 359 (1981).
[52] H. Sompolinsky and A. Zippelius, Phys. Rev. B 25, 6860 (1982).
[53] L. F. Cugliandolo and J. Kurchan, Journal of Physics A: Mathematical and General 27, 5749 (1994).
[54] R. M. Neal, “Priors for infinite networks,” in Bayesian Learning for Neural Networks (Springer New York, New York, NY, 1996) pp. 29–53.
[55] C. Williams, in Advances in Neural Information Processing Systems, Vol. 9, edited by M. Mozer, M. Jordan, and T. Petsche (MIT Press, 1996).
[56] J. A. Zavatone-Veth and C. Pehlevan, Neural Computation 34, 1136 (2022), https://direct.mit.edu/neco/article-pdf/34/5/1136/2008621/neco_a_01494.pdf.
[57] G. Parisi, Journal of Physics A: Mathematical and General 13, L115 (1980).
[58] S. Franz and G. Parisi, Journal de Physique I 5, 1401 (1995).
[59] H. Huang and Y. Kabashima, Phys. Rev. E 90, 052813 (2014).
A Flatness-Generalization Relation in the Teacher-Student Tree-Committee Machine SUPPLEMENTAL INFORMATION
Brandon Livio Annesi, Davide Straziota, and Enrico M. Malatesta
Department of Quantitative Life Sciences, ICTP Trieste, Italy
Department of Computing Sciences, Bocconi University, 20136 Milano, Italy
Bocconi Institute for Data Science and Analytics (BIDSA), Bocconi University, 20136 Milano, Italy (Dated: September 28, 2026)
CONTENTS
I. Introduction 1
II. The Model 2
III. The ERM Estimator 4
A. Replica description and generalization error 4
B. Regression: a replica symmetric phase diagram 5
C. Classification: Replica Symmetry Breaking 6
IV. Hessian Spectrum in Minimizers 6
V. Flatness is phase-dependent 7
VI. Discussion and limitations 8
VII. AI Disclosure 9
References 9
A. Setting and objective 12
B. Equilibrium measure 12
- Large width limit 13
- RS ansatz 14
- k-steps Replica Symmetry Breaking 14
a. Large limit 15
b. Square Loss case 16 - Generalization and training error 19
C. Replica computation of the spectrum of the Hessian 20
- Gibbs formulation of the spectrum of the Hessian 20
- Replica tricks 21
- Annealed ansatz 22
- Large width limit 24
- Square loss case 26
- Zero temperature limit 26
a. Square loss case 27 - Left and right edges of the spectrum of the Hessian 28
- A comment on the validity of the Annealed Ansatz 28
D. Details of the numerical experiments 28
- This work was conducted prior to the author's employment at Amazon and is unrelated to his Amazon role.
Appendix A: Setting and objective
We will consider two identical architectures given by a one-hidden layer architecture with non-overlapping first layer weights (tree committee machines)
where for regression and for classification. Moreover the input data will be standard normal i.i.d. random variables as well as the weights of the teacher . The second layer weights can be considered either to be fixed or sampled from a distribution. In the following we will assume that they satisfy the following conditions
i.e. to have mean 0 and variance 1. We consider the empirical risk minimization
of a loss function L given by
and are the output and the preactivation of the output of the teacher and student networks and represents the L2 regularization of the weights of the network. The ERM estimator can be obtained by studying the large limit of the Gibbs measure (or posterior distribution)
where we have denoted by the dataset and by the partition function
Note that the loss defined here (A4) differs from the one given in the main text by a factor . This factor can be absorbed in the definition of the inverse temperature and does not give any contribution in the large limit on which we focus.
Appendix B: Equilibrium measure
So far we did not specify how to compute the value of q, r and Q. This can be done by studying the equilibrium measure induced by the partition function defined in (A6), in particular via the corresponding equilibrium free entropy
This quantity can be computed with standard methods, namely the replica method [48] which is based on the following identity
We report here the outcome of the computation, which is reported elsewhere [42]. In the following we will denote by the index that runs over the hidden units , and by the indices running over the number of replicas . One finds that the equilibrium free entropy is obtained by a saddle point computation over a set of order parameters that can be conveniently condensed in symmetric matrices of dimension that we will call . The indices will be indexed by for convenience. This matrix has a block structure of the type
where with represents the overlap between the -th hidden unit of two students extracted from the Gibbs measure (A5), is the typical squared norm of students weights and finally is the overlap between the teacher and a student. Moreover , which corresponds to the norm of the teacher, which is 1 in the large limit by the central limit theorem.
One finds
where we have introduced the notation to denote the integration over a dimensional Gaussian variable with vanishing mean vector and covariance matrix . Note that for notational simplicity we have also rescaled the inverse temperature ; this will not affect the computation of the free entropy of the system apart from an overall scale.
1. Large width limit
We now perform the limit of large number of hidden units that we take only after the limits . Equivalently, we first determine the saddle points and evaluate the functions and at those saddle point values, and only afterwards we consider their large limit. Hence, although the number of hidden units is infinite, it remains of smaller order than both and . The limit can be done by noticing that each hidden unit accesses an uncorrelated portion of the input, so we expect the overlap matrix to be independent of .
We can exploit this property to substantially simplify both the entropic term and energetic contributions . The entropic term is straightforward and reads
The energetic term is considerably more complicated to treat [42]; but it can be simplified by noticing that the arguments of the loss function and behave as Gaussian random variables. Following closely [40, 42] one has
where the covariance matrix now reads
We have used the assumptions (A2) on the second layer weights.
Note that (B8) corresponds to the Neural Network Gaussian Process (NNGP) kernel that appears as the covariance matrix of the function implemented by a neural network at initialization in the infinite width limit and given two different inputs [54–56].
2. RS ansatz
In order to perform the extremization and the limit in (B4) we look for a saddle point matrix Q having a particular structure. The simplest ansatz is the Replica Symmetric one, which applied to the blocks of Q as in (B3) reads
It is now an easy job to perform the limit. One obtains
where and are defined as
The quantities , , can be compactly expressed in terms of the NNGP kernel function
as
3. k-steps Replica Symmetry Breaking
The equilibrium free entropy in (B4) can be obtained by searching for an extremizer in a more complex set of overlap matrices, which require the breaking of the replica symmetry [57]. We employ here a k-step Replica Symmetry Breaking (kRSB) ansatz for the overlap matrix
where is the element of a block matrix of size whose diagonal blocks have size ; those blocks are filled with ones whereas outside them all the elements are zero. In the previous equation we have also used the definitions
For the teacher-student overlap we keep the same ansatz as in (B9). We remind here that the k-steps RSB matrix has eigenvalues [40] that read
(B16) having defined and , . Using the Schur complement formula
(B17)
having used the fact that the set of k-step RSB matrices form a group. Using results exposed in [40] the entropic term now reads
The energetic term instead is
where is defined via the following recursion
Those expressions when evaluated to coincide with the RS (derived in section B2) and 1RSB approximations. Finally we point out that the equilibrium free entropy needs to be optimized with respect to the overlaps , and the breaking-points , as well as the squared norm and the teacher-student overlap .
a. Large limit
In the low temperature limit the order parameter and the breaking points scale with as
This implies the following scaling in for
can be written as
in terms of a generalized NNGP kernel function
where denotes the -th derivative of the activation function . Using this scaling the free energy is finite and can be written as
The entropic part reads in the limit as
where we have defined
The energetic term instead reads
where now the satisfies the modified following recursion
b. Square Loss case
In the square loss case the previous recursion present in the energetic term can be fully solved analytically for generic as all the integrals are Gaussian. Indeed one can guess the quantity
is stable under recursion. The constants and can be derived accordingly. We start determining them by imposing the initial condition as in (B20a); one finds
so that
If we assume (B30) for one finds for
(B33)
therefore and satisfy the recursion
Those recursions can be solved. Let's start from :
having defined
Correspondingly the coefficients are given by
(B37)
Therefore the energetic term reads
(B38)
The remaining integrals over v and h can be solved as well, but the result depends on the task i.e. on . For the classification case one finds
or
In the regression instead


Figure 7. Classification case with square loss function. Dependence of the squared norm Q on the inverse temperature for and . Left panel: comparison between the replica symmetric solution and the 1RSB solution. Right panel: comparison between the 1RSB solution and the finite-step k-RSB approximation with . In the k-RSB solution we have optimized also on the breaking points , . In both cases the curves coincide at high temperature and separate as increases.
Because the free entropy is analytic in terms of , , , and , it is easy to optimize it for generic . In Figure 7 we show the result of this optimization in the classification case, by comparing to the cases and . In particular, we show that the squared norm changes substantially when going from the RS solution to the RSB solution at large , while further RSB steps produce only comparatively small corrections to the 1RSB value.


Figure 8. Classification case with square loss function. Overlap function vs breaking points for , and several values of (left panel). On the right panel we have plotted the same data of the left panel vs . As predicted in (B21) this is the right scaling of the breaking-points for large . In black we also depict the exact solution in the limit . In the inset we show a numerical verification of (B21), plotting vs and showing that it approaches a finite limit (black dashed line).
In the left panel of Figure 8 we instead show the overlap q vs the breaking point value m. In the right panel we show a validation of the large beta scalings introduced in (B21).
The analytical large limit expression of the free entropy can be obtained by applying the scalings in (B21) or using the same approach above to solve the recursion in (B29). One finds for classification the following expression
(B42) while for regression
In the previous expressions we have defined
In Figure 9 we show the squared norm Q as a function of in the classification case comparing and steps of RSB in the large limit. We also present some representative plots for the overlap q in the right panel.


Figure 9. Classification case with square loss function. Left panel: squared norm versus in the large regime, for . We compare the 1RSB (orange curve) and -RSB with (green). In the -RSB solution we have optimized also on the breaking points , ; we therefore expect the green curve to be a good proxy of the full-RSB line (i.e. ). More than one step of RSB are therefore only slightly influencing the squared norm. We point out here that other order parameters are for all purposes left unchanged. Right panel: overlap vs breaking-points for several values of . The maximum value achieved by the overlap is .
4. Generalization and training error
In classification tasks ( ) the standard measure of predictive performance after training is the generalization error. It is defined by computing the probability of wrongly predicting a label which has been generated by the teacher network by sampling a new Gaussian input (i.e. not in the training set), i.e.
where we remind that denotes the average over the Gibbs measure (A5) and is the average over the realization of the dataset. denotes the preactivation of the student's output corresponding to the test input . This quantity can be easily computed again by using the replica method. In the limit, in particular, one finds
In regression we instead measure the test loss. In the limit one has
The training loss and the training error respectively relevant in regression and classification tasks can be found similarly. For example the training error is given by the following expression
Appendix C: Replica computation of the spectrum of the Hessian
1. Gibbs formulation of the spectrum of the Hessian
Consider to be a generic random matrix of size . Its limiting spectral distribution is defined as
where we have denoted by , the eigenvalues of . A fundamental quantity related to the empirical spectral distribution is the so-called Stieltjes transform, which is the normalized trace of the resolvent of
The previous expression can be inverted as
The Stieltjes transform can be computed by using the replica method, since it can be written as the derivative of a quantity that plays the role of a "free entropy"
which is defined as
plays the role of a partition function. Notice that similarly the cumulative distribution of can be obtained by computing the imaginary part of
The previous identities are valid for a generic random matrix . In the following we will be interested in computing the spectrum of the Hessian of the loss function of the teacher-student tree committee machine model as defined in section A, for a typical weight sampled from the Gibbs measure (A5). This means that we need to compute
where denotes the average over the Gibbs measure (A5) and is the average over the realization of the dataset.
The Hessian
(C8) is in our case an matrix having the following block structure
where we have used the notation and we have denoted by a prime the derivative of the loss function with respect to its second argument . Notice that we have not included in this definition the second derivative with respect to of the L2 regularization appearing in the loss in (3). Since the regularization term is quadratic in this provides only a shift to the spectrum of the Hessian depending on the value of . Notice that the Hessian that we compute here differs from the one in the main text by a scaling factor ; this factor can be taken into account a posteriori by appropriate rescaling of the spectrum: .
2. Replica tricks
In order to average over the input data, we use two replica tricks, one for and . Notice indeed the similarity of our computation with the standard Franz-Parisi potential [58]. By analogy the variables are acting as “fake” weights whereas the variable of the spectral density acts like a regularization over those fake weights.
where
In the following we will denote by whereas . Using the expression of the Hessian in (C9), the quadratic term in the partition function in (C5b) is given by
(C12)
We therefore found that the dependence on the disorder in the right hand side of (C11) appears via the three variables
which are jointly Gaussian random variables. Equivalently we can enforce those definitions via delta functions insertions and represent those delta functions via their Fourier representation. The average over the input data reads
(C14) where we have introduced the following overlap quantities
and we have also used the fact that for large thanks to the central limit theorem. The previous overlaps can be enforced via delta functions. In the end one finds the free entropy to be
where the interaction, entropic and energetic terms are the following:
(C17c)
where we have introduced the notation
Note that the average over can be performed in the entropic term . and we can simplify its expression to
Similarly it is convenient to perform the integral over in the energetic term
(C20)
where we remind the notation .
3. Annealed ansatz
In section B, we showed that the 1RSB theory provides an accurate approximation of the equilibrium measure, while higher-order RSB effects yield only negligible corrections. For simplicity, we therefore adopt a 1RSB ansatz for the overlap matrix (and the usual RS parametrization for )
where we remind that is the element of a block matrix of size whose diagonal blocks have size ; those blocks are filled with ones whereas outside them all the elements are zero. We do not have to worry of those order parameters because they fully satisfy the saddle point equations found in section B as in standard Franz-Parisi computations [58, 59]. Moreover, the conjugated parameters can be analytically expressed in terms of the non-conjugated ones only.
We instead consider an annealed ansatz for the new overlaps
Inserting this ansatz one can easily perform the limit and . The interaction and entropic term read
The energetic term is more involved, but it can be shown with standard methods to be equal to
where and which represents the average over the equilibrium measure, are given by
We have also defined the following quantities
Note that the expression of can be simplified by using Gaussian integration
(C27) where we have introduced the matrix with elements
Notice also that the saddle point equation for can be readily solved as . The entropic and interaction terms therefore simply read as follows
We therefore found that the “free entropy” in (C10) can be found by
The values of q, r and Q are found from the equilibrium saddle point equations (see section B). The maximization in (C30) imposes the following saddle point equation for P:
Note also that, following the discussion in Appendix C1 the Stieltjes transform of the Hessian is equal to the value of -P with P solving the saddle point equation (C31), as
The spectrum is then computed using (C3) which gives
4. Large width limit
Before sending K to infinity, we can furthermore simplify the energetic term, by using the matrix determinant lemma
(C34)
When K is large we can Taylor expand this expression to get
(C35)
where we have used the identities
In the large limit the variables , , , in (C26) become jointly Gaussian. The mean of all those observables vanishes because of the condition . The covariance elements uniquely determined by the equilibrium overlaps , , , and are those involving only averages of combinations of and
which match the quantities introduced in Appendix B (see e.g. (B13)) via the identification
The new covariance elements involve the quantities and relevant for the determination of the Hessian. Those are
Those effective order parameters can be all written in terms of the generalized kernel function (B24) as
Using those covariances one finally finds that the energetic term has the form
with the coefficients and being independent of P
In the previous expression we have denoted by the energetic equilibrium measure average in the large K limit, which at 1RSB level reads
5. Square loss case
When one takes the square loss all the integrals in the energetic term are Gaussian and can be solved. The free entropy therefore is given by where
with the coefficients and that read
The constants and depend on the task, i.e. they differ from the classification to the regression case . In classification one has
whereas in regression
The saddle point equation for P in both cases is therefore a cubic equation
with coefficients given by
Note that the coefficients in the RS case can be obtained by setting that is .
Equation (C48) can be therefore solved exactly. Indeed the cubic equation has either three real roots, corresponding to a vanishing spectral density, or one real root and a complex-conjugate pair. In the latter case, because of (C33) the physical solution is the root with negative imaginary part, so that . Finally, recalling that the computation above concerns , we have and . Therefore (C48) evaluated at , yields equation (16) of the main text with the identification
6. Zero temperature limit
Remind that in the large limit we have to impose the following scalings
This implies the following scalings in for the effective order parameters
It is easy to show by Taylor expansion that and are expressed in terms of the generalized kernel function in (B24) as
Note that the other effective order parameters stay finite in the large limit. One finally finds
(C54)
where
with the equilibrium measure in the large limit being
The replica symmetric case can be again recovered setting .
a. Square loss case
In the square loss case the limit can be worked out directly from the expressions given in section C5. What will change is the expression of the coefficients and . They are given by
where we remind that the constants C and T depend on the task and are given by (C46) and (C47) respectively in classification and regression, and tend to a finite limit for large .
7. Left and right edges of the spectrum of the Hessian
We remind the reader that the Stieltjes transform of the Hessian and the spectrum are respectively given by (see Appendix C1)
and the value of P is found maximizing with respect to P, which gives
The edges of the spectrum can be obtained by looking for the points where the derivative of is equal to zero, as beyond these points is not defined for real . Setting we get the two solutions (corresponding to the left and right edges)
8. A comment on the validity of the Annealed Ansatz
It is possible to generalize the previous computation which was valid for an annealed structure of the order parameters (C22), to a replica symmetric one
The computation is however long and tedious (especially when dealing with the large width limit) and we do not report it here. However one can analyze straightforwardly the saddle point equations. First the equation for the conjugated parameters , , and can be solved explicitly in terms of , , , , . One finds then that the free entropy function is a quadratic form of the variables , and . The only solution of the saddle point equations is therefore . Inserting this solution inside the free entropy one also finds that is always a solution. In this way one finds that
This tells us that the annealed ansatz is the correct one.
Appendix D: Details of the numerical experiments
We validate the theory with full-batch gradient-descent simulations of the model of Section II, using , , and . For each we draw a teacher 20 times, generate i.i.d. standard Gaussian training inputs and an independent test set of size 10000, and minimize the regularized objective (3) with nominal weight decay and learning rate . Training runs for up to epochs, with early stopping when the relative change of the loss and of the order parameters and all fall below between two consecutive checkpoints (checked every 100 epochs). At the end of training we evaluate the Hessian of the unregularized loss in closed form, exploiting the committee structure, and diagonalize the full matrix exactly, without any low-rank or stochastic approximation. The experiments are implemented in Julia, using Flux.jl for training, ForwardDiff.jl for , , and LinearAlgebra.jl for the diagonalization.