Learning One-hidden-layer Neural Networks with Landscape Design
Rong Ge, Jason D. Lee, Tengyu Ma
Introduction
Scalable optimization has been playing crucial roles in the success of deep learning, which has immense applications in artificial intelligence. Remarkably, optimization issues are often addressed through designing new models that make the resulting training objective functions easier to be optimized. For example, over-parameterization [LSSS14], batch-normalization [IS15], and residual networks [HZRS16a, HZRS16b] are often considered as ways to improve the optimization landscape of the resulting objective functions.
How do we design models and objective functions that allow efficient optimization with guarantees? Towards understanding this question in a principled way, this paper studies learning neural networks with one hidden layer. Roughly speaking, we will show that when the input is from Gaussian distribution and under certain simplifying assumptions on the weights, we can design an objective function , such that
[a] all local minima of are global minima
[b] all the global minima are the desired solutions, namely, the ground-truth parameters (up to permutation and some fixed transformation).
We aim to learn a neural network with a one-hidden-layer using a non-convex objective function. We assume input comes from Gaussian distribution and the label comes from the model
For technical reasons, we will further assume and that has non-negative entries.
However, empirically stochastic gradient descent cannot converge to the ground-truth parameters in the synthetic setting above when , even if we have access to an infinite number of samples, and is a orthogonal matrix. Such empirical results have been reported in [LSSS14] previously, and we also provide our version in Figure 1 of Section 6. This is consistent with observations and theory that over-parameterization is crucial for training neural networks successfully [LSSS14, HMR16, SC16].
These empirical findings suggest that the population risk has spurious local minima with inferior error compared to that of the global minimum. This phenomenon occurs even if we assume we know or is merely just the all one’s vector. Empirically, such landscape issues seem to be alleviated by over-parameterization. By contrast, our method described in the next section does not require over-parameterization and might be suitable for applications that demand the recovery of the true parameters.
2 Our contributions
Towards learning with the same number of training parameters as the ground-truth model, we first study the landscape of the population risk and give an analytic formula for it — as an explicit function of the ground-truth parameter and training parameter with the randomness of the data being marginalized out. The formula in equation (2.3) shows that is implicitly attempting to solve simultaneously a finite number of low-rank tensor decomposition problems with commonly shared components.
Inspired by the formula, we design a new training model whose associated loss function — named and formally defined in equation (2.6) — corresponds to the loss function for decomposing a matrix (2-nd order tensor) and a 4-th order tensor (Theorem 2.2). Empirically, stochastic gradient descent on learns the network as shown in experiment section (Section 6).
Despite the empirical success of , we still lack a provable guarantee on the landscape of . The second contribution of the paper is to design a more sophisticated objective function whose landscape is provably nice — all the local minima of are proven to be global, and they correspond to the permutation of the true parameters. See Theorem 2.3.
Moreover, the value and the gradient of can be estimated using samples, and there are no constraints in the optimization. These allow us to use straightforward stochastic gradient descent (see guarantees in [GHJY15, JGN+17]) to optimize and converge to a local minimum, which is also a global minimum (Corollary 2.4).
Finally, we also prove a finite-sample complexity result. We will show that with a polynomial number of samples, the empirical version of share almost the same landscape properties as itself (Theorem 2.7). Therefore, we can also use an empirical version of as a surrogate in the optimization.
3 Related work
The work of Arora et al. [ABGM14] is one of the early results on provable algorithms for learning deep neural networks, where the authors give an algorithm for learning deep generative models with sparse weights. Livni et al. [LSSS14], Zhang et al. [ZLJ16, ZLWJ17], and Daniely et al. [DFS16] study the learnability of special cases of neural networks using ideas from kernel methods. Janzamin et al. [JSA15] give a polynomial-time algorithm for learning one-hidden-layer neural networks with twice-differential activation function and known input distributions, using the ideas from tensor decompositions.
A series of recent papers study the theoretical properties of non-convex optimization algorithms for one-hidden-layer neural networks. Brutzkus and Globerson [BG17] and Tian [Tia17] analyze the landscape of the population risk for one-hidden-layer neural networks with Gaussian inputs under the assumption that the weights vector associated to each hidden variable (that is, the filters) have disjoint supports. Li and Yuan [LY17] prove that stochastic gradient descent recovers the ground-truth parameters when the parameters are known to be close to the identity matrix. Zhang et al. [ZPS17] studies the optimization landscape of learning one-hidden-layer neural networks with a specific activation function, and they design a specific objective function that can recover a single column of the weight matrix. Zhong et al. [ZSJ+17] studies the convergence of non-convex optimization from a good initializer that is produced by tensor methods. Our algorithm works for a large family of activation functions (including ReLU) and any full-rank weight matrix. To our best knowledge, we give the first global convergence result for gradient-based methods for our general setting.The work of [JSA15, ZSJ+17] are closely related, but they require tensor decomposition as the algorithm/initialization.
The optimization landscape properties have also been investigated on simplified neural networks models. Kawaguchi [Kaw16] shows that the landscape of deep neural nets does not have bad local minima but has degenerate saddle points. Hardt and Ma [HM17] show that re-parametrization using identity connection as in residual networks [HZRS16a] can remove the degenerate saddle points in the optimization landscape of deep linear residual networks. Soudry and Carmon [SC16] showed that an over-parameterized neural network does not have bad differentiable local minimum. Hardt et al. [HMR16] analyze the power of over-parameterization in a linear recurrent network (which is equivalent to a linear dynamical system.)
The optimization landscape has also been analyzed for other machine learning problems, including SVD/PCA phase retrieval/synchronization, orthogonal tensor decomposition, dictionary learning, matrix completion, matrix sensing [BH89, SJ13, GHJY15, SQW15, BBV16, GLM16, BNS16, GJZ17]. Our analysis techniques build upon that for tensor decomposition in [GHJY15] — we add two additional regularization terms to deal with spurious local minimum caused by the weights and to remove the constraints.
4 Notations:
We use to denote the Kronecker product of and , and is a shorthand for where appears times. For vectors and denote the tensor product. We use to denote the largest and smallest eigenvalues of a square matrix. Similarly, and are used to denote the largest and smallest singular values. We denote the identity matrix in dimension by , or Id when the dimension is clear from the context.
In the analysis, we rely on many properties of Hermite polynomials. We use to denote the -th normalized Hermite polynomial. These polynomials form an orthonormal basis. See Section 4.1 for an introduction of Hermite polynomials.
We will define other notations when we first use them.
Main Results
A straightforward approach of learning the model (1.1) is to parameterize the prediction by
Throughout the paper, we use to denote the row vectors of and similarly for . That is, we have and . Let and ’s be the coordinates of and respectively.
We give the following analytic formula for the population risk defined above.
Assume vectors ’s are unit vectors. Then, the population risk defined in equation (2.2) satisfies that
where is the -th Hermite coefficient of the function . See section 4.1 for a short introduction of Hermite polynomial basis. When , we have that , . For and even, . For and odd, .
The proof of Theorem 2.1 follows from using techniques in Hermite Fourier analysis, which is deferred to Section 4.2.
It turns out that optimizing the population risk using stochastic gradient descent is empirically difficult. Figure 1 shows that in a synthetic setting where the noise is zero, the test error empirically doesn’t converge to zero for sufficiently long time with various learning rate schemes, even if we are using fresh samples in iteration. This suggests that the landscape of the population risk has some spurious local minimum that is not a global minimum. See Section 6 for more details on the experiment setup.
An empirical fix:
Inspired by the connection to tensor decomposition objective described earlier in the subsection, we can design a new objective function that takes exactly the same form as the tensor decomposition objective function . Concretely, let’s define
where and and are the 2nd and 4th normalized probabilists’ Hermite polynomials [Wik17b]. We abuse the notation slightly by using the same notation to denote the its element-wise application on a vector. Now for each example we use as loss function. The corresponding population risk is
Now by an extension of Theorem 2.1, we have that the new population risk is equal to the .
Let be defined as in equation (2.6) and and be defined in equation (2.4). Assume ’s are unit vectors. Then, we have
It turns out stochastic gradient descent on the objective (with projection to the set of matrices with row norm 1) converges empirically to the ground truth or one of its equivalent permutations. (See Figure 2.) However, we don’t know of any existing work for analyzing the landscape of the objective (or for any ). We conjecture that the landscape of doesn’t have any spurious local minimum under certain mild assumptions on . Despite recent attempts on other loss functions for tensor decomposition [GM17], we believe that analyzing is technically challenging and its resolution will be potentially enlightening for the understanding landscape of loss function with permutation invariance. See Section 6 for more experimental results.
The population risk defined in equation (2.6) — though works empirically for randomly generated ground-truth — doesn’t have any theoretical guarantees. It’s also possible that when are chosen adversarially or from a different distribution, SGD no longer converges to the ground-truth.
To solve this problem, we design another objective function , such that the optimizer of still corresponds to the ground-truth, and has provably nice landscape — all local minima of are global minima.
In this subsection, for simplicity, we work with the case when is an orthogonal matrix and state our main result. The discussion of the general case is deferred to the end of this Section and Section A.
We define our objective function as
where is defined as
and is defined as
The rationale behind of the choices of and will only be clearer and relevant in later sections. For now, the only relevant property of them is that both are smooth functions whose derivatives are easily computable.
We remark that we can sample using the samples straightforwardly — it’s defined as an average of functions of examples and the parameters. We also note that only parameter appears in the loss function. We will infer the value of using straightforward linear regression after we get the (approximately) accurate value of .
Due to technical reasons, our method only works for the case when for every . We will assume this throughout the rest of the paper. The general case is left for future work. Let , , and . Our result will depend on the value of Essentially we treat as an absolute constant that doesn’t scale in dimension. The following theorem characterizes the properties of the landscape of .
Let be a sufficiently small universal constant (e.g. suffices) and suppose the activation function satisfies . Assume , , and is an orthogonal matrix. The function defined as in equation (2.8) satisfies that
A matrix is a local minimum of if and only if can be written as where is a permutation matrix and is a diagonal matrix with .More precisely, Furthermore, this means that all local minima of are also global.
Any saddle point has a strictly negative curvature in the sense that where
Suppose is an approximate local minimum in the sense that satisfies
Then can be written as where is a permutation matrix, is a diagonal matrix satisfying the same bound as in bullet 1, and .
As a direct consequence, is -close to a global minimum in Euclidean distance, where hides polynomial dependency on and other parameters.
The theorem above implies that we can learn (up to permutation of rows and sign-flip) if we take to be sufficiently large and optimize using stochastic gradient descent. In this case, the diagonal matrix in bullet 1 is sufficiently close to identity (up to sign flip) and therefore a local minimum is close to up to permutation of rows and sign flip. The sign of each can be recovered easily after we recover (see Lemma 2.5 below.)
Stochastic gradient descent converges to a local minimum [GHJY15] (under the additional property as established in bullet 2 above), which is also a global minimum for the function . We will prove the theorem in Section 5 as a direct corollary of Theorem 5.1. The technical bullet 2 and 3 of the theorem is to ensure that we can use stochastic gradient descent to converge to a local minimum as stated below.In the most general setting, converging to a local minimum of a non-convex function is NP-hard.
In the setting of Theorem 2.3, we can use stochastic gradient descent to optimize function (with fresh samples at each iteration) and converge to an approximate global minimum that is -close to a global minimum in time .
After approximately recovering the matrix , we can also recover the coefficient easily. Note that fixing , we can fit using simply linear regression. For the ease of analysis, we analyze a slightly different algorithm. The lemma below is proved in Section B.
Given a matrix whose rows have unit norm, and are -close to in Euclidean distance up to permutation and sign flip with . Then, we can give estimates (using e.g., Algorithm 1) such that there exists a permutation where and is row-wise -close to .
The key step towards analyzing objective function is the following theorem that gives an analytic formula for .
Theorem 2.6 is proved in Section 4. We will motivate our design choices with a brief overview in Section 3 and formally analyze the landscape of in Section 5 (see Theorem 5.1).
: Extending Theorem 2.3, we can characterize the landscape of the empirical risk , which implies that stochastic gradient on also converges approximately to the ground-truth parameters with polynomial number of samples.
In the setting of Theorem 2.3, suppose we use empirical samples to approximate and obtain empirical risk . There exists a fixed polynomial such that if , then with high probability the landscape of very similar properties to that of .
Precisely, if is an approximate local minimum in the sense that and , then can be written as where is a permutation matrix, is a diagonal matrix and .
All of the results above assume that is orthogonal. Since the local minimum are preserved by linear transformation of the input space, these results can be extended to the general case when is not orthogonal but full rank (with some additional technicality) or the case when the dimension is larger than the number of neurons (). See Section A for details.
Overview: Landscape Design and Analysis
In this section, we present a general overview of ideas behind the design of objective function . Inspired by the formula (2.3), in Section 3.1, we envision a family of possible objective functions for which we have unbiased estimators via samples. In Section 3.2, we pick a specific function that feeds our needs: a) it has no spurious local minimum; b) the global minimum corresponds to the ground-truth parameters.
Recall that in equation (2.2) of Theorem 2.1 we give an analytic formula for the straightforward population risk . Although the population risk doesn’t perform well empirically, the lesson that we learn from it help us design better objective functions. One of the key fact that leads to the proof of Theorem 2.1 is that for any continuous and bounded function , we have that
Here and are the -th Hermite coefficient of the function and . That is, letting the -th normalized probabilists’ Hermite polynomials [Wik17b] and be the standard inner product between functions, we have .
Note that can be chosen arbitrarily to extract different terms. For example, by choosing , we obtain that
That is, we can always access functions forms that involves weighted sum of the powers of , as in RHS of equation (3.1).
Using a bit more technical tools in Fourier analysis (see details in Section 4), we claim that most of the symmetric polynomials over variables can be estimated by samples:
For an arbitrary polynomial over a single variable, there exits a corresponding function such that
Moreover, for an any polynomial over two variables, there exists corresponding such that
We will not prove these two general claims. Instead, we only focus on the formulas in Theorem 4.5 and Theorem 4.6, which are two special cases of the claims above.
Motivated by Claim 4.3, in the next subsection, we will pick an objective function which has no spurious local minimum among those functional forms on the right-hand sides of equation (3.2) and (3.3).
2 Which objective has no spurious local minima?
As discussed briefly in the introduction, one of the technical difficulties to design and analyze objective functions for neural networks comes from the permutation invariance — if a matrix is a good solution, then any permutation of the rows of still gives an equally good solution (if we also permute the coefficients in accordingly). We only know of a very limited number of objective functions that guarantee to enjoy permutation invariance and have no spurious local minima [GHJY15].
We start by considering the objective function used in [GHJY15],
Note that here we overload the notation by using ’s to denote a set of fixed vectors that we wanted to recover and using ’s to denote the variables. Careful readers may notice that doesn’t fall into the family of functions that we described in the previous section (that is, RHS equation of (3.2) and (3.3)), because it lacks the weighting ’s. We will fix this issue later in the subsection. Before that we first summarize the nice properties of the landscape of .
For the simplicity of the discussion, let’s assume forms an orthonormal matrix in the rest of the subsection. Then, any permutation and sign-flip of the rows of leads to a global minimum of — when with a permutation matrix and a sign matrix (diagonal with ), we have that because one of and has to be zero for all Note that is orthogonal, and ).
It turns out that these permutations/sign-flips of are also the only local minimaWe note that since there are constraints here, by local minimum we mean the local minimum on the manifold defined by the constraints. of function . To see this, notice that is a degree-2 polynomial of . Thus if we pick an index and fix every row except for , then is a quadratic function over unit vector – reduces to an smallest eigenvector problem. Eigenvector problems are known to have no spurious local minimum. Thus the corresponding function (w.r.t ) has no spurious local minimum. It turns out the same property still holds when we treat all the rows as variables and add the row-wise norm constraints (see proof in [GHJY15]).
However, there are two issues with using objective function . The obvious one is that it doesn’t involve the coefficients ’s and thus doesn’t fall into the forms of equation (3.3). Optimistically, we would hope that for nonnegative ’s the weighted version of below would also enjoy the similar landscape property
When ’s are positive, indeed the global minimum of are still just all the permutations of the .This is the main reason why we require . However, when , we found that starts to have spurious local minima . It seems that spurious local minimum often occurs when a row of is a linear combination of a smaller number of rows of . See Section D for a concrete example.
To remove such spurious local minima, we add a regularization term below that pushes each row of to be close to one of the rows of ,
We see that for each fixed , the part in that involves has the form
This is commonly used objective function for decomposing tensor . It’s known that for orthogonal ’s, the only local minima are [GHJY15]. Therefore, intuitively pushes each of the ’s towards one of the ’s. However, note that by itself doesn’t work because it does not prevent the solutions where all the ’s are equal to the same . Choosing to be small enough, it turns out that doesn’t have any spurious local minimum as we will show in Section 5.
Another issue with the choice of is that we are still having a constraint minimization problem. Such row-wise norm constraints only make sense when the ground-truth is orthogonal and thus has unit row norm. A straightforward generalization of to non-orthogonal case requires some special constraints that also depend on the covariance matrix , which in turn requires a specialized procedure to estimate. Instead, we move the constraints into the objective function by considering adding another regularization term that approximately enforces the constraints.
It turns out the following regularizer suffices for the orthogonal case,
Moreover, we can extend this easily to the non-orthogonal case (see Section A) without estimating any statistics of in advance. We note that is not the Lagrangian multiplier and it does change the global minima slightly. We will take to be large enough so that has to be close to 1. As a summary, we finally use the unconstrained objective
Since and are degree-4 polynomials of , the analysis of is much more delicate, and we cannot use much linear algebra as we could for . See Section 5 for details.
Finally we note that a feature of this objective is that it only takes as variables. We will estimate the value of after we recover the value of . (see Section B). ·
Analytic Formula for Population Risks
The polynomials are orthogonal to each other under this inner product:
Since forms a complete orthonormal basis, we have the expansion that
We will leverage several other nice properties of the Hermite polynomials in our proofs. The following claim connects the Hermite polynomial to the coefficients of Taylor expansion of a certain exponential function. It can also serve as a definition of Hermite polynomials.
Let and . Then are two spherical standard normal random variables that are -correlated, and we have that
We expand and in the Fourier basis and obtain that
In this section we prove Theorem 2.1 and Theorem 2.2, which both follow from the following more general Theorem.
where are the -th Hermite coefficients of the function and respectively.
We can see that Theorem 2.1 follows from choosing and Theorem 2.2 follows from choosing . The key intuition here is that we can decompose into a weighted combination of Hermite polynomials, and each Hermite polynomial influence the population risk more or less independently (because they are orthogonal polynomials with respect to the Gaussian measure).
3 Analytic Formula for population risk G𝐺G
In this section we show that the population risk (defined as in equation (2.8)) has the following analytical formula:
The formula will be crucial for the analysis of the landscape of in Section 5. The formula follows straightforwardly from the following two theorems and the definition (2.8).
Let be defined as in equation (2.10), we have that
Let be defined as in equation (2.9), then we have that
In the rest of the section we prove Theorem 4.5 and 4.6.
We start with a simple but fundamental lemma. Essentially all the result in this section follows from expanding the two sides of equation (4.1) below.
Next we extend some of the results in the previous section to the setting with different scaling (such as when in Claim 4.3 is no longer a unit vector.)
As a sanity check, we can verify that when is a unit vector, and th Lemma reduces to a special case of Claim 4.2.
where the last line is by the fact that . This can be verified by applying Claim 4.1 with and , and noting that . ∎
Now we are ready prove Theorem 4.6 using Lemma 4.8.
Using the fact that , we have that
Using the fact that and Lemma 4.8, we have that
Using the fact that , we conclude that
Now we are ready to prove Theorem 4.5 by using Lemma 4.9 for every summand.
Landscape of Population Risk G(⋅)𝐺⋅G(\cdot)
In this section we prove Theorem 2.3. Since the landscape property is invariant with respect to rotations of parameters, without loss of generality we assume is the identity matrix Id throughout this section. (See Section A for a precise statement for the invariance.) Recall that by Theorem 2.6, the population risk in the case of is equal to
In the rest of section we work with the formula above for instead of the original definition. In fact, for future reference, we study a more general version of the function . For nonnegative vectors and nonnegative number , let be defined as
Here denotes the -th natural basis vector. We see that is sub-case of and we prove the following extension of Theorem 2.3. Let and .
Let and be a sufficiently small universal constant (e.g. suffices). Suppose and . Then, the function defined as in equation (5.2) satisfies that
A matrix is a local minimum of if and only if can be written as where is a permutation matrix and is a diagonal matrix with .
Any saddle point has strictly negative curvature in the sense that where
Suppose is an approximate local minimum in the sense that satisfies
Then can be written as where is a permutation matrix, is a diagonal matrix with the entries satisfying
As a direct consequence, is -close to a global minimum in Euclidean distance, where hides polynomial dependency on and other parameters.
Here we recall that denotes the largest entries in the matrix . Theorem 2.3 follows straightforwardly from Theorem 5.1 by setting and . In the rest of the section we prove Theorem 5.1.
Note that our variable is a matrix of dimension and we use to denote the rows of , that is, . Naturally, towards analyzing the properties of a local minimum , the first step is that we pick a row of and treat only as variables and others rows as fixed. We will show that local optimality of will imply that is equal to one of the basis vector up to some scaling factor. This step is done in Section 5.1. Then in Section 5.2 we show that the local optimality of all the variables in implies that each of the rows of corresponds to different basis vector, which implies that is a permutation matrix (up to scaling of the rows).
Suppose we fix , and optimize only over , we obtain the objective of the following form:
We can see that setting gives us the original objective . In this subsection, we will work with and analyze the properties of the local minima of .
The following lemma shows that a local minimum of the objective must be a scaling of a basis vector. Recall that denotes the second largest absolute value of the entries of . The lemma deals generally an approximate local minimum, though we suggest casual readers simply think of in the lemma.
Without loss of generality, we can take which means . The gradient and Hessian of function are
where .
Let be the indices of the coordinates that are significantly away from zero, where . Since , we have that for every , which implies that
If , then we are done because . Next we prove that . For the sake of contradiction, we assume that . Moreover, WLOG, we assume that are the two largest entries of in absolute values.
Recall that . Then we conclude that
This contradicts with the assumption that and that . Therefore we have and
For future reference, we can also show that for a sufficiently strong regularization term (sufficiently large ), the norm of a local minimum should be bounded from below and above by and . This are rather coarse bounds that suffice for our purpose in this subsection. In Section 5.2 we will show that all the rows of a local minimum of have norm close to 1.
Suppose in addition that and , then
Let . In addition to the previous conditions in bullet 1, assume that . Then,
We remark that we have to state the conditions for the upperbounds and lowerbounds separately since they will be used with these different conditions.
Let be the indices of the coordinates that are significantly away from zero, where . We first show that . We divide into two cases:
is empty. Since , then . We conclude that .
is non-empty. For , recall equation (5.6) which implies that
Since , so , and thus from the display above we have that .
Next we show that . Again we divide into two cases:
is empty. For the sake of contradiction, assume that , then . We show that there is sufficient negative curvature. Recall that
Choose index so that , then
This contradicts with the fact that . Thus when is empty, .
is non-empty. Recall that , and by definition . Using Equation (5.6)
Since , and , we conclude that .
We have shown that a local minimum of should be a scaling of the basis vector . The following lemma strengthens the result by demonstrating that not all basis vector can be a local minimum — the corresponding coefficient has to be reasonably small for being a local minimum. The key intuition here is that if is very large compared to other entries of , then if we move locally the mass of from entry to some other index , the objective function will be likely to decrease because is likely to be smaller than . (Indeed, we will show that such movement will cause a second-order decrease of the objective function in the proof.)
In the setting of Lemma 5.2, let . If , and for and , then
For the ease of notation, assume WLOG that . Let . By the assumptions, we have that . By Lemma 5.2, we have , which implies that
Define . Since is the largest entry of , we can verify that . By the assumption, we have that
On the other hand, recall the form of Hessian (equation (5.4)), by straightforward algebraic manipulation, we have that
Combining equation (5.8) and the equation above gives
Since is arbitrary we complete the proof. ∎
The previous lemma implies that it’s very likely that the local minimum can be written as and the index is also likely to be the argmin of . The following technical lemma shows that when this indeed happens, then we can strengthen Lemma 5.2 in terms of the error bound’s dependency on and . In Lemma 5.2, we have that is bounded by a function of . Here we strengthen the bound to be a function that only depends on . Thus as long as be small enough so that we can apply Lemma 5.2 and Lemma 5.4 to meet the condition of the lemma below, then we get an error bound that goes to zero as goes to zero. This translates to the error bound in bullet 3 of Theorem 5.1 where the bound on only depends on . For casual readers we suggest to skip this Lemma since its precise functionality will only be clearer in the proof of Theorem 5.1.
In the setting of Lemma 5.2, in addition we assume that and that can be written as satisfying
WLOG, let . Let be the second largest entry of in absolute value. Define , and similarly . Since , by equation (5.6), we have that and . Subtracting and , we obtain,
Since , then . Since ,
Since and ,
and re-arranging gives . ∎
2 Local Optimality of All the Variables
In this section we prove Theorem 5.1. Results in Subsection 5.1 have established that if is a local minimum, then each row of has to be a scaling of a basis vector. In this section we show that these basis vectors need to be distinct from each other. The following proposition summaries such a claim (with a weak error analysis).
In the setting of Theorem 5.1, suppose satisfies
for parameters satisfying and . Then, the matrix can be written as
where is diagonal such that , and is a permutation matrix, and with .
As alluded before, in the proof we will first apply the results in Section 5.1 to show that when is a local minimum, each row has a unique large entry. Then we will show that the largest entries of each row sit on different columns. The key intuition behind the proof is that if two rows, say row , have their large entries on the same column, then it means that there exists a column— say column — that doesn’t contain largest entry of any row. Then either row or will violate Lemma 5.4. Or in other words, either row or can move their mass into the column to decrease the function value. This contradicts the assumption that is a local minimum.
As pointed in the paragraph below equation (5.3), when we restrict our attention to a particular row of and fix the rest of the rows the function reduces to the function in equation (5.3) so that we can apply lemmas in Section 5.1.
Concretely, fix an index and let . For all , let , and . Then we have that
We view the function above as . Now we apply Lemma 5.2 (by replacing in Lemma 5.2 by ). The assumption that implies that since is a submatrix of . Moreover,
Hence by Lemma 5.2, we have that the second largest entry of satisfies
where for the ease of notation. We can check that by the assumption. Therefore, we have essentially shown that each row of has only one single large entry, since the second largest entry is at most .
Next we show that each row of has largest entries on distinct columns. For each row , let be the index of the largest entry of . We will show that are distinct.
For the sake of contradiction, suppose they are not distinct, that is, there are two distinct rows that have the same largest entries on column , that is, we assume that . This implies that and let be the index such that . We note that by the assumption . We first bound from above
Assume in addition without loss of generality that . Let
be the sum of squares of the entries on the column without entry , and that . We first prove that .
For the sake of contradiction, assume Then we have that This implies that , and since is the index of the largest column of we can invoke Lemma 5.3 and conclude that . This further implies that
Since we have assumed that . Then we obtain that
which contradicts the assumption. Therefore, we conclude that . Then we are ready to bound from below:
The display above and Equation (5.13) implies that
Note that is the largest entry in absolute value in the vector . We will apply Lemma 5.4. We fix every row of except and consider the objective as a function of only. Again let , and and we have the equation (5.11). (Note that now depends on the choice of which we fixed.) Lemma 5.4 gives us that
Since , and , we obtain that
which contradicts equation (5.14). Thus we have established that are distinct.
Finally, let be the matrix that only contain the largest entries (in absolute value) of each columns of . Since are distinct, we have that contains exactly one entry per row and per column. Therefore can be written as where is a permutation matrix and is a diagonal matrix. Moreover, we have that and . Therefore, the largest entry of each row has absolute value between and . Therefore . Let . Then we have that ,which completes the proof.
Applying Lemma 5.5, we can further strengthen Proposition 5.6 with better error bounds and better control of the largest entries of each column.
In the setting of Proposition 5.6. Suppose in addition that satisfies . Then, the matrix can be written as
where is a permutation matrix, is diagonal such that
By Proposition 5.6, we know that . Now we use Lemma 5.5 to strength the error bound.
As we have done in the proof of Proposition 5.6, we again fix an arbitrary and all the rows except and view as a function of . For all , let , and and view as a function of the form with replaced by , namely,
We will verify the condition of Lemma 5.5. Let be the index of the largest entry in absolute value of the vector . Since we have shown that the largest entry in each row sits on different columns, and the second largest entry is always less than , we have that,
For any , we know that the column contains some entry which is the largest entry of some row, and we also have that since the largest entry of row is on column . Therefore, we have that
Therefore, for any and thus . By the fact that , we have that . Now we are ready to apply Lemma 5.5 and obtain that . Applying the argument for every row gives .
Finally, we give the bound for the entires in . Let be a short hand for which is equal to the -th column of . Since is an -approximate stationary point, then we have that and by straightforward calculation of the gradient, we have
Since , dividing by gives,
To upper bound , we note that , , and , so
For the lower bound of , we note that implies . Moreover, we have proved that each rows has largest entry at different columns. Also note that the largest entry of row is on column . Therefore, we have . Using these two estimates and , we have
Finally we are ready to prove Theorem 5.1 by applying Proposition 5.6.
By setting in Proposition 5.6, we have that any local minimum satisfies that where is a permutation matrix and is a diagonal and the precise diagonal entries of . It can be verified that all these points have the same function value, so that they are all global minimizers.
Towards proving the second bullet, we note that a saddle point satisfies that . We will prove that . For the sake of contradiction, suppose . Then setting and in Propostion 5.7, we have that and , which by bullet 1 implies that is a local minimum. This contradicts the assumption that is a saddle point.
The 3rd bullet is a just a rephrasing of Proposition 5.7. ∎
Simulation
In this section, we provide simple simulation results that verify that minimizing with SGD recovers a permutation of ; however, minimizing Equation (2.2) with SGD results in finding spurious local minima. Based on the formula for the population risk in Equation (2.3), we also verified empirically the conjecture that SGD would successfully recover using the activation functions ,We also observed that using also works but due to the space limitation we don’t report the experimental results here. even if the data were generated via a model with ReLU activation. (See Section 2.1 for the rationale behind such conjectures.)
For all of our experiments, we chose with dimension and for simplicity, and the data is generated from a one-hidden-layer network with ReLU activation without noise. We use stochastic gradient descent with fresh samples at each iteration, and we plot the (expected) population error (that is, the error on a fresh batch of examples).
Then we have that if for some , then it implies that is -close to a permutation matrix in infinity norm. On the other direction, we know that if , then is not -close to any permutation matrix in infinity norm. The latter statement also holds when doesn’t have row norm .
Figure 1 shows that without over-parameterization, using ReLU as an activation function, SGD doesn’t converge to zero test error and the ground-truth parameters. We decreased step-size by a factor of every number of iterations after the error plateaus at iterations. For the final iterations, the step-size is less than , so we can be confident that the non-zero objective value is not due to the variance of SGD. We see that none of the five runs of SGD converged to a global minimum.
Figure 2 shows that using as the activation function, SGD with projection to the set of matrices with row norm 1 converges to the ground-truth parameters. We also plot the loss function which converges the value of a global minimum. (We subtracted the constant term in equation (2.7) so that the global minimum has loss 0.)
Figure 3 shows that using our objective function , the iterate converges to the ground truth matrix . The fact that the parameter error goes up and down is not surprising, because the algorithm first gets close to a saddle point and then breaks ties and converges to a one of the global minima.
Finally we note that using the loss function seems to require significantly larger batch (and sample complexity) to reduce the variance in the gradients estimation. We used batch size 262144 in the experiment for . However, in contrast, for the we used batch size 8192 and for relu we used batch size 256.
Conclusion
Designing objective functions with well-behaved landscape is an intriguing and fruitful direction. We hope that our techniques can be useful for characterizing and designing the optimization landscape for other settings.
We conjecture that the objective has no spurious local minimum when are reasonable constants and the ground-truth parameters are in general positionSee equation (2.4) for the definition of and Theorem 2.2 for how to access in the setting of one-hidden-layer neural nets.. We provided empirical evidence to support the conjecture.
Our results assume that the input distribution is Gaussian. Extending them to other input distributions is a very interesting open problem.
References
Appendix A Handling Non-Orthogonal Weights
In this section, we first show that when the weight vectors are not orthonormal, the local optimum of a slight variant of still allow us to recover . The main observation is that the set of local minima are preserved (in a certain sense) by linear transformation of the variables. We design an objective function that is equivalent to up to a linear transformation. This allows us to use Theorem 2.3 as a black box to characterize all the local minima of .
Given a function , we say function is a linear transformation of if there is a matrix such that . If has full rank, the local minima of are closely related to the local minima of .
We recall some standard notation in calculus first. We use to denote the gradient of evaluated at . For example, is a shorthand for , and similarly is .
The following theorem then connects the gradients and Hessians of and . Essentially, it shows that the set of local minima and saddle points have a 1-1 mapping between and , and the corresponding norms/eigenvalues only differ multiplicatively by quantities related to the spectrum of .
.
If , then
The point satisfies the first and second order optimality condition for iff also satisfy the first and second order optimality condition for .
The proof follows from the relationship between the gradients of and the gradients of . By basic calculus, we have
which immediately implies bullet 1. Similarly, we can compute the second order derivative:
To simplify notation, let . Let , and . Therefore
On the other hand, let be the unit vector that minimizes , we know is in column span of because is only defined on the row span, so there must exist a unit vector such that where . For this we have . This finishes the proof for 2.
Finally, notice that is full rank, so iff . Also, iff . ∎
A.2 Objective for Non-Orthogonal Weights
Now we will design a new objective function that can be linearly transformed to the orthonormal case. The main idea is to view the rows of as the new basis that we work on (which is not necessarily orthogonal). Note that this is already the case for the first two terms of the objective function , we change the objective function as follows: More concretely, we define
Note that the only change in the objective is the regularizer for the norm of . It is now replaced by , which tries to ensure the “norm” of in the basis defined by row of to be 1. The objective function that we will optimize corresponds to choosing .
Similar as before, this function can be computed as expectations
where is an independent sample, and .
Intuitively, if we can find a linear transformation that makes ’s orthonormal, that will reduce the problem to the orthonormal case. This is in fact the whitening matrix:
Let be the weighted covariance matrix of ’s. Suppose the SVD of is and let . We apply the transformation to the vectors ’s and obtain that . We can verify that ’s are orthogonal vectors because
(That is, the index denotes the ground-truth solution with respect to which is defined.)
The next Theorem shows that we can rotate the objective function properly so that it matches the objective with a ground-truth vector ’s.
Let be defined as above, and let be the vector whose -th entry is . Then, we have that
Note this can be interpreted as a linear transformation as in vector format is equal to .
The equality can be obtained by straightforward calculation. We note that since , the rows of are .
From Theorem 2.3 we can immediately get the following Corollary (note that the only difference is that the coefficients now are instead of ). Recall and , we have
Let . Let be a sufficiently small universal constant (e.g. suffices). Assume and . The function defined as in Theorem A.2 satisfies that
A matrix is a local minimum of if and only if can be written as where is a matrix whose rows are ’s, is a permutation matrix and is a diagonal matrix with .
Any saddle point has a strictly negative curvature in the sense that where
Suppose is an approximate local minimum in the sense that satisfies
Then can be written as where is a permutation matrix, is a diagonal matrix and .
Finally, we can combine the theorem above and Theorem 5.1 to give a guarantee for optimizing . Let be a diagonal matrix with . Let and .
Let be a sufficiently small universal constant (e.g. suffices). Let . Assume and . The function defined as in Theorem A.2 satisfies that
A matrix is a local minimum of if and only if satisfy where is a permutation matrix, is a diagonal matrix with , and is a diagonal matrix with . Furthermore, this means that all local minima of are also global.
Any saddle point has a strictly negative curvature in the sense that where .
Suppose is an approximate local minimum in the sense that satisfies
Then can be written as where are as in 1, the error term (when ).
Note that we can immediately apply Theorem 2.3 to to characterize all its local minima. See Corollary A.3.
Next we will transform the properties for local minima of (stated in Corollary A.3) to using Theorem A.1. First we note that the transformation matrix and are closely related:
This is because according to the definition of , the SVD of is and , so . The claims of the singular values follow immediately from the SVD of and .
As a result, all local minimum of are of the form where is a local minimum of . For , the gradient and Hessian of and are also related by Theorem A.1.
Let us first prove 1. By Corollary A.3, we know every local minimum of is of the form . According to the definition of in Theorem A.2, we know each row vector is equal to , therefore . As a result, all local minima of are of the form . By Theorem A.1 and Theorem A.2, we know all local minima of must be of the form .
Now we try to compute . To do that observe that . Therefore , and for any local minimum , we have
Note that is still a permutation matrix, and is still a matrix whose diagonal entries are , so this is exactly the form we stated in 1. More concretely, the rows of are permutations of .
For bullet 2, it follows immediately from Property 2 in Theorem A.1. Note that by property 2,
Finally we will prove 3. Let , so that . We will prove properties of using the properties of from Corollary A.3.
Therefore the second order condition for Claim 3 in Corollary A.3 is satisfied. Now when , we have . By Corollary A.3, we know can be expressed as where is the diagonal matrix, is a permutation matrix and . We will apply perturbation Theorem A.9 for matrix inversion. Since , we know when ,
Here is bounded by , which is smaller than when is small enough.
The corresponding point in is , and in 1 we have already proved is of the form we want, therefore we can define , and
A.3 Handle Undercomplete Case
The objective function can handle the case when the weights ’s are not orthogonal, but still requires the number of components to be equal to the number of dimensions . In this section we show how to use similar ideas for the case when the number of components is smaller than the dimension ().
Note that all the terms in only depends on the inner-products . Let be the span of ’s and be the projection matrix to this subspace, it is easy to see that satisfies
That is, the previous objective function only depends on the projection of in the space . Using similar argument as Theorem A.4, it is not hard to show the only local optimum in satisfies the same conditions, and allow us to recover . However, without modifying the objective, the local optimum of can have arbitrary components in the orthogonal subspace .
Intuitively, since the first term only cares about the projection , minimizing will remove the components in the orthogonal subspace of . We will choose carefully to make sure that the additional term does not change the local optima of by too much, while still ensuring a small projection on .
In this case we will consider pseudo-inverse instead of inverse. In particular, for a matrix , define its pseudo-inverse to be the matrix such that and is the projection to the row span of .
Let , .
For any desired accuracy , we can choose parameters , such that for the objective function , for any such that
we have where is a diagonal matrix with entries , is a diagonal matrix with entries close to 1, is a permutation matrix and .
To choose the parameters, let be a sufficiently small universal constant (e.g. suffices). Assume and . Let . Let , and .
We first show that if the gradient is small, then the point cannot have a large component in .
If , then .
Since only depends , we know . Therefore , and we have as desired. ∎
Next we show that if the gradient of is small, and is also small, then the gradient of can be bounded.
In the setting of Theorem A.5, if , then we have
Towards proving Lemma A.7, we first bound the norm of by the following claim:
If , then each row must satisfy .
We prove by contradiction. Assume towards contradiction that there is a column such that . We consider the quantity,
Note that has 4 terms: (1) , (2) , (3) , (4) .
Among these 4 terms, the first, third and forth terms all contribute positively to this inner-product (because when is moved to all those terms clearly decrease). Term 2 contribute negatively. Therefore we can ignore terms 1 and 4:
Let , we know . Therefore,
By the choice of , we can see that the negative term is negligible, and we know
Since , we have . Therefore the norm of the gradient is at least , this contradicts with the assumption. The norm of the rows must all be bounded. ∎
We have that implies . The norm of the whole matrix is bounded by, so by triangle inequality we have
Finally we are ready to prove Theorem A.5.
We will separate into two components and .
We will first show that is close to the desirable solution. To do that we will use Theorem A.4 If we restrict all the vectors to the subspace , we can still apply Theorem A.4 as long as we replace all inverses with pseudo-inverses.. By the choice of , we know from Lemma A.7 that . Also, . Therefore we know must be of the form
where . Also at the same time from the proof of Theorem A.4 we know where has singular values close to 1. Therefore .
By Lemma A.6 we know . We apply inverse matrix perturbation (Theorem A.9) again, using , therefore we know
where .
Combining these two perturbations we know
and the error term has spectral norm at most . ∎
A.4 Toolbox: Matrix Perturbation
In the proof we used the following theorem for the perturbation of matrices.
Consider the perturbation of a matrix : if ,then we have
As a corollary, if , then we have
Appendix B Recovering the Linear Layer
We will show in this section that if we have are given a -approximation of , then it is easy to recover . The key observation here is that the correlation between the and the output is exactly proportional to . We also note that there could be multiple other ways to recover , e.g., using linear regression with the as input and the as output. We chose this algorithm mostly because of the ease of analysis.
Given a matrix whose rows are -close to in Euclidean distance up to permutation and sign flip with . Then, we can give estimates (using e.g., Algorithm 1) such that there exists a permutation where and is row-wise -close to .
To see why this simple algorithm works for recovering , we need the following simple claim.
The proof of this claim follows immediately from the property of Hermite polynomials. Now we are ready to prove the corollary.
Without loss of generality we assume is close to a sign flip of . The unknown permutation does not change the proof.
Since is close to , let be the vector where , we have
Therefore is always positive, is in the desirable range and .
Similarly, if is close to , we have , and the conclusion still holds.
For the settings considered in Section A, the vectors are not necessarily orthogonal. In this case we use the following algorithm:
Given a matrix whose rows have unit norm, and for some permutation matrix and diagonal matrix with entries on diagonals.If , we can give estimates (using e.g., Algorithm 2) such that and .
We again use Claim B.1: in this case we know the vector satisfies . As a result, for the vector , we have
By assumption we know where . By the perturbation of matrix inverse (Theorem A.9), we know if , then where . Therefore
(Here the last equality is because for both permutation matrix and sign flip matrix , and .) Therefore, coordinates of are permutation and sign flips of , up to an error term .
When , we know , therefore the signs are all recovered correctly. After fixing the sign, we have , and . ∎
Appendix C Sample Complexity
In this section we will show that our algorithm only requires polynomially many samples to find the desired solution. Note that we did not try to optimize the polynomial dependency.
In the setting of Theorem 2.3, suppose we use empirical samples to approximate and obtain function . There exists a fixed polynomial such that if , with high probability for any point with and , then can be written as where is a permutation matrix, is a diagonal matrix and .
In order to bound the sample complexity, we will prove a uniform convergence result: we show that with polynomially many samples, the gradient and Hessian of are point-wise close to the gradient and Hessian of , therefore any approximate local minimum of must also be an approximate local minimum of .
However, there are two technical issues in showing the uniform convergence result. The first issue is that when the norm of is very large, both the gradient and Hessian of and are very large and we cannot hope for good concentration. We deal with this issue by showing when has a large norm, the empirical gradient must also have large norm, and therefore it can never be an approximate local minimum (we do this later in Lemma C.5). The second issue is that our objective function involves high-degree polynomials over Gaussian variables , and is therefore not sub-Gaussian or sub-exponential. We use a standard truncation argument to show that the function does not change by too much if we restrict to the event that the Gaussian variables have bounded norm.
By standard concentration bounds, for large enough and any , the probability that is at most .
The bound for the Hessian follows from the same argument. ∎
Finally, we combine this truncation with a result of [MBM16] that proves universal convergence of gradient and Hessian. For completeness here we state a version of their theorem with bounded gradient/Hessian:
The sample gradient converges to the population gradient. Namely if we have
The sample Hessian converges to the empirical Hessian. Namely if we have
As an immediate corollary of this theorem and Lemma C.2, we have
In the setting of Theorem 2.7, for every whose rows have norm at most 2, we have with high probability,
On the other hand, for all such matrices , by Lemma C.2 we know the gradient and Hessian of is close to the gradient and Hessian of .
Now, the gradient and Hessian for individual samples for estimating are bounded by some , therefore by Theorem C.3 we know the gradient and Hessian of are close to those of . When for a large enough polynomial, we have with high probability, for all with all rows ,
The corollary then follows from triangle inequality. ∎
Finally we handle the case when has a row with large norm. We will show that in this case must also be large, so cannot be an approximate local minimum.
If is the row with largest norm and , then when for some fixed polynomial, we have with high probability for some universal constant .
Note that the first two terms are homogeneous degree 4 polynomials over , and the third term does not depend on the sample. By argument similar to Corollary C.4, we know for any where has the largest row norm, with the number of samples we choose the gradient of the first two terms is close to the gradient of their expectations, where is a small constant.
By Theorem 2.6, we know the expectation of the first two terms are equal to and . Here the gradient of the first term always have positive correlation with , so we can ignore it. For the second term, we know the gradient
Taking the inner-product with , and use the fact that form an orthonormal basis, we know
On the other hand, when , we have for the third term
Since is larger than , we know the negative contribution from and the difference between the empirical version and are both negligible. Therefore we have as desired. ∎
By Lemma C.5, any point with must have for all . Now by Corollary C.4, we know the point we have must satisfy
By point 3 in Theorem 2.3, this implies the guarantee on . ∎
In this section we give an example where the function does have spurious local minimum.
In this example, , and the true vectors are the standard basis vectors . We will set , and (where is an arbitrary positive constant).
The spurious local minimum that we consider is , , . That is,
The objective and the only non-zero term is . In order to improve the objective locally, we need to change either or , otherwise the term is still 1, and all other terms () are non-negative.
Assume we have a local perturbation , where , . Here are unit vectors that are orthogonal to . Also, since this is a local perturbation, we make sure , and , . We will show that when is small enough, the objective function .
To see this, notice that the term is now equal to . On the other hand, for , we have
Similarly we have the same equation for . Note that all the terms we analyzed are disjoint, therefore
By removing higher order terms of , it is easy to see that when is small enough. Therefore is a local minima of .