The power of deeper networks for expressing natural functions

David Rolnick, Max Tegmark

Introduction

Deep learning has lately been shown to be a very powerful tool for a wide range of problems, from image segmentation to machine translation. Despite its success, many of the techniques developed by practitioners of artificial neural networks (ANNs) are heuristics without theoretical guarantees. Perhaps most notably, the power of feedforward networks with many layers (deep networks) has not been fully explained. The goal of this paper is to shed more light on this question and to suggest heuristics for how deep is deep enough.

It is well-known (Cybenko, 1989; Funahashi, 1989; Hornik et al., 1989; Barron, 1994; Pinkus, 1999) that neural networks with a single hidden layer can approximate any function under reasonable assumptions, but it is possible that the networks required will be extremely large. Recent authors have shown that some functions can be approximated by deeper networks much more efficiently (i.e. with fewer neurons) than by shallower ones. Often, these results admit one or more of the following limitations: “existence proofs” without explicit constructions of the functions in question; explicit constructions, but relatively complicated functions; or applicability only to types of network rarely used in practice.

It is important and timely to extend this work to make it more concrete and actionable, by deriving resource requirements for approximating natural classes of functions using today’s most common neural network architectures. Lin et al. (2017) recently proved that it is exponentially more efficient to use a deep network than a shallow network when Taylor-approximating the product of input variables. In the present paper, we move far beyond this result in the following ways: (i) we use standard uniform approximation instead of Taylor approximation, (ii) we show that the exponential advantage of depth extends to all general sparse multivariate polynomials, and (iii) we address the question of how the number of neurons scales with the number of layers. Our results apply to standard feedforward neural networks and are borne out by empirical tests.

Our primary contributions are as follows:

It is possible to achieve arbitrarily close approximations of simple multivariate and univariate polynomials with neural networks having a bounded number of neurons (see §3).

Such polynomials are exponentially easier to approximate with deep networks than with shallow networks (see §4).

The power of networks improves rapidly with depth; for natural polynomials, the number of layers required is at most logarithmic in the number of input variables, where the base of the logarithm depends upon the layer width (see §5).

Related Work

Deeper networks have been shown to have greater representational power with respect to various notions of complexity, including piecewise linear decision boundaries (Montufar et al., 2014) and topological invariants (Bianchini & Scarselli, 2014). Recently, Poole et al. (2016) and Raghu et al. (2016) showed that the trajectories of input variables attain exponentially greater length and curvature with greater network depth.

Work including Daniely (2017); Eldan & Shamir (2016); Pinkus (1999); Poggio et al. (2017); Telgarsky (2016) shows that there exist functions that require exponential width to be approximated by a shallow network. Barron (1994) provides bounds on the error in approximating general functions by shallow networks. Mhaskar et al. (2016) and Poggio et al. (2017) show that for compositional functions (those that can be expressed by recursive function composition), the number of neurons required for approximation by a deep network is exponentially smaller than the best known upper bounds for a shallow network. Mhaskar et al. (2016) ask whether functions with tight lower bounds must be pathologically complicated, a question which we answer here in the negative.

Various authors have also considered the power of deeper networks of types other than the standard feedforward model. The problem has also been posed for sum-product networks (Delalleau & Bengio, 2011) and restricted Boltzmann machines (Martens et al., 2013). Cohen et al. (2016) showed, using tools from tensor decomposition, that shallow arithmetic circuits can express only a measure-zero set of the functions expressible by deep circuits. A weak generalization of this result to convolutional neural networks was shown in Cohen & Shashua (2016).

The power of approximation

Two notions of approximation will be relevant in our results: ϵ\epsilon-approximation, also known as uniform approximation, and Taylor approximation.

For constant ϵ>0\epsilon>0, we say that a network N(x)N({\bf x}) ϵ\epsilon-approximates a multivariate function f(x)f({\bf x}) (for x{\bf x} in a specified domain (−R,R)n(-R,R)^{n}) if sup⁡x∣N(x)−f(x)∣<ϵ\sup_{{\bf x}}|N({\bf x})-f({\bf x})|<\epsilon.

We say that a network N(x)N({\bf x}) Taylor-approximates a multivariate polynomial p(x)p({\bf x}) of degree dd if p(x)p({\bf x}) is the ddth order Taylor polynomial (about the origin) of N(x)N({\bf x}).

The following proposition shows that Taylor approximation implies ϵ\epsilon-approximation for homogeneous polynomials. The reverse implication does not hold.

Suppose that the network N(x)N({\bf x}) Taylor-approximates the homogeneous multivariate polynomial p(x)p({\bf x}). Then, for every ϵ\epsilon, there exists a network Nϵ(x)N_{\epsilon}({\bf x}) that ϵ\epsilon-approximates p(x)p({\bf x}), such that N(x)N({\bf x}) and Nϵ(x)N_{\epsilon}({\bf x}) have the same number of neurons in each layer. (This statement holds for x∈(−R,R)n{\bf x}\in(-R,R)^{n} for any specified RR.)

We conclude that Nϵ(x)N_{\epsilon}({\bf x}) is an ϵ\epsilon-approximation of p(x)p({\bf x}), as desired. ∎

