Stronger generalization bounds for deep nets via a compression approach

Sanjeev Arora, Rong Ge, Behnam Neyshabur, Yi Zhang

Introduction

A mystery about deep nets is that they generalize (i.e., predict well on unseen data) despite having far more parameters than the number of training samples. One commonly voiced explanation is that regularization during training –whether implicit via use of SGD Neyshabur et al. (2015c); Hardt et al. (2016) or explicit via weight decay, dropout Srivastava et al. (2014), batch normalization Ioffe and Szegedy (2015), etc. –reduces the effective capacity of the net. But Zhang et al. (2017) questioned this received wisdom and fueled research in this area by showing experimentally that standard architectures using SGD and regularization can still reach low training error on randomly labeled examples (which clearly won’t generalize).

Clearly, deep nets trained on real-life data have some properties that reduce effective capacity, but identifying them has proved difficult —at least in a quantitative way that yields sample size upper bounds similar to classical analyses in simpler models such as SVMs Bartlett and Mendelson (2002); Evgeniou et al. (2000); Smola et al. (1998) or matrix factorization Fazel et al. (2001); Srebro et al. (2005).

Qualitatively Hochreiter and Schmidhuber (1997); Hinton and Van Camp (1993) suggested that nets that generalize well are flat minima in the optimization landscape of the training loss and Hinton and Van Camp (1993) further discusses the connections to Minimum Description Length principle for generalization. Recently Keskar et al. (2016) show using experiments with different batch-sizes that sharp minima do correlate with higher generalization error. A quantitative version of “flatness” was suggested in (Langford and Caruana, 2001): the net’s output is stable to noise added to the net’s trainable parameters. Using PAC-Bayes bound (McAllester, 1998, 1999) this noise stability yielded generalization bounds for fully connected nets of depth 22. The theory has been extended to multilayer fully connected nets (Neyshabur et al., 2017b), although thus far yields sample complexity bounds much worse than naive parameter counting. (Same holds for the earlier Bartlett and Mendelson (2002); Neyshabur et al. (2015b); Bartlett et al. (2017); Neyshabur et al. (2017a); Golowich et al. (2017); see Figure 4). Another notion of noise stability —closely related to dropout and batch normalization—is stability of the output with respect to the noise injected at the nodes of the network, which was recently shown experimentally (Morcos et al., 2018) to improve in tandem with generalization ability during training, and to be absent in nets trained on random data. Chaudhari et al Chaudhari et al. (2016) suggest adding noise to gradient descent to bias it towards finding flat minima.

While study of generalization may appear a bit academic — held-out data easily establishes generalization in practice— the ultimate hope is that it will help identify simple, measurable and intuitive properties of well-trained deep nets, which in turn may fuel superior architectures and faster training. We hope the detailed study —theoretical and empirical—in the current paper advances this goal.

A simple compression framework (Section 2) for proving generalization bounds, perhaps a more explicit and intuitive form of the PAC-Bayes work. It also yields elementary short proofs of recent generalization results (Section 2.2).

Identifying new form of noise-stability for deep nets: the stability of each layer’s computation to noise injected at lower layers. (Earlier papers worked only with stability of the output layer.) Figure 1 visualizes the stability of network w.r.t. Gaussian injected noise. Formal statements require a string of other properties (Section 3). All are empirically studied, including their correlation with generalization (Section 6).

Using the above properties to derive efficient and provably correct algorithms that reduce the effective number of parameters in the nets, yielding generalization bounds that: (a) are better than naive parameter counting (Section 6) (b) depend on simple, intuitive and measurable properties of the network (Section 4) (c) apply also to convolutional nets (Section 5) (d) empirically correlate with generalization (Section 6).

The main idea is to show that noise stability allows individual layers to be compressed via a linear-algebraic procedure Algorithm 1. This results in new error in the output of the layer. This added error is “gaussian-like” and tends to get attenuated as it propagates to higher layers.

Other related works. Dziugaite and Roy (2017) use non-convex optimization to optimize the PAC-Bayes bound get a non-vacuous sample bound on MNIST. While very creative, this provides little insight into favorable properties of networks. Liang et al. (2017) have suggested Fisher-Rao metric, a regularization based on the Fisher matrix and showed that this metric correlate with generalization. Unfortunately, they could only apply their method to linear networks. Recently Kawaguchi et al. (2017) connects Path-Norm Neyshabur et al. (2015a) to generalization. However, the proved generalization bound depends on the distribution and measuring it requires vector operations on exponentially high dimensional vectors. Other works have designed experiments to empirically evaluate potential properties of the network that helps generalizationArpit et al. (2017); Neyshabur et al. (2017b); Dinh et al. (2017). The idea of compressing trained deep nets is very popular for low-power applications; for a survey see (Cheng et al., 2018).

Finally, note that the terms compression and stability are traditionally used in a different sense in generalization theory Littlestone and Warmuth (1986); Kearns and Ron (1999); Shalev-Shwartz et al. (2010). Our framework is compared to other notions in the remarks after Theorem 2.1.

(Notice, the classification loss corresponds to γ=0\gamma=0.) Let L^γ\hat{L}_{\gamma} denote empirical estimate of the margin loss. Generalization error is the difference between the two.

For most of the paper we assume that deep nets have fully connected layers, and use ReLU activations. We treat convolutional nets in Section 5. If the net has dd layers, we label the vector before activation at these layers by x0x^{0}, x1x^{1}, … xdx^{d} for the dd layers where x0x^{0} is the input to the net, also denoted simply xx. So xi=Aiϕ(xi1)x^{i}=A^{i}\phi(x^{i-1}) where AiA^{i} is the weight matrix of the iith layer. (Here ϕ(x)\phi(x) if xx is a vector applies the ReLU component-wise. The ReLU is allowed a trainable bias parameter, which is omitted from the notation because it has no effect on any calculations below.) We denote the number of hidden units in layer ii by hih^{i} and set h=maxi=1dhih=\max_{i=1}^{d}h^{i}. Let fA(x)f_{A}(x) be the function calculated by the above network.

Stable rank of a matrix BB is BF2/B22\|B\|_{F}^{2}/\|B\|_{2}^{2}, where F\|\cdot\|_{F} denotes Frobenius norm and 2\|\cdot\|_{2} denotes spectral norm. Note that stable rank is at most (linear algebraic) rank.

For any two layer iji\leq j, denote by Mi,jM^{i,j} the operator for composition of these layers and Jxi,jJ^{i,j}_{x} be the Jacobian of this operator at input xx (a matrix whose p,qp,q is the partial derivative of the ppth output coordinate with respect to the qq’th input input). Therefore, we have xj=Mi,j(xi)x^{j}=M^{i,j}(x^{i}). Furthermore, since the activation functions are ReLU, we have Mi,j(xi)=Jxii,jxiM^{i,j}(x^{i})=J^{i,j}_{x^{i}}x^{i}.

Compression and Generalization

Our compression framework rests on the following obvious fact. Suppose the training data contains mm samples, and ff is a classifier from a complicated class (e.g., deep nets with much more than mm parameters) that incurs very low empirical loss. We are trying to understand if it will generalize. Now suppose we can compute a classifier gg with discrete trainable parameters much less than mm and which incurs similar loss on the training data as ff. Then gg must incur low classification error on the full distribution. This framework has the advantage of staying with intuitive parameter counting and to avoid explicitly dealing with the hypothesis class that includes ff (see note after Theorem 2.1). Notice, the mapping from ff to gg merely needs to exist, not to be efficiently computable. But in all our examples the mapping will be explicit and fairly efficient. Now we formalize the notions. The proofs are elementary via concentration bounds and appear in the appendix.

