High-dimensional manifold of solutions in neural networks: insights from
  statistical physics
In these pedagogic notes I review the statistical mechanics approach to
neural networks, focusing on the paradigmatic example of the perceptron
architecture with binary an continuous weights, in the classification setting.
I will review the Gardner's approach based on replica method and the derivation
of the SAT/UNSAT transition in the storage setting. Then, I discuss some recent
works that unveiled how the zero training error configurations are
geometrically arranged, and how this arrangement changes as the size of the
training set increases. I also illustrate how different regions of solution
space can be explored analytically and how the landscape in the vicinity of a
solution can be characterized. I give evidence how, in binary weight models,
algorithmic hardness is a consequence of the disappearance of a clustered
region of solutions that extends to very large distances. Finally, I
demonstrate how the study of linear mode connectivity between solutions can
give insights into the average shape of the solution manifold.
Enrico M. Malatesta
**High-dimensional manifold of solutions in neural networks:**

## Abstract

**In these pedagogic notes I review the statistical mechanics approach to neural networks, focusing on the paradigmatic example of the perceptron architecture with binary an continuous weights, in the classification setting. I will review the Gardner's approach based on replica method and the derivation of the SAT/UNSAT transition in the storage setting. Then, I discuss some recent works that unveiled how the zero training error configurations are geometrically arranged, and how this arrangement changes as the size of the training set increases. I also illustrate how different regions of solution space can be explored analytically and how the landscape in the vicinity of a solution can be characterized. I give evidence how, in binary weight models, algorithmic hardness is a consequence of the disappearance of a clustered region of solutions that extends to very large distances. Finally, I demonstrate how the study of linear mode connectivity between solutions can give insights into the average shape of the solution manifold.**

###### Contents

* 1 Introduction
* 2 Gardner's computation
	* 2.1 Statistical mechanics representation
	* 2.2 Simple geometric properties of the solution space
	* 2.3 The typical Gardner volume
	* 2.4 Replica Method
	* 2.5 Replica-Symmetric ansatz
	* 2.6 SAT/UNSAT transition
* 3 Landscape geometry
	* 3.1 Local Entropy
	* 3.2 Algorithmic hardness
* 4 Linear mode connectivity
## 1 Introduction

Suppose we are given a dataset \(\mathcal{D}=\left\{\xi^{\mu},y^{\mu}\right\}_{\mu=1}^{p}\) composed by a set of \(P\), \(N\)-dimensional "patterns" \(\xi^{\mu}_{i}\), \(i=1,\ldots,N\) and the corresponding label \(y^{\mu}\). The patterns can represent whatever type of data, for example an image, text or audio. In the binary classification setting that we will consider, \(y^{\mu}=\pm 1\); it will represent some particular property of the data that we want to be able to predict, e.g. if in the image there is a cat or a dog. The goal is to learn a function \(f:\mathbb{R}^{N}\to\pm 1\) that is able to associate to each input \(\xi\in\mathbb{R}^{N}\) the corresponding label. This function should be able to _generalize_, i.e. to _predict_ the label corresponding to a pattern not in the training set.

In the following we will consider, in order to fit training set, the so-called _perceptron_ model, as it is the simplest, yet non-trivial, one-layer neural network that we can study using statistical mechanics tools. Given an input pattern \(\xi^{\mu}\) the perceptron predicts a label \(\hat{y}^{\mu}\)

\[\hat{y}^{\mu}=\text{sign}\left(\frac{1}{\sqrt{N}}\sum_{i=1}^{N}w_{i}\,\xi^{ \mu}_{i}\right) \tag{1}\]

where \(w_{i}\) are the \(N\) parameters that need to be adjusted in order to fit the training set. If the possible values of \(\mathbf{w}\) lie on the vertices of the hypercube, i.e. \(w_{i}=\pm 1\), \(\forall i\), the model is called _binary_ perceptron. If instead the weights lie on the \(N-\)dimensional sphere of radius \(\sqrt{N}\), i.e. \(\sum_{i=1}^{N}w_{i}^{2}=\mathbf{w}\cdot\mathbf{w}=N\) the model is called _spherical_ perceptron.

As usual in statistical mechanics, we consider the case of a _synthetic_ dataset, where the patterns are formed by random i.i.d. \(N\)-dimensional Gaussian patterns \(\xi^{\mu}_{i}\sim\mathcal{N}(0,1)\), \(i=1,\ldots,N\). Depending on the choice of the label \(y^{\mu}\), we can define two different scenarios:

* in the so called _teacher-student_ scenario, \(y^{\mu}\) is generated by a network, called "teacher". The simplest case corresponds to a perceptron architecture, i.e. \[y^{\mu}=\text{sign}\left(\frac{1}{\sqrt{N}}\sum_{i=1}^{N}w_{i}^{T}\xi^{\mu}_{ i}\right)\] (2) with random i.i.d. Gaussian or binary weights: \(w_{i}^{T}\sim\mathcal{N}(0,1)\) or \(w_{i}^{T}=\pm 1\) with equal probability. This model has been studied by Gardner and Derrida [1] and Gyorgyi in the binary case [2].
* In real scenarios, sometimes data can be corrupted or the underline rule that generates the label for a given input is noisy. This makes the problem sometimes being _unrealizable_, since, expecially for large datasets, no student exists that is able to learn the training set. The _storage problem_, describes the case of extreme noise in the dataset: \(y^{\mu}\) is chosen to be \(\pm 1\) with equal probability. As a matter of fact this makes the label completely independent from the input data.

In the following we will focus on the storage problem setting. Even if this problem does not present the notion of generalization error, still, it is a scenario where we can try to answer very simple questions using the same statistical mechanics tools that can be also applied to teacher-student settings (see for example [3]). For example: what is the maximum value of the size of the training set \(P\) that we are able to fit? It was discovered by the pioneering work by Gardner [4, 5] and Krauth and Mezard [6] that, in both binary and continuous settings, in the large \(P\) and \(N\) limit, with the ratio \(\alpha\equiv P/N\) fixed, it exists a _sharp_ phase transition \(\alpha_{c}\) separating a satisfiable (SAT) phase \(\alpha<\alpha_{c}\) where solutions to the problem exists, to an unsatisfiable (UNSAT) phase where the set of solutions is empty. The goal of the next Section 2
is to introduce the statistical mechanics tools through which we can answer such a question. The same tools, in turn, will provide valuable insights into how the solutions are arranged geometrically.

## 2 Gardner's computation

### Statistical mechanics representation

Every good statistical mechanics computation starts by writing the partition function of the model under consideration. This is the goal of this section.

Fitting the training set means that we need to satisfy the following set of constraints

\[\Delta^{\mu}\equiv\frac{y^{\mu}}{\sqrt{N}}\sum_{i}w_{i}\xi_{i}^{\mu}\geq 0\,, \qquad\mu=1,\dots,P \tag{3}\]

indeed if the _stability_\(\Delta^{\mu}\) of example \(\mu\) in the training set is positive, it means that the predicted label is equal to the true one. In general we can try to ask to fit the training set in a way that is _robust_ with respect to noisy perturbation of the inputs; this can be done by requiring that the stability of each pattern is larger that a given threshold \(\kappa\geq 0\) called _margin_

\[\Delta^{\mu}\equiv\frac{y^{\mu}}{\sqrt{N}}\sum_{i}w_{i}\xi_{i}^{\mu}\geq\kappa \,,\qquad\mu=1,\dots,P \tag{4}\]

The total amount of noise that we can inject in \(\xi^{\mu}\) without changing the corresponding label \(y^{\mu}\) depends on \(\kappa\). Notice that if \(\kappa\geq 0\) the solutions to (4) are also solutions to (3). Sometimes satisfying all the contraints (3) can be hard or even impossible, for example when the problem is not linearly separable. In that case one can relax the problem by counting as "satisfied" certain violated contraints: one way to do that is to impose a _negative_ margin \(\kappa\). The corresponding model is usually called _negative perceptron_. As we will see in the next subsection this changes dramatically the nature of the problem.

We are now ready to write down the partition function, as