For a fixed nonlinear function σ\sigma, we consider the total number of neurons (excluding input and output neurons) needed for a network to approximate a given function. Remarkably, it is possible to attain arbitrarily good approximations of a (not necessarily homogeneous) multivariate polynomial by a feedforward neural network, even with a single hidden layer, without increasing the number of neurons past a certain bound. (See also Corollary 1 in Poggio et al. (2017).)

Suppose that p(x)p({\bf x}) is a degree-dd multivariate polynomial and that the nonlinearity σ\sigma has nonzero Taylor coefficients up to degree dd. Let mkϵ(p)m^{\epsilon}_{k}(p) be the minimum number of neurons in a depth-kk network that ϵ\epsilon-approximates pp. Then, the limit lim⁡ϵ→0mkϵ(p)\lim_{\epsilon\to 0}m^{\epsilon}_{k}(p) exists (and is finite). (Once again, this statement holds for x∈(−R,R)n{\bf x}\in(-R,R)^{n} for any specified RR.)

We show that lim⁡ϵ→0m1ϵ(p)\lim_{\epsilon\to 0}m^{\epsilon}_{1}(p) exists; it follows immediately that lim⁡ϵ→0mkϵ(p)\lim_{\epsilon\to 0}m^{\epsilon}_{k}(p) exists for every kk, since an ϵ\epsilon-approximation to pp with depth kk can be constructed from one with depth 11.

Let p1(x),p2(x),…,ps(x)p_{1}({\bf x}),p_{2}({\bf x}),\ldots,p_{s}({\bf x}) be the monomials of p(x)p({\bf x}), so that p(x)=∑ipi(x)p({\bf x})=\sum_{i}p_{i}({\bf x}). We claim that each pi(x)p_{i}({\bf x}) can be Taylor-approximated by a network Ni(x)N^{i}({\bf x}) with one hidden layer. This follows, for example, from the proof in Lin et al. (2017) that products can be Taylor-approximated by networks with one hidden layer, since each monomial is the product of several inputs (with multiplicity); we prove a far stronger result about Ni(x)N^{i}({\bf x}) later in this paper (see Theorem 4.1).

Suppose now that Ni(x)N^{i}({\bf x}) has mim_{i} hidden neurons. By Proposition 3.3, we conclude that since pi(x)p_{i}({\bf x}) is homogeneous, it may be δ\delta-approximated by a network Nδi(x)N^{i}_{\delta}({\bf x}) with mim_{i} hidden neurons, where δ=ϵ/s\delta=\epsilon/s. By combining the networks Nδi(x)N^{i}_{\delta}({\bf x}) for each ii, we can define a network Nϵ(x)=∑iNδi(x)N_{\epsilon}({\bf x})=\sum_{i}N^{i}_{\delta}({\bf x}) with ∑imi\sum_{i}m_{i} neurons. Then, we have:

Hence, Nϵ(x)N_{\epsilon}({\bf x}) is an ϵ\epsilon-approximation of p(x)p({\bf x}), implying that m1ϵ(p)≤∑imim^{\epsilon}_{1}(p)\leq\sum_{i}m_{i} for every ϵ\epsilon. Thus, lim⁡ϵ→0m1ϵ(p)\lim_{\epsilon\to 0}m^{\epsilon}_{1}(p) exists, as desired. ∎

This theorem is perhaps surprising, since it is common for ϵ\epsilon-approximations to functions to require ever-greater complexity, approaching infinity as ϵ→0\epsilon\to 0. For example, the function exp⁡(∣−x∣)\exp(|-x|) may be approximated on the domain (−π,π)(-\pi,\pi) by Fourier sums of the form ∑k=0mamcos⁡(kx)\sum_{k=0}^{m}a_{m}\cos(kx). However, in order to achieve ϵ\epsilon-approximation, we need to take m∼1/ϵm\sim 1/\sqrt{\epsilon} terms. By contrast, we have shown that a finite neural network architecture can achieve arbitrarily good approximations merely by altering its weights.

Note also that the assumption of nonzero Taylor coefficients cannot be dropped from Theorem 3.4. For example, the theorem is false for rectified linear units (ReLUs), which are piecewise linear and do not admit a Taylor series. This is because ϵ\epsilon-approximating a non-linear polynomial with a piecewise linear function requires an ever-increasing number of pieces as ϵ→0\epsilon\to 0.

Theorem 3.4 allows us to make the following definition:

Suppose that a nonlinear function σ\sigma is given. For pp a multivariate polynomial, let mkuniform(p)m^{\text{uniform}}_{k}(p) be the minimum number of neurons in a depth-kk network that ϵ\epsilon-approximates pp for all ϵ\epsilon arbitrarily small. Set muniform(p)=min⁡kmkuniform(p)m^{\text{uniform}}(p)=\min_{k}m^{\text{uniform}}_{k}(p). Likewise, let mkTaylor(p)m^{\text{Taylor}}_{k}(p) be the minimum number of neurons in a depth-kk network that Taylor-approximates pp, and set mTaylor(p)=min⁡kmkTaylor(p)m^{\text{Taylor}}(p)=\min_{k}m^{\text{Taylor}}_{k}(p).

