How degenerate is the parametrization of neural networks with the ReLU activation function?
Julius Berner, Dennis Elbrächter, Philipp Grohs
Introduction and Motivation
In recent years much effort has been invested into explaining and understanding the overwhelming success of deep learning based methods. On the theoretical side, impressive approximation capabilities of neural networks have been established . No less important are recent results on the generalization of neural networks, which deal with the question of how well networks, trained on limited samples, perform on unseen data . Last but not least, the optimization error, which quantifies how well a neural network can be trained by applying stochastic gradient descent to an optimization problem, has been analyzed in different scenarios . While there are many interesting approaches to the latter question, they tend to require very strong assumptions (e.g. (almost) linearity, convexity, or extreme over-parametrization). Thus a satisfying explanation for the success of stochastic gradient descent for a non-smooth, non-convex problem remains elusive. In the present paper we intend to pave the way for a functional perspective on the optimization problem. This allows for new mathematical approaches towards understanding the training of neural networks, some of which are demonstrated in Section 1.2. To this end we examine degenerate parametrizations with undesirable properties in Section 2. These can be roughly classified as
weight vectors with directly opposite directions.
Under conditions designed to avoid these degeneracies, Theorem 3.1 establishes inverse stability for shallow networks with ReLU activation function. This is accomplished by a refined analysis of the behavior of ReLU networks near a discontinuity of their derivative. Proposition 1.2 shows how inverse stability connects the loss surface of the parametrized minimization problem to the loss surface of the realization space problem. In Theorem 1.3 we showcase a novel result on almost optimality of local minima of the parametrized problem obtained by analyzing the realization space problem. Note that this approach of analyzing the loss surface is conceptually different from previous approaches as in .
The architecture simply specifies the number of neurons in each of the layers. We can then define the space of parametrizations with architecture as
the set of all parametrizations with architecture in , and the realization map
Given and that are close, does there exist a parametrization with such that and are close?
As we will see in Section 2, this question is fundamentally connected to understanding the redundancies and degeneracies of the way that neural networks are parametrized. By suitable regularization, i.e. considering a subspace of parametrizations, we can avoid these pathologies and establish a positive answer to the question above. For such a property the term inverse stability was introduced in , which constitutes the only other research conducted in this area, as far as we are aware.
Let , , and . We say that the realization map is inverse stable on w.r.t. , if for all and there exists with
See for further information on Sobolev norms, and for further information on the derivative of ReLU networks.
2 Implications of inverse stability for neural network optimization
Typically, the optimization problem is solved over some subspace of parametrizations , i.e.
From an abstract point of view, by writing , this is equivalent to the corresponding optimization problem over the space of realizations , i.e.
However, the loss landscape of the optimization problem (8) is only properly connected to the loss landscape of the optimization problem (9) if the realization map is inverse stable on . Otherwise a realization can be arbitrarily close to a global minimum in the realization space but every parametrization with is far away from the corresponding global minimum in the parametrization space. Moreover, local minima of (8) in the parametrization space must correspond to local minima of (9) in the realization space if and only if we have inverse stability.
Let , and let the realization map be inverse stable on w.r.t. . Let be a local minimum of on with radius , i.e. for all with it holds that
Then is a local minimum of on with radius , i.e. for all with it holds that
See Appendix A.1.2 for a proof and Example A.1 for a counterexample in the case that inverse stability is not given. Note that in (9) we consider a problem with convex loss function but non-convex feasible set, see [34, Section 3.2]. This opens up new avenues of investigation using tools from functional analysis and allows utilizing recent results exploring the topological properties of neural network realization spaces. As a concrete demonstration we provide with Theorem A.2 a strong result obtained on the realization space, which estimates the quality of a local minimum based on its radius and the approximation capabilities of the chosen architecture for a class of functions . Specifically let , let be a quasi-convex regularizer, and define
We denote the sets of regularized parametrizations by
Assume that is compact in the -closure of and that for every the realization map is inverse stable on w.r.t. . Then for all there exists such that for every with the following holds: Every local minimum with radius at least of satisfies
See Appendix A.1.2 for a proof and note that here it is important to have an inverse stability result, where the parameters do not depend on the size of the architecture, which we achieve for and . Suitable would be Besov norms which constitute a common regularizer in image and signal processing. Moreover, note that the required size of the architecture in Theorem 1.3 can be quantified, if one has approximation rates for . In particular, this approach allows the use of approximation results in order to explain the success of neural network optimization and enables a combined study of these two aspects, which, to the best of our knowledge, has not been done before. Unlike in recent literature, our result needs no assumptions on the sample set (incorporated in the loss function, see (7)), in particular we do not require “overparametrization” with respect to the sample size. Here the required size of the architecture only depends on the complexity of , i.e. the class of functions one wants to approximate, the radius of the local minima of interest, the Lipschitz constant of the loss function, and the parameters of the inverse stability. In the following we restrict ourselves to two-layer ReLU networks without biases, where we present a proof for inverse stability w.r.t. the Sobolev semi-norm on a suitably regularized space of parametrizations. Both the regularizations as well as the stronger norm (compared to the uniform norm) will shown to be necessary in Section 2. We now present, in an informal way, a collection of our main results. A short proof making the connection to the formal results can be found in Appendix A.1.2.
the network is balanced, i.e. ,
no non-zero weight vectors in the first layer are redundant, i.e. ,
the last two coordinates of each weight vector are strictly positive.
The global minimum of (17) is at least as good as the global minimum of (15), i.e.
By further regularizing (17) in the sense of Theorem 1.3, we can estimate the quality of its local minima.
This argument is not limited to the MSE loss function but works for any loss function based on evaluating the realization. The omission of bias weights is standard in neural network optimization literature . While this severely limits the functions that can be realized with a given architecture, it is sufficient to augment the problem by one dimension in order to recover the full range of functions that can be learned . Here we augment by two dimensions, so that the third regularization condition C.3 can be fulfilled without loosing range. Moreover, note that, for simplicity of presentation, the regularization assumptions stated above are stricter than necessary and possible relaxations are discussed in Section 3.
Obstacles to inverse stability - degeneracies of ReLU parametrizations
In (21) one can see that in our setting is independent of (as long as contains a neighbourhood of the origin) and will thus be abbreviated by .
All proofs for this section can be found in Appendix A.2.2. We start by showing that inverse stability fails w.r.t. the uniform norm. This example is adapted from [34, Theorem 5.2] and represents, to the best of our knowledge, the only degeneracy which has already been observed before.
Let and be given by (see Figure 1)
In particular, note that inverse stability fails here even for a non-degenerate parametrization of the zero function . However, for this type of counterexample the magnitude of the gradient of needs to go to infinity, which is our motivation for looking at inverse stability w.r.t. .
2 Failure of inverse stability w.r.t. Sobolev norm
In this section we present four degenerate cases where inverse stability fails w.r.t. . This collection of counterexamples is complete in the sense that we can establish inverse stability under assumptions which are designed to exclude these four pathologies.
Let , \Gamma:=\big{(}(r,0),0\big{)}\in\mathcal{N}_{(2,1,1)} and be given by (see Figure 3)
This is a very simple example of a degenerate parametrization of the zero function, since regardless of choice of . The issue here is that we can have a weight pair, i.e. , where the product is independent of the value of one of the parameters. Note that in Example A.4 one can see a slightly more subtle version of this pathology by considering \Gamma_{k}:=\big{(}(k,0),\tfrac{1}{k^{2}}\big{)}\in\mathcal{N}_{(2,1,1)} instead. In that case one could still get an inverse stability estimate for each fixed ; the parameters of inverse stability would however deteriorate with increasing . In particular this demonstrates the need for some sort of balancedness of the parametrization, i.e. control over and individually relative to . Inverse stability is also prevented by redundant directions as the following example illustrates.
and be given by (see Figure 3)
The next example shows that not only redundant weight vectors can cause issues, but also weight vectors of opposite direction, as they would allow for a (balanced) degenerate parametrization of the zero function.
Thus we will need an assumption which prevents each individual in our restricted set from having pairwise linearly dependent weight vectors, i.e. coinciding hyperplanes of non-differentiability. This, however, does not suffice as is demonstrated by the next example, which shows that the relation between the hyperplanes of the two realizations matters.
and consider the parametrizations (see Figure 5)
Note that and need to have multiple exactly opposite weight vectors which add to something small (compared to the size of the individual vectors), but not zero, since otherwise reparametrization would be possible (see Lemma A.5).
Inverse stability for two-layer ReLU Networks
We now establish an inverse stability result using assumptions designed to exclude the pathologies from the previous section. First we present a rather technical theorem for output dimension one which considers a parametrization in the unrestricted parametrization space and a function in the the corresponding function space . The aim is to use assumptions which are as weak as possible, while allowing us to find a parametrization of , whose distance to can be bounded relative to . We then continue by defining a restricted parametrization space , for which we get uniform inverse stability (meaning that we get the same estimate for every ).
It holds for all with that .
It holds for all with that .
There exists a parametrization \Theta=\Big{(}\big{[}a_{1}^{\Theta}\big{|}\dots\big{|}a_{m}^{\Theta}\big{]}^{T},c^{\Theta}\Big{)}\in\mathcal{N}_{N} such that and
it holds for all with that and for all with that ,
it holds for all , that
where .
Then there exists a parametrization with
for which we have . Note that the above definition as well as the following definition and theorem are for networks with arbitrary output dimensions, as the balancedness condition makes this extension rather straightforward. In order to satisfy Conditions C.3a and C.3b we need to restrict the parametrization space in a way which also restricts the corresponding space of realizations. One possibility to do so is the following approach, which also incorporates the previous restrictions as well as the transition to networks without biases.
In particular, this means that for any optimization problem over an unrestricted parametrization space , there is a corresponding optimization problem over the parametrization space whose solution is at least as good (see Corollary 1.4). Our main result now states that for such a restricted parametrization space we have uniform inverse stability w.r.t. , a proof of which can be found in Appendix A.3.2.
Outlook
This contribution investigates the potential insights which may be gained from studying the optimization problem over the space of realizations, as well as the difficulties encountered when trying to connect it to the parametrized problem. While Theorem 1.3 and Theorem 3.3 offer some compelling preliminary answers, there are multiple ways in which they can be extended. To obtain our inverse stability result for shallow ReLU networks we studied sums of ridge functions. Extending this result to deep ReLU networks requires understanding their behaviour under composition. In particular, we have ridge functions which vanish on some half space, i.e. colloquially speaking each neuron may “discard half the information” it receives from the previous layer. This introduces a new type of degeneracy, which one will have to deal with. Another interesting direction is an extension to inverse stability w.r.t. some weaker norm like or a fractional Sobolev norm under stronger restrictions on the space of parametrizations (see Lemma A.7 for a simple approach using very strong restrictions). Lastly, note that Theorem 1.3 is not specific to the ReLU activation function and thus also incentivizes the study of inverse stability for any other activation function. From an applied point of view, Conditions C.1-C.3 motivate the implementation of corresponding regularization (i.e. penalizing unbalancedness and redundancy in the sense of parallel weight vectors) in state-of-the-art networks, in order to explore whether preventing inverse stability leads to improved performance in practice. Note that there already are results using, e.g. cosine similarity, as regularizer to prevent parallel weight vectors as well as approaches, called Sobolev Training, reporting better generalization and data-efficiency by employing a Sobolev norm based loss .
Acknowledgment
The research of JB and DE was supported by the Austrian Science Fund (FWF) under grants I3403-N32 and P 30148. The authors would like to thank Pavol Harár for helpful comments.
References
Appendix A Appendix - Proofs and Additional Material
For simplicity of presentation, assume we are given two samples , with labels , . The corresponding MSE is
with loss . Note that changing each weight by less than does not decrease the loss, as this rotates the vector by at most . Thus is a local minimum in the parametrization space. However, the sequence of realizations given by
see Figure 6. Accordingly, is not a local minimum in the realization space even w.r.t. the Sobolev norm. The problem occurs, since inverse stability fails due to unbalancedness of .
Let be a local minimum with radius of the optimization problem . Then it holds for every (in particular for every global minimizer) that
Define and . Due to (46) there is such that and by the assumptions on and it holds that
This completes the proof. See Figure 7 for illustration.
A.1.2 Proofs
By Definition 1.1 we know that for every with there exists with
Let , define and . Then compactness of implies the existence of an architecture such that for every with the approximability assumption (46) is satisfied. Let now be a local minimum with radius at least of . As we assume uniform inverse stability, Proposition 1.2 implies that is a local minimum of the optimization problem with radius at least . Theorem A.2 establishes the claim. ∎
We simply combine the main observations from our paper. First, note that the assumptions imply that the restricted parametrization space , which we are optimizing over, is the space from Definition 3.2. Secondly, Theorem 3.3 implies that the realization map is inverse stable on . Thus, Proposition 1.2 directly proves Claim 1. For the proof of Claim 2 we make use of Lemma A.6. It implies that for every there exists such that it holds that
A.2 Section 2
with linearly independent weight vectors and and let
with . Then there exists a permutation such that for every there exist with
This means that, up to reordering and rebalancing, is the unique parametrization of .
First we define for every the corresponding open orthant
By assumption has rank , i.e. is surjective, and therefore the preimages of the orthants
are disjoint, non-empty open sets. Note that on each the realization is linear with
Since has full row rank, it has a right inverse. Thus we have for that
Note that can only hold if due to the assumptions that for all . Thus the above establishes that for it holds that
i.e. has different derivatives on its linear regions. In order for to have matching linear regions and matching derivatives on each one of them, there must exist a permutation matrix such that for every
Thus, there exist such that
The assumption that , together with (56) for , implies that
and be given by
The only way to parametrize is with (see Lemma A.3), and we have
A.2.2 Proofs
(see [34, Prop. 5.1]). It follows that is uniformly bounded which contradicts (67). ∎
The only way to parametrize is with (see also Lemma A.3), which proves the claim. ∎
(see Lemma A.3). Thus it holds that and the proof is completed by direct calculation. ∎
Let be an arbitrary parametrization of given by
The Cauchy-Schwarz inequality and the linear independence of to each , , establishes that . Together with the fact that , this completes the proof. ∎
and thus the difference of the gradients is constant, i.e.
However, regardless of the balancing and reordering of the weight vectors , , we have that
By Lemma A.3, up to balancing and reordering, there does not exist any other parametrization of with the same realization. ∎
A.3 Section 3
Since it can be written as
and observe that , , and . For let
In order to balance the network, let and for every . Then the claim follows by direct computation. ∎
A.3.2 Proofs
By conditions C.2 and C.3a we have for all that
Further note that we can reparametrize such that the same holds there. To this end observe that
given that is a positive multiple of . Specifically, let be a partition of (i.e. , and if ), such that for all it holds that
We denote by the smallest element in and make the following replacements, for all , without changing the realization of :
Note that we also update the set accordingly. Let now
By construction and condition C.3a, we have for all that
Note that we now have a parametrization of , where all weight vectors are either zero (in which case the corresponding are also zero) or pairwise linearly independent to each other nonzero weight vector. Next, for , let
The , , and , , are the interiors of the different linear regions of and respectively. Next observe that the derivatives of are (a.e.) given by
Note that for every , we have
Next we use that for , we have if , and compare adjacent linear regions of . Let now and consider the following cases: Case 1: We have for all . This means that the , , and the , , are the same on both sides near the hyperplane , while the value of is on one side and on the other. Specifically, there exist and such that , , for all , and , , which implies
Case 2: There exists such that . Note that (86) ensures that for and (92) ensures that for . Moreover, Condition C.3b implies . This means that the , , and the , , are the same on both sides near the hyperplane , while the values of and change. Specifically there exist and such that , , for all , , , for all and , , which implies
Analogously we get for that for all implies . Next let
Colloquially speaking, this shows that for every with there is a with exactly matching half-spaces, i.e. , and approximately matching gradients (Case 2). Moreover, all unmatched and must have a small gradient (Case 1). Specifically, the above establishes that there exists a permutation such that for every it holds that
We make the following replacements, for all , without changing the realization of :
In order to balance the weights of for , we further make the following replacements, for all with , without changing the realization of :
Moreover, due to Condition C.1, we get for every that
Next we (approximately) match the balancing of to the balancing of for , in order to derive estimates on and from (102). Specifically, we make the following replacements, for all , without changing the realization of :
Let now and consider the following cases: Case A: We have which, together with (102), implies . Due to (108) and Condition C.1 it follows that
Case B.1: We have and which ensures . Due to (109) we get and it follows that
Case B.2: We have and which ensures . Due to (110) we get and it follows that
Case B.3: We have and . Note that and (102) ensure that , and that for it holds that . Combining this with the definition of , the reverse triangle inequality, and (111) implies that
Combining (107), (112), (113), (114), and (115) establishes that
Let be a parametrization of , i.e. . We write
As in (103), we make the following replacements, for all , without changing the realization of :
Note that the weights of are already balanced, i.e. we have for every that
Thus, we can skip the reparametrization step in (104) and get directly for every that
and analogously . For we need to slightly deviate from the proof of Theorem 3.1. We can skip the reparametrization step in (108)-(111) due to balancedness and need to distinguish three cases: Case A.1: We have which, together with (125), implies . Due to balancedness it follows that
Case A.2: We have which, together with (125), implies . Again it follows that
Let now w.l.o.g. (otherwise we switch their roles in the following) which implies that with . Then it holds that
The last step holds due to (131) and the balancedness of which ensure that
A.4 Section 4
for all , and define
Then for every there is such that we have uniform inverse stability w.r.t. . That is, for all and there exists a parametrization with
Note that the non-zero angle between the hyperplanes given by the weight vectors establishes that the minimal perimeter inside each linear region intersected with is lower bounded. As the realization is linear on each region, this implies the existence of a constant , such that for every it holds that
Now note that for we can get the same uniform inverse stability result w.r.t. as in Theorem 3.3 by choosing to be the identity in (124). Together with (137) this implies the claim. ∎