\[Z_{\mathcal{D}}=\int d\mu(\boldsymbol{w})\,\mathbb{X}_{\mathcal{D}}( \boldsymbol{w};\kappa) \tag{5}\]

where

\[\mathbb{X}_{\mathcal{D}}(\boldsymbol{w};\kappa)\equiv\prod_{\mu=1}^{P}\Theta \left(\frac{y^{\mu}}{\sqrt{N}}\sum_{i}w_{i}\xi_{i}^{\mu}-\kappa\right) \tag{6}\]

is an indicator function that selects a solution to the learning problem. Indeed \(\Theta(x)\) is the Heaviside Theta function that gives \(1\) if \(x>0\) and zero otherwise. \(d\mu(\boldsymbol{w})\) is a measure over the weights that depends on the spherical/binary nature of the problem under consideration

\[d\mu(\boldsymbol{w})=\left\{\begin{array}{ll}\prod_{i=1}^{N}dw_{i}\,\delta \left(\boldsymbol{w}\cdot\boldsymbol{w}-N\right),&\text{\emph{spherical case}}\\ \prod_{i=1}^{N}dw_{i}\,\frac{1}{2^{N}}\prod_{i}\left[\delta\left(w_{i}-1 \right)+\delta\left(w_{i}+1\right)\right],&\text{\emph{binary case}}\end{array}\right. \tag{7}\]

The partition function is called also _Gardner_ volume [5] since it measures the total volume (or number in the binary case) of networks satisfying all the constraints imposed by the training set. Notice that sending \(\xi_{i}^{\mu}\to y^{\mu}\xi_{i}^{\mu}\) one does not change the probability measure over the patterns \(\xi^{\mu}\), therefore we can simply set \(y^{\mu}=1\) for all \(\mu=1,\dots,P\) without loss of generality.
### Simple geometric properties of the solution space

We want here to give a simple geometrical interpretation of the space of solutions corresponding to imposing constraints of equation (4). By those simple arguments, we will be able to unravel the convexity/non-convexity properties of the space of solutions.

Let's start from the spherical case. For simplicity consider also \(\kappa=0\). Initially, when no pattern has been presented, the whole volume of the \(N\)-dimensional sphere is a solution. When we present the first pattern \(\xi^{1}\) uniformly generated on the sphere, the allowed solutions lie on the half-sphere with a positive dot product with \(\xi^{1}\). Of course, the same would happen if we had presented any other pattern \(\xi^{\mu}\) of the training set. The intersection of those half-spheres form the space of solutions. Since the intersection of half spheres is a convex set, it turns out that the manifold of solutions is always convex, see left panel of Fig. 1 for an example. Notice that this is also true if one is interested in looking to the subset of solutions having \(\kappa>0\). If one keeps adding constraints one can obtain an empty set. The minimal density of constraints for which this happens is the SAT/UNSAT transition.

The middle panel of Fig. 1, refers to the \(\kappa<0\) case, i.e. the spherical negative perceptron [7]. In this problem the space of solutions can be obtained by _removing_ from the sphere a convex spherical cap, one for each pattern (blue and red regions). As a result the manifold of solutions is non-convex and, if one adds too many constraints the space of solutions can become also _disconnected_, before the SAT/UNSAT transition.

In the right panel of Fig. 1 we show the binary case. Since \(w_{i}=\pm 1\), the hypercube (in red) is inscribed in the sphere in \(N\)-dimension, i.e. the vertices of the hypercube are contained in the space of solutions of the corresponding spherical problem (green region). As can be readily seen from the example in the figure, the binary weight case is a non-convex problem (even for \(\kappa\geq 0\)), since in order to go from one solution to another, it can happen that one has to pass through a set of vertices not in the solution space.

### The typical Gardner volume

The Gardner volume \(Z_{\mathcal{D}}\) introduced in equation 5 is random variable since it explicitly depends on the dataset. The goal of statistical mechanics is to characterize the _typical_, i.e. the most probable value of this random quantity. A first guess would be to compute the averaged volume \(\langle Z_{\mathcal{D}}\rangle_{\mathcal{D}}\). However, since (5) involves a product of many random contributions, the most

Figure 1: **Left and middle panels**: space of solutions (green shaded area) in the spherical perceptron with \(\kappa=0\) (left panel) and \(\kappa<0\) (middle). The green shaded area is obtained by taking the intersection of two spherical caps corresponding to patterns \(\xi^{1}\) and \(\xi^{2}\). **Right panel**: binary weight case. The cube (red) is inscribed in the sphere. The green shaded area represents the (convex) space of solutions of the corresponding spherical problem. In this simple example only two vertices of the cube are inside the green region.
probable value of \(Z_{\mathcal{D}}\) and its average are expected to not coincide1. On the other hand, the log of the product of independent random variables is equivalent to a large sum of independent terms, that, because of the central limit theorem, is Gaussian distributed; in that case we expect that the most probable value coincides with the average. Therefore we expect that for large \(N\)

Footnote 1: In the spin glass literature one says that \(Z_{\mathcal{D}}\) is _not a self-averaging_ quantity for large \(N\).

\[Z_{\mathcal{D}}\sim e^{N\phi} \tag{8}\]

where

\[\phi=\lim_{N\to\infty}\frac{1}{N}(\ln Z_{\mathcal{D}})_{\mathcal{D}}\,. \tag{9}\]

is the averaged log-volume. Since we are at zero training error \(\phi\) coincides with the _entropy_ of solutions. Performing the average over the log is usually called as _quenched_ average in spin glass theory, to distinguish from the log of the average, which is instead called _annealed_. Annealed averages are much easier than quenched ones; even if they do not give information to the typical value of a random variable, they can still be useful, since they can give an upper bound to the quenched entropy. Indeed due to Jensen's inequality

\[\phi\leq\phi_{ann}=\lim_{N\to\infty}\frac{1}{N}\ln\langle Z_{\mathcal{D}} \rangle_{\mathcal{D}}\,. \tag{10}\]

### Replica Method

In order to compute the average of the log we use the _replica trick_

\[\langle\ln Z_{\mathcal{D}}\rangle_{\mathcal{D}}=\lim_{n\to 0}\frac{\langle Z _{\mathcal{D}}^{n}\rangle_{\mathcal{D}}-1}{n}=\lim_{n\to 0}\frac{1}{n}\ln (Z_{\mathcal{D}}^{n})_{\mathcal{D}}\,. \tag{11}\]

The _replica method_ consists in performing the average over the disorder of \(Z_{\mathcal{D}}^{n}\) considering \(n\) integer (a much easier task with respect to averaging the log of \(Z_{\mathcal{D}}\)), and then performing an analytic continuation of the result to \(n\to 0\)[8]. It has been used firstly in spin glasses models such as the Sherrington-Kirkpatrick model [9] and then applied by E. Gardner to neural networks [10, 5]. Replicating the partition function and introducing an auxiliary variable \(v_{\mu}^{a}\equiv\frac{1}{\sqrt{N}}\sum_{i}w_{i}^{a}\varepsilon_{i}^{\mu}\) using a Dirac delta function, we have

\[\begin{split} Z_{\mathcal{D}}^{n}&=\int\prod_{a=1} ^{n}d\mu(w^{a})\prod_{\mu a}\Theta\left(\frac{1}{\sqrt{N}}\sum_{i}w_{i}^{a} \varepsilon_{i}^{\mu}-\kappa\right)\\ &=\int\prod_{a\mu}\frac{d\nu_{a}^{\mu}d\nu_{a}^{a}}{2\pi}\prod_{ \mu a}\Theta\left(\nu_{a}^{\mu}-\kappa\right)e^{i\nu_{a}^{a}\nu_{a}^{a}}\int \prod_{a=1}^{n}d\mu(w^{a})\,e^{-i\sum_{\mu,a}\delta_{\mu}^{\mu}\frac{1}{\sqrt {N}}\sum_{i}w_{i}^{a}\varepsilon_{i}^{\mu}}\end{split} \tag{12}\]

where we have used the integral representation of the Dirac delta function

\[\delta(v)=\int\frac{d\hat{v}}{2\pi}e^{iv\hat{v}}\,. \tag{13}\]

Now we can perform the average over the patterns in the limit of large \(N\) obtaining

\[\begin{split}\prod_{\mu i}\left\langle e^{-i\frac{\zeta_{i}^{\mu} }{\sqrt{N}}\sum_{w_{i}^{a}\varepsilon_{i}^{\mu}}}\right\rangle_{\xi_{i}^{\mu} }&=\prod_{\mu i}e^{-\frac{1}{2N}\left(\sum_{u}w_{i}^{a}\varepsilon _{\mu}^{a}\right)^{2}}\\ &=\prod_{\mu}e^{-\sum_{u<1}y_{\mu}^{a}\varepsilon_{u}^{b}\left( \frac{1}{N}\sum_{i}w_{i}^{a}w_{i}^{b}\right)-\frac{1}{N}\sum_{i}\left(y_{\mu} ^{a}\right)^{2}}\,.\end{split} \tag{14}\]
Next we can enforce the definition of the \(n\times n\) matrix of order parameters

\[q_{ab}\equiv\frac{1}{N}\sum_{i=1}^{N}w_{i}^{a}w_{i}^{b} \tag{15}\]

by using a delta function and its integral representation. \(q_{ab}\) represents the typical overlap between two replicas \(a\) and \(b\), sampled from the Gibbs measure corresponding to (5) and having the same realization of the training set. Due to the binary and spherical normalization of the weights this quantity is bounded \(-1\leq q_{ab}\leq 1\). We have

\[\begin{split}\left\langle Z_{\mathcal{D}}^{n}\right\rangle_{ \mathcal{D}}&=\int\prod_{a<b}\frac{dq_{ab}d\hat{q}_{ab}}{2\pi/N}e^ {-N\sum_{a<b}q_{ab}\hat{q}_{ab}}\int\prod_{a}d\mu(w^{a})e^{\sum_{a<b}\hat{q}_{ab }\sum u_{i}^{a}w_{i}^{b}}\\ &\times\int\prod_{a\mu}\frac{dv_{a}^{\mu}d\hat{v}_{a}^{\mu}}{2\pi }\prod_{\mu a}\Theta\left(v_{a}^{\mu}-\kappa\right)e^{i\sum_{\mu}y_{a}^{\mu}q_ {a}^{\mu}-1}\sum_{\mu}\left(\hat{y}_{a}^{\mu}\right)^{2}-\sum_{a<b,a}q_{ab} \hat{y}_{a}^{\mu}q_{b}^{b}}\,.\end{split} \tag{16}\]

