Sampling the space of solutions of an artificial neural network
Abstract
The weight space of an artificial neural network can be systematically explored using tools from statistical mechanics. We employ a combination of a hybrid Monte Carlo algorithm which performs long exploration steps, a ratchet-based algorithm to investigate connectivity paths, and coupled replica models simulations to study subdominant flat regions. Our analysis focuses on one hidden layer networks and spans a range of energy levels and constrained density regimes.
Near the interpolation threshold, the low-energy manifold shows a spiky topology. While these spikes aid gradient descent, they can trap general sampling algorithms at low temperatures; they remain connected by complex paths in a confined, non-flat region.
In the overparameterized regime, however, the low-energy manifold becomes entirely flat, forming an extended complex structure that is easy to sample. These numerical results are supported by an analytical study of the training error landscape, and we show numerically that the qualitative features of the loss landscape are robust across different data structures. Our study aims to provide new methodological insights for developing scalable methods for large networks.
I Introduction
Understanding the geometry of the loss landscape in deep neural network models is a critical challenge epf , as it directly influences the design and optimization of learning algorithms. The non-convexity of the loss landscape introduces significant complexity that often precludes the application of analytical methods.
Empirical evidence suggests that first-order optimization methods such as gradient descent (GD) and its variants such as stochastic gradient descent (SGD) can effectively navigate certain regions of these landscapes LeCun et al. (2015, 1998); Bottou (2010); Kingma and Ba (2014); Wilson et al. (2017). However, the insights derived from such methods are closely tied to the specifics of the algorithms, limiting their usefulness in providing a comprehensive understanding of the underlying geometric structures. For example, large language models are typically not trained to optimality on their data Kaplan et al. (2020); Hoffmann et al. (2022), linking their generalization properties to high-loss configurations, a relationship that remains poorly understood but holds promise for improving learning efficiency.
Analytical progress has been made in shallow, non-convex networks under simplified assumptions Gardner and Derrida (1988); Baldassi et al. (2019), using statistical physics techniques such as the replica and cavity methods. These studies reveal a highly intricate structure of minima Baldassi et al. (2020a, 2015, 2021); Annesi et al. (2023), characterized by features such as the overlap gap that renders some minima inaccessible Huang and Kabashima (2014), as well as rare, broad, and accessible minima. These minima have also been found to exhibit a diverse and broad range of generalization abilities Baldassi et al. (2022, 2020b).
On the empirical side, simple low-dimensional visualizations of the loss landscape have been used to gain insight into the general properties of these minima and their arrangement within the loss landscape Li et al. (2018); Huang et al. (2020). In particular, linear and piecewise linear paths Draxler et al. (2018); Garipov et al. (2018); Fort and Jastrzebski (2019) have been used to show that weight configurations found by SGD are generally not linearly connected but are nevertheless connected through a piecewise path Pittorino et al. (2022); Entezari et al. (2022).
The problem of studying the geometry of the solutions of a deep neural network can be easily formulated in terms of statistical mechanics. While an exhaustive search for the regions associated with a low value of the loss in the high-dimensional parameter space is infeasible, one can explore the parameter space requiring the average loss to be small, while allowing its instantaneous value to fluctuate around it.
We investigate the loss landscape using a Hybrid Monte Carlo (HMC) approach Duane et al. (1987), which enables large exploratory steps guided by gradients, in contrast to the purely random updates of standard Monte Carlo methods.
We also introduce a Ratchet Hybrid Monte Carlo (RHMC) algorithm, which steers sampling along complex paths while maintaining low loss values. This approach is inspired by a similar technique shown to be efficient in protein folding simulations Camilloni et al. (2011) and in identifying their transition states Tiana and Camilloni (2012).
To demonstrate the effectiveness of HMC and RHMC, we compare their results with analytical predictions for shallow non-convex networks and find agreement between the numerical results of the numerical methods and these predictions. Additionally, we uncover previously unreported theoretical insights into the geometry of minima in single–hidden–layer neural networks with generic activation functions Baldassi et al. (2019), including configurations that pose challenges to conventional optimization approaches.
Although these results underscore the efficacy of HMC and RHMC as powerful tools for probing neural networks with intricate architectures, extending these findings to large-scale networks remains a challenge. Our work provides new insights in this regard.
The architecture we have chosen to study the solution space of artificial neural networks is a tree committee machine Barkai et al. (1992); Engel et al. (1992); Baldassi et al. (2019). It can be considered as the simplest non-convex and non-linear toy model of a neural network. It has the advantages of being analytically treatable using replica methods techniques and that its optimized parameters are not related by trivial permutational symmetries. Classical works in the 90s have studied this model by using the replica method Barkai et al. (1990); Engel et al. (1992) for the sign activation function and in the thermodynamic limit and with fixed and for . The typical and atypical states Baldassi et al. (2019) of this model were studied in the large width limit (but with ) for a generic activation function. The same work provided a determination of the SAT/UNSAT transition, i.e. the maximum number of samples that the model can in principle store, in the Replica Symmetric (RS) and 1-step Replica Symmetry Breaking (1RSB) scheme. Recently the exact SAT/UNSAT transition has been computed in Annesi et al. (2024) by using a numerical solution of the full Replica Symmetry Breaking (fRSB) equations and it has been compared with the the maximal capacity reached by Gradient Descent; this unveiled the presence of an hard phase for Gradient Descent.
Our results are presented as follows. We shall first introduce the model and the algorithms to sample the loss space (Sect. II), then we shall describe the numerical results obtained close to the interpolation threshold (Sect. III.3) . In the case of the overparametrized regime (Sect. III.2), we shall first present the numerical results of the sampling and then compare it with the analytical calculations. Finally, we will discuss how these results change when realistic, correlated data are used as input (Sect. III.3), and we will draw the overall conclusions (Sect. IV).
II The model and the Methods for sampling and connecting solutions
II.1 The model and main definitions
The tree committee machine we consider consists of a two layer neural network with a generic non-linear activation function, in which each of the neurons of the hidden layer is connected only to a subset of elements of the –dimensional input vector (Fig. 1).
For any input , the output of the tree committee machine can be written as
(1) |
where is the width of the hidden layer and is a non-linear activation function. The first layer is parameterized by a set of weights , which will be trained to learn a dataset. The weights of the second layer, are fixed (not learned) to , with equal probability. Thus, the number of learned weights is exactly equal to , the input dimension of the network.
We consider a syntetic dataset made of input vectors , whose elements are extracted from a standard normal distribution, and the associated labels , also generated randomly with equal probability. The ratio is called constrained density.
The task is to find an -dimensional vector that correctly classifies each input in the dataset to the corresponding label , for every , i.e.
(2) |
A weight vector satisfying Eq. (2) will be therefore called in the following as a solution of the classification problem. Equivalently, this means that the training error of defined as the number of misclassified input-output associations
(3) |
is equal to zero, where we have denoted by the Heaviside function, and by the “error counting” loss. Since this loss is not differentiable, it is not used for optimization in machine learning, which typically relies on gradient-based algorithms. Instead, the error counting loss usually serves to evaluate whether a solution has been found, rather than guiding the optimization process itself.
A loss function that is commonly used to actually find solutions, and on which we will focus on this paper, is the so called cross-entropy loss, which in binary classification reads
(4) |
In the following we will say that a solution is “typical” if it is extracted from the flat measure over the set of all solutions. Sometimes one requires not only that is a solution of the classification problem, but also that it satisfies a certain degree of robustness. This can be enforced by ensuring that aligns with the corresponding label for any , within a specified confidence level
(5) |
is also named “margin”. Imposing a margin ensures that the solution sampled non only has zero training error, but also it is robust to perturbations of the inputs. Both typical (i.e. ) and atypically robust solutions with a positive margin can be obtained using a loss function that generalizes the one defined in Eq. (3),
(6) |
Indeed in the limit the Boltzmann measure of Eq. (7), equipped with the loss function of Eq. (6), focuses on solutions satisfying Eq. (5). We stress that extracting solutions by optimizing a loss different from the error counting loss is therefore to be considered as "atypical".
II.2 The canonical–ensemble framework
We shall look for the solutions of the network using the formalism of the canonical ensemble, thus sampling the space of parameters that have in average a given value of the loss. The solutions of the network are then found sampling the parameters at low temperature, where the average loss is minimal.
The posterior distribution corresponding to a given loss function (or log-likelihood) is given by the Boltzmann-like distribution
(7) |
where is the inverse temperature, is the prior distribution of the weights. For simplicity, a Boltzmann constant is assumed in every equation. The factor is a normalization factor that is called evidence in Bayesian statistics and partition function in statistical physics and it reads
(8) |
The loss function usually considered in the machine learning literature is factorized over the elements of the dataset, i.e.
(9) |
where is a loss function per pattern and identifies the preactivation of the output node. We consider as a prior a standard normal distribution, or equivalently a regularization term with parameter
(10) |
We can incorporate the regularization term and the loss term in a function
(11) |
that can be though as the (potential) energy associated to the neural network parameters . Equation (7) can be then rewritten as
(12) |
where we have dropped for simplicity the dependence on the dataset both on the posterior distribution and in the partition function .
II.3 Hybrid Monte Carlo algorithm
One of the main goals of statistical inference is to be able to sample from the posterior distribution of Eq. (12). Monte Carlo–based methods achieve this by simulating a Markovian stochastic process over that converges to the distribution of Eq. (12). In the Metropolis implementation, the transition rate of the stochastic process is
(13) |
where is a rate constant, is the a priori conditional probability of proposing a move and the last term is the acceptance probability. If is symmetric upon exhange of the two states, the condition of detailed balance holds and the process converges to Eq. (12). Often a uniform a priori probability is used; however, the higher the dimension of the system, the lower is the probability of going in an optimal direction with a uniform choice.
A way of mitigating this problem is to choose the a priori probability exploiting the knowledge of the energy gradient Duane et al. (1987), using a Hamiltonian formalism. Defining as the momenta associated to the weights , the Hamiltonian of the system is
(14) |
where is the inverse of a (fictitious) mass matrix.
The solutions to the equations of motion resulting from this Hamiltonian can be used as a preliminary step in the HMC algorithm. The time reversal invariance of Hamiltonian systems guarantees that the detailed balance holds.
In general, the equations of motions are solved with a numerical integrator, and detailed balance is satisfied only in the limit of time step . However, some integrators like the velocity Verlet algorithm
(15) |
are intrinsically symmetric for time reversal, and thus detailed balance holds for any choice of , even if the energy is not conserved. In fact, evaluating the latter of Eqs. (15) for one obtains
(16) |
and substituting it in the former,
which is a backward trajectory with respect to that of Eqs. (15).
Operatively, at each iteration of the Metropolis algorithm, the momenta are extracted from a Maxwell–Boltzmann distribution at temperature and a trajectory in the phase space is generated solving Eqs. (15). The final point of the trajectory is then accepted with probability , where . In the condition of detailed balance, the kinetic energy arising from the Metropolis acceptance probability and that coming from the Maxwell–Boltzmann term in the a priori probability cancel out and the algorithm converges to Eq. (12).
The power of this scheme is that it can produce large moves in a direction that change smoothly the energy of the system, and thus the Metropolis acceptance rate can remain high.
II.4 Double ratchet
In deep learning, characterizing the structure of neural network loss landscapes is crucial for understanding both optimization dynamics and generalization properties. A key line of research explores pathways between distinct weight configurations and , which typically correspond to solutions with low loss. The simplest approach examines how the loss behaves along the linear (or straight) path connecting these points. As shown in Draxler et al. (2018), overparameterized neural networks trained with stochastic gradient descent (SGD) often exhibit a loss barrier along the linear path. The barrier can be notably decreased by removing the symmetries that the neural network possess, like permutation symmetry of the hidden units Pittorino et al. (2022); Entezari et al. (2022).
While linear paths provide an intuitive and computationally efficient visualization of the loss landscape, they do not explicitly search for paths between solutions. To address these limitations, the authors of Garipov et al. (2018) introduced the use of piecewise linear trajectories, or “polygonal chains”, where the path is optimized by introducing intermediate pivot points. Although this method allows for more flexible connections, it is computationally demanding, requiring multiple training runs to optimize the pivot locations. Furthermore, the number of required pivots can grow significantly, particularly in less overparameterized settings, making the approach increasingly impractical in such regimes.
As an alternative to generate trajectories from to , we make use of a modified HMC algorithm that damps fluctuations in the direction opposite to . This is inspired from the ratchet–and–paw mechanical system and has given good results in molecular dynamics simulations Camilloni et al. (2011). It can be implemented calculating the dynamics of two points and starting in and , respectively, and evolving under a HMC with energy
(17) |
where is the potential energy of Eq.(11) and
(18) |
where is the minimum distance observed along the trajectories of the two points up to time . The time–dependent term of Eq. (18) favors the moves which get the two weights closer to each other, without exerting work to push them. In this way, the two points can autonomously find the minimum–energy path that connects them.
During each simulation, the two vectors are updated sequentially at each time step according to Eq. (17), until their cosine–similarity (or normalized overlap)
(19) |
is equal to 1. We will call the point where the two trajectories and meet as the “anchor” weight of , .
II.5 Coupled replica simulations
Besides sampling the Boltzmann–like probability of Eq. (12), it can be useful to bias in order to give more statistical weight to wider energy minima, which were shown to have better generalization properties than narrow ones Baldassi et al. (2015, 2020b, 2021, 2022).
We did this using an entropy–driven search algorithm inspired from ref. Baldassi et al. (2016). We used a system composed of coupled replicas , each starting from a different solution previously found by using the HMC. The replicas are coupled to the barycenter of the system
(20) |
with a potential
(21) |
where is a Lagrange multiplier regulating the mean distance between the replicas and the barycenter .
Algorithmically, the weights are updated sequentially according to Eq. (21), whereas the barycenter is computed once one of the replicas has moved. The value of is increased during the simulations, until the replicas all collapse onto a single high–entropy weight , that we will refer in the rest of the paper as the “center” weight found by the coupled replica simulation.
Note that in the definition of the barycenter of Eq. (20), the norm is rescaled to match the mean of the other replicas. This prevents the replicas from being driven toward a lower norm point, which would undesirably increase their energy .
III Results
Using the numerical techniques listed in the previous section, we explored the learning loss landscape of the tree committee machine at different energy levels and in different regimes of constrained density. Our main results are the following:
-
•
Close to interpolation threshold, the low-energy manifold has a spiky shaped structure, i.e. it is composed by sharp protrusions (targeted by GD) from which HMC is not able to escape at low temperatures. We nevertheless show that those protrusions are connected by complex paths through a more compact narrow region that is not completely flat (see section III.1)
-
•
In the overparametrized regime we show that the spikes do not trap anymore HMC. Furthermore, the low-energy manifold is entirely flat in the bulk, giving it a star-shaped structure. We confirm this numerical evidence by studying analytically the error landscape, showing analogous results (see section III.2).
-
•
Preliminary experiments on highly correlated, real-world datasets indicate that our findings remain robust even when the data exhibit significant structural properties.
Unless stated otherwise, in all the numerical simulations we have used a tree committee machine with input neurons, hidden neurons, and ReLU activation functions . In HMC simulations we have used the cross entropy loss function in Eq. (4). The norm of the weights is controlled by the Lagrange multiplier , with being the dimension of the dataset. The mass matrix in Eq. (14) required by the algorithm is set .
III.1 The model close to the interpolation threshold
We first study the loss landscape of the model in the underparametrized regime, i.e. just below the threshold at which full–batch GD can no longer find weights with zero training error and which is usually called "interpolation threshold" Engel and Van den Broeck (2001); Belkin et al. (2019). This happens approximately around (Fig. 2a), which is very far from the SAT/UNSAT transition where solutions cease to exist and which was computed in Annesi et al. (2024). All the numerical studies of this section therefore refer to the case .
III.1.1 The weight space displays three regimes with respect to the temperature
First, we trained the model with GD for approximately epochs and with a fixed learning rate . The solutions found with GD, from which we started the sampling, have mean energy and mean training error (Fig. 2a). The similarity between them is peaked at (see upper panel in Fig. 2c), which means that GD finds solutions with an almost fixed mutual distance.
Starting from GD solutions, we explored the space of parameters of the network with the HMC algorithm at different temperatures (Fig. 2b). For the average energy starts to flatten, suggesting that here the system freezes in the lowest–energy available states. The average energy is comparable with that of the solutions and also the mean training error remains . At these temperatures the sampling of the space of weights is difficult and the system gets trapped in local minima of the loss. The similarity distribution (see Eq. (19)) calculated on weights sampled from HMC trajectories starting from the same initial condition (intra-state overlap distribution) is strongly peaked around 1, see Fig. 2c, middle panel. This is markedly different from the inter-state overlap distribution, which is obtained by measuring the overlap between weights along HMC trajectories starting from strictly different initial conditions and is peaked at . Thus, the system is not able to equilibrate at these temperatures but stays close to the initial condition.
In the range of temperature the average energy increases almost linearly , with a scaling exponent . This is typical of a glassy thermodynamic phase with a sub-exponential number of accessible states. In this intermediate temperature range, there is no marked difference between the inter and intra state overlap distribution (Fig. 2c, lower panel). This suggests that the system is not trapped in local minima as in the low–temperature phase. The average similarity between states displays a single peak centered at , similar to that observed at low temperature, but with a larger variance.
In the high temperature phase, the average energy deviates from the linear behavior and the training error further increases. The distribution of similarities is very broaden. However, here the HMC algorithm becomes inefficient because the high velocities extracted before each HMC move require a very small step for a correct integration of the equations of motion and thus for an acceptable acceptance rate.
We summarize these results in Fig. 2d, where we show a sketch of the space of parameters at fixed norm. On this hypersphere, the solutions found by the GD define energy basins which are explored by the system at low and intermediate temperatures. These basins are disconnected at low temperature, since HMC remains confined near the initialization and cannot find pathways connecting the different basins while remaining at low energy and at zero training error.
III.1.2 The low–energy basins are connected by complex paths
To explore the connectivity of energy basins at low temperatures, we performed double-ratchet simulations, hoping to find paths which are not found by the HMC algorithm. This method is designed to identify low-barrier pathways between two weight configurations by following the minimal gradient in the direction that brings them closer together (Fig. 3a).
The double ratchets are initialized on different pairs of solutions found after a short thermalization of the system of approximately HMC steps. Along each simulation, the weights do not cross significant energy barriers, as compared to the average energy at this temperature, keeping the training error equal to zero. Conversely, the linear interpolation between pairs of points along the double–ratchet trajectory results in barriers that are substantially higher than the average energy (Fig. 3b). These results suggest that, although the solutions found by gradient descent are linearly mode disconnected, low-energy tortuous paths joining them still exist.
The anchor point obtained at the end of the double–ratchet trajectory has an energy that is slightly lower than the one of the initial points and is compatible with the average , that is the constrained dynamic arising from the double–ratchet simulation helps the equilibration of the system. The anchor weights obtained from several double ratchet simulations initialized from different weight pairs exhibit larger similarity than the respective initial vectors and are separated by energy barriers along their linear interpolation (Fig. 3c). This suggests the presence of a compact and narrow region of the solution space that must be traversed to move from one gradient descent solution to another. The similarity between the anchor weights and the associated initial weights is also centered around , as that between the starting solutions.
In summary (Fig. 3d), the basins identified by GD solutions are connected by non–linear paths pointing towards a denser, more compact region with slightly lower energy. The low–energy manifold of the space of weights has thus a spiky shape, with the GD solutions lying on its spikes.
III.1.3 The center is not flat
We then studied the geometry of the center of the spiky low energy manifold in more detail using coupled replica simulations, starting with five GD solutions coupled to their barycenter and increasing the harmonic couplings until all the running points converge to a single vector (Fig. 4a).
We compared the properties of the centers found in different coupled replica simulations with the solutions found by GD and the anchor points found by double ratchets initialized on different GD solutions at . The final configuration always has an energy that is lower by several standard deviations than the mean energy at the simulation temperature (Fig. 4b,c). The centers obtained from the coupled replica simulations are confined to a very narrow region of the solution space (Fig. 4b), even narrower than the region spanned by the anchor points (middle panel of Fig. 3c).
In addition, the similarity distribution between centers and anchor points is larger than that between centers and GD solutions. This ordering suggests that the centers lie deep within the bulk of the solution manifold, with anchor points positioned more peripherally and GD solutions even farther away. This “nested overlap” structure has already been observed in the negative perceptron problem, see Annesi et al. (2024).
Despite the high similarity between the vectors (), the latter are not linearly connected at fixed norm (Fig. 4b, upper panel, green curves), even though the barrier height is significantly lower than the one between and GD solutions , as well as points (Fig. 4b, upper panel, blue and red curves, respectively).
Finally, we performed double–ratchet simulations between pairs of vectors and between centers and GD solutions. In the latter case, at the weight initialized on the center stays very close to it along the double ratchet dynamics (and its energy within two standard deviations from the average at the simulation temperature); the weight starting from the GD solution instead slowly lowers its energy until the coupled vector is reached (Fig. 4c, blue curves).
On the contrary, when the same simulation is performed between pairs of center points at , the latter are able to connect to each other through paths whose energy is lower than the average (Fig. 4c, green curves).
From this last computational analysis, we conclude that the center of the spiky low–energy manifold is not barrier–free. Although there are low–energy paths connecting all low–energy regions of the structure, these are simple as linear paths. Moreover, there is a small slope of the energy towards the center.
III.1.4 The intermediate temperature regime
By increasing the temperature to intermediate values (cf. Fig. 2), the system reaches a phase where the HMC algorithm can easily sample the space of weights. In this phase the training error is still small but non–negligible (up to ) but the system can still learn some of the data we present.
The similarity distribution between states shows a single peak centered at , indicating that most of the sample states are equivalent to each other. This is different from what is found at low temperatures, where there is a difference between points at the periphery of the structure and weights in the center of the low–energy manifold. Such a single peak in is compatible with what is known in the language of complex systems as replica-symmetric behavior of the system Mézard et al. (1987).
The states sampled during simulations in this intermediate regime () show an average similarity with respect to GD solutions and with respect to both the and vectors found in the low–temperature phase. Consequently, here the system is never close to any specific region of the subspace explored at low temperatures. In particular, the large mean distance between the center of the manifold and the typical states sampled at intermediate temperatures suggests that the former is entropically unfavorable. This fact, along with the unimodal shape of the cosine–similarity distribution, suggests that the visited manifold at intermediate temperatures still retains a (less rugged) spiky shape, but with a “hollow” center characterized by high free energy.
III.2 The overparametrized regime
III.2.1 Similarities and differences with the underparametrized regime
We then compared the properties of the space of weights that we found at the interpolation threshold with that of the overparametrized regime.
We performed various HMC simulations at for a wide range of temperatures, all of which never indicate a frozen behavior as, similarly to the intermediate–temperature case at , the intra e inter overlap distribution coincide, see Fig. 5a. Moreover, the energy profile along the linear paths between the sampled states shows a central free energy barrier, both at and at most temperatures at . In the last case, the central barrier disappears for vanishing temperatures and the energy profile assumes a convex shape (Fig. 5b).
In conclusion, the intermediate–temperature configurations visited by the system are similarly distributed both near the interpolation threshold and in the overparametrized regime, where in both scenarios the manifold exhibits a symmetric shape, in the sense that the system populates a single kind of state, belonging to the spiky periphery of the space. Only at low temperatures do the two cases differ, since in the former the explored subspace maintains a spiky shape, where part of the center of the manifold and its periphery are populated, whilst in the latter it becomes convex.