Let ff be a classifier and GA={gAAA}G_{\mathcal{A}}=\{g_{A}|A\in\mathcal{A}\} be a class of classifiers. We say ff is (γ,S\gamma,S)-compressible via GAG_{\mathcal{A}} if there exists AAA\in\mathcal{A} such that for any xSx\in S, we have for all yy

We also consider a different setting where the compression algorithm is allowed a“helper string” ss, which is arbitrary but fixed before looking at the training samples. Often ss will contain random numbers. A simple example is to let ss be the random initialization used for training the deep net. Then compress the difference between the final weights and ss; this can give better generalization bounds, similar to Dziugaite and Roy (2017). Other nontrivial examples appear later.

Suppose GA,s={gA,sAA}G_{\mathcal{A},s}=\{g_{A,s}|A\in\mathcal{A}\} is a class of classifiers indexed by trainable parameters AA and fixed strings ss. A classifier ff is (γ,S\gamma,S)-compressible with respect to GA,sG_{\mathcal{A},s} using helper string ss if there exists AAA\in\mathcal{A} such that for any xSx\in S, we have for all yy

Suppose GA,s={gA,sAA}G_{\mathcal{A},s}=\{g_{A,s}|A\in\mathcal{A}\} where AA is a set of qq parameters each of which can have at most rr discrete values and ss is a helper string. Let SS be a training set with mm samples. If the trained classifier ff is (γ,S)(\gamma,S)-compressible via GA,sG_{\mathcal{A},s} with helper string ss, then there exists AAA\in\mathcal{A} with high probability over the training set,

Remarks: (1) The framework proves the generalization not of ff but of its compression gAg_{A}. (An exception is if the two are shown to have similar loss at every point in the domain, not just the training set. This is the case in Theorem 2.2.) (2) The previous item highlights how our framework steps away away from uniform convergence framework, e.g., covering number arguments Dudley (2010); Anthony and Bartlett (2009). There, one needs to fix a hypothesis class independent of the training set. By contrast we have no hypothesis class, only a single neural net that has some specific properties (described in Section 3) on a single finite training set. But if we can compress this specific neural net to a simpler neural nets with fewer parameters then we can use covering number argument on this simpler class to get the generalization of the compressed net. (3) Issue (1) exists also in standard PAC-Bayes framework for deep nets (see tongue-in-cheek title of (Langford and Caruana, 2001)). They yield generalization bounds not for ff but for a noised version of ff (i.e., net given by W+ηW+\eta, where WW is parameter vector of ff and η\eta is a noise vector). For us issue (1) could be fixed by showing that if ff satisfies the properties of Section 3 on training data then it satisfies them on the entire domain. This is left for future work.

A classifier with margin γ\gamma can be compressed to one that has only O(1/γ2)O(1/\gamma^{2}) non-zero entries. For each coordinate ii, toss a coin with Pr[heads]=8ci2/γ2\Pr[heads]=8c_{i}^{2}/\gamma^{2} and if it comes up heads set the coordinate to equal to γ2/8ci\gamma^{2}/8c_{i} (see Algorithm 2 in supplementary material). This yields a vector c^\hat{c} with only O(1/γ2)O(1/\gamma^{2}) nonzero entries such that for any vector uu, with reasonable probability c^ucuγ|\hat{c}^{\top}u-c^{\top}u|\leq\gamma, so c^\hat{c} and cc will make the same prediction. We can then apply Theorem 2.1 on a discretized version of c^\hat{c} to show that the sparsified classifier has good generalization with O(logd/γ2)O(\log d/\gamma^{2}) samples.

This compressed classifier works correctly for a fixed input xx with good probability but not high probability. To fix this, one can recourse to the “compression with fixed string” model. The fixed string is a random linear transformation. When applied to unit vector xx, it tends to equalize all coordinates and the guarantee c^ucuγ|\hat{c}^{\top}u-c^{\top}u|\leq\gamma can hold with high probability. This random linear transformation can be fixed before seeing the training data. Similar approach was discussed by Blum (2006) for linear classifiers. See Section A.2 in supplementary material for more details.

2 Example 2: Existing generalization bounds

Our compression framework gives easy and short proof of the generalization bounds of a recent paper; see appendix for slightly stronger result of Bartlett et al. (2017).

(Neyshabur et al. (2017a)) For a deep net with layers A1,A2,AdA^{1},A^{2},\ldots A^{d} and output margin γ\gamma on a training set SS, the generalization error can be bounded by

The second part of this expression (i=1dAiF2Ai22\sum_{i=1}^{d}\frac{\|A^{i}\|_{F}^{2}}{\|A^{i}\|_{2}^{2}}) is sum of stable ranks of the layers, a natural measure of their true parameter count. The first part (i=1dAi22\prod_{i=1}^{d}\|A^{i}\|_{2}^{2}) is related to the Lipschitz constant of the network, namely, the maximum norm of the vector it can produce if the input is a unit vector. The Lipschitz constant of a matrix operator BB is just its spectral norm B2\|B\|_{2}. Since the network applies a sequence of matrix operations interspersed with ReLU, and ReLU is 11-Lipschitz we conclude that the Lipschitz constant of the full network is at most i=1dAi2.\prod_{i=1}^{d}\|A^{i}\|_{2}.

To prove Theorem 2.2 we use the following lemma to compress the matrix at each layer to a matrix of smaller rank. Since a matrix of rank rr can be expressed as the product of two matrices of inner dimension rr, it has 2hr2hr parameters (instead of the trivial h2h^{2}). (Furthermore, the parameters can be discretized via trivial rounding to get a compression with discrete parameters as needed by Definition 1.)

Let rr be the rank of A^\hat{A}. By construction, the maximum singular value of A^A\hat{A}-A is at most δA2\delta\|A\|_{2}. Since the remaining singular values are at least δA2\delta\|A\|_{2}, we have AFA^FrδA2\|A\|_{F}\geq\|\hat{A}\|_{F}\geq\sqrt{r}\delta\|A\|_{2}.∎

For each ii replace layer ii by its compression using the above lemma, with δ=γ(3xdi=1dAi2)1\delta=\gamma(3\|x\|d\prod_{i=1}^{d}\|A^{i}\|_{2})^{-1}. How much error does this introduce at each layer and how much does it affect the output after passing through the intermediate layers (and getting magnified by their Lipschitz constants)? Since AAi^A-\hat{A^{i}} has spectral norm (i.e., Lipschitz constant) at most δ\delta, the error at the output due to changing layer ii in isolation is at most δxij=1dAj2γ/3d\delta\|x^{i}\|\prod_{j=1}^{d}\|A^{j}\|_{2}\leq\gamma/3d.

A simple induction (see Neyshabur et al. (2017a) if needed) can now show the total error incurred in all layers is bounded by γ\gamma. The generalization bound follows immediately from Theorem 2.1.

Noise stability properties of deep nets

This section introduces noise stability properties of deep nets that imply better compression (and hence generalization). They help overcome the pessimistic error analysis of our proof of Theorem 2.2: when a layer was compressed, the resulting error was assumed to blow up in a worst-case manner according to the Lipschitz constant (namely, product of spectral norms of layers). This hurt the amount of compression achievable. The new noise stability properties roughly amount to saying that noise injected at a layer has very little effect on the higher layers. Our formalization starts with noise sensitivity, which captures how an operator transmits noise vs signal.

If MM is a mapping from real-valued vectors to real-valued vectors, and N{\mathcal{N}} is some noise distribution then noise sensitivity of MM at xx with respect to N{\mathcal{N}}, is