The next step of every replica computation is to notice that the terms depending on the patterns \(\mu=1,\dots,P\) and on the index of the weights \(i=1,\dots,N\) have been decoupled (initially they were not), at the price of coupling the replicas (that initially were uncopled). So far the computation was the same independently on the nature of the weights. From now on, however the computation is different, since we need to explicit the form of the measure \(d\mu(\mathbf{w})\) in order to factorize the expression over the index \(i\). In the next paragraph we therefore focus on the binary case first, moving then to the spherical case.

Binary caseSetting \(P=\alpha N\), in the binary weight case we reach the following integral representation of the averaged replicated partition function

\[\left\langle Z_{\mathcal{D}}^{n}\right\rangle_{\mathcal{D}}\mathbf{\propto}\int \prod_{a<b}\frac{dq_{ab}d\hat{q}_{ab}}{2\pi}\,e^{NS(q,\hat{q})} \tag{17}\]

where we have defined

\[S^{\text{bin}}(q,\hat{q}) =G_{S}^{\text{bin}}(q,\hat{q})+\alpha G_{E}(q) \tag{18a}\] \[G_{S}^{\text{bin}} =-\frac{1}{2}\sum_{a\neq b}q_{ab}\hat{q}_{ab}+\ln\sum_{\{w^{a}\}} e^{\frac{1}{2}\sum_{a\neq b}\hat{q}_{ab}w^{a}w^{b}}\] (18b) \[G_{E} =\ln\int\prod_{a}\frac{dv_{a}d\hat{v}_{a}}{2\pi}\prod_{a}\Theta(v_ {a}-\kappa)e^{i\sum_{a}v_{a}\hat{v}_{a}-\frac{1}{2}\sum_{ab}q_{ab}\hat{v}_{a} \hat{v}_{b}}\,. \tag{18c}\]

\(G_{S}\) is the so called "entropic" term, since it represents the logarithm of the volume at \(\alpha=0\), where there are no constraints induced by the training set. \(G_{E}\) is instead called the "energetic" term and it represents the logarithm of the fraction of solutions. In the energetic term we have also used the fact that, because of equation (15), \(q_{aa}=1\).

Spherical caseIn the spherical case, one needs to do a little more work in order to decouple the \(i\) index in the spherical contraints of equation (7):

\[\begin{split}\int\prod_{a}d\mu(w^{a})\,e^{\sum_{a<b}\hat{q}_{ab} \sum u_{i}^{a}w_{i}^{b}}&\mathbf{\propto}\int\prod_{a}\frac{d\hat{q} _{aa}}{2\pi}\int\prod_{ai}dw_{i}^{a}\,e^{-\frac{u}{2}\sum_{a\neq b}\hat{q}_{ ab}\sum u_{i}^{a}w_{i}^{b}}\\ &=\int\prod_{a}\frac{d\hat{q}_{aa}}{2\pi}e^{-\frac{u}{2}\sum_{a }\hat{q}_{aa}}\left[\int\prod_{a}dw^{a}\,e^{\frac{1}{2}\sum_{ab}\hat{q}_{ab}w^ {a}w^{b}}\right]^{N}\end{split} \tag{19}\]
Therefore the replicated averaged partition in the spherical case is equal to

\[\left\langle Z_{\mathcal{D}}^{n}\right\rangle_{\mathcal{D}}\propto\int\prod_{a<b} \frac{dq_{ab}d\hat{q}_{ab}}{2\pi}\int\frac{d\hat{q}_{aa}}{2\pi}\,e^{NS(q,\hat{q})} \tag{20}\]

where we have defined

\[S^{\mathrm{sph}}(q,\hat{q}) =G_{S}^{\mathrm{sph}}(\hat{q})+\alpha G_{E}(q) \tag{21a}\] \[G_{S}^{\mathrm{sph}} =-\frac{1}{2}\sum_{ab}q_{ab}\hat{q}_{ab}+\ln\int\prod_{a}dw^{a}\,e ^{\frac{1}{2}\sum_{ab}\hat{q}_{ab}w^{a}w^{b}}\] (21b) \[=-\frac{1}{2}\sum_{ab}q_{ab}\hat{q}_{ab}-\frac{1}{2}\ln\det(-\hat {q})\]

and we have used again the definition \(q_{aa}=1\). Notice how only the entropic term changes with respect to the binary case, whereas the energetic term is the same defined in (18c).

Saddle pointsIn either case, being the model binary or spherical, the corresponding expressions can be evaluated by using a saddle point approximation, since we are interested in a regime where \(N\) is large. The saddle point have to be found by finding two \(n\times n\) matrices \(q_{ab}\) and \(\hat{q}_{ab}\) that maximize the action \(S\). This gives access to the entropy \(\phi\) of solutions

\[\phi=\lim_{N\to\infty}\frac{1}{N}\langle\ln Z_{\mathcal{D}}\rangle_{\mathcal{D }}=\lim_{n\to 0}\frac{1}{n}\max_{\{q,\hat{q}\}}S(q,\hat{q})\,. \tag{22}\]

### Replica-Symmetric ansatz

Finding the solution to the maximization procedure is not a trivial task. Therefore one proceeds by formulating a simple parameterization or _ansatz_ on the structure of the saddle points. The simplest ansatz one can formulate is the Replica-Symmetric (RS) one. Considering the binary case, this reads

\[q_{ab} =\delta_{ab}+q(1-\delta_{ab})\,, \tag{23a}\] \[\hat{q}_{ab} =\hat{q}(1-\delta_{ab}) \tag{23b}\]