In the next section, we will show that there is an exponential gap between m1uniform(p)m^{\text{uniform}}_{1}(p) and muniform(p)m^{\text{uniform}}(p) and between m1Taylor(p)m^{\text{Taylor}}_{1}(p) and mTaylor(p)m^{\text{Taylor}}(p) for various classes of polynomials pp.

The inefficiency of shallow networks

In this section, we compare the efficiency of shallow networks (those with a single hidden layer) and deep networks at approximating multivariate polynomials. Proofs of our main results are included in the Appendix.

Our first result shows that uniform approximation of monomials requires exponentially more neurons in a shallow than a deep network.

Let p(x)p({\bf x}) denote the monomial x1r1x2r2⋯xnrnx_{1}^{r_{1}}x_{2}^{r_{2}}\cdots x_{n}^{r_{n}}, with d=∑i=1nrid=\sum_{i=1}^{n}r_{i}. Suppose that the nonlinearity σ\sigma has nonzero Taylor coefficients up to degree 2d2d. Then, we have:

m1uniform(p)=∏i=1n(ri+1),m^{\text{uniform}}_{1}(p)=\prod_{i=1}^{n}(r_{i}+1),

muniform(p)≤∑i=1n(7⌈log⁡2(ri)⌉+4),m^{\text{uniform}}(p)\leq\sum_{i=1}^{n}(7\lceil\log_{2}(r_{i})\rceil+4),

where ⌈x⌉\lceil x\rceil denotes the smallest integer that is at least xx.

We can prove a comparable result for mTaylorm^{\text{Taylor}} under slightly weaker assumptions on σ\sigma. Note that by setting r1=r2=…=rn=1r_{1}=r_{2}=\ldots=r_{n}=1, we recover the result of Lin et al. (2017) that the product of nn numbers requires 2n2^{n} neurons in a shallow network but can be Taylor-approximated with linearly many neurons in a deep network.

Let p(x)p({\bf x}) denote the monomial x1r1x2r2⋯xnrnx_{1}^{r_{1}}x_{2}^{r_{2}}\cdots x_{n}^{r_{n}}, with d=∑i=1nrid=\sum_{i=1}^{n}r_{i}. Suppose that σ\sigma has nonzero Taylor coefficients up to degree dd. Then, we have:

m1Taylor(p)=∏i=1n(ri+1),m^{\text{Taylor}}_{1}(p)=\prod_{i=1}^{n}(r_{i}+1),

mTaylor(p)≤∑i=1n(7⌈log⁡2(ri)⌉+4).m^{\text{Taylor}}(p)\leq\sum_{i=1}^{n}(7\lceil\log_{2}(r_{i})\rceil+4).

It is worth noting that neither of Theorems 4.1 and 4.2 implies the other. This is because it is possible for a polynomial to admit a compact uniform approximation without admitting a compact Taylor approximation.

It is natural now to consider the cost of approximating general polynomials. However, without further constraint, this is relatively uninstructive because polynomials of degree dd in nn variables live within a space of dimension (n+dd)\binom{n+d}{d}, and therefore most require exponentially many neurons for any depth of network. We therefore consider polynomials of sparsity cc: that is, those that can be represented as the sum of cc monomials. This includes many natural functions.

The following theorem, when combined with Theorems 4.1 and 4.2, shows that general polynomials pp with subexponential sparsity have exponentially large m1uniform(p)m^{\text{uniform}}_{1}(p) and m1Taylor(p)m^{\text{Taylor}}_{1}(p), but subexponential muniform(p)m^{\text{uniform}}(p) and mTaylor(p)m^{\text{Taylor}}(p).

Let p(x)p({\bf x}) be a multivariate polynomial of degree dd and sparsity cc, having monomials q1(x),q2(x),…,qc(x)q_{1}({\bf x}),q_{2}({\bf x}),\ldots,q_{c}({\bf x}). Suppose that the nonlinearity σ\sigma has nonzero Taylor coefficients up to degree 2d2d. Then, we have:

m1uniform(p)≥1cmax⁡jm1uniform(qj)m^{\text{uniform}}_{1}(p)\geq\frac{1}{c}\max_{j}m^{\text{uniform}}_{1}(q_{j}).

muniform(p)≤∑jmuniform(qj)m^{\text{uniform}}(p)\leq\sum_{j}m^{\text{uniform}}(q_{j}).

These statements also hold if muniformm^{\text{uniform}} is replaced with mTaylorm^{\text{Taylor}}.

As mentioned above with respect to ReLUs, some assumptions on the Taylor coefficients of the activation function are necessary for the results we present. However, it is possible to loosen the assumptions of Theorem 4.1 and 4.2 while still obtaining exponential lower bounds on m1uniform(p)m^{\text{uniform}}_{1}(p) and m1Taylor(p)m^{\text{Taylor}}_{1}(p):

Let p(x)p({\bf x}) denote the monomial x1r1x2r2⋯xnrnx_{1}^{r_{1}}x_{2}^{r_{2}}\cdots x_{n}^{r_{n}}, with d=∑i=1nrid=\sum_{i=1}^{n}r_{i}. Suppose that the nonlinearity σ\sigma has nonzero ddth Taylor coefficient (other Taylor coefficients are allowed to be zero). Then, m1uniform(p)m^{\text{uniform}}_{1}(p) and m1Taylor(p)m^{\text{Taylor}}_{1}(p) are at least 1d∏i=1n(ri+1)\frac{1}{d}\prod_{i=1}^{n}(r_{i}+1). (An even better lower bound is the maximum coefficient in the polynomial ∏i(1+y+…+yri)\prod_{i}(1+y+\ldots+y^{r_{i}}).)