III.2.2 The barrier along linear paths between sampled solutions can be computed analytically
In the overparametrized regime, we can compute analytically both the energy (loss) and the training error along the geodesic path connecting two weights , in the thermodynamic limit, extending the previous analysis performed in ref. Annesi et al. (2023) to the tree committee machine case. In full generality we will assume to sample the two weights from two different Boltzmann distributions , whose individual form are the same as in equation (7) but each of them differing from the choice of the loss function and the prior, i.e.
(22a) | |||
(22b) |
Notice, moreover, that in equations (22) the training data is the same for both Boltzmann distributions. As in Section II we choose a Gaussian distribution as a prior , , with a regularization parameter that we denote respectively by and . In the large limit the choice of the regularization parameter will induce a non-trivial value of the norm of the weights and . In the following we will suppose that and are chosen such that the norm of is the same as the one of , i.e. .
We are interested in computing the average training error and training loss landscape on the geodesic path joining and at fixed squared norm . This can be obtained as follows. Given and we define the interpolating weight with parameter as the vector whose components are the linear interpolation of the components of and
(23) |
In order to compute the geodesic path at the same squared norm , we finally need to project the whole straight path on the hypersphere of radius . This defines the weight
(24) |
where
(25) |
In the previous expression we have introduced the quantity
(26) |
which corresponds to the overlap between and . In the previous equation we have denoted by the average over the Boltzmann distribution (7) and by the average over the dataset.
We are interested in finding what is the average value of a loss of the projected interpolated weight as a function of , and how this profile depends on the choice of the endpoints and via the probability density functions in (22). In formulas, what we compute is
(27) |
Using a general loss allows us also to both have access to training loss and training error profiles. Equation (27) can be computed by the replica method in the large limit. In the following we will focus only on the infinite width limit with the ratio , as done in Baldassi et al. (2019). The full calculation is reported in Appendix B. Here we only mention that the result of the calculation, assuming no replica symmetry breaking of the solution space (i.e. in the so called Replica Symmetric ansatz), will depend on simple geometrical quantities. Those are the typical overlap between two weights , extracted from , (respectively from , i.e. ), i.e.
(28a) | ||||
(28b) |
as well as the typical overlap between the endpoints and , which was introduced in equation (26). In the Replica Symmetric ansatz all those overlaps concentrate in the large limit. Since the weights and are in general samples of two different probability distributions (22), the overlaps and can be simply obtained by computing with the replica method the corresponding partition function and . We refer to Baldassi et al. (2019, 2023) for such calculation, but we report for convenience of the reader in Appendix A its outcome. The overlap is instead slightly more difficult to compute, because it amounts to study an elastically coupled system of weights , in the limit where the coupling is sent to zero, see Annesi et al. (2023) for details. We present in Appendix D an alternative and complementary calculation based on the Franz-Parisi potential Franz and Parisi (1995).
III.2.3 Comparison between theory and simulations
We compare here our analytical predictions with the numerical results obtained using the HMC algorithm. We have considered the case , a constraint density , temperature and L2 regularization .
The plot of Figure 6 shows the cross-entropy loss along the geodesic path interpolating between two samples of the Boltzmann distribution. We note that the cross-entropy profile presents a non-trivial non-monotonic behavior: starting from one of the two configurations, the loss starts to decrease and then increasing again, reaching a local maximum in the middle of the path. This same non-trivial behavior is also observed in the numerical estimate. We emphasize that achieving the asymptotic limit predicted by the theory is nontrivial, as it requires accounting for finite and corrections while operating in the scaling regime . Nevertheless, by keeping the ratio small and increasing , we show that the simulations approach the predictions given by our infinite-size theory.