The noise sensitivity of MM with respect to N{\mathcal{N}} on a set of inputs SS, denoted ψN,S(M)\psi_{{\mathcal{N}},S}(M), is the maximum of ψN(M,x)\psi_{{\mathcal{N}}}(M,x) over all inputs xx in SS.

To illustrate, we examine noise sensitivity of a matrix (i.e., linear mapping) with respect to Gaussian distribution. Low sensitivity turns out to imply that the matrix has some large singular values (i.e., low stable rank), which give directions that can preferentially carry the “signal”xx whereas noise η\eta attenuates because it distributes uniformly across directions.

The noise sensitivity of a matrix MM at any vector x0x\neq 0 with respect to Gaussian distribution N(0,I){\mathcal{N}}(0,I) is exactly MF2x2/Mx2\|M\|_{F}^{2}\|x\|^{2}/\|Mx\|^{2}, and at least its stable rank.

Thus noise sensitivity ψ\psi at xx is MF2x2/Mx2\|M\|_{F}^{2}\|x\|^{2}/\|Mx\|^{2}, which is at least the stable rank MF2/M22\|M\|_{F}^{2}/\|M\|_{2}^{2} since MxM2x\|Mx\|\leq\|M\|_{2}\|x\|. ∎

The above proposition suggests that if a vector xx is aligned to a matrix MM (i.e. correlated with high singular directions of MM), then matrix MM becomes less sensitive to noise at xx. This intuition will be helpful in understanding the properties we define later to formalize noise stability.

The above discussion motivates the following approach. We compress each layer ii by an appropriate randomized compression algorithm, such that the noise/error in its output is “Gaussian-like”. If layers i+1i+1 and higher have low sensitivity to this new noise, then the compression can be more extreme producing much higher noise. We formalize this idea using Jacobian Ji,jJ^{i,j}, which describes instantaneous change of Mi,j(x)M^{i,j}(x) under infinitesimal perturbation of xx.

Now we formalize the error-resilience properties. Section 6 reports empirical findings about these properties. The first is cushion, to be thought of roughly as reciprocal of noise sensitivity. We first formalize it for single layer.

The layer cushion of layer ii is similarly defined to be the largest number μi\mu_{i} such that for any xSx\in S, μiAiFϕ(xi1)Aiϕ(xi1)\mu_{i}\|A^{i}\|_{F}\|\phi(x^{i-1})\|\leq\|A^{i}\phi(x^{i-1})\|.

Intuitively, cushion considers how much smaller the output Aiϕ(xi1)A^{i}\phi(x^{i-1}) is compared to the upper bound AiFϕ(xi1)\|A^{i}\|_{F}\|\phi(x^{i-1})\|. Using argument similar to Proposition 3.1, we can see that 1/μi21/\mu_{i}^{2} is equal to the noise sensitivity of matrix AiA^{i} at input ϕ(xi1)\phi(x^{i-1}) with respect to Gaussian noise ηN(0,I)\eta\sim{\mathcal{N}}(0,I).

For any two layers iji\leq j, we define the interlayer cushion μi,j\mu_{i,j} as the largest number such that for any xSx\in S:

Furthermore, for any layer ii we define the minimal interlayer cushion as μi=minijdμi,j=min{1/hi,mini<jdμi,j}\mu_{i\rightarrow}=\min_{i\leq j\leq d}\mu_{i,j}=\min\{1/\sqrt{h^{i}},\min_{i<j\leq d}\mu_{i,j}\}Note that Jxii,i=IJ_{x^{i}}^{i,i}=I and μi,i=1/hi\mu_{i,i}=1/\sqrt{h^{i}}.

Since Jxi,jJ^{i,j}_{x} is a linear transformation, a calculation similar to Proposition 3.1 shows that its noise sensitivity at xix^{i} with respect to Gaussian distribution N(0,I)\mathcal{N}(0,I) is at most 1μij2\frac{1}{\mu_{ij}^{2}}.

The next property quantifies the intuitive observation on the learned networks that for any training data, almost half of the ReLU activations at each layer are active. If the input to the activations is well-distributed and the activations do not correlate with the magnitude of the input, then one would expect that on average, the effect of applying activations at any layer is to decrease the norm of the pre-activation vector by at most some small constant factor.

The activation contraction cc is defined as the smallest number such that for any layer ii and any xSx\in S,

We discussed how the interlayer cushion captures noise-resilience of the network if it behaves linearly, namely, when the set of activated ReLU gates does not change upon injecting noise. In general the activations do change, but the deviation from linear behavior is bounded for small noise vectors, as quantified next.

Let η\eta be the noise generated as a result of substituting weights in some of the layers before layer ii using Algorithm 1. We define interlayer smoothness ρδ\rho_{\delta} to be the smallest number such that with probability 1δ1-\delta over noise η\eta for any two layers i<ji<j any xSx\in S:

In order to understand the above condition, we can look at a single layer case where j=i+1j=i+1:

where \odot is the entry-wise product operator and ν=(ϕ(xi+η)ϕ(xi))(xi+η)\nu=(\phi^{\prime}(x^{i}+\eta)-\phi^{\prime}(x^{i}))\odot(x^{i}+\eta). Since the activation function is ReLU, ϕ(xi+η)\phi^{\prime}(x^{i}+\eta) and ϕ(xi))\phi^{\prime}(x^{i})) disagree whenever the perturbation has the opposite sign and higher absolute value compared to the input and hence νη\|\nu\|\leq\|\eta\|.

Let us first see what happens if the perturbation ν\nu is adversarially aligned to the weights:

where ri+1r_{i+1} is the stable rank of layer i+1i+1. Therefore the interlayer smoothness from layer ii to layer i+1i+1 is at least ρδ=μi+1ri+1/c\rho_{\delta}=\mu_{i+1}r_{i+1}/c. However, the noise generated from Algorithm 1 has similar properties to Gaussian noise (see Lemma 2). If ν\nu behaves similar to Gaussian noise, then Ai+1νAi+1Fν/hi\|A^{i+1}\nu\|\approx\|A^{i+1}\|_{F}\|\nu\|/\sqrt{h^{i}} and therefore ρδ\rho_{\delta} is as high as hiμi+1/c\sqrt{h^{i}\mu_{i+1}/c}. Since the layer cushion of networks trained on real data is much more than that of networks with random weights, ρδ\rho_{\delta} is greater than one in this case. Another observation is that in practice, the noise is well-distributed and only a small portion of activations change from active to inactive and vice versa. Therefore, we can expect ν\|\nu\| to be smaller than η\|\eta\| which further improves the interlayer smoothness. This appeared in Neyshabur et al. (2017b) that showed for one layer we can even use η1.5xjρδxi\frac{\|\eta\|^{1.5}\|x^{j}\|}{\rho_{\delta}\|x^{i}\|} as the RHS of interlayer smoothness. Our current proof requires 1/ρδ1/\rho_{\delta} to be of order 1/d1/d, this requirement can be removed (with ρδ\rho_{\delta} appear in sample complexity) if we make the stronger assumption that the RHS is a lower order term in η\|\eta\|.

In general, for a single layer, ρδ\rho_{\delta} captures the ratio of input/weight alignment to noise/weight alignment. Since the noise behaves similar to Gaussian, one expects this number to be greater than one for a single layer. When j>i+1j>i+1, the weights and activations create more dependencies. However, since these dependences are applied on both noise and input, we again expect that if the input is more aligned to the weights than noise, this should not change in higher layers. In Section 6, we show that the interlayer smoothness is indeed good: 1/ρδ1/\rho_{\delta} is a small constant.

Fully Connected Networks