2 Univariate polynomials

As with multivariate polynomials, depth can offer an exponential savings when approximating univariate polynomials. We show below (Proposition 4.5) that a shallow network can approximate any degree-dd univariate polynomial with a number of neurons at most linear in dd. The monomial xdx^{d} requires d+1d+1 neurons in a shallow network (Proposition 4.6), but can be approximated with only logarithmically many neurons in a deep network. Thus, depth allows us to reduce networks from linear to logarithmic size, while for multivariate polynomials the gap was between exponential and linear. The difference here arises because the dimensionality of the space of univariate degree-dd polynomials is linear in dd, which the dimensionality of the space of multivariate degree-dd polynomials is exponential in dd.

Suppose that the nonlinearity σ\sigma has nonzero Taylor coefficients up to degree dd. Then, m1Taylor(p)≤d+1m^{\text{Taylor}}_{1}(p)\leq d+1 for every univariate polynomial pp of degree dd.

Pick a0,a1,…,ada_{0},a_{1},\ldots,a_{d} to be arbitrary, distinct real numbers. Consider the Vandermonde matrix A{\bf A} with entries Aij=aijA_{ij}=a_{i}^{j}. It is well-known that det⁡(A)=∏i<i′(ai′−ai)≠0\det({\bf A})=\prod_{i<i^{\prime}}(a_{i^{\prime}}-a_{i})\neq 0. Hence, A{\bf A} is invertible, which means that multiplying its columns by nonzero values gives another invertible matrix. Suppose that we multiply the jjth column of A{\bf A} by σj\sigma_{j} to get A′{\bf A}^{\prime}, where σ(x)=∑jσjxj\sigma(x)=\sum_{j}\sigma_{j}x^{j} is the Taylor expansion of σ(x)\sigma(x).

Now, observe that the iith row of A′{\bf A}^{\prime} is exactly the coefficients of σ(aix)\sigma(a_{i}x), up to the degree-dd term. Since A′{\bf A}^{\prime} is invertible, the rows must be linearly independent, so the polynomials σ(aix)\sigma(a_{i}x), restricted to terms of degree at most dd, must themselves be linearly independent. Since the space of degree-dd univariate polynomials is (d+1)(d+1)-dimensional, these d+1d+1 linearly independent polynomials must span the space. Hence, m1Taylor(p)≤d+1m^{\text{Taylor}}_{1}(p)\leq d+1 for any univariate degree-dd polynomial pp. In fact, we can fix the weights from the input neuron to the hidden layer (to be a0,a1,…,ada_{0},a_{1},\ldots,a_{d}, respectively) and still represent any polynomial pp with d+1d+1 hidden neurons. ∎

Let p(x)=xdp(x)=x^{d}, and suppose that the nonlinearity σ(x)\sigma(x) has nonzero Taylor coefficients up to degree 2d2d. Then, we have:

muniform(p)≤7⌈log⁡2(d)⌉m^{\text{uniform}}(p)\leq 7\lceil\log_{2}(d)\rceil.

These statements also hold if muniformm^{\text{uniform}} is replaced with mTaylorm^{\text{Taylor}}.

Part (i) follows from part (i) of Theorems 4.1 and 4.2 by setting n=1n=1 and r1=dr_{1}=d.

For part (ii), observe that we can Taylor-approximate the square x2x^{2} of an input xx with three neurons in a single layer:

We refer to this construction as a square gate, and the construction of Lin et al. (2017) as a product gate. We also use identity gate to refer to a neuron that simply preserves the input of a neuron from the preceding layer (this is equivalent to the skip connections in residual nets (He et al., 2016)).

Consider a network in which each layer contains a square gate (3 neurons) and either a product gate or an identity gate (4 or 1 neurons, respectively), according to the following construction: The square gate squares the output of the preceding square gate, yielding inductively a result of the form x2kx^{2^{k}}, where kk is the depth of the layer. Writing dd in binary, we use a product gate if there is a 1 in the 2k−12^{k-1}-place; if so, the product gate multiplies the output of the preceding product gate by the output of the preceding square gate. If there is a 0 in the 2k−12^{k-1}-place, we use an identity gate instead of a product gate. Thus, each layer computes x2kx^{2^{k}} and multiplies x2k−1x^{2^{k-1}} to the computation if the 2k−12^{k-1}-place in dd is 1. The process stops when the product gate outputs xdx^{d}.

This network clearly uses at most 7⌈log⁡2(d)⌉7\lceil\log_{2}(d)\rceil neurons, with a worst case scenario where d+1d+1 is a power of 2. Hence mTaylor(p)≤7⌈log⁡2(d)⌉m^{\text{Taylor}}(p)\leq 7\lceil\log_{2}(d)\rceil, with muniform(p)≤mTaylor(p)m^{\text{uniform}}(p)\leq m^{\text{Taylor}}(p) by Proposition 3.3 since pp is homogeneous. ∎