III.2.4 The star-shaped property of the solution space
Thus far, in both the underparametrized and overparametrized regimes we have focused on the energy landscape induced by the cross-entropy loss. Here, we broaden our scope to examine the entire solution space, i.e. we consider the loss function (6). Notice that this is a larger set of set of weights that includes, but is not limited to, those configurations selected by optimizing the cross-entropy loss.
In Figure 7 we consider the case in which the endpoints are sampled from the large limit of the Boltzmann distributions corresponding to the theta loss (6), with two equal margin . We plot the training error (3) (i.e. ) on the geodesic path joining such solutions for several values of in the low regime, i.e. corresponding to a rather overparameterized network. It can be noticed that for , i.e. for typical solutions of the learning task, as soon as one moves away from the endpoints the training error is strictly positive, meaning that and . Increasing the value of there is a small neighborhood of the endpoints where the training error vanishes. Overall the whole curve of the training error monotonically decreases if one keeps increasing . For the two endpoints become linear mode connected. This has been called in Annesi et al. (2023) the “geodesically convex” component of the manifold of solutions, as any two solutions sampled within this region are linear mode connected. In the two panels of Figure 7 we also compare two activation functions, the ReLU and the sign activation function. It can be noticed that overall the barrier for a fixed is smaller in the ReLU activation case. This is consistent with was found in Baldassi et al. (2019), where it has been argued that the training error landscape corresponding to the ReLU activation possess wider and flatter minima with respect to other activation choices like the sign case.
In Figure 8 we consider the case in which the endpoints are sampled from the large limit of the Boltzmann distributions corresponding to the loss (6), but with two different margin and . We consider the first endpoint to be a typical solution of the classification task, i.e. to have margin . Similarly as before, we plot the training error, i.e. , on the geodesic path joining to for several values of and for the same considered in Figure 7. It can be noticed that the maximum of the barrier is always closer to the less robust solution, and the whole curve monotonically decreases if one keeps increasing . For the two solutions become eventually linear mode connected. This means that typical solutions despite not being linear mode connected, are connected by a piecewise path, passing through a solution having a rather large margin . It therefore exists a subset of solutions called kernel, that are geodesically connected to any other solution of the learning task111Indeed if , then not only this solution is linear mode connected to a typical solution with , but also to any other solution with margin extracted from the Boltzmann measure induced by (6).. This implies that the space of solutions is star-shaped in the overparameterized regime. Similar plots hold for other activation functions; we report the case of the Erf activation function in the appendix. This conclusion is consistent with what was found in reference Annesi et al. (2023) for a non-convex but simpler linear model called the negative perceptron. Recently in Lin et al. (2024); Sonthalia et al. (2024), numerical evidence has been presented suggesting that the solutions space of deep networks possess a star-shaped geometry. We first provide theoretical support for this claim in the case of simple, overparameterized one-hidden-layer networks with general activation functions.
We refer to Appendix B.4.3 for a discussion of the training error and loss along the path connecting a typical solution of the cross entropy loss and the error counting loss, which shows that the low temperature configurations sampled from the cross-entropy loss are solutions located deep into the geodesically convex component of the manifold of solutions. Note that this is consistent with what has been observed numerically in Fig. 5. As we have numerically observed, however, this is not true in the underparametrized regime, as typical cross-entropy loss solutions become linear mode disconnected.