In the spherical case, instead one has (\(q_{ab}\) is the same as in binary weights)

\[\hat{q}_{ab}=-\hat{Q}\delta_{ab}+\hat{q}(1-\delta_{ab}) \tag{24}\]

The entropy in both cases can be written as

\[\phi=\mathcal{G}_{S}+\alpha\mathcal{G}_{E} \tag{25}\]

where we remind that the entropic term depends on the binary or spherical nature of the weights and are

\[\mathcal{G}_{S}^{\mathrm{bin}} \equiv\lim_{n\to 0}\frac{G_{S}^{\mathrm{bin}}}{n}=-\frac{\hat{q}}{ 2}(1-q)+\int Dx\ln 2\cosh(\sqrt{\hat{q}}x)\,, \tag{26a}\] \[\mathcal{G}_{S}^{\mathrm{sph}} \equiv\lim_{n\to 0}\frac{G_{S}^{\mathrm{sph}}}{n}=\frac{1}{2} \hat{Q}+\frac{q\hat{q}}{2}+\frac{1}{2}\ln\frac{2\pi}{\hat{Q}+\hat{q}}+\frac{1 }{2}\frac{\hat{q}}{\hat{Q}+\hat{q}}\,. \tag{26b}\]

The energetic term is instead common to both models

\[\mathcal{G}_{E}\equiv\lim_{n\to 0}\frac{G_{E}}{n}=\int Dx\ln H\left(\frac{ \kappa+\sqrt{q}x}{\sqrt{1-q}}\right)\,. \tag{27}\]
In the previous equations we denoted by \(Dx\equiv\frac{dx}{\sqrt{2\pi}}e^{-x^{2}/2}\) the standard normal measure and we have defined the function

\[H(x)\equiv\int_{x}^{\infty}Dy=\frac{1}{2}\text{erfc}\left(\frac{x}{\sqrt{2}}\right) \tag{28}\]

The value of the order parameters \(\hat{q}\), \(\hat{Q}\) and \(q\) for the spherical case and \(\hat{q}\), \(q\) for the binary case can be obtained by differentiating the entropy and equating it to zero.

Saddle point equations: spherical perceptronThe saddle point equations for the spherical case read

\[q =\frac{\hat{q}}{(\hat{Q}+\hat{q})^{2}} \tag{29a}\] \[1 =\frac{\hat{Q}+2\hat{q}}{(\hat{Q}+\hat{q})^{2}}\] (29b) \[\hat{q} =-a\frac{\partial\mathcal{G}_{E}}{\partial q}=\frac{a}{1-q}\int Dx \left[GH\left(\frac{\kappa+\sqrt{q}x}{\sqrt{1-q}}\right)\right]^{2} \tag{29c}\]

where we have defined the function \(GH(x)\equiv\frac{G(x)}{H(x)}\), \(G(x)\) being a standard normal distribution. The saddle point equations can be simplified, by explicitly expressing \(\hat{q}\) and \(\hat{Q}\) in terms of \(q\). Indeed equations (29a) (29b) are simple algebraic expression for \(\hat{q}\) and \(\hat{Q}\) in terms of \(q\); they can be explicitly inverted as \(\hat{q}=\frac{q}{(1-q)^{2}}\), \(\hat{Q}=(1-2q)/(1-q)^{2}\). Inserting the expression of \(\hat{q}\) inside (29c) we get an equation for \(q\) only

\[q=\alpha(1-q)\int Dx\left[GH\left(\frac{\kappa+\sqrt{q}x}{\sqrt{1-q}}\right) \right]^{2}\,, \tag{30}\]

Saddle point equations: binary perceptronIn the binary case only the equation involving derivatives of the entropic term changes. The saddle point equations are therefore

\[q =\int Dx\,\tanh^{2}\left(\sqrt{\hat{q}}x\right) \tag{31a}\] \[\hat{q} =-a\frac{\partial\mathcal{G}_{E}}{\partial q}=\frac{a}{1-q}\int Dx \left[GH\left(\frac{\kappa+\sqrt{q}x}{\sqrt{1-q}}\right)\right]^{2} \tag{31b}\]

The saddle point equations (equation (30) for the spherical and (31) for the binary case), can be easily solved numerically by simple recursion with \(\alpha\) and \(\kappa\) being two external parameters. It is important to notice that the value of the order parameter \(q\) has physical meaning. Indeed one can show that \(q\) is the _typical_ (i.e. the most probable) overlap between two solutions \(\boldsymbol{w}^{1}\) and \(\boldsymbol{w}^{2}\) extracted from the Gibbs measure (6), i.e.

\[q=\left\langle\frac{\int d\mu(\boldsymbol{w}^{1})\,d\mu(\boldsymbol{w}^{2}) \left(\frac{1}{N}\sum_{i}w_{i}^{1}w_{i}^{2}\right)\mathbb{X}_{\mathcal{D}}( \boldsymbol{w}^{1};\kappa)\mathbb{X}_{\mathcal{D}}(\boldsymbol{w}^{2};\kappa )}{Z_{\mathcal{D}}^{2}}\right\rangle_{\mathcal{D}} \tag{32}\]

Therefore solving the saddle point equations gives access to interesting geometrical information: it suggests how distant the solutions extracted from the Gibbs measure (6) are from each other. The distance between solutions can be obtained from the overlap using the relation

\[d=\frac{1-q}{2}\in[0,1] \tag{33}\]
In the binary setting this definition coincides with the _Hamming distance_ between \(\mathbf{w}^{1}\) and \(\mathbf{w}^{2}\), since in that case \(d\) is equal to the fraction of indexes \(i\) at which the corresponding \(\mathbf{w}^{1}_{i}\) and \(\mathbf{w}^{2}_{i}\) are different. The distance between solutions extracted from the Gibbs measure with a given margin \(\kappa\) is shown as a function of \(\alpha\) in Fig. 2 for the spherical (left panel) and for the binary (right panel) case. In both cases one can clearly see that the distance is monotonically decreasing with \(\alpha\) it also exists a value of \(\alpha\) for which the distance goes to zero. In addition is interesting to notice that fixing the value of \(\alpha\) to a certain value, the distance decreases as the margin is increased, meaning that more robust solutions are located in a smaller region of the solution space [11].

### SAT/UNSAT transition

Once the saddle point equations are solved numerically, we can compute the value of the entropy (i.e. the total number/volume) of solutions using (24) for a given \(\alpha\) and margin \(\kappa\). The entropy is plotted in the left panel of Fig. 3 and Fig. 4 for the binary and spherical cases respectively.

It is interesting to notice that in both models, for a fixed value of \(\kappa\), there is a critical value of \(\alpha\) such that the typical distance between solutions goes to zero, i.e. the solution space shrinks to a point as we approach it. The corresponding entropy diverges to \(-\infty\) at this value of \(\alpha\). This defines what we have called SAT/UNSAT transition \(\alpha_{c}(\kappa)\) in the spherical case. This _cannot_ be the true value of \(\alpha_{c}(\kappa)\) in the binary case: in binary models the entropy cannot be negative, since we are _counting_ solutions (not measuring volumes as in the spherical counterpart). This means that the analytical results obtained are wrong whenever \(\phi<0\); for this reason in Fig 2 and 4 the unphysical parts of the curves are dashed. Where is the computation wrong in the binary case? As shown by [6], it is the RS ansatz that, although stable, is wrong; at variance with the spherical case for \(\kappa\geq 0\), in the binary case the solution space is non-convex, so the solution space can be disconnected; in those cases it is well known that the RS ansatz might fail. As shown by Krauth and Mezard [6] (see also [3] for a nice "discussion"), by using a _one-step replica symmetry breaking_ (1RSB) ansatz [12], in order to compute the SAT/UNSAT transition we should compute the value of \(\alpha\) for which the _RS entropy_ vanishes

\[\phi^{\text{\tiny RS}}(\alpha_{c})=0\,. \tag{34}\]