We prove generalization bounds using for fully connected multilayer nets. Details appear in Appendix Section B.

where μi\mu_{i}, μi\mu_{i\rightarrow}, cc and ρδ\rho_{\delta} are layer cushion, interlayer cushion, activation contraction and interlayer smoothness defined in Definitions 4,5,6 and 7 respectively.

To prove this we describe a compression of the net with respect to a fixed (random) string. In contrast to the deterministic compression of Lemma 1, this randomized compression ensures that the resulting error in the output behaves like a Gaussian. The proofs are similar to standard JL dimension reduction.

Note that the helper string of random matrices MiM_{i}’s were chosen and fixed before training set SS was picked. Each weight matrix is thus represented as only kk real numbers A,Mi\langle A,M_{i}\rangle for i=1,2,...,ki=1,2,...,k.

Lemma 2 can be used to upper bound the change in the network output after compressing a single layer if the activation patterns remain the same. For any layer, in the lemma statement take xx to be the input to the layer, AA to be the layer weight matrix, and UU to be the Jacobian of the network output with respect to the layer output. Network output before and after compression can then be calculated by the matrix products UAxUAx and UA^xU\hat{A}x respectively. Hence, the lemma bounds the distance between network output before and after compression.

Next Lemma bounds the number of parameters of the compressed network resulting from applying Algorithm 1 to all the layer matrices of the net. The proof does induction on the layers and bounds the effect of the error on the output of the network using properties defined in Section 3.1.

where μi\mu_{i}, μi\mu_{i\rightarrow}, cc and ρδ\rho_{\delta} are layer cushion, interlayer cushion, activation contraction and interlayer smoothness defined in Definitions 4,5,6 and 7 respectively.

(i) Empirically it has been observed that deep net training introduces fairly small changes to parameters as compared to the (random) initial weights Dziugaite and Roy (2017). We can exploit this by incorporating the random initial weights into the helper string and do the entire proof above not with the layer matrices AiA^{i} but only the difference from the initial starting point. Experiments in Section 6 show this improves the bounds. (ii) Cushions and other quantities defined earlier are data-dependent, and required to hold for the entire training set. However, the proofs go through if we remove say ζ\zeta fraction of outliers that violate the definitions; this allows us to use more favorable values for cushion etc. and lose an additive factor ζ\zeta in the generalization error.

Convolutional Neural Networks

Now we sketch how to provably compress convolutional nets. (Details appear in Section C of supplementary.) Intuitively, this feels harder because the weights are already compressed— they’re shared across patches!

where μi\mu_{i}, μi\mu_{i\rightarrow}, cc, ρδ\rho_{\delta} and β\beta are layer cushion, interlayer cushion, activation contraction, interlayer smoothness and well-distributed Jacobian defined in Definitions 4,8,6, 7 and 9 respectively. Furthermore, sis_{i} and κi\kappa_{i} are stride and filter width in layer ii.

Let’s realize that obvious extensions of earlier sections fail. Suppose layer ii of the neural network is an image of dimension n1i×n2in^{i}_{1}\times n^{i}_{2} and each pixel has hih^{i} channels, the size of the filter at layer ii is κi×κi\kappa_{i}\times\kappa_{i} with stride sis_{i}. The convolutional filter has dimension hi1×hi×κi×κih^{i-1}\times h^{i}\times\kappa_{i}\times\kappa_{i}. Applying matrix compression (Algorithm 1) independently to each copy of a convolutional filter makes number of new parameters proportional to n1in2in^{i}_{1}n^{i}_{2}, a big blowup.

Compressing a convolutional filter once and reusing it in all patches doesn’t work because the interlayer analysis implicitly requires the noise generated by the compression to behave similar to a spherical Gaussian, but the shared filters introduce correlations. Quantitatively, using the fully connected analysis would require the error to be less than interlayer cushion value μi\mu_{i\to} (Definition 5) which is at most 1/hin1in2i1/\sqrt{h^{i}n^{i}_{1}n^{i}_{2}}, and this can never be achieved from compressing matrices that are far smaller than n1i×n2in^{i}_{1}\times n^{i}_{2} to begin with.

We end up with a solution in between fully independent and fully dependent: p-wise independence. The algorithm generates pp-wise independent compressed filters A^(a,b)\hat{A}_{(a,b)} for each convolution location (a,b)[n1i]×[n2i](a,b)\in[n^{i}_{1}]\times[n^{i}_{2}]. It results in pp times more parameters than a single compression. If pp grows logarithmically with relevant parameters, the filters behave like fully independent filters. Using this idea we can generalize the definition of interlayer margin to the convolution setting:

For any two layers iji\leq j, we define the interlayer cushion μi,j\mu_{i,j} as the largest number such that for any xSx\in S:

Furthermore, for any layer ii we define the minimal interlayer cushion as μi=minijdμi,j=min{1/hi,mini<jdμi,j}\mu_{i\rightarrow}=\min_{i\leq j\leq d}\mu_{i,j}=\min\{1/\sqrt{h^{i}},\min_{i<j\leq d}\mu_{i,j}\}Note that Jxii,i=IJ_{x^{i}}^{i,i}=I and μi,i=1/hi\mu_{i,i}=1/\sqrt{h^{i}}.

Recall that interlayer cushion is related to the noise sensitivity of Jxii,jJ^{i,j}_{x^{i}} at xix^{i} with respect to Gaussian distribution N(0,I)\mathcal{N}(0,I). When we consider Jxii,jJ^{i,j}_{x^{i}} applied to a noise η\eta, if different pixels in η\eta are independent Gaussians, then we can indeed expect Jxii,jη1hin1in2iJxii,jη\|J^{i,j}_{x^{i}}\eta\|\approx\frac{1}{\sqrt{h^{i}n^{i}_{1}n^{i}_{2}}}\|J^{i,j}_{x^{i}}\|\|\eta\|, which explains the extra 1n1in2i\frac{1}{\sqrt{n^{i}_{1}n^{i}_{2}}} factor in Definition 8 compared to Definition 5. The proof also needs to assume —in line with intuition behind convolution architecture— that information from the entire image field is incorporated somewhat uniformly across pixels. It is formalized using the Jacobian which gives the partial derivative of the output with respect to pixels at previous layer.

Empirical Evaluation

We study noise stability properties (defined in Section 3) of an actual trained deep net, and compute a generalization bound from Theorem 5.1. Experiments were performed by training a VGG-19 architecture Simonyan and Zisserman (2014) and a AlexNet Krizhevsky et al. (2012) for multi-class classification task on CIFAR-10 dataset. Optimization used SGD with mini-batch size 128, weight decay 5e-4, momentum 0.90.9 and initial learning rate 0.050.05, but decayed by factor 2 every 30 epochs. Drop-out was used in fully-connected layers. We trained both networks for 299 epochs and the final VGG-19 network achieved 100%100\% training and 92.45%92.45\% validation accuracy while the AlexNet achieved 100%100\% training and 77.22%77.22\% validation accuracy. To investigate the effect of corrupted label, we trained another AlexNet, with 100%100\% training and 9.86%9.86\% validation accuracy, on CIFAR-10 dataset with randomly shuffled labels.

Our estimate of the sample complexity bound used exact computation of norms of weight matrices (or tensors) in all bounds(A1,,A1,2,A2,AF||A||_{1,\infty},||A||_{1,2},||A||_{2},||A||_{F}). Like previous bounds in generalization theory, ours also depend upon nuisance parameters like depth dd, logarithm of hh, etc. which probably are an artifact of the proof. These are ignored in the computation (also in computing earlier bounds) for simplicity. Even the generalization based on parameter counting arguments does have an extra dependence on depth Bartlett et al. (2017). A recent work, Golowich et al. (2017) showed that many such depth dependencies can be improved.

