Mean-field Analysis of Piecewise Linear Solutions for Wide ReLU Networks
Alexander Shevchenko, Vyacheslav Kungurtsev, Marco Mondelli
Introduction
Neural networks are the key ingredient behind many recent advances in machine learning. They achieve state-of-the-art performance on various practical tasks, such as image classification [HZRS16] and synthesis [BDS19], natural language processing [VSP+17] and reinforcement learning [SHM+16]. However, these results would not be possible without computational advances which enabled the training of highly overparameterized models with billions of weights. Such complex networks are capable of extracting more sophisticated patterns from the data than their less parameter-heavy counterparts. Nonetheless, in the view of classical learning theory, models with a large number of parameters are prone to over-fitting [VLS11]. Contrary to the conventional statistical wisdom, overparameterization turns out to be a rather desirable property for neural networks. This was even observed in a classical paper by [Bar98], which demonstrated that in the overparameterized setting, the size of the network is less important than the magnitude of the weights. More recently, phenomena such as double descent [BHMM19, SGd+19, NKB+20] and benign overfitting [BLLT20, LZG21, BMR21] suggest that understanding the generalization properties of overparameterized models lies beyond the scope of the usual control of capacity via the size of the parameter set [NTS15].
One way to explain the generalization capability of large neural networks lies in characterizing the properties of solutions found by stochastic gradient descent (SGD). In other words, the question is whether the optimization procedure is implicitly selective, i.e., it finds the functionally simple solutions that exhibit superior generalization ability in comparison to other candidates with roughly the same value of the empirical risk. For instance, [CB20] consider shallow networks minimizing the logistic loss, and show that SGD converges to a max-margin classifier on a certain functional space endowed with the variation norm. In the machine learning literature, it has been suggested that large margin classifiers inherently exhibit better performance on unseen data [BMR21, CV95].
In this work, we develop a novel approach towards understanding the implicit bias of gradient descent methods applied to overparameterized neural networks. In particular, we focus on the following key questions:
Once stochastic gradient descent has converged, how does the distribution of the weights of the neural network look like? What functional properties of the resulting solution are induced by this stationary distribution? Can we quantitatively characterize the trade-off between the complexity of the solution and the size of the training data in the overparameterized regime?
To answer these questions, we consider training a wide two-layer ReLU (rectified linear unit) network for univariate regression, and we focus on the mean-field regime [MMN18, RVE18, CB18, SS20]. In this regime, the idea is that, as the number of neurons of the network grows, the weights obtained via SGD are close to i.i.d. samples coming from the solution of a certain Wasserstein gradient flow. As a consequence, the output of the neural network approaches the following quantity:
Here, is the input, denotes the activation function, and is the solution of the Wasserstein gradient flow minimizing the free energy
\beta=+\infty, while in (c) we have a sufficiently large regularization coefficient, which does not allow the network to fit the training data perfectly. Note that the piecewise linear solution exhibits tangent changes also at points different from the training data. Furthermore, the number of “knot” points may differ from the minimum required to fit the data: for instance, in (a) the minimum amount of tangent changes is , but the solution has two of them. A number of works has exploited this connection to provide a rigorous justification to various phenomena attributed to neural networks. [MMN18, MMM19] give global convergence guarantees for two-layer networks by studying the energy dissipation along the trajectory of the flow. The paper by [CB18] takes a different route and exploits a lifting property enabled by a certain type of initialization and regularization, and [JMM20] put forward an argument based on displacement convexity. [NP20] and [AOY19] tackle the multi-layer case, and, in particular, [NP20] establish convergence guarantees for a three-layer network. [FLYZ21] introduce a mean-field dynamics capturing the evolution of the features (instead of the network parameters) and show global convergence of ResNet type of architectures. [SM20] prove two properties commonly observed in practice (see e.g. [GIP+19, DVSH18, KWL+19]), namely dropout stability and mode connectivity, for multi-layer networks trained under the mean-field regime. [DBDFS20] consider different scalings of the step size of SGD, and identify two regimes under which different mean-field limits are obtained. [WTS+19] show that the gradient flow for unregularized objectives forces the neurons of a two-layer ReLU network to concentrate around a subset of the training data points.
In this paper, we take a mean-field view to show that SGD is biased towards functionally simple solutions, namely, piecewise linear functions. Our idea is to analyze the stationary distribution minimizing the free energy (1.1). We show that, in the low temperature regime (), the estimator’s curvature vanishes everywhere except for a certain cluster set. More precisely, for each interval between two consecutive training inputs, aside for a set of small measure, the second derivative vanishes, i.e.,
Furthermore, we provide a characterization of the cluster set and show that its measure vanishes while it concentrates around at most 3 points per interval. Ultimately, this analysis guarantees that, in the regime of decreasing temperature (corresponding to a small noise injected in the gradient updates), the solution found by SGD is piecewise linear. Our main contribution can be summarized in the following informal statement:
Under the low temperature regime, i.e., , the estimator obtained by training a two-layer ReLU network via noisy-SGD converges to a piecewise linear solution. Furthermore, the number of “knot” points – i.e., points at which distinct linear pieces connect – between two consecutive training inputs is at most 3.
Let us remark on a few important points. In the overparameterized regime, the number of neurons is significantly larger than the number of training samples , i.e., . The output of the two-layer ReLU network is a linear combination of ReLU units, hence the function implemented by the network is clearly piecewise linear with knot points. Here, we show that the number of knot points is actually . Our analysis applies for both constant () and vanishing () regularization, and it does not require a specific form for the initialization of the parameters of the networks (as long as some mild technical conditions are satisfied).
Organization of the paper. The rest of the paper is organized as follows. In Section 2, we review the related work and a more detailed comparison is deferred to Section 8. In Section 3, we provide some preliminaries, including a background on the mean-field analysis in Section 3.1. Our main results are stated in Section 4 and proved in Section 5. In Section 6, we provide an example of a dataset for which the estimator found by SGD has a knot at a location different from the training inputs. We validate our findings with numerical simulations for different regression tasks in Section 7. We conclude and discuss some future directions in Section 9. Some of the technical lemmas and the corresponding proofs are deferred to Appendix A.
Related Work
The line of works [WTS+19, JM20] shows that, in the lazy training regime [COB19, JGH18] and for a uniform initialization, SGD converges to a cubic spline interpolating the data. Furthermore, for multivariate regression in the lazy training regime, [JM20] proved that the optimization procedure is biased towards solutions minimizing the 2-norm of the Radon transform of the fractional Laplacian. Similar results (although without the connection to the training dynamics) are obtained in [SESS19, OWSS20], which analyze the solutions with zero loss and minimum norm of the parameters. [EP21] develop a convex analytic framework to explain the bias towards simple solutions. In particular, an explicit characterization of the minimizer is provided, which implies that an optimal set of parameters yields linear spline interpolation for regression problems involving one dimensional or rank-one data. [CFW+21] show that, for overparameterized models, the lower degree spherical harmonics are easier to learn. This observation comes from the fact that, in the lazy training regime, the convergence occurs faster along the directions given by the top eigenfunctions of the neural tangent kernel. Classification with linear networks on separable data is considered in [SHN+18], where it is shown that gradient descent converges to the max-margin solution. This max-margin behavior is demonstrated in [CB20] for non-linear wide two-layer networks using a mean-field analysis. In particular, in the mean-field regime, optimizing the logistic loss is equivalent to finding the max-margin classifier in a certain functional space. The paper by [ZXLM20] focuses on the lazy training regime, and it shows that the optimization procedure finds a solution that fits the data perfectly and is closest to the starting point of the dynamics in terms of Euclidean distance in the parameter space. [WZBG21] characterize the directional bias of GD and SGD in the case of moderate (but annealing) learning rate.
The behavior of SGD with label noise near the zero-loss manifold is studied in [BGVV20]. Here, it is shown that the training algorithm implicitly optimizes an auxiliary objective, namely, the sum of squared norms of the gradients evaluated at each training sample. This allows the authors of [BGVV20] to show that SGD with label noise for a two-layer ReLU network with skip-connections is biased towards a piecewise linear solution. In particular, this piecewise linear solution has the minimum number of tangent changes required to fit the data. [WTS+19] consider the Wasserstein gradient flow on a certain space of reduced parameters (in polar coordinates), and show that the points where the solution changes tangent are concentrated around a subset of training examples. A trade-off between the scale of the initialization and the training regime is also provided in [WTS+19, SPD+20]. [MBG18] prove that the gradient flow enforces the weight vectors to concentrate at a small number of directions determined by the input data. Through the lens of spline theory, [PN20b] explain that a number of best practices used in deep learning, such as weight decay and path-norm, are connected to the ReLU activation and its smooth counterparts. [NLB+19] suggest a novel complexity measure for neural networks that provides a tighter generalization for the case of ReLU activation.
Preliminaries
where the integral is taken over the support of . For the forthcoming analysis, a certain regularity is required for the weight distribution . In particular, the weight distribution is restricted to a set of admissible densities
stands for the differential entropy of , which is equal to if the distribution is singular. In this view, the distributional dynamics (3.1) is the Wasserstein gradient flow that minimizes the free energy
over the set of admissible densities . Furthermore, this free energy has a unique minimizer and the solution of (3.1) converges to it as :
The unique minimizer is absolutely continuous, and it has the Gibbs form
where is the normalization constant, also referred to as partition function.
2 Approximation of the ReLU Activation
Let us elaborate on the properties which should satisfy so that the results of Section 3.1 hold. First, the distributional dynamic (3.1) is known to be well-defined for a smooth and bounded potential . In particular, it suffices to choose a bounded, Lipschitz with Lipschitz gradient, see assumptions A2-A3 in [MMN18]. Furthermore, the minimizer of the free energy (3.5) exists and has a Gibbs form even for non-smooth potentials and, in particular, it suffices that is bounded and Lipschitz (this allows the first derivative to be discontinuous), see Lemmas 10.2-10.4 in [MMN18].
In the case of a ReLU activation, the corresponding has the following form
which does not satisfy some of the aforementioned conditions. The first salient problem is the lack of continuity of the derivative at zero. This issue can be dealt with by considering a soft-plus activation with scale :
Notice that, as grows large, we have that . Another issue is that the function is not Lipschitz in the parameters , and it is unbounded. This problem can be solved by an appropriate truncation applied to the parameter of the activation. The truncation should be Lipschitz and smooth for the dynamics to be well-defined.
We define the smooth -truncation of the ReLU activation as
Finally, we define the smooth -truncation of the softplus activation as
Notice that, for , the soft-plus activation can be sandwiched as follows:
In order to establish the continuity of a certain limit and smoothness properties, we also pick such that the smooth -truncation of soft-plus activation satisfies a similar bound:
At this point, we remark that the activation satisfies all the conditions necessary for the results of Section 3.1 to hold. In what follows, we will also use the activation as an auxiliary object. This map is not smooth, but it satisfies all the assumptions required for the existence of a free energy minimizer . We also note that the truncation of the parameter might seem unnatural (we are truncating the ReLU activation anyway), but it simplifies our analysis. In particular, it allows us to establish a connection between the derivatives (w.r.t. the input ) of the predictor implemented by the solution of the flow (3.1) and the same quantity evaluated on the minimizer, as grows large.
We will use the following notation for the values of the risks corresponding to different activations
Here, and represent the rescaled error on the -th training sample, and and are the standard expected square losses. In this way, we can write the Gibbs minimizers in a compact form, namely,
where and denote the partition functions.
Main Results
Before presenting the main results, let us introduce the notion of a cluster set. This set allows us to identify the locations of the knot points of an estimator function that is implemented by the neural network. In particular, we consider the second derivative of the predictor evaluated at the Gibbs distribution with activation , for large , i.e.,
Then, the cluster set is associated to the inputs on which the quantity (4.1) might grow unbounded in absolute value, in the low temperature regime (). Intuitively, this indicates that on some points of the cluster set, the tangent of the predictor changes abruptly, resulting in “knots”. We denote the cluster set by , and we define it below.
Let be the set of prediction intervals, i.e.,
where is any fixed positive constant independent of . For each , the intersection of the cluster set with the prediction interval is denoted by , i.e.,
Thus, in order to define the cluster set , it suffices to give the definition of . To do so, consider the second-degree polynomials and given by
Here, if the summation set is empty (e.g., for ), the corresponding coefficient is equal to zero. Then, the set is defined as the union of the non-positive sets of the second-degree polynomials and :
We now provide an informal explanation on how the non-positive sets of the second-degree polynomials and come into play. A central object of interest in our analysis is the second derivative of the estimator implemented by the neural network, and our strategy is to bound its magnitude by a particular Gaussian-like integral. This integral does not diverge as long as the corresponding covariance matrix is non-degenerate, i.e., it has strictly positive eigenvalues. In this view, the non-positive sets of the polynomials and precisely characterize the inputs for which this covariance matrix is degenerate. Hence, for such inputs , this upper bound on the second derivative of the estimator diverges, which implies that the predictor may have a “knot”.
Since and are second-degree polynomials, the set can be always written as the union of at most intervals. Moreover, depends only on the errors of the estimator at the training points and on the penalty parameter . Thus, if one has access to the value of the errors at each training point for the optimal estimator, i.e., , an explicit expression for the cluster set can be readily obtained. Figure 3 shows three different configurations of the polynomials and , together with the corresponding cluster set.
The size of the set can be controlled explicitly as a function of the parameters . More formally, in Lemma 5.3, we show that the Lebesgue measure of can be upper bounded as
where denotes a numerical constant independent of and we have made the following assumption:
, \beta\geq\max\Big{\{}C_{1},\frac{1}{\lambda},\frac{1}{\lambda}\log\frac{1}{\lambda}\Big{\}}, and for some numerical constants .
In particular, (4.7) implies that the cluster set vanishes as and . Therefore, as is the union of at most intervals, the cluster set concentrates on at most 3 points per prediction interval.
We note that our use of A1 throughout the sequel is with the flexibility of , , and in mind; we are interested in the behavior as and grow large, so we permit liberty in the determination of the constants implying the formal statements we intend to show.
A key step of our analysis (cf. Theorem 1) consists in showing that, outside the cluster set, the absolute value of the second derivative vanishes. Our bound on this absolute value is connected to the speed of decay to zero of the polynomials and , as the input approaches the cluster set. In order to establish a quantitative bound for such a decay, we introduce an auxiliary quantity, namely, a critical point, that is associated to each input point outside of the cluster set. Given the polynomial and the input , the critical point associated to is defined below.
Figure 4 provides a visualization of the critical point associated to for several configurations of . For the polynomial and an input , the critical point is defined in a similar fashion. In this view, we show in Lemma 5.5 that the following lower bounds on hold for ,
The coefficients satisfy the following condition: either or , and either or , where is a numerical constant independent of the choice of .
At this point, we are ready to state our upper bound on the second derivative outside the cluster set.
Assume that condition A1 is satisfied and that for some numerical constant independent of . Then, for each , the following upper bound on the second derivative holds
where the coefficient is defined as
with and given by (4.8). Furthermore, the following upper-bound on the size of the cluster set holds
for some numerical constant independent of .
Some remarks are in order. First, the inequality (4.9) shows that, in the low temperature regime, the curvature vanishes outside the cluster set, and it also provides a decay rate. Second, we will upper bound the measure of the cluster set as in (4.7), thus the condition ensures that the upper bound (4.11) holds. Finally, the presence of the coefficient is due to the fact that the second derivative can grow unbounded for points approaching the cluster set. Let us highlight that this growth is solely dictated by the distance to the cluster set, and it does not depend on . In fact, (4.8) holds, where one of the coefficients in and in is lower bounded by a strictly positive constant independent of .
Figure 5 provides some examples of piecewise linear solutions: (a) and (b) are admissible (in the sense of Definition 4.2), while (c) is not admissible, since it has two knots in the interior of the prediction interval and one located at the right endpoint. As mentioned before, the location of the knot points is associated with the limiting behaviour of the corresponding polynomials and . For instance, consider the prediction interval . Then, the configuration of Figure 5a corresponds to the case described in Figure 3a. In fact, has a negative leading coefficient, and its roots are converging to the end points of the interval. Moreover, has positive curvature and the minimizer is located inside the interval. The same parallel can be drawn between Figure 5b and Figure 3c. Furthermore, one can verify that the situation described in Figure 5c cannot be achieved for any configuration of and .
We are now ready to state our result concerning the structure of the function obtained from the Gibbs distribution .
Assume that condition A1 is satisfied and that , where is a constant independent of . Then, given a set of prediction intervals , there exists a family of admissible piecewise linear solutions as per Definition 4.2, such that, for any and , the following convergence result holds
The proof of Theorem 2 crucially relies on the fact that the second moment of is uniformly bounded along the sequence . In fact, the uniform bound on the second moment implies that the first derivatives of the predictors w.r.t. the input are uniformly bounded (even for points inside the cluster set), and therefore the sequence of predictors is equi-Lipschitz. This, in particular, allows us to show that the limit is well-behaved, as function changes can be controlled via Lipschitz bounds.
Let us clarify that Theorem 2 does not establish the uniqueness of the limit in , i.e., that the limiting piecewise linear function is the same regardless of the subsequence. Our numerical results reported in Figures 1, 6b, 7 and 8 suggest that the limit is unique. However, a typical line of argument (see e.g. [JKO98]) would require the lower-semicontinuity of the free energy (which does not hold for ). Furthermore, even the uniqueness of the minimizer for remains unclear in our setup. Nevertheless, let us point out that the sequence is tight, since the second moments are uniformly bounded by Lemma A.6, and Proposition 2.3 in [HRŠS21] suggests that at least the cluster points of the sequence as coincide with the set of minimizers of the limiting objective (). Another piece of evidence comes from the fact that the annealed dynamics converges to the minimizers of the noiseless objective [Chi22]. We leave for future work the resolution of these issues.
We remark that providing a quantitative bound on the parameter appears to be challenging. The current analysis relies on a dominated convergence argument which does not lead to an explicit convergence rate. Obtaining such a rate requires understanding the trade-off between the terms in the free energy (3.5) for varying , and it is also left for future work.
Finally, by combining Theorem 2 with the mean-field analysis in [MMN18], we obtain the desired result on finite-width networks trained via noisy SGD in the low temperature regime.
where the limit in is taken along any subsequence with and .
In words, Corollary 4.3 means that, at convergence, the estimator implemented by a wide two-layer ReLU network approaches a piecewise linear function, in the regime of vanishingly small noise. In fact, as , the activation function converges pointwise to the ReLU activation . We also remark that our result holds for any initialization of the weights of the network, as long as some mild technical conditions are fulfilled (absolute continuity, sub-Gaussian tails, finite second moment and entropy).
Let us clarify some technical aspects of the statement of Corollary 4.3. The result holds for a particular sequence of minimizers, since some of the limits (, , and ) are not interchangeable. Furthermore, it appears to be difficult to prove the same statement directly for the noiseless case (). We also point out that the stochasticity of the gradient descent algorithm does not play a role in our analysis, since its impact is seen to be inconsequential by the usual concentration argument [MMN18] when passing to its non-stochastic counterpart.
As concerns the limit in , describing the dependence of the mixing time of the diffusion dynamics (3.1) on the temperature parameter is a cumbersome task. In particular, [GBEK04] show that an exponentially bad dependence could occur if the target function has multiple small risk regions. However, some recent studies show an exponentially fast convergence of the noisy dynamics under some reasonable but particular conditions on the objective landscape [Chi22, NWS22].
As concerns the limit in , the analyses in [MMN18, MMM19] lead to an upper bound on the error term that, with probability at least , is given by
where denotes the maximum between and . The exponential dependence of (4.12) in the time of the dynamics is a common drawback of existing mean-field analyses, and improving it is an open problem which lies beyond the scope of this work. Let us conclude by mentioning that the numerical results presented in Section 7 suggest that, in practical settings, the convergence to the limit occurs rather quickly in the various parameters.
Proof of the Main Results
To do so, in Lemma A.4 we prove that, as , the sequence of minimizers of the free energy converges pointwise for all to a minimizer of the free energy with truncated ReLU activation. Then, a dominated convergence argument allows us to obtain (5.1). Next, in Lemma 5.7 we show that, as , the absolute value of the integral
can be made arbitrary small for all except those in the cluster set. The idea is that the absolute value of (5.2) can be bounded by a certain Gaussian integral, and the corresponding covariance matrix is well-defined everywhere except in the cluster set (see Lemmas 5.4 and 5.5). The definition of the cluster set (see (4.2)-(4)) together with the fact that the partition function of is uniformly bounded in (see Lemma 5.2) allows us to show that the cluster set concentrates on at most three points per interval as .
In Section 5.3, we show that the predictor evaluated at the Gibbs distribution can be approximated arbitrarily well by an admissible piecewise linear solution (Theorem 2). First, via a Taylor argument, since the curvature vanishes, the estimator can be approximated by a linear function on each interval of . Since the cluster set vanishes concentrating on at most three points per prediction interval, the predictor converges to an admissible piecewise linear solution. However, there is one technical subtlety to consider before reaching this conclusion. Namely, we must consider the possibility that the sequence of predictors experiences unbounded oscillations inside the cluster set, which might ultimately result in a discontinuous limit. Fortunately, this scenario is ruled out because the sequence has uniformly bounded second moments. This fact in conjunction with the structure of the first derivative of the predictor yields the conclusion that the sequence of predictors is equi-Lipschitz, and therefore the limit is well-behaved.
Finally, the proof of Corollary 4.3 follows from similar arguments together with the application of the result established in [MMN18]. More specifically, first, the truncation of the parameter ensures that, as , the curvature of the predictor evaluated on the solution of the flow (3.1) converges pointwise in to the corresponding evaluation on the Gibbs distribution . Next, following [MMN18], we couple the weights obtained after steps of the SGD iteration (3.3) with i.i.d. particles with distribution , thus obtaining that the curvature of the SGD predictor converges to the curvature of the flow predictor. By using this coupling again, together with the fact that along the trajectory of the flow (see [MMN18] or [JKO98]), we obtain a uniform bound on the second moment of the empirical distribution of the SGD weights. The final result then follows from the same Lipschitz argument described above.
2 Proof of Theorem 1
Let us start with the proof of the vanishing curvature phenomenon. The quantity
is hard to analyze directly due to the presence of the -smoothing in the soft-plus activation. However, the structure of the activation alongside with the pointwise convergence of the minimizers to (cf. Lemma A.4) allows us to infer the properties of (5.3) through the analysis of the auxiliary object:
Formally, we show that the approximation result below holds.
Assume that condition A1 holds. Let and be the minimizers of the free energy for truncated softplus and ReLU activations, respectively, as defined in (3.9)-(3.10). Then,
where is a constant independent of .
Recall the definition of the activation provided in (3.7). We can decompose the integral into two pieces with respect to the domain of truncation and obtain
Let us focus on the first term in the RHS of (5.2). The second derivative has the following form
Thus, the following chain of equalities holds
where in the last step we have performed the change of variables . By Lemma A.4, we have that, as , converges to pointwise in . Furthermore, as , converges to for any , and converges to for any . Thus, as the Gibbs distributions and are continuous with respect to , we have that
Furthermore, combining (A.1) and (A.5) from Lemma A.2, we get the following bound
for some constant independent of and . Thus, we have
which is integrable in . Hence, by using the Dominated Convergence theorem and integrating out using Tonelli’s theorem, we have
Now, by triangle inequality, it remains to show that the absolute value of the second term in the RHS of (5.2) can be upper bounded by as . Recall that, by construction,
In addition, we have the following pointwise convergence of the integrand
Furthermore, by using (5.7), we conclude that the integrand can be dominated by an integrable function. Hence, an application of the Dominated Convergence theorem gives that
where the last inequality follows from Lemma A.2, which gives that for some that is independent of . By combining (5.2), (5.8), (5.9) and (5.10), we conclude that (5.5) holds. Finally, by using a standard line of arguments, i.e., Mean Value theorem and Dominated Convergence, the derivative can be pushed inside the integral sign, which finishes the proof. ∎
Next, we study the set on which (5.4) might grow unbounded. In particular, in Lemma 5.3, we provide an upper bound on the measure of the set defined in (4.5)-(4). To do so, we will first show that the partition function of is uniformly bounded in , as stated and proved below.
Consider or , and let be the Gibbs distribution with activation . Then, the following upper bound holds for its partition function :
where is a constant independent of .
Let be defined as follows
By substituting the form (3.6) of the Gibbs distribution into the free energy functional (3.5), we have that
Note that, by Fubini’s theorem, we can interchange summation and integration in the first integral, since the activation and the labels are bounded. By using also the definition of , we have that
where is independent of . From Lemma 10.2 in [MMN18], we obtain that, for any ,
where the last inequality follows from non-negativity of and . Combining the upper and lower bounds gives
In order to bound the measure of , the idea is to combine the upper bound on the partition function of Lemma 5.2 with a lower bound that diverges in unless vanishes. In particular, we derive a lower bound with the structure of a Gaussian integral which grows unbounded for a certain set of inputs. This set of inputs corresponds to the scenario when the Gaussian covariance has non-positive eigenvalues, and it can be expressed as the set in which the polynomials and defined in (4.3) are non-negative. For brevity, we suppress the dependence of and on in the proofs below.
Assume that condition A1 holds. For , let and be defined as in (4). Then,
where is independent of .
We start with the proof for . For , the corresponding polynomial is equal to and therefore . Let us now consider the case , and assume that . (If that’s not the case, the claim trivially holds.)
Now, we can lower bound the partition function as
Here, the equality in the second line follows from the following observation: if and , then and therefore ; if and , then (, hence , as is a numerical constant independent of and is sufficiently large by assumption A1) and therefore for all . Thus, after the change of variables and an application of Tonelli’s theorem, the RHS in (5.12) reduces to
Here the coefficients and are defined as per (4). The term under the exponent can be rewritten as
By definition of in conjunction with Sylvester’s criterion, we have that has a non-positive eigenvalue with corresponding eigenvector
Furthermore, the other eigenvalue with corresponding eigenvector is given by
Note that and are orthogonal, and consider the following change of variables for the integral
As the matrix is unitary, the quantity in (5.13) can be rewritten as
as the determinant of the Jacobian is 1 for any unitary linear transformation. As , this quantity is lower bounded by
Notice that , and Thus, picking and ensures that . Furthermore, these conditions on do not violate the requirement on , since Consequently, as the integrand is non-negative, the integral in (5.14) is lower bounded by
By Lemma A.5, is bounded by a constant independent of , since from condition A1. Hence, is also uniformly bounded in . This, in particular, implies that
where is independent of . Furthermore, by definition of , , which implies that and are also upper bounded by a constant independent of , and therefore
With this in mind, we can then further lower bound the integral in (5.15) by
In regards to the argument for , for the result trivially holds, since and, thus, . For , the partition function can be lower bounded by
where the set is defined on non-positive and , i.e.,
The rest of the argument remains the same by noting that with the change of variable
which is exactly as in (5.13), but with and the polynomial in place of and the polynomial . ∎
In order to control the magnitude of (5.4), it is also necessary to understand the behavior of the polynomials defined in (4.3). The worst case scenario, in terms of presenting a challenge to bounding the curvature, corresponds to or being arbitrarily close to zero on the whole area outside of cluster set. In fact, this would imply that the Gaussian-like integral arising in the computation of (5.4) has arbitrary small eigenvalues. More specifically, our plan is to exploit the following bound for :
Now, the RHS of (5.18) diverges (and, therefore, the bound is useless), if either of the polynomials is arbitrarily close to zero outside of the cluster set. Fortunately, we are able to prove that this cannot happen: in Lemma 5.5 we show that and can be small only when approaches the cluster set, i.e.,
where are defined in (4.8) and, because of the condition on their coefficients , they cannot be arbitrarily close to in any interval .
where we suppress the dependence on , i.e., , for more compact notation. In addition, let be the subset of on which is strictly positive, i.e.,
For a fixed small constant , define the set of admissible coefficients as follows
Given and , we define the critical point of the polynomial associated with and in the same fashion as in Definition 4.1, after replacing with and with . Notice that, since has strictly positive Lebesgue measure for , the critical point is well-defined and, in particular, always holds.
Fix some such that , as defined in (5.20), is of positive measure. Pick some interval . Let and be the critical point associated to . Then, the following holds
where and at least one of them is lower bounded by a strictly positive constant depending on but independent of the choice of .
We defer the proof of Lemma 5.4 to Appendix A.3. Recall the definition of the polynomial given in (4.3), and notice that expression can be rearranged such that is in the form of (5.19), namely
In this view, the following result follows from Lemma 5.4.
Assume that , i.e., is lower bounded by a positive constant. Given , let be the critical point associated to . Then, we have that
where and either or for some that is independent of but depending on as appearing in the definition of .
Note that is the set in which is strictly positive. Hence, since is lower bounded by a positive constant independent of , we can apply Lemma 5.4 to get
where and at least one of them is lower bounded by a strictly positive constant independent of . Thus, since each term of the RHS above is non-negative, we get
where . Furthermore, as , we have
Now, either or as well as are lower bounded by strictly positive constants independent of . Thus, taking and concludes the proof. ∎
Let us point out that, although does not depend on the values of , the position of a critical point depends on .
In a similar fashion, we define to be the set of admissible as in (5.20), and given , we let be the critical point associated to and . Then, a result analogous to Lemma 5.5 holds for :
where and either or for some that is independent of the choice of .
The last ingredient for the proof of the vanishing curvature phenomenon is the control of the decay of the partition function as .
for some that is independent of .
The proof of Lemma 5.6 is deferred to Appendix A.2. At this point, we are ready to provide an upper bound on the magnitude of (5.4).
Assume that condition A1 holds. Furthermore, assume that , where is given in (5.11). Fix . Then, for any ,
where is independent of , , and are given by (5.22) and (5.23), respectively.
Note that the following upper bound holds
Let us now decompose the integral depending on the sign of , i.e.,
and, recalling the form of from (3.10), the corresponding potentials are given by
By recalling from (4) the definitions of and , we obtain the following upper bounds.
Let us analyze the RHS of (5.24). This term can be rewritten as
where the first inequality follows from Lemma 5.3, and the second inequality uses that . Therefore, for sufficiently large , is smaller than , and therefore is lower bounded by . At this point, we can apply Lemma 5.5 which gives that . Thus, (5.26) is upper bounded by
where . Furthermore, the following chain of inequalities hold:
where the second passage follows from Jensen’s inequality. By using (5.28), the RHS of (5.27) is upper bounded by
Applying Lemma 5.5 again to obtain and noting by definition that , we now upper bound this last term by
where in the second line we use that and again that , and in the third line we use that .
Finally, computing explicitly the last integral gives the following upper bound on the RHS of (5.24) and consequently on :
By following the similar passages, we obtain the same upper bound for . By using the lower bound on the partition function shown in Lemma 5.6, we conclude that
where is independent of , and the proof is complete. ∎
The proof of Theorem 1 is an immediate consequence of the results presented so far.
The proof of (4.9) follows from Lemmas 5.1 and 5.7, and the proof of (4.11) follows from Lemma 5.3. ∎
3 Proof of Theorem 2
To summarize, at this point we have shown that as the second derivative of the predictor vanishes outside the cluster set, and that the size of the cluster set shrinks to concentrate on at most 3 points per prediction interval. With these results in mind, we are ready to provide the proof for Theorem 2.
The predictor evaluated at the Gibbs distribution is given by
where denotes the aggregated index and we suppress the dependence on in for convenience. By Lemma A.6, there exists such that, for any ,
for some independent of . We start by showing that the family of predictors is equi-Lipschitz for . First, note that
since the derivative can be pushed inside by the same line of arguments as given in the proof of Lemma 5.1. Next, we have that, by construction of the activation, the following holds
Using the Cauchy-Schwartz inequality and (5.30), we obtain that
By combining (5.31) and (5.32), we have shown that the family for is equi-Lipschitz, as the derivatives are uniformly bounded. By using a similar argument, we can show that the same result holds for the predictor itself, i.e., for all , is uniformly bounded.
Note that Theorem 1 considers the curvature of points outside the cluster set, and it gives an upper bound which diverges when approaches for some . Thus, our next step is to develop the analytical machinery to make this scenario impossible. Let us recall Definitions (4.8) and (4.10). Then, by Lemma 5.5, we have that
where and , for some that is independent of . Let us focus on the term . If or it approaches (as ), then we extend as
where denote such (possibly empty) open intervals. Furthermore, is the union of at most three disjoint closed intervals, i.e.,
where denote such (possibly empty) closed intervals.
where we use that by construction of the extended set . Let us define
Then, by picking a sufficiently small , (5.33) implies that, as and , for all ,
Let us now consider the open intervals . For any , let
where the second inequality is due to the fact that the families and are equi-Lipschitz. From (5.34) the second term in the RHS in (5.3) vanishes. As for the first term, by construction of the extension, together with the result of Lemma 5.3, we have that
for some independent of . Thus, by picking a sufficiently small and , we conclude that the first term in the RHS in (5.3) also vanishes.
So far, we have showed that, both inside and outside of the extension of the cluster set, the predictor is well approximated by linear functions. It remains to prove that the linear pieces connect, i.e., there exists such that, for two neighboring linearities and (possibly belonging to different intervals), the following holds
This claim follows from Lipschitz arguments similar to those presented above, and the proof is complete. ∎
4 Proof of Corollary 4.3
At this point, we have proved a result about the structure of the predictor coming from the minimizer of the free energy (3.5). By using the mean-field analysis in [MMN18], we finally show that this structural result holds for the predictor obtained from a wide two-layer ReLU network.
First, we show that, as , the second derivative of the predictor evaluated on the solution of the flow (3.1) converges to the same quantity evaluated on the Gibbs minimizer . To do so, we decompose the integral involving as in Lemma 5.1 (cf. (5.2)):
Next, we show that a technical condition bounding the free energy at initialization appearing in the statement of Theorem 4 in [MMN18] is satisfied under the assumption and . Recalling the sandwich bound for the truncated soft-plus activation (3.8) and the fact that that by condition A1, an application of Cauchy-Schwarz inequality gives
where are some numerical constants independent of . This readily implies that
since and are upper-bounded by assumption A1.
Now we can apply Theorem 4 in [MMN18] to conclude that, as ,
Thus, as the terms inside the integrals in (5.4) are all bounded for fixed , by definition of weak convergence, we get that, as ,
Consequently, since the derivative operator can be pushed inside by the same arguments as in Lemma 5.1, we have that, as , the following pointwise convergence holds
Next, we show that the second derivative of the predictor obtained from the two-layer ReLU network also converges to the same limit. Recall that . Then, by Theorem 3 in [MMN18], we have that, almost surely, as
along any sequence such that and . By combining (5.37) and (5.38), we obtain that the desired convergence result holds for the LHS of (5.37).
Another application of Theorem 3 of [MMN18], together with the fact that the second moment of the flow solution is uniformly bounded along the sequence (cf. Lemma 10.2 in [MMN18], following Proposition 4.1 in [JKO98]), gives that the gradients
are almost surely uniformly bounded. This fact, in turn, implies that the corresponding predictor is almost surely equi-Lipschitz. In a similar fashion, we also have that the predictor itself is almost surely uniformly bounded in absolute value.
At this point, the desired result follows from the same line of arguments as in the proof of Theorem 2. ∎
Knots Inside the Interval
In this section, we provide an explicit example of a 2-point dataset such that the SGD solution exhibits a change of tangent (or “knot”) inside the training interval. To do so, we will show that neural networks implementing a linear function without knots on the prediction interval cannot minimize the free energy (3.5). To simplify the analysis, throughout the section we omit the limits in , i.e., we consider directly ReLU activations (this corresponds to taking ). Similar arguments apply to the case of sufficiently large parameters and .
We start with the case of noiseless SGD training, i.e., . Here, the free energy has no entropy penalty and it can be expressed as
We consider the following dataset which consists of two points:
Let be the piecewise linear function that interpolates the training data and passes through the point , where it exhibits a knot (see the orange curve in Figure 6a). Note that
and denotes the Dirac delta function centered at . Note that and . Thus, the free energy is given by
Let be a linear function on the interval such that and (see the blue dashed line in Figure 6a), and let be the corresponding distribution of the parameters, i.e.,
In the rest of this section, we will show that, for all ,
In words, the minimizer of the free energy cannot be a linear function on the interval . As is linear, we have that
First, we consider the case . From (6.7), we have that . Hence,
By combining (6.8) and (6.4), we conclude that (6.6) holds for all (under the additional restriction ).
Next, we consider the case . By using (6.7) and applying Cauchy-Schwarz inequality, we have that
With this in mind, we can lower bound the regularization term as
where the last inequality follows from the fact that is minimized over by taking . Therefore, we have that
Note that, for a fixed value of the sum , the quantity is minimized when . Thus, by recalling that , we have
One can readily verify that, for any , the minimizer is given by . Thus,
where the first inequality uses (6.9) and that the minimizer is , and the next two inequalities use that . Merging two cases regarding , we conclude that (6.6) holds, as desired.
2 Low Temperature Regime
We now focus on the case of noisy SGD with temperature . Here, the free energy can be expressed as
We consider the two-point dataset (6.2) and we recall that has a knot inside the training interval. In this section we will show that the following two results hold for all :
There exists a sequence of distributions such that, for any ,
Let be a distribution such that the function given by (6.5) is linear in the interval . Pick a sequence of distributions such that and for any ,
Combining these two results gives that, for sufficiently large , the minimizer of the free energy (6.11) cannot yield a linear estimator on the interval between the two data points. In Figure 6b, we represent the function obtained by training via SGD a two-layer ReLU network with 500 neurons on the dataset (6.2). Clearly, the blue curve approaches the piecewise linear function , which contains a knot inside the interval $\lambda=0$), but similar results are obtained for small (but non-zero) regularization.
where we have used that the support of lies inside the ball . The first term in the RHS of (6.16) vanishes as by weak convergence, since the function is bounded inside . For the second term, we have that, for any ,
where is a constant independent of . Since the sequence is uniformly integrable, we can make the RHS arbitrary small by picking a sufficiently large (uniformly for all ). As a result, (6.12) readily follows.
Note that (6.12) immediately implies that, as , . Furthermore, with similar arguments we obtain that, as , . By convexity of the differential entropy, we have that . Hence, , where is independent of . By combining these bounds on , and , we conclude that
which, combined with (6.4), completes the proof of (6.13).
Proof of (ii).
From (6.14), we obtain that . As the second moment is lower-semicontinuous and bounded from below, we have that . Furthermore, Lemma 10.2 in [MMN18] implies that
By replicating the argument leading to (6.10) (but now with regularization coefficient instead of ), we obtain that the RHS of (6.17) can be lower bounded as
for all . Then, the desired result follows from (6.17) and (6.18).
Numerical Simulations
We consider training the two-layer neural network (3.1) with neurons and ReLU activation functions, i.e., , with . We run the SGD iteration (3.3) (no momentum or weight decay, batch size equal to ), and we plot the resulting predictor once the algorithm has converged. The results for two different unidimensional datasets are reported in Figures 7 and 8. In these experiments, we set and we remark that the plots for wider networks () look identical. We also point out that the shape of the predictor does not change for different runs of the SGD algorithm (with different initializations, and order of the training samples). This is in agreement with the mean-field predictions when , and the variance of the initialization does not depend on . The same setup is employed to obtain the numerical results of Figure 1 and 6b, discussed in Section 1 and 6, respectively.
Comparison with Related Work
The work by [WTS+19] considers a noiseless setting with no regularization, and it studies the properties of gradient flow on the space of reduced parameters. In particular, the initial ReLU neurons depending on three parameters (, and , in our notation) are mapped to a two-dimensional space, where each neuron is defined by its magnitude and angle. Then, it is proven that the Wasserstein gradient flow on this reduced space drives the activation points of the ReLU neurons to the training data. As a consequence, the solution found by SGD is piecewise linear and the knot points are located at a subset of the training samples. [BGVV20] consider SGD with label noise and no regularization, and show that, once the squared loss is close to zero, the algorithm minimizes an auxiliary quantity, i.e., the sum of the squared norms of the gradients evaluated at each training point. By instantiating this result in the case of a two-layer ReLU network with a skip connection, the authors show that the solution found by SGD is piecewise linear with the minimum amount of knots required to fit the data.
Concluding Remarks
We focus on ReLU networks. However, only the following two properties of the activation appear to be crucial for the analysis: (i) its second derivative behaves like a Dirac delta, and (ii) its growth is at most linear. In fact, the first property reduces the computation of the curvature to an integral over a lower-dimensional subspace; and the second property leads to a uniform bound on the second moment of the network parameters. Hence, our approach may be extendable to a more general class of piecewise linear activations, although this would come at the cost of a more intricate structure for the cluster set containing the location of the tangent changes.
We focus on univariate regression. The natural ordering on one-dimensional features allows for a convenient characterization of the activation regions that correspond to each input conditioned on the sign of . For larger input dimension, such a characterization appears to be cumbersome, as the structure of these regions is induced by the intersection of hyperplanes. Furthermore, in the setting considered in this work, the cluster set is the union of intervals where certain second-degree polynomials are non-positive. For multivariate regression, we expect the cluster set to be connected to the non-positive set of quadratic forms. Hence, the structure of the cluster set may be highly non-linear, and its concentration can occur on subspaces which are hard to define explicitly.
We provide an upper bound on the number of tangent changes of the predictor. The numerical simulations of Section 6 suggest that one and two knots between consecutive training inputs can occur. Showing whether our theoretical bound of three knots is tight by providing an explicit example, or by proving a tighter bound of two, is an open question for possible future work. We also remark that, given the errors of the neural network estimator at the data points, one can deduce the location of the knot points. Such implicit characterization is similar in spirit to the attractive/repulsive condition on the training points of [WTS+19].
In conclusion, in this work we demonstrate how to exploit the Gibbs form of the minimizer in order to accurately characterize a functional property of the predictor learnt by the neural network using limiting arguments of the training process. The general spirit of this technique could potentially be informative in additional ways. For instance, utilizing the properties of the Gibbs distribution reached at convergence may be of additional interest for future study. We conjecture that this could yield insight into the stability of the predictor with respect to perturbations in the training data at finite temperature .
Acknowledgements
We would like to thank Mert Pilanci for several exploratory discussions in the early stage of the project, Jan Maas for clarifications about [JKO98], and Max Zimmer for suggestive numerical experiments. A. Shevchenko and M. Mondelli are partially supported by the 2019 Lopez-Loreta Prize. V. Kungurtsev acknowledges support to the OP VVV project CZ.02.1.01/0.0/0.0/16_019/0000765 Research Center for Informatics.
References
Appendix A Technical Results
In this appendix, we prove a few technical results which are used in the arguments of Section 5.2. More specifically, in Section A.1 we show that, as , the minimizer of the free energy converges pointwise in to the minimizer of the free energy . This pointwise convergence is needed to establish the result of Lemma 5.1. In Section A.2, we derive upper bounds on the risk of the minimizer (used in Lemma 5.3) and on its second moment (which implies that the sequence of predictors is equi-Lipschitz), and we also prove the lower bound on the partition function in Lemma 5.6. Finally, in Section A.3 we give the proof of Lemma 5.4, which lower bounds the growth of the polynomials and .
Let be a sequence of densities in with uniformly bounded truncated entropy, that is
for some that is independent of , and uniformly bounded second moment, i.e., for all . Then, there exists a subsequence of and such that and
Since , , has super-linear growth, this result in conjunction with the de la Vallée Poussin criterion (see for instance [HR11]) guarantees that the sequence of densities is uniformly integrable. By Dunford-Pettis Theorem (for -finite measure spaces, see for instance [Lau15]), relative weak compactness in is equivalent to uniform integrability. Hence, there exists a density and a subsequence of such that .
As is lower-semicontinuous with respect to the topology of weak convergence in and bounded from below, we have that Furthermore, as , we get that and, thus, . ∎
Assume that condition A1 holds. Consider the sequence of minimizing Gibbs distributions . The following results hold:
is uniformly bounded in . Moreover, if ,
where is independent of .
Given any consistent with A1, there exists and a subsequence (which with an abuse of notation we identify with ) such that as .
Given any consistent with A1, for all , and .
Note that for this , , in fact, does not depend on .
From Lemma 10.2 in [MMN18], since is the unique minimizer of the free energy , we have that the following inequalities hold
Furthermore, by using (A.1) and the fact that and , we obtain
for some that are independent of . By combining (A.3) and (A.2) and using that , we conclude that
where is independent of . As , the first claim immediately follows.
Since the activation and the labels are uniformly bounded in and is finite, is uniformly bounded in . Hence, the following lower bound on the partition function holds
for some independent of (but dependent on ). In the same way, one can upper bound as
where is independent of (but dependent on ). Notice that we can increase to be arbitrarily large and still satisfy (A.5), and in particular, increase it to satisfy . Thus, by combining (A.1) and (A.5), we get
where the RHS is independent of . As is uniformly bounded in , we can invoke Lemma A.1 to finish the proof of the second statement.
We now prove the third statement. By the triangle inequality, we have that, for all ,
By upper bounding as in (A.1)-(A.5), we have
where is independent of . Thus, an application of the Dominated Convergence theorem gives that the term vanishes. Furthermore, the term vanishes by weak convergence of to . This proves that, as , and so .
Note that and are lower-semicontinuous in . Furthermore, is lower bounded and is lower bounded by Lemma 10.1 in [MMN18] on the subsequence , as is uniformly bounded in . Hence, as converges weakly to , we conclude that
which, combined with , implies the desired result. ∎
Fix some distribution , then we have the following pointwise convergence:
and the RHS is integrable. Thus, an application of the Dominated Convergence theorem gives that
This concludes the proof since and are independent of . ∎
Assume that condition A1 holds and consider any satisfactory . Then, as , the minimizer of the free energy converges pointwise in to the minimizer of the free energy , i.e.,
From Lemma A.2, we have that there exists a subsequence and such that the following holds
Since minimizes , we have
By taking the liminf on both sides, using Lemma A.3 and (A.6), we have
Since is the unique minimizer of (see Lemma 10.2 of [MMN18]), and coincide almost everywhere, which implies that
where the convergence is intended to be pointwise in . Note that is uniformly bounded in , hence
which implies that converges pointwise to . Furthermore, as , converges to by Dominated Convergence, which concludes the proof. ∎
A.2 Bounds on Risk of Minimizer, Second Moment and Partition Function
where is a constant independent of . In addition, for any , there exists such that for any we have
Consider a “saw-tooth” function centered at with height and width , namely,
Notice that this function can be implemented by the following :
which ensures that the “saw-tooth” functions are not intersecting. Define
Then, one immediately has that, for all ,
Furthermore, by taking a sufficiently large , in particular, taking suffices, we get that, for all ,
which implies that .
Note that, for and chosen sufficiently large as mentioned previously,
Thus, by computing the integral w.r.t. , we have that
where, with an abuse of notation, we denote by the marginal of with respect to the last two components. By applying to Kantorovich-Rubinstein theorem (see, for instance, [Vil09]), we have that
for two densities and , where is the 1-Wasserstein distance and denotes the Lipschitz constant of . Notice that is Lipschitz in with Lipschitz constant upper bounded by . Hence, combining (A.8) and (A.9), we have that
where is a constant independent of . Recalling the form of the 2-Wasserstein distance between a delta and a Gaussian distribution, we have that
for some constant . As the distance is upper bounded by the distance (via Hölder’s inequality), by combining (A.10) and (A.11), we conclude that
where is a constant independent of . Hence, by taking , we have
where is a constant independent of .
Now recall that the differential entropy is a concave function of the distribution. Hence, by using the fact that is a product distribution and by explicitly computing the entropy of a Gaussian and a uniform random variable, we conclude that
with independent of . Hence, since is the minimizer of the free energy, by using the bound from Lemma 10.2 in [MMN18], we get that
Since and , (A.13) implies that
for independent of . This finishes the proof of the first part of the statement. The second part of the statement follows by combining (A.14) with Lemma A.4. ∎
Assume that condition A1 holds. It holds that there exists such that for any the following upper bound holds:
for some that is independent of .
We conclude this part of the appendix by providing the proof of Lemma 5.6.
Define and . By Lemma A.5, , where is independent of . Therefore, for some independent of . Using the inequalities and , the RHS of (A.15) can be lower bounded by
By explicitly computing the integral above, the desired result immediately follows. ∎
A.3 Lower Bound on Polynomials
By definition of , one can immediately verify that . Notice that, if is close to , then is close to , which implies that (since and, thus, bounded in absolute value) is close to and is close to . Therefore, at least one of the coefficients is lower bounded by a constant that is independent of .
Next, we distinguish two cases depending on the sign of . First, assume that . We now show that .
Now assume that and let be the minimizer of on the interval . If then, by definition of a critical point, which means that is located on the right branch of the parabola and, hence, . Furthermore, belongs to the interval by definition of . These facts imply that . The case is treated in a similar fashion.
As it was shown, at least one of the coefficients is lower bounded by a constant that is independent of , and , hence, choosing
concludes the proof for the case of non-negative curvature.
Now, if both and are close to , then (A.18) immediately implies that is also close to . However, following the argument above, it is not possible that , and are simultaneously close to . This proves that is lower bounded by a constant that is independent of .
gives the desired result in the case and concludes the proof. ∎