This is known as the _zero entropy condition_; at this value of \(\alpha_{c}\), the distance between solutions does not go to \(0\), for \(\kappa=0\) for example \(d\simeq 0.218\). In the right panel of Fig. 3 we plot \(\alpha_{c}\) as

Figure 2: Distance between solutions sampled with a given margin \(\kappa\) as a function of the constrained density \(\alpha\) for the spherical case (**left panel**) and the binary perceptron (**right panel**). In the binary case, the lines change from solid to dashed when the entropy of solutions becomes negative.
a function of \(\kappa\). In particular for \(\kappa=0\), the value \(\alpha_{c}=0.833\dots\) can be obtained numerically. This value is still not rigorously proved, although in recent years [13], proved that the value obtained by the replica formula is lower bound with positive probability.

In the spherical perceptron \(\kappa\geq 0\) the space of solution is convex and the RS ansatz gives correct results. The critical capacity can be therefore obtained by sending \(q\to 1\). In order to get an explicit expression that can be evaluated numerically, one therefore has to do the limit explicitly, so a a little bit of work has still to be done.

The entropy is, in both cases, a monotonically decreasing function of \(\alpha\). This should be expected: when we increase the number of contraints, we should expect that the solution space shrinks. Moreover for a fixed value of \(\alpha\) the entropy is a monotonically decreasing function of the margin: this means that solutions with larger margin are _exponentially_ fewer in \(N\) (remind (8)).

\(q\to 1\) limit in the spherical perceptronIn order to perform the limit analytically [4, 14] it is convenient to use the following change of variables in the entropy

\[q=1-\delta q \tag{35}\]

and then send \(\delta q\to 0\). We now insert this into the RS energetic term (27); using the fact that \(\ln H(x)\simeq-\frac{1}{2}\ln(2\pi)-\ln x-\frac{x^{2}}{2}\) as \(x\to\infty\), retaining only the diverging terms we get

\[\int Dx\ln H\left(\frac{\kappa+\sqrt{q}x}{\sqrt{1-q}}\right)\simeq\int_{- \kappa}^{+\infty}Dx\left[\frac{1}{2}\ln\delta q-\frac{(\kappa+x)^{2}}{2\delta q }\right]=\frac{1}{2}\ln(\delta q)\,H\left(-\kappa\right)-\frac{B(\kappa)}{2 \delta q} \tag{36}\]

and

\[B(\kappa)=\int_{-\kappa}^{\infty}Dz_{0}(\kappa+z_{0})^{2}=\kappa G(\kappa)+ \left(\kappa^{2}+1\right)H\left(-\kappa\right)\,. \tag{37}\]

The free entropy is therefore

\[\phi=\frac{1}{2\delta q}+\frac{1}{2}\ln\delta q+\frac{\alpha}{2}\left(\ln( \delta q)\,H\left(-\kappa\right)-\frac{B(\kappa)}{\delta q}\right) \tag{38}\]

The derivative with respect to \(\delta q\) gives the saddle point condition that \(\delta q\) itself must satisfy

\[2\frac{\partial\,\phi}{\partial\delta q}=\frac{1}{\delta q}-\frac{1}{\delta q ^{2}}+\alpha\left(\frac{H\left(-\kappa\right)}{\delta q}+\frac{B(\kappa)}{ \delta q^{2}}\right)=0\,. \tag{39}\]

Figure 3: **Binary perceptron. Left: RS entropy as a function of \(\alpha\) for several values of the margin \(\kappa\). Dashed lines show the nonphysical parts of the curves, where entropy is negative. The value of \(\alpha\) where the entropy vanishes corresponds to the SAT/UNSAT transition \(\alpha_{c}(\kappa)\). Right: SAT/UNSAT transition \(\alpha_{c}(\kappa)\) obtained using the zero entropy condition (34).**
When we send \(\delta q\to 0\), for a fixed value of \(\kappa\) we can impose that we are near the critical capacity \(\alpha=\alpha_{c}-\delta\alpha\) and \(\delta q=C\delta\alpha\). We get

\[\begin{split} 2\frac{\partial\phi}{\partial\delta q}&=\frac{1}{ C\delta\alpha}-\frac{1}{C^{2}\delta\alpha^{2}}+(\alpha_{c}-\delta\alpha) \left[\frac{H(-\kappa)}{C\delta\alpha}+\frac{B(\kappa)}{C^{2}\delta\alpha^{2} }\right]\\ &=\frac{1}{C\delta\alpha}\left[1+\alpha_{c}H(-\kappa)-\frac{B( \kappa)}{C}\right]+\frac{1}{C^{2}\delta\alpha^{2}}[\alpha_{c}B(\kappa)-1]=0\,. \end{split} \tag{40}\]

The first term gives the scaling of \(\delta q\), the second gives us the critical capacity in terms of the margin [5, 10].

\[\alpha_{c}(\kappa)=\frac{1}{B(\kappa)}=\frac{1}{\kappa G\left(\kappa\right)+( \kappa^{2}+1)H\left(-\kappa\right)} \tag{41}\]

Notice that \(\alpha_{c}=\frac{1}{B(\kappa)}\) is equivalent to imposing that the divergence \(1/\delta q\) in the free entropy (38) is eliminated at the critical capacity (so that it correctly goes to \(-\infty\) in that limit). In particular for \(\kappa=0\) we get

\[\alpha_{c}(\kappa=0)=2\,, \tag{42}\]

a results that has been derived rigorously by Cover in 1965 [15]. In the right panel of Fig. 4 we plot \(\alpha_{c}\) as a function of \(\kappa\) obtained by (41). It is important to mention that, since in the case \(\kappa\leq 0\) the model becomes non-convex, the RS estimate of the critical capacity (41) gives uncorrect results, even if it is un upper bound to the true value. We refer to [16] for a rigorous upper bound to the critical capacity and to [14] for the evaluation of \(\alpha_{c}(\kappa)\) based on a 1RSB ansatz. However the correct result should be obtained by performing a full-RSB ansatz [7, 12].

## 3 Landscape geometry

One of the most important open puzzles in deep learning is to understand how the error and the loss landscape look like [17] especially as a function of the number of parameters, and how the shape of the learning landscape impacts the learning dynamics. So far there has been growing empirical evidence that, especially in the _overparameterized regime_, where the number of parameters is much larger that the size of the training set, the landscape presents a region at low values of the loss with a large number of flat directions. For example, studies of the

Figure 4: **Spherical perceptron. Left: RS entropy as a function of \(\alpha\) for several values of the margin \(\kappa\). The point in \(\alpha\) where the entropy goes to \(-\infty\) (indicated by the dashed vertical lines) corresponds to the SAT/UNSAT transition \(\alpha_{c}(\kappa)\). Right: RS SAT/UNSAT transition \(\alpha_{c}(\kappa)\) as given by (41). For \(\kappa<0\) the line is dashed, to remind that the RS prediction is only an upper bound to the true one, since the model becomes non-convex.**
spectrum of the Hessian [18, 19] on a local minima or a saddles found by Stochastic Gradient Descent (SGD) optimization, show the presence of a large number of zero and near to zero eigenvalues. This region seem to be attractive for the gradient-based algorithms: the authors of [20] show that different runs of SGD end in the same basin by explicitly finding a path connecting them, in [21, 22] it was shown that very likely even the whole straight path between two different solutions lies at zero training error, i.e. they are _linear mode connected_. Also, an empirical evidence of an implicit bias of SGD towards flat regions have been shown in [23]. Study of the limiting dynamics of SGD [24, 25] unveil the presence of a diffusive behaviour in weight space, once the training set has been fitted. Simple 2D visualization of the loss landscape [26], provided insights into how commonly employed machine learning techniques for improving generalization also tend also to smooth the landscape. One of the most recent algorithms, Sharpness Aware Minimization (SAW) [27], explicitly designed to target flat regions within the loss landscape, consistently demonstrates improved generalization across a broad spectrum of datasets. In [28] it was suggested numerically that moving from the over to the underparameterized regime, gradient based dynamics suddendly becomes glassy. This observation raises the intriguing possibility of a phase transition occurring between these two regimes.