How efficiency improves with depth

We now consider how mkuniform(p)m^{\text{uniform}}_{k}(p) scales with kk, interpolating between exponential in nn (for k=1k=1) and linear in nn (for k=log⁡nk=\log n). In practice, networks with modest k>1k>1 are effective at representing natural functions. We explain this theoretically by showing that the cost of approximating the product polynomial drops off rapidly as kk increases.

By repeated application of the shallow network construction in Lin et al. (2017), we obtain the following upper bound on mkuniform(p)m^{\text{uniform}}_{k}(p), which we conjecture to be essentially tight. Our approach leverages the compositionality of polynomials, as discussed e.g. in Mhaskar et al. (2016) and Poggio et al. (2017), using a tree-like neural network architecture.

Let p(x)p({\bf x}) equal the product x1x2⋯xnx_{1}x_{2}\cdots x_{n}, and suppose σ\sigma has nonzero Taylor coefficients up to degree nn. Then, we have:

We construct a network in which groups of the nn inputs are recursively multiplied up to Taylor approximation. The nn inputs are first divided into groups of size b1b_{1}, and each group is multiplied in the first hidden layer using 2b12^{b_{1}} neurons (as described in Lin et al. (2017)). Thus, the first hidden layer includes a total of 2b1n/b12^{b_{1}}n/b_{1} neurons. This gives us n/b1n/b_{1} values to multiply, which are in turn divided into groups of size b2b_{2}. Each group is multiplied in the second hidden layer using 2b22^{b_{2}} neurons. Thus, the second hidden layer includes a total of 2b2n/(b1b2)2^{b_{2}}n/(b_{1}b_{2}) neurons.

We continue in this fashion for b1,b2,…,bkb_{1},b_{2},\ldots,b_{k} such that b1b2⋯bk=nb_{1}b_{2}\cdots b_{k}=n, giving us one neuron which is the product of all of our inputs. By considering the total number of neurons used, we conclude

By Proposition 3.3, mkuniform(p)≤mkTaylor(p)m^{\text{uniform}}_{k}(p)\leq m^{\text{Taylor}}_{k}(p) since pp is homogeneous. Setting bi=n1/kb_{i}=n^{1/k}, for each ii, gives us the desired bound (1). ∎

In fact, we can solve for the choice of bib_{i} such that the upper bound in (2) is minimized, under the condition b1b2⋯bk=nb_{1}b_{2}\cdots b_{k}=n. Using the technique of Lagrange multipliers, we know that the optimum occurs at a minimum of the function

Differentiating L\mathcal{L} with respect to bib_{i}, we obtain the conditions

Dividing (3) by ∏j=i+1kbj\prod_{j=i+1}^{k}b_{j} and rearranging gives us the recursion

Thus, the optimal bib_{i} are not exactly equal but very slowly increasing with ii (see Figure 2).

The following conjecture states that the bound given in Theorem 1 is (approximately) optimal.

Let p(x)p({\bf x}) equal to the product x1x2⋯xnx_{1}x_{2}\cdots x_{n}, and suppose that σ\sigma has all nonzero Taylor coefficients. Then, we have:

i.e., the exponent grows as n1/kn^{1/k} for n→∞n\to\infty.

We empirically tested Conjecture 6 by training ANNs to predict the product of input values x1,…,xnx_{1},\ldots,x_{n} with n=20n=20 (see Figure 2). The rapid interpolation from exponential to linear width aligns with our predictions.

In our experiments, we used feedforward networks with dense connections between successive layers. In the figure, we show results for σ(x)=tanh⁡(x)\sigma(x)=\tanh(x) (note that this behavior is even better than expected, since this function actually has numerous zero Taylor coefficients). Similar results were also obtained for rectified linear units (ReLUs) as the nonlinearity, despite the fact that this function does not even admit a Taylor series. The number of layers was varied, as was the number of neurons within a single layer. The networks were trained using the AdaDelta optimizer (Zeiler, 2012) to minimize the absolute value of the difference between the predicted and actual values. Input variables xix_{i} were drawn uniformly at random from the interval $$, so that the expected value of the output would be of manageable size.

Eq. (6) provides a helpful rule of thumb for how deep is deep enough. Suppose, for instance, that we wish to keep typical layers no wider than about a thousand (∼210\sim 2^{10}) neurons. Eq. (6) then implies n^{1/k}\mathrel{\hbox to0.0pt{\lower 3.0pt\hbox{\mathchar 536\relax}\hss}\raise 2.0pt\hbox{\mathchar 316\relax}}10, i.e., that the number of layers should be at least

It would be very interesting if one could show that general polynomials pp in nn variables require a superpolynomial number of neurons to approximate for any constant number of hidden layers. The analogous statement for Boolean circuits - whether the complexity classes TC0TC^{0} and TC1TC^{1} are equal - remains unresolved and is assumed to be quite hard. Note that the formulations for Boolean circuits and deep neural networks are independent statements (neither would imply the other) due to the differences between computation on binary and real values. Indeed, gaps in expressivity have already been proven to exist for real-valued neural networks of different depths, for which the analogous results remain unknown in Boolean circuits (see e.g. Mhaskar (1993); Chui et al. (1994; 1996); Montufar et al. (2014); Cohen et al. (2016); Telgarsky (2016)).

