Gradient Descent for One-Hidden-Layer Neural Networks: Polynomial Convergence and SQ Lower Bounds
Santosh Vempala, John Wilmes
Introduction
It is well known that artificial neural networks (NNs) can approximate any real-valued function. Fundamental results show that a NN with a single hidden layer provides a universal representation up to arbitrary approximation, with the number of hidden units needed depending on the function being approximated and the desired accuracy.
Besides their generality, an important feature of NNs is the ease of training them — gradient descent (GD) is used to minimize the error of the network, measured by a loss function of the current weights. This seems to work across a range of labeled data sets. Yet despite its tremendous success, there is no satisfactory explanation for the efficiency or effectiveness of this generic training algorithmIndeed, one might consider this a miraculous feat of engineering and even ask, is there anything to explain rigorously? We are not entirely comfortable with this view and optimistic of some life beyond convexity..
The difficulty is that even for highly restricted classes of NNs, natural loss functions such as the mean squared loss have a highly non-convex landscape with many nonoptimal local minima. However, when data is generated from a model with random weights, GD (the stochastic version with a small batch size) seems to consistently learn a network with error close to zero. This raises the prospect of a provable guarantee, but there are two complicating experimental observations. First, the randomness of the initialization appears essential (standard in practice) as in experiments it is possible to remain stuck at higher error. Second, we observe smaller error (and it decreases more quickly) when the model size used for training is made larger; in particular, for the realizable case (when the data is itself labeled by a NN), we train using many more units than the original. This aspect is also commonly encountered in the training of large NNs on real data — even with huge amounts of data, the size of the model used can be larger.
In this paper we give nearly matching upper and lower bounds that help explain the phenomena seen in practice when training NNs. The upper bounds are for GD and the lower bounds are for all statistical query algorithms. We summarize them here, and present them formally in the next section.
Our algorithmic result is an agnostic upper bound on the approximation error and time and sample complexity of GD with the standard mean squared loss function. Despite training only the output layer weights, our novel proof techniques avoid using any convexity in the problem. Since our analysis does not rely on reaching a global minimum, there is reason to hope the techniques will extend to nonconvex settings where we can in general expect only to find a local minimum. Prior results along this line were either for more complicated algorithms or more restricted settings; the closest is the work of Andoni et al. where they assume the target function is a bounded degree polynomial. A detailed comparison of results is given in Section 1.3. As a corollary of our convergence analaysis, we obtain a rigorous proof of the “spectral bias” of gradient descent observed experimentally in .
The upper bound shows that to get close to the best possible degree polynomial approximation of the data, it suffices to run GD on a NN with units, using the same number of samples. It suffices to train the output layer weights alone. This is an agnostic guarantee. We prove a matching lower bound for solving this polynomial learning problem over the uniform distribution on the unit sphere, for any statistical query algorithm that uses tolerance inversely proportional to . Thus, for this general agnostic learning problem, GD is as good as it gets.
We initialize our NNs by choosing the vectors independently from , and setting each to .
Our first theorem is for training networks of sigmoid gates. The same statement holds for ReLU activation units and even functions .
Next we state a more general theorem. This will apply to a large class of activation functions. The main property we need of the activation function is that it should not be a low-degree polynomial. We first introduce additional notation. (See Section 2 for related definitions and background.) We denote by the set of spherical harmonics of degree on the sphere .
Since the dimension is uniform throughout this paper, we will abbreviate our notation and refer to -activations. The set will not generally depend on , but the quantity generally will (see, e.g., Lemma 2.6).
For example, the commonly used sigmoid gate is an -activation function for the odd integers less than and . Similarly, ReLU gates are -activation functions for subsets of the even integers.
This general theorem has the following corollary in the realizable case, when data is generated by a one-hidden-layer NN. In this case, the function can be approximated by a low-degree polynomial. In order to allow for this approximation guarantee, and to side-step previous statistical query lower bounds , we guarantee some degree on nondegeneracy by focusing on unbiased NNs, i.e., networks without additive bias terms (as in Eq. (1)).
The use of sigmoid units in Corollary 1.4 is not essential, but the bounds on network size and training time will depend on the specific activation function chosen.
Spectral bias.
As a consequence of our techniques, we give a proof of the “spectral bias” phenomenon observed experimentally in . The experiments of showed that neural networks trained via gradient descent learned low Fourier frequencies more quickly than higher frequencies, which the authors propose as a mechanism to explain generalization performance of deep learning. We prove that low frequencies are indeed learned more quickly than high frequencies, where “low frequencies” and “high frequencies” are understood as low and high degree harmonic components of a function.
To quantify the relative speed of learning, we introduce additional notation.
Lower bounds.
The bound is the standard deviation of independent Bernoulli coins with desired expectation, i.e., the error that even a random sample of size would yield. The SQ complexity of an algorithm is given by the number of queries and the batch size . The remaining computation is unrestricted and can use randomization. We will also give lower bounds against the oracle, which responds to queries with a single honest bit. Given a distribution over and a query function , the oracle responds with a single value , where .
Choosing a useful SQ model for regression problems is nontrivial. We discuss some of the pitfalls in Section 4. Our lower bounds concern three query models.
Let . For all and all sufficiently large and , there exists a family of degree- polynomials on with such that if a randomized SQ algorithm learns to regression error less than any fixed constant with probability at least :
it requires at least queries, if the queries are inner product queries to ;
it requires at least queries, if the queries are -normalized -Lipschitz queries to ;
for , it requires at least queries, if the queries are -normalized queries to with Gaussian noise of variance
where all the hidden constants depend on only.
2 Approach and techniques
The gradient of the loss function with respect to any outer layer weight can be viewed as a spherical transform of the current residual error. More precisely, if the current function is computed by an unbiased single hidden-layer NN with output-layer weights , as in Eq. (1), and the residual error with respect to the target function is , then for any ,
The latter expectation is quite special when the domain of integration is the unit sphere. Different choices of the function correspond to different spherical transformations. For example, being the indicator of is the hemispherical transform, while iff is the Radon transform, etc. This type of transformation
In particular, the harmonic polynomials are eigenfunctions of the operator . Moreover, since there exists an orthonormal basis of harmonic polynomials for functions over the unit sphere, any function (in our case the residual ) has zero norm iff the corresponding transform has zero norm (assuming the function has nonzero coefficients ).
Thus, if the current residual error is given by some function , then the empirical gradient of the mean-squared loss with respect to a set of labeled examples is (see Section 3).
Show that, with a large enough set of samples, the empirical gradient operator approximates the Funk transform as an operator on the space of residual error functions (Lemmas 3.5 and 3.6)
Bound the rate at which error from the approximation of by accumulates over multiple rounds of GD (Lemmas 3.7 and 3.8)
Estimate the final loss in terms of the distance of the target function from the space of low-degree harmonic polynomials — i.e., the distance from the most significant eigenspaces of (see proof of Lemma 3.3)
Our analysis does not use the fact that the optimization produces an approximate global minimum; hence, there is a greater hope of generalizing to nonconvex regimes where we expect to instead only reach a local minimum in general. Another pleasant feature of our analysis is that we need not directly prove a “representation theorem” showing that the hypothesis minimizing the population loss is a good approximation to the target function; instead, we can derive such a result for free, as a corollary to our analysis. That is, since we prove directly that GD on the output layer weights of a single-layer NN with randomly-initialized gates results in small loss, it follows that any low-degree harmonic polynomial is in fact approximated by such a network. Our hope is that this new approach offers an interesting possibility for understanding GD in more difficult settings.
A practical consequence of our method of analysis is that we can easily prove a “spectral bias” result, showing the lower degrees are learned more quickly than higher degrees, as was suggested experimentally in (see Theorem 1.6).
The upper bound guarantees hold for the agnostic learning problem of minimizing the least squares error, and the bound is with respect to the best degree polynomial approximation. The size of the network needed grows as , as does the time and sample complexity. We show that this unavoidable for any SQ algorithm, including GD and its variants on arbitrary network architectures. The “hard” functions used for the lower bound will be generated by spherical harmonic polynomials. Specifically, we use the univariate Legendre polynomial of degree in dimension , denoted as , and also called the Gegenbauer polynomial (see Section 2 for more background). We pick a set of unit vectors and for each one we get a polynomial . We choose the vectors randomly so that most have a small pairwise inner product. Then querying one of these polynomials gives little information about the others (on the same input ), and forces an algorithm to make many queries. As in the work on SQ regression algorithms of , it is essential not only to bound the pairwise correlations of the “hard” functions themselves, but also of arbitary “smoothed” indicator functions composed with the hard family. This is accomplished by using a concentration of measure inequality on the sphere to avoid regions where these indicators are in fact correlated. In contrast to those earlier SQ regression lower bounds, we obtain bounds on the sensitivity parameter for the oracle that scales with the number of queries and the degree .
3 Related work
Explaining the success of deep NNs and GD for training NNs has been a challenge for several years. The trade-off between depth and size for the purpose of representation has been rigorously demonstrated . Moreover, there are strong complexity-theoretic and cryptographic-assumption based lower bounds to contend with . These lower bounds are typically based on Boolean functions and “hard” input distributions. More recent lower bounds hold even for specific distributions and smooth functions, for basic GD , and even realizable smooth functions for any SQ algorithm and any product logconcave input distribution . These earlier lower bound constructs are degenerate in the sense that they rely on data generated by networks whose bias and weight vectors have unbounded Euclidean norm as the dimension increases. In contrast, the constructions used in this paper match a corresponding upper bound almost exactly by making use of generic harmonic polynomials in the construction, apply to a significantly broader family of functions, and achieve a much stronger bound on the sensitivity parameter .
Upper bounds have been hard to come by. Standard loss functions, even for one-hidden-layer networks with an output sum gate, are not convex and have multiple disconnected local minima. One body of work shows how to learn more restricted functions, e.g., polynomials and restricted convolutional networks . Another line of work investigates classes of such networks that can be learned in polynomial time, notably using tensor methods and polynomial kernels , more direct methods with assumptions on the structure of the network and a combination of tensor initialization followed by GD . A recent paper shows that the tensor method can be emulated by GD by adding a sufficiently sophisticated penalty to the objective function . Earlier work gave combinatorial methods to learn random networks , guarantees for learning linear dynamical systems by GD and ReLU networks with more restrictive assumptions . Representation theorems analogous to our own were also proved in , and a very general analysis of GD is given in .
Our analysis is reminiscent of the well-known random kitchen sinks paper , which showed that GD using a hard upper bound on the magnitude of coefficients (in practice, an penalty term) with many random features from some distribution achieves error that converges to the best possible error among functions whose coefficients are not much higher than those of the corresponding densities of the sampling distribution. While this approach has been quite insightful (and effective in practice), it (a) does not give a bound for standard GD (with no penalty) and (b) does not address functions that have very different support than the sampling distribution. Our bounds compare with the best possible polynomial approximations and are essentially the best possible in that generality for randomly chosen features.
The work of Andoni et al. shows that GD applied to learn a bounded degree polynomial, using a 1-hidden-layer network of exponential gates, converges with roughly the same number of gates (and a higher iteration count, instead of to achieve error ). A crucial difference is that our analysis is agnostic and we show that GD converges to the error of the best degree approximation of the target function given sufficient many gates. We also state our results for general and commonly-used activation functions, rather than the gate analyzed in , and obtain explicit sample complexity bounds. Of course, the proof technique is also novel; we obtain our representation theorem as a side effect of our direct analysis of GD, rather than the other way around.
Spherical Harmonics
We now recall the basic theorems of spherical harmonics we will require. A more detailed treatment can be found in .
The following proposition is immediate from Cauchy-Schwarz.
We have .
By Proposition 2.3, has bounded norm as an operator on and so by Theorem 2.2,
We first prove a general lemma describing the harmonic spectrum of a wide class of functions, and then derive estimates of the spectra for commonly used activation functions.
By Rodrigues’ formula (see [18, Proposition 3.3.7]),
Hence, by the bounded convergence theorem,
where is the Euler beta function. Indeed, integrating by parts, we see that if the expression is , and otherwise
After a change of variables , this latter integral is by definition .
Now for any of the same parity , if we estimate
In particular, whenever we have
Let be the standard sigmoid function. Then for any positive integer , is an -activation function, where contains and all odd integers less than .
Let be the “softplus” function. Then for any positive integer , is an -activation function, where contains and all even integers less than .
The statement follows from Lemma 2.6 by computing the relevant Taylor series. ∎
We can also perform a similar computation for ReLU activations. (A more general estimate is given in [3, Appendix D.2].)
Let be the ReLU function. Then for any positive integer , is an -activation function, where contains and all even integers less than .
Analysis of Gradient Descent
We now define notation that will be used throughout the rest of this section.
We fix , the approximation error we will achieve over the projection of to harmonics of degrees in . We define quantities , , and as follows, using absolute constants , , and to be defined later in the proof. The maximum number of iterations of gradient descent will be
We define to be an error tolerance used in certain estimates in the proof,
Finally, we define to be the number of hidden units (so ), as well as the number of samples,
We recall the definition in Eq. (3) of the operator
We denote by the th residual. We define and, for , set .
We therefore have the following two propositions which describe how the neural network evolves over multiple iterations of gradient descent.
Thus, a single iteration of gradient descent with learning rate will update the weight by adding . The proposition now follows by induction on . ∎
For all , .
By the definitions of and , we have
Having introduced and explained the necessary notation, we now state our main technical estimate, the following Lemma 3.3, which will be proved at the end of this section. For the rest of Section 3, we write for the change in the residual at step , and we abbreviate .
Suppose and for all . Then with high probability
Given Lemma 3.3, proved in the following Section 3.2, the main results stated in Section 1.1 are straightforward.
By Lemma 3.3, as long as remains larger than and , we have . Now and are orthogonal, so also . Therefore, rewriting , we have
For a sufficiently small choice of the constant defining (Eq. (6)), under the assumption that , we can take the term to be at most . Therefore,
Since , for some we have (assuming a sufficiently large choice of the constant defining in Eq. (5)). Then
Theorem 1.1 now follows from Theorem 1.3, in view of Lemma 2.7.
To prove Corollary 1.4, we first recall an approximation lemma of Livni et al. [25, Lemma 2]:
Let denote the sigmoid function. For every , there is a polynomial of degree such that for all .
2 Proof of Lemma 3.3
We now prove Lemma 3.3. Essentially, the lemma states that the operator approximates for sufficiently large sets . We will prove Lemma 3.3 via a sequence of gradually improving estimates of the approximation of by . Lemma 3.5 gives a very general approximation, which we use to prove the finer approximation described in Lemma 3.6.
In particular, the second inequality of the present lemma holds.
We now complete the proof of the first inequality. For all choices of and , using Proposition 2.3, we have
In the following Lemma 3.6 we prove a finer-tuned approximation of the operator by both and . Since Lemma 3.5 doesn’t give a sufficiently tight approximation between the operators simultaneously for every -function on , we restrict our attention to the subspace we care about, namely, the functions spanned by the for .
With probability over the choice of and , the following statements are all true:
For all , we have ;
For all we have
For all , we have ;
We will use Markov’s inequality to bound the probability that is far from at a random input, followed by a union bound over the choice of and the choice of . We require the constant to be sufficiently large.
In detail, we have , so for any fixed , we can set sufficiently large that there is some also satisfying
Therefore, by Markov’s inequality, with probability over the choice of , Eqs. (10) and (11) both hold for a random with probability .
Similar to Eq. (10), with in place of and in place of , statement (1) of the present lemma holds with probability over the choice of . Furthermore, for any fixed , taking a union bound over , we have with probability that statement (2) holds.
Now suppose is such that Eq. (10) holds for a random with probability at least ; as we have already observed, this is the case with probability at least over the choice of . Then by a union bound over , it then follows that with probability over the choice of , statement (3) holds. Finally, suppose similarly that is such that Eq. (11) holds for a random with probability at least . By a union bound, we with probability at least that for all ,
Now, fixing such an , a union bound over all with gives that
with probability . Taking another union bound over all , we get statement (4) with probability as well. Overall, statements (1)–(4) hold with probability at least . ∎
For the remainder of this section, we use the notation and .
We focus on the second step of our analysis, as outlined in Section 1.2, bounding the rate at which error from the approximations of described above accumulates over multiple iterations of GD. More precisely, we control the norm of , measured via and . The statements are given in the following two lemmas.
By Lemma 3.6 (3), since and are linear operators,
By Proposition 3.2, we have . Therefore, since for all functions , we have altogether that
For all , we have . Furthermore, if statement (4) of Lemma 3.6 holds, then for all , we have
For the first inequality, we have by definition that for all
For the second inequality, fix . Using statement (4) of Lemma 3.6 we compute
By Proposition 2.3 and the first statement of Lemma 3.7,
(So the statement of the lemma follows from estimate (3) and .)
Since , , and , the base cases are all trivial. Fix and assume estimates (1)–(4) hold for all . We first prove that estimate (1) holds for . Indeed, using the second statement of Lemma 3.8, and then simplifying using the inductive hypothesis for estimates (1), (2) and (4), we have
This latter expression is at most , using the fact that and the definitions of , , and in Eqs. (5), (6), and (7). Estimate (1) now follows by induction.
Similarly, from the first statement of Lemma 3.8 and from estimate (1), we have
By the second statement of Lemma 3.7, and using estimates (1) and (2), we have
giving estimate (3) by induction. Rewriting , we have . Now by estimate (4), , and so
For a sufficiently small choice of the constant defining (Eq. (6)), under the assumption that , we can take the term to be at most . Therefore,
The norm of the residual is therefore monotonically decreasing in , giving estimate (4). ∎
Statistical query models
In particular, with a constant error tolerance , such a family can be learned using statistical queries.
In particular, a statistical query model allowing arbitary measurable and bounded queries would allow efficiently learning any finite class of real-valued functions, perhaps perturbed slightly to ensure the functions disagree pairwise almost everywhere.
Furthermore, arbitrary measurable query functions don’t have concise descriptions anyway. So it is reasonable to require “well-behaved” query functions. We now describe three “well-behaved” statistical query settings, and prove strong lower bounds against algorithms learning degree- polynomials on in each setting.
We recall the definition of statistical dimension, denoting by the average correlation among the functions of , i.e.,
where .
The following theorem can be proved in a manner almost identical to the proof of [12, Theorem 2.7].
Let be such that . Then
By the Funk–Hecke theorem, We therefore have, again by the Funk–Hecke theorem,
Since and (by [18, Proposition 3.3.7]), the result follows. ∎
We can now prove the SQ lower bound for this class of queries.
Taking a random (uniform) set of vectors , let . For any pair of distinct vectors , we have with probability that . Thus, with positive probability, we have for all distinct . Then by Lemma 4.4, we have
for all . The theorem now follows from Theorem 4.3. ∎
2 Lipschitz queries
We now recall the Lipschitz query model introduced in . The functions learned in that paper were already bounded, so no normalization is performed. We state an -normalized version of the relationship between statistical dimension and statistical query complexity, which are an immediate consequence of those proved in .
So is -Lipschitz, is supported on , and has norm .
We can now prove the lower bound for this query model. We use the same family of functions as for the inner product query model, but we must now also estimate the covariances of the soft indicators of these functions, as in the following lemma. We recall our notation .
For , we write .
Let , so . Then
Now substituting , we have
Next we note that in our range of ,
Taking a random (uniform) set of vectors , let . As seen in the proof of Theorem 1.7 (1), we can take every pair to satisfy . By Lemma 4.4, we have
We therefore have . The result now follows by Theorem 4.6. ∎
3 Queries with Gaussian noise
We conclude this section with our lower bounds against . These lower bounds rely on the simulation of using proved in [12, Theorem 3.13].
In order to give our lower bounds against oracles, we first give the following lower bounds for queries to in the presence of Gaussian noise, which by Lemma 4.9 are in effect a special case of those proved in Section 4.2 for Lipschitz queries.
Let . For all and all sufficiently large and , there exists a family of degree- polynomials on with such that if a randomized SQ algorithm learns to regression error less than any fixed constant with probability at least , it requires at least queries, if the queries are -normalized queries to in the presence of Gaussian noise of variance . (All the hidden constants depend on only.)
where denotes the total variation distance. This distance is bounded above by (see, e.g., ). ∎
By [12, Theorem 3.13], if there is an algorithm solving the problem using queries to , there is an algorithm solving the problem using queries to . By Lemma 4.8, at least queries to are required. Hence, at least queries to are also required in the presence of Gaussian noise of variance , as long as the number of polynomials in is at least . ∎
Discussion
We have given a polynomial-time analysis of gradient descent for training a neural network in an agnostic setting. In particular, we show that functions that are approximated by polynomials can be learned by gradient descent, as well as functions computed by single-hidden-layer neural networks. These results build on a long line of work by many authors studying the power of random initialization combined with output-layer training.
We show that our analysis is essentially tight, in the sense that no statistical query algorithm can have significantly better time complexity.
Extending the training to hidden-layer weights cannot offer an asymptotic improvement in the number of gates needed to achieve small error in the general setting we consider. However, experiments suggest that training hidden-layer weights might allow for tighter bounds in the realizable case. In particular, it would be interesting to give a fully polynomial analysis of gradient descent for learning data labeled by a single-hidden layer neural network with neurons. An extension for networks with bounded bias parameters, rather than unbiased networks, would also be interesting.
The authors are grateful to Adam Kalai and Le Song for helpful discussions. The authors also thank Joël Bellaïche and the anonymous referees for careful reading and many suggestions that improved the presentation. This work was supported in part by NSF grants CCF-1563838, CCF-1717349 and E2CDA-1640081.