In this section we review some simple results obtained on one layer models concerning the characterization of the flatness of different classes of solutions. We will consider, the paradigmatic case of the binary perceptron, but, as we will see, the definitions of the quantities are general, and can be also used in the case of continuous weights. We will see that in the overparameterized regime (i.e. \(N\gg P\)) solutions located in a very wide and flat region exist. However, as the number of constraints is increased, this region starts to shrink and at a certain point it breaks down in multiple pieces. This, in binary models, is responsible of algorithmic hardness and glassy dynamics.

### Local Entropy

In order to quantify the flatness of a given solutions, several measures can be employed. One such obvious measure is the spectrum of the Hessian; however this quantity is not trivial to study analytically. Here we will employ the so called _local entropy_[29] measure. Given a configuration \(\tilde{\mathbf{w}}\) (in general it may not be a solution), its local entropy is defined as

\[\mathcal{S}_{\mathcal{D}}(\tilde{\mathbf{w}},d;\kappa)=\frac{1}{N}\ln\mathcal{N}_ {\mathcal{D}}(\tilde{\mathbf{w}},d;\kappa) \tag{43}\]

where \(\mathcal{N}_{\mathcal{D}}(\tilde{\mathbf{w}},d;\kappa)\) is a _local Gardner volume_

\[\mathcal{N}_{\mathcal{D}}(\tilde{\mathbf{w}},d;\kappa)\equiv\int d\mu(\mathbf{w})\, \mathbb{X}_{\mathcal{D}}(\mathbf{w};\kappa)\,\delta(N(1-2d)-\mathbf{w}\cdot\tilde{\bm {w}}) \tag{44}\]

which counts2 solutions having margin at least \(\kappa\) at a given distance \(d\) from \(\tilde{\mathbf{w}}\). In the binary perceptron, we will set for simplicity \(\kappa=0\) in the above quantity, since for \(\kappa=0\) the problem is already non-convex. In (44) we have used the relation between overlap and distance of (33) to impose an hard constraint between \(\tilde{\mathbf{w}}\) and \(\mathbf{w}\). For any distance, the local entropy is bounded from above by the _total_ number of _configurations_ at distance \(d\). This value, that we will call \(\mathcal{S}_{\text{max}}\), is attained at \(\alpha=0\), i.e. when we do not impose any constraints. Moreover, since every point on the sphere is equivalent, \(\mathcal{S}_{\text{max}}\) does not depend on \(\tilde{\mathbf{w}}\) and \(\kappa\) and it reads3

Footnote 2: In the spherical case it measures a volume.

Footnote 3: In the spherical case an equivalent analytical formula can be derived, see [14].

\[\mathcal{S}_{\text{max}}(d)=-d\ln d-(1-d)\ln(1-d) \tag{45}\]
which is of course always non-negative. In full generality, we are interested in evaluating the local entropy of solutions \(\tilde{\mathbf{w}}\,\) that have margin \(\tilde{\kappa}\) and that are sampled from a probability distribution \(P_{\mathcal{D}}(\tilde{\mathbf{w}}\,;\tilde{\kappa})\). We are interested in computing the typical local entropy of those class of solutions, that is obtained averaging \(\mathcal{S}_{\mathcal{D}}\) over \(P_{\mathcal{D}}\) and over the dataset, i.e.

\[\phi_{\text{FP}}(d;\tilde{\kappa},\kappa)=\left\langle\int d\mu(\tilde{\mathbf{w}} \,)P_{\mathcal{D}}(\tilde{\mathbf{w}}\,;\tilde{\kappa})\,\mathcal{S}_{\mathcal{D}} (\tilde{\mathbf{w}},d;\kappa)\right\rangle_{\mathcal{D}} \tag{46}\]

This "averaged local entropy" is usually called _Franz-Parisi entropy_ in the context of mean field spin glasses [30]. In the following we will consider \(P_{\mathcal{D}}\) as the flat measure over solutions with margin \(\tilde{\kappa}\)

\[P_{\mathcal{D}}(\tilde{\mathbf{w}};\tilde{\kappa})=\frac{\mathbb{X}_{\mathcal{D} }(\tilde{\mathbf{w}},\tilde{\kappa})}{\int d\mu(\tilde{\mathbf{w}}\,)\mathbb{X}_{ \mathcal{D}}(\tilde{\mathbf{w}},\tilde{\kappa})} \tag{47}\]

The first analytical computation of (46) was performed by Huang and Kabashima [31] in the binary perceptron by using the replica method (using steps similar to the ones done in Section 2.4, even if ther are much more involved). They considered the case of typical solutions, i.e. \(\tilde{\kappa}=0\). A plot of \(\phi_{\text{FP}}\) as a function of distance is shown in the left panel of Fig. 5 for several values of \(\alpha\). It exists a neighborhood of distances \(d\in[0,d_{\text{min}}]\) around \(\tilde{\mathbf{w}}\,\) for which the local entropy is negative, which is unphysical in the binary case. The authors of [31] also showed analytically that \(\phi_{\text{FP}}(d=0)=0\)4 and that for \(d\to 0\)

Footnote 4: This should be expected: if you are at zero distance from \(\tilde{\mathbf{w}}\), the only solution to be counted is \(\tilde{\mathbf{w}}\,\) itself

\[\frac{\partial\,\phi_{\text{FP}}}{\partial\,d}=\alpha Cd^{-1/2}+O(\ln d) \tag{48}\]

where \(C\) is a _negative_ constant. This tells us that \(d_{\text{min}}>0\)_for any \(\alpha>0\)_. This suggests that typical solutions are always _isolated_, meaning that there is a value \(d_{\text{min}}\) below which no solution can be found5, no matter what the value of the constraint density is. Notice that, since the overlap is normalized by \(N\) as in (32), in order to go from \(\tilde{\mathbf{w}}\,\) to the closest solution, one should flip an _extensive_ number of weights. The plot of \(d_{\text{min}}\) is shown, as a function of \(\alpha\), in the right panel of Fig. 5.

Footnote 5: In principle, the fact that the local entropy is negative suggest that only a _subestensive_ number of solutions can be found below \(d_{\text{min}}\). Abbe and Sly [32] have also proved that in a slight variation of the model (the so called _symmetric binary perceptron_), that actually _no_ solution can be found with probability one within a distance \(d_{\text{min}}\). See also [33].

The picture, however is far from being complete. This kind of landscape with point-like solutions suggests that finding such solution should be a hard optimization problem. Indeed, from the rigorous point of view, similar hardness properties has been shown to exist if the problem at hand verifies the so called _Overlap Gap Property_ (OGP) [34, 35]. An optimization problem possesses OGP if picking _any_ two solutions the overlap distribution between them exhibits a gap, i.e. they can be either close or far away from each other, but can't be in some interval in between. However, this is contrary to the numerical evidence given by simple algorithms such as the ones based on message passing [36, 37] or gradient-based methods [14, 38] which find solutions easily. In [29] it was shown that non-isolated solutions indeed exists, but they are exponentially rarer ("subdominant"). In order to target those solutions one should give a larger statistical weight to those \(\tilde{\mathbf{w}}\,\) that are surrounded by a larger number of solutions. This led [29] to choose the measure

\[P_{\mathcal{D}}(\tilde{\mathbf{w}}\,;d)=\frac{e^{\gamma N\mathcal{S}_{\mathcal{D}}( \tilde{\mathbf{w}};d)}}{\int d\mu(\tilde{\mathbf{w}}\,)e^{\gamma N\mathcal{S}_{ \mathcal{D}}(\tilde{\mathbf{w}};d)}}\,. \tag{49}\]