Conclusion

We have shown how the power of deeper ANNs can be quantified even for simple polynomials. We have proved that arbitrarily good approximations of polynomials are possible even with a fixed number of neurons and that there is an exponential gap between the width of shallow and deep networks required for approximating a given sparse polynomial. For nn variables, a shallow network requires size exponential in nn, while a deep network requires at most linearly many neurons. Networks with a constant number k>1k>1 of hidden layers appear to interpolate between these extremes, following a curve exponential in n1/kn^{1/k}. This suggests a rough heuristic for the number of layers required for approximating simple functions with neural networks. For example, if we want no layers to have more than 2102^{10} neurons, say, then the minimum number of layers required grows only as log⁡10n\log_{10}n. To further improve efficiency using the O(n)\mathcal{O}(n) constructions we have presented, it suffices to increase the number of layers by a factor of log⁡210≈3\log_{2}10\approx 3, to log⁡2n\log_{2}n.

The key property we use in our constructions is compositionality, as detailed in Poggio et al. (2017). It is worth noting that as a consequence our networks enjoy the property of locality mentioned in Cohen et al. (2016), which is also a feature of convolutional neural nets. That is, each neuron in a layer is assumed to be connected only to a small subset of neurons from the previous layer, rather than the entirety (or some large fraction). In fact, we showed (e.g. Prop. 4.6) that there exist natural functions computable with linearly many neurons, with each neuron is connected to at most two neurons in the preceding layer, which nonetheless cannot be computed with fewer than exponentially many neurons in a single layer, no matter how may connections are used. Our construction can also be framed with reference to the other properties mentioned in Cohen et al. (2016): those of sharing (in which weights are shared between neural connections) and pooling (in which layers are gradually collapsed, as our construction essentially does with recursive combination of inputs).

This paper has focused exclusively on the resources (neurons and synapses) required to compute a given function for fixed network depth. (Note also results of Lu et al. (2017); Hanin & Sellke (2017); Hanin (2017) for networks of fixed width.) An important complementary challenge is to quantify the resources (e.g. training steps) required to learn the computation, i.e., to converge to appropriate weights using training data — possibly a fixed amount thereof, as suggested in Zhang et al. (2017). There are simple functions that can be computed with polynomial resources but require exponential resources to learn (Shalev-Shwartz et al., 2017). It is quite possible that architectures we have not considered increase the feasibility of learning. For example, residual networks (ResNets) (He et al., 2016) and unitary nets (see e.g. Arjovsky et al. (2016); Jing et al. (2017)) are no more powerful in representational ability than conventional networks of the same size, but by being less susceptible to the “vanishing/exploding gradient” problem, it is far easier to optimize them in practice. We look forward to future work that will help us understand the power of neural networks to learn.

Acknowledgments

This work was supported by the Foundational Questions Institute http://fqxi.org/, the Rothberg Family Fund for Cognitive Science and NSF grant 1122374. We would like to thank Tomaso Poggio, Scott Aaronson, Surya Ganguli, David Budden, Henry Lin, and the anonymous referees for helpful suggestions and discussions, and the Center for Brains, Minds, & Machines for an excellent working environment.

References

Appendix

Without loss of generality, suppose that ri>0r_{i}>0 for i=1,…,ni=1,\ldots,n. Let XX be the multiset in which xix_{i} occurs with multiplicity rir_{i}.

We first show that ∏i=1n(ri+1)\prod_{i=1}^{n}(r_{i}+1) neurons are sufficient to approximate p(x)p({\bf x}). Appendix A in Lin et al. (2017) demonstrates that for variables y1,…,yNy_{1},\ldots,y_{N}, the product y1⋅⋯⋅yNy_{1}\cdot\cdots\cdot y_{N} can be Taylor-approximated as a linear combination of the 2N2^{N} functions σ(±y1±⋯±yd)\sigma(\pm y_{1}\pm\cdots\pm y_{d}).

Consider setting y1,…,ydy_{1},\ldots,y_{d} equal to the elements of multiset XX. Then, we conclude that we can approximate p(x)p({\bf x}) as a linear combination of the functions σ(±y1±⋯±yd)\sigma(\pm y_{1}\pm\cdots\pm y_{d}). However, these functions are not all distinct: there are ri+1r_{i}+1 distinct ways to assign ±\pm signs to rir_{i} copies of xix_{i} (ignoring permutations of the signs). Therefore, there are ∏i=1n(ri+1)\prod_{i=1}^{n}(r_{i}+1) distinct functions σ(±y1±⋯±yN)\sigma(\pm y_{1}\pm\cdots\pm y_{N}), proving that mTaylor(p)≤∏i=1n(ri+1)m^{\text{Taylor}}(p)\leq\prod_{i=1}^{n}(r_{i}+1). Proposition 3.3 implies that for homogeneous polynomials pp, we have m1uniform(p)≤m1Taylor(p)m^{\text{uniform}}_{1}(p)\leq m^{\text{Taylor}}_{1}(p).