III.3 The geometrical structure can be robust with respect to highly correlated data
To further assess the applicability of our techniques, we repeated the numerical study on the same architecture, utilizing correlated data for both the training phase and the exploration of the weight space via ratchet and coupled replica simulations. Again, we treated a case of binary classification, where the dataset is composed of 32x32 images of cats and dogs from the CIFAR10 repository, each of which labeled respectively as and . Furthermore, each component of an input vector , representing a given image in the training dataset, has been scaled so that (cf. Fig. 9a).
Due to the nature of the task, we again adopted the binary cross–entropy function with a regularization term as the potential energy of the system (see Eq. (11)), with the Lagrange multiplier . On the contrary, we slightly modified the networks parameters, because of the different size of the input vectors . In this case, , so that the -th neuron in the hidden layer takes as input the -th row of each input image. Once again, the value of is chosen to be just below the threshold where full–batch GD can no longer find weights with zero training error. In this case, that is (or equivalently ).
Similarly to the case of random inputs, the energy of the sampled state decreases as we move from the GD solutions to the center (upper panel in Fig. 9b). An important difference is that now the distribution of similarities between the center and the GD solutions partially overlaps with the similarity between the center and the points found by the double ratchet to connect the GD solutions. In turn, this distribution partially overlaps with that of similarity between the different central points (lower panel in Fig. Fig. 9b). This suggests that the spiky manifold has a larger center for correlated data.
Moreover, the energy profile seems to display higher peaks and to be more rugged than the random label case, as apparent from the shape of the energy along the paths generated by the double ratchet (Fig. 9c) and from the irregular relation between the height of the peaks found along the linear paths (compare the upper panel of Fig. 9b with that of Fig. 4b).
The central points are still connected by low–energy paths (Fig. 9c), even though the mean similarity between them is lower than in the random–label case ().
Summing up, the low–energy states of a tree committee machine trained with correlated data still have a spiky shape, but its energy profile is more rugged and irregular than the random–label case. Moreover, the center is more bulky (see sketch in Fig. 9d).
IV Discussion and Conclusions
In this work, we analyzed the loss landscape of a simple one-hidden-layer artificial neural network with a tree-like structure in both the underparameterized and overparameterized regimes. We employed various numerical techniques, including (Hamiltonian) Monte Carlo methods and biased dynamics that were originally developed in statistical mechanics and have been used to identify native-like conformations in protein folding molecular dynamics simulations. This approach allowed us to sample the weight space manifold at different loss levels and investigate low-energy paths connecting distinct weights.
Close to the interpolation threshold, the numerical exploration of the weight space by using HMC starting from GD solutions, identified two main regimes as a function of temperature. At low temperatures, the system is in a frozen state having zero training error and is unable to move sufficiently far away from initialization (the inter-state overlap distribution is peaked near 1), despite the overlap between HMC trajectories starting from different GD solutions (intra-state overlap) is strictly less then 1. The linear interpolation between GD solutions also shows a loss barrier. Despite this, GD solutions can be connected by a low energy path; those paths are tortuous and difficult to find by an unbiased Monte Carlo algorithm. We identified them by using a double–ratchet hybrid Monte Carlo algorithm, which penalizes moves that cause the two gradient descent solutions to drift apart. These results suggest that the manifold of low-energy weights has a spiky topology, with gradient descent solutions located along its protruding rays. We have also shown that the center of the manifold solutions has also has a complex pattern of valleys and barriers.
At intermediate temperatures, the training error is small but not zero. Differently from the low temperature regime, the HMC dynamics is ergodic, since there is no difference between inter- and intra-state overlaps. This means that the shape of the populated state is particularly symmetric and corresponds, in the language of replica calculations, to a replica–symmetric solution. The energy always displays a maximum at the center of the straight lines between states populated at intermediate temperatures.
The symmetric, hollow structure of states at intermediate temperature is similar to that displayed by the system in the overparametrized regime, suggesting that the two manifolds are quite similar. The main difference between the overparametrized regime and that at the interpolation threshold is at low temperature; while in the latter case we have the spiky shape of the manifold discussed above, in the former they are more spherical, located at the center of the manifold.
In the overparametrized regime we have also resorted to replica computation to study both the loss and the training error landscape on the linear interpolation between two weights sampled with different Boltzmann probability distributions. Our work shows that the training error manifold is star-shaped: it exists a subset of robust, solutions having a large margin that are linear mode connected to solutions having lower (even zero) margin, similarly to what was found in Annesi et al. (2023). Typical low temperature weights extracted from the Boltzmann measure equipped with the cross entropy loss function tend to focus on the inner core of the star-shaped manifold, that we called geodesically convex component, as any two solutions in this region are linear mode connected. This result also agrees with numerical simulations. Our theory also reproduces the non-monotonic behavior of the energy along the linear interpolation between Boltzmann samples at larger temperatures.
The use of a realistic training dataset, displaying correlated data, instead of random data, does not change substantially the properties of the space of weights at low temperature. The center of the spiky structure becomes more bulky and the barriers more heterogeneous, but the overall geometry does not change.
References
- (1) Loss Landscape of Neural Networks: theoretical insights and practical implications, EPFL Virtual Symposium .
- LeCun et al. (2015) Y. LeCun, Y. Bengio, and G. Hinton, Nature 521, 436 (2015).
- LeCun et al. (1998) Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, Proceedings of the IEEE 86, 2278 (1998).
- Bottou (2010) L. Bottou, in Proceedings of COMPSTAT’2010 (Springer, 2010) pp. 177–186.
- Kingma and Ba (2014) D. P. Kingma and J. Ba, CoRR abs/1412.6980 (2014).
- Wilson et al. (2017) A. C. Wilson, R. Roelofs, M. Stern, N. Srebro, and B. Recht, in Advances in Neural Information Processing Systems 30, edited by I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (Curran Associates, Inc., 2017) pp. 4148–4158.
- Kaplan et al. (2020) J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei, arXiv preprint arXiv:2001.08361 (2020).
- Hoffmann et al. (2022) J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. de Las Casas, L. A. Hendricks, J. Welbl, A. Clark, T. Hennigan, E. Noland, K. Millican, G. van den Driessche, B. Damoc, A. Guy, S. Osindero, K. Simonyan, E. Elsen, O. Vinyals, J. W. Rae, and L. Sifre, in Proceedings of the 36th International Conference on Neural Information Processing Systems, NIPS ’22 (Curran Associates Inc., Red Hook, NY, USA, 2022).
- Gardner and Derrida (1988) E. Gardner and B. Derrida, Journal of Physics A: Mathematical and General 21, 271 (1988).
- Baldassi et al. (2019) C. Baldassi, E. M. Malatesta, and R. Zecchina, Phys. Rev. Lett. 123, 170602 (2019).
- Baldassi et al. (2020a) C. Baldassi, F. Pittorino, and R. Zecchina, Proceedings of the National Academy of Sciences 117, 161 (2020a).
- Baldassi et al. (2015) C. Baldassi, A. Ingrosso, C. Lucibello, L. Saglietti, and R. Zecchina, Phys. Rev. Lett. 115, 128101 (2015).
- Baldassi et al. (2021) C. Baldassi, C. Lauditi, E. M. Malatesta, G. Perugini, and R. Zecchina, Physical Review Letters 127, 278301 (2021).
- Annesi et al. (2023) B. L. Annesi, C. Lauditi, C. Lucibello, E. M. Malatesta, G. Perugini, F. Pittorino, and L. Saglietti, Phys. Rev. Lett. 131, 227301 (2023).
- Huang and Kabashima (2014) H. Huang and Y. Kabashima, Phys. Rev. E 90, 052813 (2014).
- Baldassi et al. (2022) C. Baldassi, C. Lauditi, E. M. Malatesta, R. Pacelli, G. Perugini, and R. Zecchina, Physical Review E 106, 014116 (2022).
- Baldassi et al. (2020b) C. Baldassi, E. M. Malatesta, M. Negri, and R. Zecchina, Journal of Statistical Mechanics: Theory and Experiment 2020, 124012 (2020b).
- Li et al. (2018) H. Li, Z. Xu, G. Taylor, C. Studer, and T. Goldstein, in Advances in Neural Information Processing Systems, Vol. 31, edited by S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (Curran Associates, Inc., 2018).
- Huang et al. (2020) W. R. Huang, Z. Emam, M. Goldblum, L. Fowl, J. K. Terry, F. Huang, and T. Goldstein, in Proceedings on "I Can’t Believe It’s Not Better!" at NeurIPS Workshops, Proceedings of Machine Learning Research, Vol. 137, edited by J. Zosa Forde, F. Ruiz, M. F. Pradier, and A. Schein (PMLR, 2020) pp. 87–97.
- Draxler et al. (2018) F. Draxler, K. Veschgini, M. Salmhofer, and F. Hamprecht, in Proceedings of the 35th International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 80, edited by J. Dy and A. Krause (PMLR, 2018) pp. 1309–1318.
- Garipov et al. (2018) T. Garipov, P. Izmailov, D. Podoprikhin, D. P. Vetrov, and A. G. Wilson, in Advances in Neural Information Processing Systems, Vol. 31, edited by S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (Curran Associates, Inc., 2018).
- Fort and Jastrzebski (2019) S. Fort and S. Jastrzebski, Advances in Neural Information Processing Systems 32 (2019).
- Pittorino et al. (2022) F. Pittorino, A. Ferraro, G. Perugini, C. Feinauer, C. Baldassi, and R. Zecchina, Journal of Statistical Mechanics: Theory and Experiment 2022, 114007 (2022).
- Entezari et al. (2022) R. Entezari, H. Sedghi, O. Saukh, and B. Neyshabur, in International Conference on Learning Representations (2022).
- Duane et al. (1987) S. Duane, A. D. Kennedy, B. J. Pendleton, and D. Roweth, Physics Letters B 195, 216 (1987).
- Camilloni et al. (2011) C. Camilloni, R. A. Broglia, and G. Tiana, Journal of Chemical Physics 134, 45105 (2011).
- Tiana and Camilloni (2012) G. Tiana and C. Camilloni, The Journal of Chemical Physics 137, 235101 (2012).
- Barkai et al. (1992) E. Barkai, D. Hansel, and H. Sompolinsky, Phys. Rev. A 45, 4146 (1992).
- Engel et al. (1992) A. Engel, H. M. Köhler, F. Tschepke, H. Vollmayr, and A. Zippelius, Phys. Rev. A 45, 7590 (1992).
- Barkai et al. (1990) E. Barkai, D. Hansel, and I. Kanter, Physical review letters 65, 2312 (1990).
- Annesi et al. (2024) B. L. Annesi, E. M. Malatesta, and F. Zamponi, arXiv preprint arXiv:2410.06717 (2024).
- Baldassi et al. (2016) C. Baldassi, C. Borgs, J. T. Chayes, A. Ingrosso, C. Lucibello, L. Saglietti, and R. Zecchina, Proceedings of the National Academy of Sciences 113, E7655 (2016).
- Engel and Van den Broeck (2001) A. Engel and C. Van den Broeck, Statistical mechanics of learning (Cambridge University Press, 2001).
- Belkin et al. (2019) M. Belkin, D. Hsu, S. Ma, and S. Mandal, Proceedings of the National Academy of Sciences 116, 15849 (2019).
- Mézard et al. (1987) 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).
- Baldassi et al. (2023) C. Baldassi, E. M. Malatesta, G. Perugini, and R. Zecchina, Phys. Rev. E 108, 024310 (2023).
- Franz and Parisi (1995) S. Franz and G. Parisi, Journal de Physique I 5, 1401 (1995).
- Lin et al. (2024) Z. Lin, P. Li, and L. Wu, arXiv preprint arXiv:2404.06391 (2024).
- Sonthalia et al. (2024) A. Sonthalia, A. Rubinstein, E. Abbasnejad, and S. J. Oh, arXiv preprint arXiv:2403.07968 (2024).
- Neal (1996) R. M. Neal, “Priors for infinite networks,” in Bayesian Learning for Neural Networks (Springer New York, New York, NY, 1996) pp. 29–53.
Appendix A Equilibrium measure
We report here the outcome of the equilibrium calculation, through the evaluation of the free entropy
(29) |
where is the partition function defined in equation (8) with the Gaussian prior (10); refers to the average over the random dataset . This average can be performed by using the replica trick Mézard et al. (1987) and the saddle point method in the large limit. Here we report the final result, which is a slight variation of the one reported in Baldassi et al. (2019)
(30) |
where we have defined the entropic and the energetic terms respectively as
(31) |
We remind that is the Lagrange multiplier (or regularization in machine learning jargon) that fixes the square norm of the weights . and can be obtained from the extremization of the right side of (30). represent the typical overlap of two weights , sampled from the Boltzmann distribution (7) (see also equation (28)); represent the typical squared norm of a sample of (7). In the large limit (but having ), the energetic term can be simplified by using the central limit theorem as shown in Baldassi et al. (2019); Annesi et al. (2024)
(32) |
where
(33) |
is an effective order parameter Barkai et al. (1990); Engel et al. (1992) whose expression depends on the choice of the activation function . This kernel has also the same expression of the Neural Network Gaussian Process (NNGP) kernel that appears in neural networks learning a finite number of examples in the large width limit Neal (1996).
A.1 Large limit
In the large limit we have the following scaling
(34) |
This induces the following scaling on the effective order parameter difference
(35) |
where
(36) |
We therefore have that the free energy of the system is
(37a) | ||||
(37b) | ||||
(37c) |
where we have defined the function as
(38) |
Appendix B Loss Landscape on the linear interpolation between weights
In this section we want to compute the average loss of as defined in (27). is the interpolation of and , see equation (24). As stated in the main text, both weights and and their interpolation are considered to have the same squared norm . Equation (27) can be written also in terms of the corresponding loss per pattern
(39) |
we have here focused on a particular pattern , since in the thermodynamic limit all input patterns will give the same contribution on average.
B.1 Replica approach
The computation proceeds as usual introducing replicas via the identity with . We have (denoting with the index that runs over the real replicas and )
(40) |
where we remind that is the the quantity that appears in equation (24). We have also introduced the usual entropic and energetic terms Baldassi et al. (2019) as
(41) |
B.2 Replica Symmetric ansatz
We impose the Replica Symmetric (RS) ansatz over order parameters
(42a) | |||||
(42b) |
Notice that we called by and the typical overlap between solutions extracted from the distribution of the endpoint and respectively. The overlap represents the typical overlap between the two endpoints. A similar ansatz is imposed over the conjugated order parameters . However in the limit the conjugated order parameters will not appear explicitly in the expression of . We need to express decompose the term
(43) |
where is the element of the square root of the matrix defined in (42b). The computation proceeds in a standard way by using a Hubbard-Stratonovich transformation and integrating over . We get
(44) |
where in the last expression we have defined and for convenience.
B.3 Large limit
We now perform the large limit, in order to further simplify and the expression in (44) by repeated usage of the central limit theorem. We will call by the numerator of the last expression in (44).
The numerator of the fraction can be written as
(45) |
Expanding the exponential up to second order, averaging over and re-exponentiating we get
(46) |
where we have introduced the notation
(47a) | ||||
(47b) |
to define the following quantities
(48a) | ||||
(48b) | ||||
(48c) | ||||
(48d) | ||||
(48e) |
Notice that if since the Gaussian variable is independent of . We then inserting (46) back into (45) and perform the integrals over and ; in general the integral is of the form
(49) |
with . Specializing this identity to our case, i.e. using we get
(50) |
with . Notice that we have done the same steps also in the denominator of the fraction.
Finally we apply the central limit again to simplify the integrals over variables; concerning all the variance terms, i.e. , and we can trivially compute their mean with respect to , their variance being subleading in . The only new terms come from the variance of the mean terms, i.e. the parameters and . We get a term of the type
(51) |
where we have used in the last step the general identity (LABEL:eq::generic_identity). The final result is
(52) |
where we have defined the quantities
(53a) | ||||
(53b) |
and
(54a) | ||||
(54b) | ||||
(54c) | ||||
(54d) | ||||
(54e) | ||||
(54f) |
Note that in doing the last step in equation (52) we have used the fact that since they are both proportional to . We show in appendix C that the quantities above can be all written in terms of the following function that depends on the activation function
(55) |
as
(56a) | ||||
(56b) | ||||
(56c) | ||||
(56d) | ||||
(56e) | ||||
(56f) | ||||
(56g) | ||||
(56h) |
We can simplify (52) by performing 2-dimensional rotations of the integration over the variables
(57) |
Notice how the variable appears only in . Performing a rotation over and
(58) |
Notice how disappears from the argument of the second loss function . Finally (57) can be further simplified by letting appear the same argument in in the numerator and denominator. This can be obtained by performing a rotation over the Gaussian variables and . After one can integrate explicitly over obtaining
(59) |
B.4 Analytical predictions in some particular cases
In the following we will specialize equation (59) to several interesting cases depending on the Boltzmann distribution through which the endpoints are sampled.
B.4.1 Error counting loss with a margin