Section 3 identifies four properties in the networks that contribute to noise-stability: layer cushion, interlayer cushion, contraction, interlayer smoothness. Figure 2 plots the distribution of over different data points in the training set and compares to a Gaussian random network and then scaled properly. The layer cushion, which quantifies its noise stability, is drastically improved during the training, especially for the higher layers (88 and higher) where most parameters live. Moreover, we observe that interlayer cushion, activation contraction and interlayer smoothness behave nicely even after training. These plots suggest that the driver of the generalization phenomenon is layer cushion. The other properties are being maintained in the network and prevent the network from falling prey to pessimistic assumptions that causes the other older generalization bounds to be very high. The assumptions made in section 3 (also in B.1) are verified on the VGG-19 net in appendix D.1 by histogramming the distribution of layer cushion, interlayer cushion, contraction, interlayer smoothness, and well-distributedness of the Jacobians of each layer of the net on each data point in the training set. Some examples are shown in Figure 2.

2 Correlation to generalization error

We evaluate our generalization bound during the training, see Figure 4, Right. After 120 epochs, the training error is almost zero but the test error continues to improve in later epochs. Our generalization bound continues to improve, though not to the same level. Thus our generalization bound captures part of generalization phenomenon, not all. Still, this suggests that SGD somehow improves our generalization measure implicitly. Making this rigorous is a good topic for further research.

Furthermore, we investigate effect of training with normal data and corrupted data by training two AlexNets respectively on original and corrupted CIFAR-10 with randomly shuffled labels. We identify two key properties that differ significantly between the two networks: layer cushion and activation contraction, see 4. Since our bound predicts larger cushion and lower contraction indicates better generalization, our bound is consistent w with the fact that the net trained on normal data generalizes (77.22%77.22\% validation accuracy).

3 Comparison to other generalization bounds

Table 1 shows the compressibility of various layers according to the bounds given by our theorem. Again, this is a qualitative due to ignoring nuisance factors, but it gives an idea of which layers are important in the calculation.

Conclusions

With a new compression-based approach, the paper has made progress on several open issues regarding generalization properties of deep nets. The approach also adapts specially to convolutional nets. The empirical verification of the theory in Section 6 shows a rich set of new properties satisfied by deep nets trained on realistic data, which we hope will fuel further theory work on deep learning, including how these properties play into optimization and expressivity. Another possibility is a more rigorous understanding of deep net compression, which sees copious empirical work motivated by low-power applications. Perhaps our p-wise independence idea used for compressing convnets (Section 5) has practical implications.

Acknowledgements

This research was done with support from NSF, ONR, Simons Foundation, Mozilla Research, and Schmidt Foundation.

References

Appendix A Complete proofs for Section 2

In this section we give proofs of the various statements.

We will first prove Theorem 2.1, which gives generalization guarantees for the compressed function.

(Theorem 2.1) The proof is a basic application of concentration bounds and union bound and appears in the appendix.

For each AAA\in\mathcal{A}, the training loss L^0(gA)\hat{L}_{0}(g_{A}) is just the average of nn i.i.d. Bernoulli random variables with expectation equal to L0(gA)L_{0}(g_{A}). Therefore by Chernoff bound we have

Therefore, suppose we choose τ=(mlogqn)\tau=\left(\sqrt{\frac{m\log q}{n}}\right), with probability at least 1exp(2mlogq)1-\exp(-2m\log q) we have L0(gA)L^0(gA)+τL_{0}(g_{A})\leq\hat{L}_{0}(g_{A})+\tau. There are only qmq^{m} different AAA\in\mathcal{A}, hence by union bound, with probability at least 1exp(mlogq)1-\exp(-m\log q), for all AAA\in\mathcal{A} we have

Next, since ff is (γ,S)(\gamma,S)-compressible with respect to gg, there exists AAA\in\mathcal{A} such that for xSx\in S and any yy we have

For these training examples, as long as the original function ff has margin at least γ\gamma, the new function gAg_{A} classifies the example correctly. Therefore

Combining these two steps, we immediately get the result. ∎

Using the same approach, we can also prove the following Corollaries that allow the compression to fail with some probability

In the setting of Theorem 2.1, if the compression works for 1ζ1-\zeta fraction of the training sample, then with high probability

The proof is using the same approach, except in this case we have

A.2 Example 1: Compress a Vector

This section gives detailed calculations supporting the first example in Section 2.

Algorithm 2 Vector-Compress(γ\gamma, cc) returns a vector c^\hat{c} such that for any fixed uu (independent of choice of c^\hat{c}), with probability at least 1η1-\eta, c^ucuγ|\hat{c}^{\top}u-c^{\top}u|\leq\gamma. The vector c^\hat{c} has at most O((logh)/ηγ2)O((\log h)/\eta\gamma^{2}) non-zero entries with high probability.

On the other hand, the expected number of non-zero entries in c^\hat{c} is i=1dpi=2/ηγ2\sum_{i=1}^{d}p_{i}=2/\eta\gamma^{2}. By Chernoff bound we know with high probability the number of non-zero entries is at most O((logh)/ηγ2)O((\log h)/\eta\gamma^{2}). ∎

Combining the above two lemmas, we know there is a compression algorithm with O((logh)/ηγ2)O((\log h)/\eta\gamma^{2}) discrete parameters that works with probability at least 1η1-\eta. Applying Corollary A.1 we get

For any number of sample mm, there is an efficient algorithm to generate a compressed vector c^\hat{c}, such that

Note that the rate we have here is not optimal as it depends on m1/3m^{1/3} instead of m\sqrt{m}. This is mostly due to Lemma 4 cannot give a high probability bound (indeed if we consider all the basis vectors as the test vectors uu, Vector-Compress is always going to fail on some of them).

To fix this problem we use a different algorithm that uses a helper string, see Algorithm 3

Note that in Algorithm 3, the parameters for the output are the ziz_{i}’s. The vectors viv_{i}’s are sampled independently, and hence can be considered to be in the helper string.

For any fixed vector uu, Algorithm 3 \mboxVectorProject(c,γ)\mbox{Vector-Project}(c,\gamma) produces a vector c^\hat{c} such that with probability at least 1η1-\eta, we have c^ucuγ|\hat{c}^{\top}u-c^{\top}u|\leq\gamma.

This is in fact a well-known corollary of Johnson-Lindenstrauss Lemma. Observe that

The discretization is easy to check as with high probability the matrix VV with columns viv_{i}’s have spectral norm at most 2h2\sqrt{h}, so the vector before and after discretization can only change by γ/2\gamma/2. ∎

For any number of sample mm, there is an efficient algorithm with helper string to generate a compressed vector c^\hat{c}, such that

We will choose η=1/m\eta=1/m. By Lemma 7, we know there is a compression algorithm that works with probability 1η1-\eta, and has at most O((log1/η)/γ2)O((\log 1/\eta)/\gamma^{2}) parameters. By Corollary A.1, we know

A.3 Proof for Generalization Bound in Neyshabur et al. [2017a]

We gave a compression in Lemma 1, the discretization in this case is trivial just by rounding the weights to nearest multiples of AF/h2\|A\|_{F}/h^{2}. The following lemma from Neyshabur et al. [2017a] (based on a simple induction of the noise) shows how the noises from different layers add up.

Let fAf_{A} be a dd-layer network with weights A={A1,,Ad}A=\{A^{1},\dots,A^{d}\}. Then for any input xx, weights AA and A^\hat{A}, if for any layer ii, AiA^i1dAi\|A^{i}-\hat{A}^{i}\|\leq\frac{1}{d}\|A^{i}\|, then we have:

Compressing each layer ii with δ=δ=γ(exdi=1dAi2)1\delta=\delta=\gamma(e\|x\|d\prod_{i=1}^{d}\|A^{i}\|_{2})^{-1} ensures fA(x)fA^(x)γ|f_{A}(x)-f_{\hat{A}}(x)|\leq\gamma. Since each A^i\hat{A}^{i} has rank AiF2δ2Ai22\frac{\|A^{i}\|_{F}^{2}}{\delta^{2}\|A^{i}\|_{2}^{2}}, the total number of parameters of the compressed network will be 2e2d2hx2i=1dAi22i=1dAiF2Ai222e^{2}d^{2}h\|x\|^{2}\prod_{i=1}^{d}\|A^{i}\|_{2}^{2}\sum_{i=1}^{d}\frac{\|A^{i}\|_{F}^{2}}{\|A^{i}\|_{2}^{2}}. Therefore we can apply Theorem 2.1 to get the generalization bound.

Appendix B Complete Proofs for Section 4

We discussed and verified several conditions in Section 3. Here, we formally state these conditions:

Layer cushion (μi\mu_{i}): For any layer ii, we define the layer cushion μi\mu_{i} as the largest number such that for any xSx\in S:

Interlayer cushion (μi,j\mu_{i,j}): For any two layers iji\leq j, we define interlayer cushion μi,j\mu_{i,j} as the largest number such that for any xSx\in S:

Furthermore, we define minimal interlayer cushion μi=minijdμi,j=min{1/hi,mini<jdμi,j}\mu_{i\rightarrow}=\min_{i\leq j\leq d}\mu_{i,j}=\min\{1/\sqrt{h^{i}},\min_{i<j\leq d}\mu_{i,j}\}.

Activation contraction (cc): The activation contraction cc is defined as the smallest number such that for any layer ii and any xSx\in S,

Interlayer smoothness (ρδ\rho_{\delta}): Interlayer smoothness is defined the smallest number such that with probability 1δ1-\delta over noise η\eta for any two layers i<ji<j any xSx\in S:

B.2 Proofs

(of Lemma 2) For any fixed vectors u,vu,v, we have

This is exactly the same as the case of Johnson-Lindenstrauss transformation. By standard concentration inequalities we know

Now for any pair of matrix/vector (U,x)G(U,x)\in G, let uiu_{i} be the ii-th row of UU, by union bound we know with probability at least 1δ1-\delta for all uiu_{i} we have ui(A^A)vεAFuiv|u_{i}^{\top}(\hat{A}-A)v\|\leq\varepsilon\|A\|_{F}\|u_{i}\|\|v\|. Since U(A^A)x2=i=1n(ui(A^A)x)2\|U(\hat{A}-A)x\|^{2}=\sum_{i=1}^{n}(u_{i}^{\top}(\hat{A}-A)x)^{2} and UF2=i=1nui2\|U\|_{F}^{2}=\sum_{i=1}^{n}\|u_{i}\|^{2}, we immediately get U(A^A)xεAFUFx\|U(\hat{A}-A)x\|\geq\varepsilon\|A\|_{F}\|U\|_{F}\|x\|. ∎

For the base case i=0i=0, since we are not perturbing the input, the inequality is trivial. Now assuming that the induction hypothesis is true for i1i-1, we consider what happens at layer ii. Let A^i\hat{A}^{i} be the result of Algorithm 1 on AiA^{i} with εi=εμiμi4cd\varepsilon_{i}=\frac{\varepsilon\mu_{i}\mu_{i\rightarrow}}{4cd} and η=δ6d2h2m\eta=\frac{\delta}{6d^{2}h^{2}m}. We can now apply Lemma 2 on the set G={(Jxii,j,xi)xS,ji}G=\{(J^{i,j}_{x^{i}},x^{i})|x\in S,j\geq i\} which has size at most dmdm. Let Δi=A^iAi\Delta^{i}=\hat{A}^{i}-A^{i}, for any jij\geq i we have

The second term can be bounded by (i1)εxj/d(i-1)\varepsilon\|x^{j}\|/d by induction hypothesis. Therefore, in order to prove the induction, it is enough to show that the first term is bounded by ε/d\varepsilon/d. We decompose the error into two error terms one of which corresponds to the error propagation through the network if activation were fixed and the other one is the error caused by change in the activations:

The first term can be bounded as follows:

Both terms can be bounded using interlayer smoothness condition of the network. First, notice that Aiϕ(x^i1)=x^i1iA^{i}\phi(\hat{x}^{i-1})=\hat{x}^{i}_{i-1}. Therefore by induction hypothesis Aiϕ(x^i1)xi(a1)εxi/dεxi\|A^{i}\phi(\hat{x}^{i-1})-x^{i}\|\leq(a-1)\varepsilon\|x^{i}\|/d\leq\varepsilon\|x^{i}\|. Now by interlayer smoothness property, (Mi,jJxii,j)(Aiϕ(x^i1)xbερδ(ε/3d)xj\|(M^{i,j}-J^{i,j}_{x^{i}})(A^{i}\phi(\hat{x}^{i-1})\|\leq\frac{\|x^{b}\|\varepsilon}{\rho_{\delta}}\leq(\varepsilon/3d)\|x^{j}\|. On the other hand, we also know A^iϕ(x^i1)=x^i1i+Δiϕ(x^i1)\hat{A}^{i}\phi(\hat{x}^{i-1})=\hat{x}^{i}_{i-1}+\Delta^{i}\phi(\hat{x}^{i-1}), therefore A^iϕ(x^i1)xiAiϕ(x^i1)xi+Δiϕ(x^i1)(i1)ε/d+ε/3dε\|\hat{A}^{i}\phi(\hat{x}^{i-1})-x^{i}\|\leq\|A^{i}\phi(\hat{x}^{i-1})-x^{i}\|+\|\Delta^{i}\phi(\hat{x}^{i-1})\|\leq(i-1)\varepsilon/d+\varepsilon/3d\leq\varepsilon, so again we have (Mi,jJxii,j)(A^iϕ(x^i1))(ε/3d)xj\|(M^{i,j}-J^{i,j}_{x^{i}})(\hat{A}^{i}\phi(\hat{x}^{i-1}))\|\leq(\varepsilon/3d)\|x^{j}\|. Putting everything together completes the induction. ∎

where μi\mu_{i}, μi\mu_{i\rightarrow}, cc and ρδ\rho_{\delta} are layer cushion, interlayer cushion, activation contraction and interlayer smoothness defined in Definitions 4,5,6 and 7 respectively.

Because of positive homogeneity of ReLU activations, we can assume without loss of generality that the network is balanced, i.e for any iji\neq j, AiF=AjF=β\|A_{i}\|_{F}=\|A_{j}\|_{F}=\beta (otherwise, one could rebalance the network before approximation and cushion in invariant to this rebalancing). Therefore, for any xSx\in S we have:

where the last inequality is because by Lemma 10, e2dfA(x)γβi=1dμi<q\frac{e^{2}d\|f_{A}(x)\|}{\gamma\beta\prod_{i=1}^{d}\mu_{i}}<\sqrt{q}. Since the absolute value of each parameter in layer ii is at most βh\beta h, the logarithm of number of choices for each parameter in order to get ε\varepsilon-cover is log(qh2/ε)2log(qh/ε)\log(qh^{2}/\varepsilon)\leq 2\log(qh/\varepsilon) which results in the covering number 2qlog(kh/ε)2q\log(kh/\varepsilon). Bounding the Rademacher complexity by Dudley entropy integral completes the proof. ∎

Appendix C Convolutional Neural Networks

In this section we give a compression algorithm for convolutional neural networks, and prove Theorem 5.1.

We start by developing some notations to work with convolutions and product of tensors. For simplicity of notation, for any kkk^{\prime}\leq k, we define a product operator ×k\times_{k^{\prime}} that given a kkth-order tensor YY and a kk^{\prime} order tensor ZZ with a matching dimensionality to the last kk^{\prime}-dimensions of YY, vectorizes the last kk^{\prime} dimensions of each tensor and returns a kkk-k^{\prime}th order tensor as follows:

The A^(i,j)\hat{A}_{(i,j)}’s will be generated by Algorithm 4 and are pp-wise independent.

Let κi\kappa_{i} be the filter size and sis_{i} be the stride in layer ii of the convolutional network. Then for any i>1i>1, xi+1=ϕ(Aisixi)x^{i+1}=\phi(A^{i}*_{s_{i}}x^{i}). Furthermore, since the activation functions are ReLU, we have xj=Mij(xi)=Jxiij×3xix^{j}=M^{ij}(x^{i})=J^{ij}_{x^{i}}\times_{3}x^{i}.

In the rest of this section, we will first describe the compression algorithm Matrix-Project-Conv (Algorithm 4) and show that the output of this algorithm behaves similar to Gaussian noise (similar to Lemma 2). Then we will follow the same strategy as the feed-forward case and give the full proof.

The weights in convolutional neural networks have inherent correlation due to the architecture, as the weights are shared across different locations. However, in order to randomly compress the weight tensors, we need to break this correlation and try to introduce independent perturbations at every location. The procedure is described as Algorithm 4.

The goal of Algorithm 4 is to generate different compressed filters A^i,j\hat{A}_{i,j} such that the total number of parameters is small, and at the same time A^i,j\hat{A}_{i,j}’s behave very similarly to applying Algorithm 1 AA for each location independently. We formalize these two properties in the following two lemmas:

Given a helper string that contains all of the MM^{\prime} matrices used in Algorithm 4, then it is possible to compute all of A^(i,j)\hat{A}_{(i,j)}’s based on \mboxProjS(A)\mbox{Proj}_{\mathcal{S}}(A). Since S\mathcal{S} is a kpkp dimensional subspace \mboxProjS(A)\mbox{Proj}_{\mathcal{S}}(A) has kpkp parameters.

By Algorithm 4 we know A^(i,j)\hat{A}_{(i,j)}’s are average of the ZZ matrices, and Zk=A,MkMkZ_{k^{\prime}}=\langle A,M^{\prime}_{k^{\prime}}\rangle M^{\prime}_{k^{\prime}}. Since MkSM^{\prime}_{k^{\prime}}\in\mathcal{S}, we know A,Mk=\mboxProjS(A),Mk\langle A,M^{\prime}_{k^{\prime}}\rangle=\langle\mbox{Proj}_{\mathcal{S}}(A),M^{\prime}_{k^{\prime}}\rangle. Hence Zk=\mboxProjS(A),MkMkZ_{k^{\prime}}=\langle\mbox{Proj}_{\mathcal{S}}(A),M^{\prime}_{k^{\prime}}\rangle M^{\prime}_{k^{\prime}} only depends on \mboxProjS(A)\mbox{Proj}_{\mathcal{S}}(A) and MkM^{\prime}_{k^{\prime}}. ∎

The random matrices A^(i,j)\hat{A}_{(i,j)}’s generated by Algorithm 4 are pp-wise independent. Moreover, for any A^(i,j)\hat{A}_{(i,j)}, the marginal distribution of the MM^{\prime} matrices are i.i.d. Gaussian with variance 1 in every direction.

Take any subset of pp random matrices A^(i1,j1),...,A^(ip,jp)\hat{A}_{(i_{1},j_{1})},...,\hat{A}_{(i_{p},j_{p})} generated by Algorithm 4. We are going to consider the joint distribution of all the MM^{\prime} matrices used in generating these A^\hat{A}’s (k×pk\times p of them) and the subspace S\mathcal{S}.

Consider the following procedure: generate k×pk\times p random matrices M1,M2...,MkpM^{\prime}_{1},M^{\prime}_{2}...,M^{\prime}_{kp} from N(0,1)h×h×κ×κN(0,1)^{h^{\prime}\times h\times\kappa\times\kappa}, and let S\mathcal{S} be the span of these kpkp vectors. By symmetry of Gaussian vectors, we know S\mathcal{S} is a uniform random subspace of dimension kpkp.

Now we sample from the same distribution in a different order: first sample a uniform random subspace S\mathcal{S} of dimension kpkp, then sample kpkp random Gaussian matrices within this subspace (which can be done by sample a Gaussian in the entire space and then project to this subspace). This is exactly the procedure described in Algorithm 4.

Therefore, the MM^{\prime} matrices used in generating these A^\hat{A}’s are independent, as a result the A^(i,j)\hat{A}_{(i,j)}’s are also independent. The equivalence also shows that the marginal distributions of MM^{\prime} are i.i.d. spherical Gaussians. (Note that the reason this is limited to pp-wise independence is that if we look at more than kpkp random matrices from the subspace S\mathcal{S}, they do not have the same distribution as Gaussian random matrices; the latter would span a subspace of dimension higher than kpkp.) ∎

Although the A^(i,j)\hat{A}_{(i,j)}’s are only pp-wise independent, when p=log1/ηp=\log 1/\eta we can show that they behave similarly to fully independent random filters. We defer the technical concentration bounds to the end of this section (Section C.3).

Using this compression, we will prove that the noise generated at each layer behaves similar to a random vector. In particular it does not correlate with any fixed tensor, as long as the norms of the tensor is well-distributed:

Intuitively, UU is well-distributed if no spacial location of UU has a norm that is significantly larger than the average. Now we are ready to show the noise generated by this procedure behaves very similar to a random Gaussian (this is a generalization of Lemma 2):

We will first expand out U×3(ΔsV)U\times_{3}(\Delta*_{s}V):

In this expression, (U:,i,j,:V(s(i1)+1,s(j1)+1),κ)(U_{:,i,j,:}\otimes V_{(s(i-1)+1,s(j-1)+1),\kappa}) generates a 5-th order tensor (2 from UU and 3 from VV), the order of dimensions is that VV takes coordinates number 3,4,5 (with dimensions h×κ×κh\times\kappa\times\kappa), the first dimension of UU takes the 2nd coordinate and the 4-th dimension of UU takes the 1st coordinate. The result of (U:,i,j,:V(s(i1)+1,s(j1)+1),κ)×4(A^(i,j)A)(U_{:,i,j,:}\otimes V_{(s(i-1)+1,s(j-1)+1),\kappa})\times_{4}(\hat{A}_{(i,j)}-A) is a vector of dimension nun_{u} (because the first 4 dimensions are removed in the inner-product).

Now let us look at the terms in this sum, let Xi,j=(U:,i,j,:V(s(i1)+1,s(j1)+1),κ)×4A^(i,j)X_{i,j}=(U_{:,i,j,:}\otimes V_{(s(i-1)+1,s(j-1)+1),\kappa})\times_{4}\hat{A}_{(i,j)}. Let M1,...,MkM^{\prime}_{1},...,M^{\prime}_{k} be the random matrices used when computing A^(i,j)\hat{A}_{(i,j)} (for simplicity we omit the indices for i,ji,j), then we have

By Lemma 12 we know Xi,jX_{i,j}’s are pp-wise independent. Now we can apply Corollary C.2 to the sum of Xi,jX_{i,j}’s. Let σ=i=1n1j=1n2σi,j2\sigma=\sqrt{\sum_{i=1}^{n^{\prime}_{1}}\sum_{j=1}^{n^{\prime}_{2}}\sigma_{i,j}^{2}}, then we know

Union bound over all (U,V)(U,V) pairs, we know with probability at least 1δ1-\delta, we have U×3(ΔsV)12σp\|U\times_{3}(\Delta*_{s}V)\|\leq 12\sigma p for all (U,V)(U,V).

Finally, we will try to relate 12σp12\sigma p with εβn1n2AFUFVF\frac{\varepsilon\beta}{\sqrt{n^{\prime}_{1}n^{\prime}_{2}}}\|A\|_{F}\|U\|_{F}\|V\|_{F}.

Here the first inequality is by the assumption that all UU’s are β\beta-well-distributed. The second inequality is true because each entry in VV appears in at most κ/s2\lceil\kappa/s\rceil^{2} entries of V(s(i1)+1,s(j1)+1),κV_{(s(i-1)+1,s(j-1)+1),\kappa}. Therefore, when kk is set to 144(Q)2κ/s2p2/ϵ2=O(κ/s2log21/ηϵ2)144(Q^{\prime})^{2}\lceil\kappa/s\rceil^{2}p^{2}/\epsilon^{2}=O(\frac{\lceil\kappa/s\rceil^{2}\log^{2}1/\eta}{\epsilon^{2}}), we have 12σpεβn1n2AFUFVF12\sigma p\leq\frac{\varepsilon\beta}{\sqrt{n^{\prime}_{1}n^{\prime}_{2}}}\|A\|_{F}\|U\|_{F}\|V\|_{F} as desired. ∎

C.2 Generalization Bounds for Convolutional Neural Networks

Next we will use Algorithm 4 to compress the neural network and prove generalization bounds. Similar to the feed-forward case, our first step is to show bound the perturbation of the output based on the noise introduced at each layer. This is captured by the following lemma (generalization of Lemma 3)

where μi\mu_{i}, μi\mu_{i\rightarrow}, cc, ρδ\rho_{\delta} and β\beta are layer cushion, interlayer cushion, activation contraction, interlayer smoothness and well-distributedness of Jacobian defined in Definitions 4,8,6, 7 and 9 respectively.

(Note that although xx is now a 3-tensor, we still use x\|x\| to denote xF\|x\|_{F} as we never use any other norm of xx.)

The second term can be bounded by (i1)εxj/d(i-1)\varepsilon\|x^{j}\|/d by induction hypothesis. Therefore, in order to prove the induction, it is enough to show that the first term is bounded by ε/d\varepsilon/d. We decompose the error into two error terms one of which corresponds to the error propagation through the network if activation were fixed and the other one is the error caused by change in the activations:

The first term can be bounded as follows:

Because of positive homogeneity of ReLU activations, we can assume without loss of generality that the network is balanced, i.e for any iji\neq j, AiF=AjF=τ\|A_{i}\|_{F}=\|A_{j}\|_{F}=\tau (otherwise, one could rebalance the network before approximation and cushion in invariant to this rebalancing). Therefore, for any xSx\in S we have:

where the last inequality is because by Lemma 10, e2dfA(x)γτi=1dμi<q\frac{e^{2}d\|f_{A}(x)\|}{\gamma\tau\prod_{i=1}^{d}\mu_{i}}<\sqrt{q}. Since the absolute value of each parameter in layer ii is at most τh\tau h, the logarithm of number of choices for each parameter in order to get ε\varepsilon-cover is log(qh2/ε)2log(qh/ε)\log(qh^{2}/\varepsilon)\leq 2\log(qh/\varepsilon) which results in the covering number 2qlog(kh/ε)2q\log(kh/\varepsilon). Bounding the Rademacher complexity by Dudley entropy integral completes the proof. ∎

Similar to the discussions at the end of Section 4, we can use distance to initialization and remove outliers. More concretely, we can get the following corollary

where μi\mu_{i}, μi\mu_{i\rightarrow}, cc and ρδ\rho_{\delta} are layer cushion, interlayer cushion, activation contraction and interlayer smoothness defined in Definitions 4,8,6 and 7 respectively and measured on a 1ζ1-\zeta fraction of the training set SS.

C.3 Concentration Inequalities for Sum of p𝑝p-wise Independent Variables

In this section we prove a technical lemma that shows the sum of pp-wise independent subexponential random variables have strong concentration properties. Previously similar results were known for Bernoulli random variables Pelekis and Ramon , the approach we take here is very similar.

The following lemma will imply concentration

Let X1,X2,...,XnX_{1},X_{2},...,X_{n} be random variables where XiX_{i} is σi\sigma_{i}-subexponential. Let σ2=i=1nσi2\sigma^{2}=\sum_{i=1}^{n}\sigma_{i}^{2}, X=i=1nXiX=\sum_{i=1}^{n}X_{i}. If XiX_{i}’s are pp-wise independent

By Claim 1 below, we know this expectation is bounded by pp(3σ)pp^{p}(3\sigma)^{p}. The second part of the lemma follows immediately from Markov’s inequality. ∎

We do induction on nn. When n1n\leq 1 this is clearly correct. Let F(n,p)=aAn,pi=1nσiaiF(n,p)=\sum_{a\in\mathcal{A}_{n,p}}\prod_{i=1}^{n}\sigma_{i}^{a_{i}}, then we have

Suppose the claim is true for all n<zn<z, let σ=i=1z1σi2\sigma^{\prime}=\sqrt{\sum_{i=1}^{z-1}\sigma_{i}^{2}}, when n=zn=z we have

When σn2σ\sigma_{n}\leq 2\sigma^{\prime}, we know a=2p(3σ)paσna3(3σ)p2σn2\sum_{a=2}^{p}(3\sigma^{\prime})^{p-a}\sigma_{n}^{a}\leq 3(3\sigma^{\prime})^{p-2}\sigma_{n}^{2}, hence by Binomial expansion we have

On the other hand, if σn2σ\sigma_{n}\geq 2\sigma^{\prime}, then we know all the terms in the summation a=2p(3σ)paσna\sum_{a=2}^{p}(3\sigma^{\prime})^{p-a}\sigma_{n}^{a} and (3σ)p(3\sigma^{\prime})^{p} are bounded by (1.5σn)p(1.5\sigma_{n})^{p}, therefore

In both cases we prove F(z,p)(9i=1nσi2)p/2F(z,p)\leq(9\sum_{i=1}^{n}\sigma_{i}^{2})^{p/2}, which finishes the induction. ∎

We also remark that Lemma 15 can be generalized to vectors

Let X1,X2,...,XnX_{1},X_{2},...,X_{n} be random vectors where Xi\|X_{i}\| is σi\sigma_{i}-subexponential. Let σ2=i=1nσi2\sigma^{2}=\sum_{i=1}^{n}\sigma_{i}^{2}, X=i=1nXiX=\sum_{i=1}^{n}X_{i}. If XiX_{i}’s are pp-wise independent, for any even pp

The proof is exactly the same as the proof of Lemma 15. When XiX_{i}’s are vectors we get exactly the same terms, except the terms have pair-wise inner-products. However, the inner-products Xi,XjXiXj\langle X_{i},X_{j}\rangle\leq\|X_{i}\|\|X_{j}\| so we only need to argue about the same inequality for Xi\|X_{i}\|’s. ∎

Appendix D Extended experiment

D.2 Effect of training on corrupted dataset