We now show that this number of neurons is also necessary for approximating p(x)p({\bf x}). Suppose that Nϵ(x)N_{\epsilon}({\bf x}) is an ϵ\epsilon-approximation to p(x)p({\bf x}) with depth 1, and let the Taylor series of Nϵ(x)N_{\epsilon}({\bf x}) be p(x)+E(x)p({\bf x})+E({\bf x}). Let Ek(x)E_{k}({\bf x}) be the degree-kk homogeneous component of E(x)E({\bf x}), for 0≤k≤2d0\leq k\leq 2d. By the definition of ϵ\epsilon-approximation, sup⁡xE(x)\sup_{\bf x}E({\bf x}) goes to as ϵ\epsilon does, so by picking ϵ\epsilon small enough, we can ensure that the coefficients of each Ek(x)E_{k}({\bf x}) go to 0.

Let m=m1uniform(p)m=m^{\text{uniform}}_{1}(p) and suppose that σ(x)\sigma(x) has the Taylor expansion ∑k=0∞σkxk\sum_{k=0}^{\infty}\sigma_{k}x^{k}. Then, by grouping terms of each order, we conclude that there exist constants aija_{ij} and wjw_{j} such that

For each S⊆XS\subseteq X, let us take the derivative of this equation by every variable that occurs in SS, where we take multiple derivatives of variables that occur multiple times. This gives

Observe that there are r≡∏i=1n(ri+1)r\equiv\prod_{i=1}^{n}(r_{i}+1) choices for SS, since each variable xix_{i} can be included anywhere from to rir_{i} times. Define A{\bf A} to be the r×mr\times m matrix with entries AS,j=∏h∈SahjA_{S,j}=\prod_{h\in S}a_{hj}. We claim that A{\bf A} has full row rank. This would show that the number of columns mm is at least the number of rows r=∏i=1n(ri+1)r=\prod_{i=1}^{n}(r_{i}+1), proving the desired lower bound on mm.

However, the left-hand side of equation (9) tells us that this coefficient should be zero - a contradiction. We conclude that A{\bf A} has full row rank, and therefore that m1uniform(p)=m≥∏i=1n(ri+1)m^{\text{uniform}}_{1}(p)=m\geq\prod_{i=1}^{n}(r_{i}+1). This completes the proof of part (i).

We now consider part (ii) of the theorem. It follows from Proposition 4.6, part (ii) that, for each ii, we can Taylor-approximate xirix_{i}^{r_{i}} using 7⌈log⁡2(ri)⌉7\lceil\log_{2}(r_{i})\rceil neurons arranged in a deep network. Therefore, we can Taylor-approximate all of the xirix_{i}^{r_{i}} using a total of ∑i7⌈log⁡2(ri)⌉\sum_{i}7\lceil\log_{2}(r_{i})\rceil neurons. From Lin et al. (2017), we know that these nn terms can be multiplied using 4n4n additional neurons, giving us a total of ∑i(7⌈log⁡2(ri)⌉+4)\sum_{i}(7\lceil\log_{2}(r_{i})\rceil+4). Proposition 3.3 implies again that m1uniform(p)≤m1Taylor(p)m^{\text{uniform}}_{1}(p)\leq m^{\text{Taylor}}_{1}(p). This completes the proof.

2 Proof of Theorem 4.2.

As above, suppose that ri>0r_{i}>0 for i=1,…,ni=1,\ldots,n, and let XX be the multiset in which xix_{i} occurs with multiplicity rir_{i}.

It is shown in the proof of Theorem 4.1 that ∏i=1n(ri+1)\prod_{i=1}^{n}(r_{i}+1) neurons are sufficient to Taylor-approximate p(x)p(x). We now show that this number of neurons is also necessary for approximating p(x)p({\bf x}). Let m=m1Taylor(p)m=m^{\text{Taylor}}_{1}(p) and suppose that σ(x)\sigma(x) has the Taylor expansion ∑k=0∞σkxk\sum_{k=0}^{\infty}\sigma_{k}x^{k}. Then, by grouping terms of each order, we conclude that there exist constants aija_{ij} and wjw_{j} such that

For each S⊆XS\subseteq X, let us take the derivative of equations (10) and (11) by every variable that occurs in SS, where we take multiple derivatives of variables that occur multiple times. This gives

for ∣S∣≤k≤d−1|S|\leq k\leq d-1. Observe that there are r=∏i=1n(ri+1)r=\prod_{i=1}^{n}(r_{i}+1) choices for SS, since each variable xix_{i} can be included anywhere from to rir_{i} times. Define A{\bf A} to be the r×mr\times m matrix with entries AS,j=∏h∈SahjA_{S,j}=\prod_{h\in S}a_{hj}. We claim that A{\bf A} has full row rank. This would show that the number of columns mm is at least the number of rows r=∏i=1n(ri+1)r=\prod_{i=1}^{n}(r_{i}+1), proving the desired lower bound on mm.

Part (ii) of the theorem was demonstrated in the proof of Theorem 4.1. This completes the proof.

3 Proof of Theorem 4.3.

Our proof in Theorem 4.1 relied upon the fact that all nonzero partial derivatives of a monomial are linearly independent. This fact is not true for general polynomials pp; however, an exactly similar argument shows that m1uniform(p)m^{\text{uniform}}_{1}(p) is at least the number of linearly independent partial derivatives of pp, taken with respect to multisets of the input variables.