Here we specialize (59) to the case and where impose a certain degree of robustness and . We further consider and we will focus on the limit for simplicity. Starting from (57) we have
(60) |
This is the expression that we have used to produce the plots in Figure 7 of the main text. We show similar plots for the Erf activation function in Figure 10. If the endpoints are sampled with the same margin then as stated before and this implies the relation . In this case, the formula simplifies even further and reads
(61) |
B.4.2 Equal general loss functions at finite temperature
We will here suppose that and . In this case , so that , and . In this case we obtain
(62) |
The previous equation is the one that we have used for the theoretical curve presented in Figure 6 of the main text. If one is interested in measuring the training error we have
(63) |
where . In the previous formulas reduces to .
B.4.3 Generic loss – error counting loss with a margin


The last case we consider is , but is considered to be a generic convex loss function. We will again consider the infinite limit. This imposes a scaling on the overlap that reads
(64) |
This induces a non-trivial scaling on some of the effective order parameters (56), in particular and will be vanishingly small
(65a) | ||||
(65b) |
where we have introduced the quantity
(66) |
and
(67) |
Furthermore, we have that , , and so that . Using those relations inside (58), rescaling and using a saddle point over , one gets
(68) |
where is the function defined in (38) that also appears in the equilibrium computation Baldassi et al. (2023). In the case we want to measure the training error, i.e. we have
(69) |
We show in Figure 11 the training loss and error along the geodesics connecting solutions extracted from the error counting loss with a margin and the typical cross-entropy minimizer. Despite the training error is very small along the path, the loss is much larger in the neighborhood of the endpoint corresponding to the solution extracted from the error counting loss with a margin. As the margin is increased the training loss decreases.
Appendix C Effective order parameters
In this section we show that the effective order parameters defined in Eq. (54) reduce to the expressions given in (56).
We remind the notation
(70a) | ||||
(70b) |
Remember also that is the square root matrix of the matrix and therefore we have the following identities , , and .
Let’s start by analyzing the terms and , which only involve . First notice that
(71a) | ||||
(71b) |
and
(72) |
Similarly, if we have
(73) |
so that and .
Secondly let’s analyze the terms which contain only , i.e. and . The terms and are easy to analyze since the integrand involves a sum of 4 uncorrelated Gaussian variables, which is Gaussian. We therefore get
(74a) | ||||
(74b) |
Finally
(75) |
The last computation concerns the correlations between the function and , which appear in the variables , . We need therefore to evaluate the following two quantities and , for . We are going to analyze the case , the other can be obtained by symmetry. We have
(76) |
Notice that this does not depend on either nor . The case can be obtained by sending and . Let’s analyze the term in the case
(77) |
The case can be obtained by sending and , i.e.
(78) |
Appendix D Computing the overlap between differently sampled solutions
The scope of this section is to find the typical overlap between two configurations and that are sampled from two (in principle different) distribution and , see the definition in equation (22). A way of computing this overlap has been sketched in Annesi et al. (2023). Here we adopt a different approach, based on the Franz-Parisi entropy Franz and Parisi (1995). The Franz-Parisi entropy is defined as the average log of the number of configurations that are at a fixed overlap from the . In formulas
(79a) | ||||
(79b) |
In the following we will call the “reference” weight and the “slaved” weight as it is constrained to stay at a distance given by the reference . In the following we will also suppose (as done in the main text), that the configuration sampled from , possesses the same squared norm as the reference ; this can be achieved by properly choosing the Lagrande multiplier .
The typical (i.e. the most probable) overlap is the one that maximizes the Franz-Parisi entropy
(80) |
The Franz-Parisi can be computed with standard methods using a double replica trick. Here we refer to Baldassi et al. (2023, 2021) for the derivation in the case of the perceptron. In the tree committee machine in the large width limit one gets
(81) |
where
(82) |
and
(83a) | ||||
(83b) | ||||
(83c) | ||||
(83d) |
Notice that represents the typical overlap between reference configurations . Imposing that at the typical distance the Franz-Parisi presents a maximum we have
(84) |
The first equality follows from the fact that at the maximum of the Franz-Parisi entropy one can verify that the saddle point equation impose . One can then compute the right hand side explicitly, expanding the expression for . The typical overlap can be obtained finally by solving this implicit equation for
(85) |
where we have introduced the quantity as in equation (36) and we have redefined to be . Notice that equation (85) depends non-trivially on and which represent respectively the typical overlap of configurations and that are extracted from and and that can be obtained by a standard equilibrium computation of the partition function in equation (8). In particular, when the solutions are sampled from the same distribution, then , and one can verify that equation (85) is trivially satisfied by .
In the following subsection we specialize equation (85) to several interesting sub-cases, in the large limit.
D.1 The error counting loss with a margin
In the case one is interested in the theta loss, i.e. and the integrals in (85) inside the logs can be performed and in the infinite limit one gets
(86) |
This expression reduces to the one of the perceptron case computed in Annesi et al. (2023) if one specializes it to the identity activation function where .
D.2 Large limit: generic loss – error counting loss with a margin
We consider here that the reference solution is sampled from a generic convex loss function, whereas . In the large limit we have that scales as and correspondingly . Scaling and using saddle point method, we therefore have
(87) |
where is the same function defined in (38).