where \(y\) is a parameter (analogous to inverse temperature) that assigns larger statistical weight to solutions with high local entropy the larger it is. In the \(y\to\infty\) limit, this measure focuses on
solutions with the _highest_ local entropy for a given value of the distance \(d\); notice, indeed, that this probability measure, depends explicitly on \(d\), meaning that the particular type of solution \(\tilde{\mathbf{w}}\) sampled changes depending on the value of \(d\) chosen. In the same work it was shown not only that those high local entropy regions exist, but also that, in the teacher-student setting, they have better generalization properties with respect to typical, isolated solutions. For some rigorous results concerning the existence of those regions in similar binary perceptron models, see [39]. It was then shown that similar atypical clustered region play a similar algorithmic role in other optimization problems, such as coloring [40, 41]. Those results suggested the design of new algorithms based on message passing that explicitly exploit local entropy maximization in order to find very well-generalizing solutions [42]. One of such algorithms is called focusing Belief-Propagation (fBP).

A simpler way of finding the high local entropy regions is by using (47) with \(\tilde{\kappa}\) stricly larger than zero [11]. Indeed, the property of being robust to small noise perturbation in the input is related to the flatness of the energy landscape in the neighborhood of the solution. This type of approach not only produces a phenomenology similar to [29], but it also helps to unravel the structure of high local entropy regions in neural networks, as we shall see. Increasing the amount of robustness \(\tilde{\kappa}\), we therefore intuitively expect to target larger local entropy solutions. As shown in Fig. 6, this is indeed what one finds: as one imposes \(\tilde{\kappa}>0\), there always exists a neighborhood of \(d=0\), with positive local entropy (i.e. those solutions are surrounded by an _exponential_ number of solutions). As shown in the inset of the same figure, the cluster is also very dense: for small \(d\), the local entropy curve is indistinguishable from the total log-number of configurations at that distance \(\mathcal{S}_{\text{max}}\). As one increases \(\tilde{\kappa}\) from \(0\) one can see that one starts to sample different kind of regions in the solutions space. Firstly, if \(0<\tilde{\kappa}<\tilde{\kappa}_{\text{min}}(\alpha)\) the local entropy is negative in an interval of distances \(d\in[d_{1},d_{2}]\) with \(d_{1}>0\): no solutions can be found in a spherical shell of radius \(d\in[d_{1},d_{2}]\). Secondly, if \(\tilde{\kappa}_{\text{min}}(\alpha)<\tilde{\kappa}<\tilde{\kappa}_{u}(\alpha)\) the local entropy is positive but non-monotonic. This means that typical solutions with such \(\tilde{\kappa}\) are immersed within small regions that have a characteristic size: they can be considered as isolated (for \(\tilde{\kappa}<\tilde{\kappa}_{\text{min}}\)) or nearly isolated (for \(\tilde{\kappa}>\tilde{\kappa}_{\text{min}}\)) balls. Finally, for \(\tilde{\kappa}>\tilde{\kappa}_{u}\), the local entropy is monotonic: this suggests that typical solutions with large enough \(\tilde{\kappa}\) are immersed in dense regions that do not seem to have a characteristic size and may extend to very large scales. The local entropy curve having the highest local entropy at a given value of \(\alpha\) is obtained by imposing the _maximum_ possible margin \(\kappa_{\text{max}}(\alpha)\), i.e. the margin for which

Figure 5: **Binary perceptron. Left: Averaged local entropy of typical solutions as a function of distance, for several values of \(\alpha\). Right: Distance \(d_{\text{min}}\) for which the Franz Parisi entropy \(\phi_{\text{FP}}\) is zero as a function of \(\alpha\). At the SAT/UNSAT transition (dashed vertical line) the minimal distance to the closest solutions coincides with the typical distance between solution \(d\simeq 0.218\).**
the entropy computed in section 2.5 vanishes6.

Footnote 6: The \(\kappa_{\max}(\alpha)\) curve is the inverse of \(\alpha_{\epsilon}(\kappa)\).

Therefore high margin solutions are not only rarer and closer to each other with respect to typical solutions (as examined in section 2), but tend to focus on regions surrounded by lower margin, which in turn are surrounded by many other solutions having even lower margin and so on and so forth. The flat regions in the landscape can be though to be formed by the coalescence of minima corresponding to high-margin classifications.

It is worth mentioning that in [14] the same type of approach was applied to the simplest non-convex but continuous weights problem: the negative spherical perceptron. Although in the spherical case the most probable, typical solutions are not completely isolated7, a similar phenomenology is valid: higher margin solutions have always a larger local entropy. Evidence of the existence of these large local entropy regions has also been established in the context of the one hidden layer neural networks [43, 44]. These studies also reveal that the use of the cross-entropy loss [44], ReLU activations [43], and even regularization of the weights [45] influence the learning landscape by inducing wider and flatter minima.

Footnote 7: In the context of a spherical model, a solution would be isolated if the Franz-Parisi entropy goes to \(-\infty\) for a \(d_{\min}>0\).

### Algorithmic hardness

One can then explore how the highest local entropy curves evolve as a function of \(\alpha\). The procedure works as follows. Firstly, for a given value of \(\alpha\), we compute the maximum margin \(\kappa_{\max}\). Secondly, we plot the corresponding local entropy curve \(\phi_{\text{FP}}\) as a function of \(d\). Finally, we repeat the process using another value of \(\alpha\). The outcome is plotted for the binary perceptron in the left panel of Fig. 7. As expected from the previous section, for low values of \(\alpha\) the Franz-Parisi entropy is monotonic. However, as we keep increasing \(\alpha\) the curve becomes

Figure 6: Averaged local entropy of solutions sampled with the flat measure over solutions with margin \(\tilde{\kappa}\). The dashed line represents \(\mathcal{S}_{\max}(d)\) as in (45). Notice how the local entropy changes from being non-monotonic to be monotonic as one keeps increasing \(\tilde{\kappa}\). The grey points corresponds to the local entropy computed numerically from solutions found by the fBP algorithm, which it has been explicitly constructed to target the _flattest_ regions in the landscape. Especially at small distances, there is a good agreement with the local entropy of maximum margin solutions obtained from theory (red line). Reprinted from [11].
non-monotonic: as shown in the right panel of Fig. 7 the derivative of \(\phi_{\text{FP}}\) with respect to \(d\) develops a zero at small distances. This critical value of the constrained density has been called "local entropy" transition \(\alpha_{\text{LE}}\), and it separates a phase where we can find a solution \(\tilde{\mathbf{w}}\) that is located inside a region that extends to very large distance \(\alpha<\alpha_{\text{LE}}\), from one \(\alpha>\alpha_{\text{LE}}\) where it can't be found. Above another critical value \(\alpha_{\text{OGP}}\) of the constrained density, only the "completely isolated ball" phase exists: all the high-margin solutions, even if they remain surrounded by an exponential number of lower margin solutions up to the SAT/UNSAT transition, are completely isolated between each other.

The local entropy transition has been shown in the binary perceptron [11, 29] to be connected with the onset of _algorithmic hardness_: no algorithm has currently been found to be able to reach zero training error for \(\alpha>\alpha_{\text{LE}}\). Surprisingly, \(\alpha_{\text{LE}}\), which has been derived as a threshold marking a profound change in the geometry of regions of higher local entropy, also acquires the role of an insurmountable _algorithmic_ barrier. Similar algorithmic thresholds have been found to exists in other binary neural network models [38]. Notice that, OGP is expected to hold for \(\alpha>\alpha_{\text{OGP}}\); indeed if the Franz-Parisi entropy displays a gap for the \(\kappa_{\text{max}}\) curve, it will also exhibit an even larger one for every \(\tilde{\kappa}\in[0,\kappa_{\text{max}})\)8. In the binary perceptron model, \(\alpha_{\text{LE}}\) and \(\alpha_{\text{OGP}}\) are very close, so it is really difficult to understand which of the two prevents algorithms to find solutions in the infinite size limit.

Footnote 8: To be precise the correct value of \(\alpha_{\text{OGP}}\) (and of \(\alpha_{\text{LE}}\)), can be obtained by sampling the reference with the _largest_ local entropy at any distance, i.e. by using (49).

In spherical non-convex models, such as the negative margin perceptron, even if the local entropy transitions can be identified similarly, it has been shown to be not predictive of the behaviour algorithms, but rather, there is numerical evidence showing that it demarks a region where the solution space is connected from one where it is not [14]. In the same work, evidence has been given that smart algorithms are able to reach the SAT/UNSAT transition. In [46] the authors, interestingly, developed an algorithm that is proved to be able to reach the SAT/UNSAT transition, provided that the OGP does not hold. A proof of the lack of OGP