Consider the monomial qq of pp such that m1uniform(q)m^{\text{uniform}}_{1}(q) is maximized, and suppose that q(x)=x1r1x2r2⋯xnrnq({\bf x})=x_{1}^{r_{1}}x_{2}^{r_{2}}\cdots x_{n}^{r_{n}}. By Theorem 4.1, m1uniform(q)m^{\text{uniform}}_{1}(q) is equal to the number ∏i=1n(ri+1)\prod_{i=1}^{n}(r_{i}+1) of distinct monomials that can be obtained by taking partial derivatives of qq. Let QQ be the set of such monomials, and let DD be the set of (iterated) partial derivatives corresponding to them, so that for d∈Dd\in D, we have d(q)∈Qd(q)\in Q.

Consider the set of polynomials P={d(p)∣d∈D}P=\{d(p)\mid d\in D\}. We claim that there exists a linearly independent subset of PP with size at least ∣D∣/c|D|/c. Suppose to the contrary that P′P^{\prime} is a maximal linearly independent subset of PP with ∣P′∣<∣D∣/c|P^{\prime}|<|D|/c.

Since pp has cc monomials, every element of PP has at most cc monomials. Therefore, the total number of distinct monomials in elements of P′P^{\prime} is less than ∣D∣|D|. However, there are at least ∣D∣|D| distinct monomials contained in elements of PP, since for d∈Dd\in D, the polynomial d(p)d(p) contains the monomial d(q)d(q), and by definition all d(q)d(q) are distinct as dd varies. We conclude that there is some polynomial p′∈P\P′p^{\prime}\in P\backslash P^{\prime} containing a monomial that does not appear in any element of P′P^{\prime}. But then p′p^{\prime} is linearly independent of P′P^{\prime}, a contradiction since we assumed that P′P^{\prime} was maximal.

We conclude that some linearly independent subset of PP has size at least ∣D∣/c|D|/c, and therefore that the space of partial derivatives of pp has rank at least ∣D∣/c=m1uniform(q)/c|D|/c=m^{\text{uniform}}_{1}(q)/c. This proves part (i) of the theorem. Part (ii) follows immediately from the definition of muniform(p)m^{\text{uniform}}(p).

Similar logic holds for mTaylorm^{\text{Taylor}}.

4 Proof of Theorem 4.4.

We will prove the desired lower bounds for m1uniform(p)m^{\text{uniform}}_{1}(p); a very similar argument holds for m1Taylor(p)m^{\text{Taylor}}_{1}(p). As above, suppose that ri>0r_{i}>0 for i=1,…,ni=1,\ldots,n. Let XX be the multiset in which xix_{i} occurs with multiplicity rir_{i}.

Suppose that Nϵ(x)N_{\epsilon}({\bf x}) is an ϵ\epsilon-approximation to p(x)p({\bf x}) with depth 1, and let the degree-dd Taylor polynomial of Nϵ(x)N_{\epsilon}({\bf x}) be p(x)+E(x)p({\bf x})+E({\bf x}). Let Ed(x)E_{d}({\bf x}) be the degree-dd homogeneous component of E(x)E({\bf x}). Observe that the coefficients of the error polynomial Ed(x)E_{d}({\bf x}) can be made arbitrarily small by setting ϵ\epsilon sufficiently small.

Let m=m1uniform(p)m=m^{\text{uniform}}_{1}(p) and suppose that σ(x)\sigma(x) has the Taylor expansion ∑k=0∞σkxk\sum_{k=0}^{\infty}\sigma_{k}x^{k}. Then, by grouping terms of each order, we conclude that there exist constants aija_{ij} and wjw_{j} such that

For each S⊆XS\subseteq X, let us take the derivative of this equation by every variable that occurs in SS, where we take multiple derivatives of variables that occur multiple times. This gives

Consider this equation as S⊆XS\subseteq X varies over all CsC_{s} multisets of fixed size ss. The left-hand side represents a linear combination of the mm terms (∑i=1naijxi)d−s\left(\sum_{i=1}^{n}a_{ij}x_{i}\right)^{d-s}. The polynomials ∂∂Sp(x)+∂∂SEd(x)\frac{\partial}{\partial S}p({\bf x})+\frac{\partial}{\partial S}E_{d}({\bf x}) on the right-hand side must be linearly independent as SS varies, since the distinct monomials ∂∂Sp(x)\frac{\partial}{\partial S}p({\bf x}) are linearly independent and the coefficients of ∂∂SEd(x)\frac{\partial}{\partial S}E_{d}({\bf x}) can be made arbitrarily small.

This means that the number mm of linearly combined terms on the left-hand side must be at least the number CsC_{s} of choices for SS. Observe that CsC_{s} is the coefficient of the term ysy^{s} in the polynomial g(y)=∏i(1+y+…+yri)g(y)=\prod_{i}(1+y+\ldots+y^{r_{i}}). A simple (and not very good) lower bound for CsC_{s} is 1d∏i=1n(ri+1)\frac{1}{d}\prod_{i=1}^{n}(r_{i}+1), since there are ∏i=1n(ri+1)\prod_{i=1}^{n}(r_{i}+1) distinct sub-multisets of XX, and their cardinalities range from to dd.