Figure 7: Averaged local entropy profiles of typical maximum margin solutions (left panel) and its derivative (right panel) as a function of the distance. The dashed line again represents \(\mathcal{S}_{\text{max}}(d)\). Different values of \(\alpha\) are displayed: for \(\alpha=0.71\) and \(0.727\) the entropy is monotonic, i.e. it has a unique maximum at large distances (not visible). For \(\alpha=\alpha_{\text{LE}}\simeq 0.729\) the Franz-Parisi entropy becomes non-monotonic (its derivative with respect to the distance develops a new zero). The entropy becomes negative in a range of distances not containing the origin for \(\alpha>\alpha_{\text{OGP}}\simeq 0.748\). Reprinted from [11].
in the spherical negative perceptron, however, is still lacking.

## 4 Linear mode connectivity

Another important line of research that has recently emerged in machine learning is the characterization of the connectivity between different solutions, i.e. the existence of a path lying a zero training error that connects them. Numerous studies [47, 48, 49, 50, 51, 20] have been started analyzing the so called _linear mode connectivity_, i.e. the particular case of a simple straight path.

The first statistical mechanics study of the behavior of the training error on the _geodesic path_ connecting two solutions has been done in [52] for the negative spherical perceptron problem. Interestingly, a complete characterization of the _shape_ of the solution space of the spherical negative perceptron has been produced. It is the aim of this section to briefly explain the analytical technique and the main results of the work.

Suppose that we are given a value of \(\kappa<0\) and we need to satisfy the constraints (4) using spherical weights. We sample two solutions \(\boldsymbol{w}_{1}\), \(\boldsymbol{w}_{2}\) from the probability distribution (49) using as margin respectively \(\kappa_{1}\), \(\kappa_{2}\geq\kappa\). Since the model is defined on the sphere, the straight path between \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{2}\) lies out of the sphere itself; therefore we project it on the sphere, obtaining a set of weights \(\boldsymbol{w}_{\gamma}\) that lie on the minimum length (i.e. the geodesic) path joining \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{2}\) Then we can define the _geodesic path_ between \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{1}\):

\[\boldsymbol{w}_{\gamma}=\frac{\sqrt{N}\left(\gamma\boldsymbol{w}_{1}+(1- \gamma)\boldsymbol{w}_{2}\right)}{\|\gamma\boldsymbol{w}_{1}+(1-\gamma) \boldsymbol{w}_{2}\|}\,,\qquad\gamma\in[0,1] \tag{50}\]

Finally we compute the average training error of \(\boldsymbol{w}_{\gamma}\) i.e. the fraction of errors on the training set, averaged over the sampled \(\boldsymbol{w}_{1}\), \(\boldsymbol{w}_{2}\) and over the realization of the dataset

\[E_{\gamma}=\lim_{N\rightarrow+\infty}\mathbb{E}_{\mathcal{D}}\left\langle \frac{1}{P}\sum_{\mu=1}^{p}\Theta\big{(}-\boldsymbol{w}_{\gamma}\cdot\xi^{\mu }+\kappa\sqrt{N}\big{)}\right\rangle_{\kappa_{1},\kappa_{2}}. \tag{51}\]

In the previous expression the average \(\langle\bullet\rangle_{\kappa_{1},\kappa_{2}}\) is over the product of the two Gibbs ensembles (49) from which \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{2}\) are sampled from. \(E_{\gamma}\) can be computed by using replica
method. Depending on the values of the margin \(\kappa_{1}\), \(\kappa_{2}\) of \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{2}\) we can sample different regions of the solution space for a fixed value of \(\alpha\). We mainly have three cases:

* \(\kappa_{1}=\kappa_{2}=\kappa\): the two solutions are typical. In this case, for every \(\gamma\in[0,1]\), \(E_{\gamma}>0\), see red line in the left panel of Fig. 8.
* \(\kappa_{1}=\kappa_{2}=\tilde{\kappa}>\kappa\): the two solutions are atypical and have the same margin. As can be seen in the left panel of Fig. 8, if \(\tilde{\kappa}\) is slightly above \(\kappa\), the maximum energy barrier is still non-zero, but in the neighborhood of \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{2}\) a region at zero training error appears. The size of this region increases with \(\tilde{\kappa}\). If \(\tilde{\kappa}>\kappa_{*}(\alpha)\) the maximum barrier is zero, i.e. \(\boldsymbol{w}_{1}\) and \(\boldsymbol{w}_{2}\) are _linear mode connected_.
* \(\kappa_{1}=\kappa\) and \(\kappa_{2}=\tilde{\kappa}>\kappa\): one solution is typical and the other is atypical and \(E_{\gamma}\) is asymmetric with respect to \(\gamma=1/2\). \(E_{\gamma}\) is shown in the right panel of Fig. 8, for several values of \(\tilde{\kappa}\). As one keeps increasing \(\tilde{\boldsymbol{w}}\), the maximum of the barrier decreases, and for \(\tilde{\kappa}>\kappa_{\text{km}}(\alpha)>\kappa_{*}(\alpha)\) the two solutions become linear mode connected. It can be also shown analytically that if \(\tilde{\kappa}>\kappa_{\text{km}}(\alpha)\) than \(\boldsymbol{w}_{2}\) is linear mode connected to another solution having margin \(\kappa_{1}>\kappa\).

The picture exposed above holds in the overparameterized regime. In particular, the result obtained in the last point tells us that the solution space \(\mathcal{A}\) of the spherical negative perceptron is _star-shaped_, since there exists a subset \(\mathcal{C}\subset\mathcal{A}\), such that for any \(\boldsymbol{w}_{*}\in\mathcal{C}\) then geodesic path from \(\boldsymbol{w}_{*}\) to _any_ other solution \(\boldsymbol{w}\) lies entirely in \(\mathcal{A}\), i.e.

\[\{\gamma\boldsymbol{w}+(1-\gamma)\boldsymbol{w}_{*};\ \gamma\in[0,1]\} \subset\mathcal{A}\,. \tag{52}\]

The subset \(\mathcal{C}\) is called _kernel_ of the star-shaped manifold. In Fig. 9 we show an intuitive, 2D picture of the space of solutions, showing a schematic interpretation of the results exposed. If we sample typical solutions we are basically sampling the tips of the star (see left panel), so that the geodesic path connecting them lies entirely at positive training error. Remind that those solutions are the largest in numbers and are located at a larger typical distance with respect to higher margin ones. As one increases the margin of \(\boldsymbol{w}_{1}\), \(\boldsymbol{w}_{2}\) they come closer together,

Figure 9: A two-dimensional view of the star-shaped manifold of solutions of the spherical negative perceptron in the overparameterized regime. When one samples typical solutions (left panel) the training error along geodesic path (dashed black line) is strictly positive. Increasing the margin of both solutions they get closer (see left panel of Fig. 2), and on geodesic path it appears a region at zero training error in their neighborhood. If the two solutions have margin larger than \(\kappa_{*}\), the maximal barrier goes to zero, and the two solutions are located in the blue area. If the margin of one solution \(\boldsymbol{w}_{*}\) is larger than \(\kappa_{\text{km}}>\kappa_{*}\), then it will be located in the _kernel_ region (green area, right panel); from there it can “view” any other solution, since the geodesic path is all at zero training error.
following the arms of the star to which they belong to. If the two margin are large enough, i.e. \(\kappa_{1}\), \(\kappa_{2}>\kappa_{\star}(\alpha)\) they are linear mode connected, and they lie in the blue region of middle panel. If the margin of one of the two solutions is even larger, \(\kappa_{1}>\kappa_{\rm km}(\alpha)\), then it will be located in the kernel, which is depicted in green in the right panel of Fig. 9. We refer to [52] to a more in-depth discussion of the attractiveness of the kernel region to gradient-based algorithms.
