Asymptotics of Wide Convolutional Neural Networks

Anders Andreassen, Ethan Dyer

Introduction

Deep neural networks continue to achieve remarkable performance on a diverse range of machine learning tasks, however detailed understanding remains elusive. One of the most promising routes towards understanding is to study very wide neural networks. Wide networks strike an attractive balance between performance and analytic control . Furthermore understanding the performance of networks as the number of parameters is increased is at the heart of the generalization paradox – the observation that over-parameterized deep networks do not over-fit.

In the authors showed that the dynamics of infinitely wide fully connected (FC) neural networks trained under gradient flow simplifies dramatically, and in the limit of infinite width argued that training a deep network is equivalent to training a linear random features model. For models trained with mean squared error (MSE) loss, this infinite width, linear evolution can be written as

where f(x)f(x) is the network output on example xx, Dtrain\mathcal{D}_{\textrm{train}} is the training dataset, and Θ(x,x′)=∑μ∂f(x)∂θμ∂f(x′)∂θμ\Theta(x,x^{\prime})=\sum_{\mu}\frac{\partial f(x)}{\partial\theta_{\mu}}\frac{\partial f(x^{\prime})}{\partial\theta_{\mu}} is the neural tangent kernel (NTK).

In this simplified infinite width evolution was extended to take into account corrections from finite width, giving a controlled prediction for the evolution of wide fully connected networks trained via stochastic gradient descent (SGD).

This formalism has the promise of explaining the training dynamics and predictions of wide neural networks. Empirically, however, there are several results that show convolutional neural networks (CNNs) exhibiting different behavior from fully connected networks (FCs) that have yet to be understood. First, for CNNs, but not FCs, there is evidence that finite width networks trained via SGD outperform their infinite width counterparts . Paradoxically, despite the drop in accuracy for the infinite width predictions, find that the performance of finite width CNNs improves as the width gets larger. These results appear in tension with our understanding of the scaling behavior of large width networks. Second, there is prior empirical evidence suggesting the scaling behavior in CNNs is different from FC networks .

To examine these differences between the observed behavior of CNNs and FCs, we present an extension of the formalism of to convolutional networks. We study correlation functions – ensemble averages over weight configurations of quantities built out of the network map and its derivatives. We conjecture a simple scaling relation for correlation functions for models with convolutional, skip, dense, and global average pooling layers. We prove this relation for deep linear and and single hidden layer networks with smooth activations and check the relation empirically in a broader context including deep non-linear networks, ReLU networks, and networks with max pooling layers. This scaling relation serves as the basis for bounding corrections to linear evolution and allows us to study how model performance depends on network width.

We derive a set of scaling relations for correlation functions, a general class of expectation values of the network map and its derivative. These relations rely on generalizing previous diagramatic methods to convolutional networks.

We apply our scaling relations to the loss and accuracy during training. In particular we argue that the difference between full and linearized test loss scales as O(n−1)\mathcal{O}(n^{-1}).

We confirm the predicted loss scaling empirically for deep non-linear networks trained on subsets of CIFAR-10 and find that it is consistent with finite width networks either outperforming or underperforming their infinite width counterparts.

We further apply our relations to derive asymptotically tight bounds for the change of the NTK during training.

Related work

There has been significant progress understanding the behavior of wide neural networks. At initialization, wide networks of any depth behave as Gaussian processes . Finite width corrections to the Gaussian process picture have been discussed in . The infinite width training of NTK parameterized networks was introduced in and studied in . Wide convolutional networks have been studied in . study the infinite width limit of a more general class of network, that includes convolutional networks as a special case. This work is most closely related to which also applied diagramatic techniques to derive asymptotic scaling rules for correlation functions. See also for another use of diagrams in this context. We also discuss finite width corrections to the evolution of convolutional networks, these corrections were studied for fully-connected networks in . Preliminary experiments for this work were run using the neural tangents python library . During the completion of this work appeared which performed extensive empirical studies comparing the performance of finite width CNNs and infinite width kernel methods.

Theory

In this section we present our main theoretical result. Namely, a conjectured class of bounds, Conjecture 1, governing the scaling with respect to width of quantities built out of the network map and its derivatives.

We consider neural networks, f(x)f(x), built out of a collection of stacked activations with non-linearity σ\sigma,

For a convolutional layer with kernel size kw×khk_{w}\times k_{h} and nn channels,

We consider networks terminated by linear transform after a flatten or global average pooling operation,

Following we introduce a class of moments built out of the network map and its derivatives called correlation functions.

A correlation function , C(x1,x2,…,xm)C(x_{1},x_{2},\ldots,x_{m}), is an ensemble average over products of the network map, f(x)f(x), and its derivatives, ∂kf(x)∂μ1∂μ2⋯∂μk\frac{\partial^{k}f(x)}{\partial_{\mu_{1}}\partial_{\mu_{2}}\cdots\partial_{\mu_{k}}}, subject to the condition that all derivatives are summed in pairs. A general correlation function CC takes the form

Here, 0≤k1≤⋯≤km−1≤km0\leq k_{1}\leq\cdots\leq k_{m-1}\leq k_{m} are integers,We adopt the convention that ka=ka−1k_{a}=k_{a-1} represents a factor of ff with no derivatives acting. mm and kmk_{m} are even, π∈Skm\pi\in S_{k_{m}} is a permutation, and Δμ1…μkm(π)=δμπ(1)μπ(2)⋯δμπ(km−1)μπ(km) .\Delta_{\mu_{1}\dots\mu_{k_{m}}}^{(\pi)}=\delta_{\mu_{\pi(1)}\mu_{\pi(2)}}\cdots\delta_{\mu_{\pi(k_{m}-1)}\mu_{\pi(k_{m})}}\,. We use δ\delta to denote the Kronecker delta.

We refer to paired summed indices as contracted derivatives and refer to factors of the network map with such contracted derivatives as being contracted in CC.

For every such correlation function we define the associated cluster graph.

The cluster graph, GC(V,E)G_{C}(V,E), associated to a correlation function C(x1,x2,…,xm)C(x_{1},x_{2},\ldots,x_{m}), is a graph consisting of mm vertices, one corresponding to each factor of the network map in Equation (8). The graph has a single edge between vertices corresponding to factors of the network map sharing a pair of contracted derivatives.

In the authors argue for a set of bounds on correlation functions for fully connected networks based on the cluster graph. For a correlation function CC with a cluster graph containing nen_{e} even components (connected components with an even number of vertices), non_{o} odd components, and mm vertices, they argue that the correlation function satisfies C=O(nne+no/2−m/2)C=\mathcal{O}(n^{n_{e}+n_{o}/2-m/2}). The authors prove these bounds for deep linear and one-hidden non-linear fully connected networks and check empirically in a variety of contexts. Subsequently established this bound for deep non-linear networks with polynomial activations. Here we extend this to networks with convolution, skip, and global average pooling layers. We present a proof in the deep-linear and 1-hidden layer non-linear case.

Let C(x1,…,xm)C(x_{1},\dots,x_{m}) be a correlation function with cluster graph, GCG_{C}. Suppose that GCG_{C} has nen_{e} connected components with an even size, and non_{o} components of odd size, then C(x1,…,xm)=O(nsC)C(x_{1},\dots,x_{m})=\mathcal{O}(n^{s_{C}}), where

We have tested this conjecture empirically in a variety of contexts, and these results appear in Section 4. We are also able to prove Conjecture 1 for deep linear and one-hidden-layer non-linear networks.

Conjecture 1 holds for deep linear and one-hidden-layer networks with smooth activations.

The argument for the deep linear case is summarized below. A detailed proof for deep linear networks and one-hidden-layer non-linear networks appears in the Supplement.

In the deep linear case, the proof follows from two lemmas.

Let f(x)f(x) be a deep linear network of depth dd made up of convolutional, skip, dense, and GAP layers. Then the network function can be written as a finite sum over Nf\mathcal{N}_{f} functions fI(x)f_{I}(x), where each function fIf_{I} has the topology of a fully connected network with depth dI≤dd_{I}\leq d.

Furthermore, let {θI}\{\theta_{I}\} be the set of weights of each fI(x)f_{I}(x) and {θ}\{\theta\} the weights of ff. Then, {θI}∈{θ}\{\theta_{I}\}\in\{\theta\}.

The decomposition of the network map motivates a generalization of the definition of correlation functions to expectations involving the maps fI(x)f_{I}(x). We dub such expectation values mixed correlation functions.

A mixed correlation function, CI1,I2,…,Im(x1,x2,…,xm)C_{I_{1},I_{2},\ldots,I_{m}}(x_{1},x_{2},\ldots,x_{m}), is an ensemble average over products of the functions, fI(x)f_{I}(x), and its derivatives, ∂kfI(x)∂μ1∂μ2⋯∂μk\frac{\partial^{k}f_{I}(x)}{\partial_{\mu_{1}}\partial_{\mu_{2}}\cdots\partial_{\mu_{k}}}, subject to the condition that all derivatives are summed in pairs.

The decomposition of the network map in Lemma 1 allows us to write correlation functions of CNNs in terms of finite sums over correlation functions of fully connected networks and thus reuse much of the technology introduced in . This is formalized in the following lemma.

Let CI1,I2,…,Im(x1,x2,…,xm)C_{I_{1},I_{2},\ldots,I_{m}}(x_{1},x_{2},\ldots,x_{m}) be a mixed correlation function. Let GCG_{C} be a cluster graph associated to CI1,I2,…,Im(x1,x2,…,xm)C_{I_{1},I_{2},\ldots,I_{m}}(x_{1},x_{2},\ldots,x_{m}) via Definition 2 ignoring the labels {I1,I2,…,Im}\{I_{1},I_{2},\ldots,I_{m}\}. Let nen_{e}, non_{o} be the number of even, odd clusters in GCG_{C}, then CI1,I2,…,Im(x1,x2,…,xm)=O(nsC)C_{I_{1},I_{2},\ldots,I_{m}}(x_{1},x_{2},\ldots,x_{m})=\mathcal{O}(n^{s_{C}}) with

Together Lemma 1 and Lemma 2 imply Theorem 1 for deep linear networks. Lemma 1 follows from the definitions of our layers above. Here we show this for convolution layers, and leave the details of skip and GAP layers to the Supplement.

We prove Lemma 2 in the Supplement. We rely on the graphical Feynman diagram techniques introduced in .

Conjecture 1 has important implications for the training dynamics of convolutional networks at both infinite and finite width.

Consider a network trained via gradient flow with mean squared error (MSE) loss.

In general this equation can describe quite complicated training dynamics, as a result of the time dependence of Θ(t)\Theta(t). Empirically we find some non-trivial late time behavior for certain CNN models which has to be treated with care. We elaborate on this in the Supplement. At infinite width, however, Θ\Theta is constant and the dynamics reduce to that of training a linear model.

As we will explain, Conjecture 1 bounds the change in the kernel as

In Figure 5 and Table 3 we see evidence that this bound is saturated in a variety of CNNs.

To understand this analytically, we begin with an illustrative example. Consider the time derivative of the NTK,

The constancy of the NTK is a striking feature of infinite width networks. However in practice we mostly consider finite width networks and the connection between infinite and finite width evolution is not immediately clear. In the authors take steps towards understanding finite width networks. In particular they show that the scaling relations, Conjecture 1, imply a systematic expansion for the evolution of the network map.

Here, f(0)(x;t)f^{(0)}(x;t) is the linearized infinite width evolution, Equation (1), and the higher order terms can be iteratively solved for in terms of the network map at initialization. The derivation of this result relies only on Conjecture 1 and so applies here as well. Some important consequences of this expansion are scaling relations for the loss and accuracy during training, which we now describe.

2 Performance scaling

One natural application of the large width evolution in Equation (19) is understanding the dynamics of the loss and accuracy during training of wide networks. This question is at the heart of the generalization paradox, the observation that over-parameterized networks suffer no degradation in performance as they become larger . It also describes the asymptotic behavior of the so called double descent curve .

The expansion of the network map in powers of 1/n1/n leads to a corresponding expansion in the test loss

Thus we expect the difference between the full model and linearized test loss to scale as

Here Ltestlin:=Ltest(f(0))L_{\textrm{test}}^{\textrm{lin}}:=L_{\textrm{test}}(f^{(0)}). This scaling has been observed empirically in fully connected networks and is the same scaling predicted in for linear models. Here we see good agreement with this asymptotic behavior of the loss in deep convolutional networks (see Figure 8).

This relation between the loss of a finite width network and the infinite width loss is of particular interest for CNNs. As mentioned above, convolutional networks often exhibit a gap in performance between infinite width networks and their finite width counterparts . It is natural to ask whether we can understand this performance gap within the framework of the perturbative expansion around large width.

The relation, Equation (21), implies that the full and linearized loss approach each other at infinite width, however the relative ordering is not dictated. We will see in the models studied below, that either ordering is possible depending on the time during training. In particular, in the setup studied here, finite width models outperform their linear counterparts if training is stopped at the non-linear early stopping time. We expand further on the dynamics and performance of the particular models studied in Section 4.3.

Numerical Experiments

To support the theoretical predictions in Section 3, we present numerical results for the scaling of the NTK at initialization as well as at convergence (100% training accuracy) for one- and three-hidden-layer convolutional neural networks with layers of the types defined in Section 3. All models are trained on 2-class MNIST (0’s and 1’s) with 10 examples per class, with the exception of Section 4.3 which is trained on 2-class CIFAR (airplane and automobile) with 100 examples per class and tested on the full 2-class test dataset. Training was done with full-batch gradient descent and all models achieved 100% training accuracy. The learning rate used (unless otherwise specified) was 0.25⋅1max⁡λi0.25\cdot\frac{1}{\max{\lambda_{i}}}, where λi\lambda_{i} are the eigenvalues of the NTK.

Next we consider the expectation of the variance of the NTK. This variance can be written as the difference of two correlation functions,

From Conjecture 1, each of these correlation functions is O(n0)\mathcal{O}(n^{0}), thus we can bound Varθ[Θ]=O(n0)\text{Var}_{\theta}\left[\Theta\right]=\mathcal{O}(n^{0}). In the Supplement we show that for deep linear networks and for one-hidden-layer networks, we can actually do better giving Varθ[Θ]=O(n−1)\text{Var}_{\theta}\left[\Theta\right]=\mathcal{O}(n^{-1}). In the spirit of Conjecture 1, we predict this scaling more generally. Note that the suppression of the variance of the NTK with width is crucial for Θ\Theta to have a well defined infinite width limit. In particular, this implies typical realizations of the kernel will be close to the mean as the width increases. Sub-panel 4b of Figure 4 corroborates this predicted scaling for three-hidden-layer CNNs with more examples in sub-panel 4d.

2 Change in the NTK

Next, we consider how the deviation in the NTK from initializaion depends on the number of color channels. Equation (17) predicts that this difference scales as O(n−1)\mathcal{O}(n^{-1}). As discussed above, this constancy of the kernel is what underlies the large width linear dynamics.

Figure 5 shows that the scaling of the expected deviation from initialization of the NTK for a three-hidden-layer convolutional networks for different layer types and ReLU activation function. For each architecture, the fit is done at the time step when all the models for the 10 initializations have hit 100% training accuracy. Further results are recorded in Table 3.

Figure 6 shows the evolution of Θ(t)\Theta(t) during training with gradient descent for a single hidden layer convolutional network with ReLU activation function and global average pooling over a range of widths, nn. Equation (17) is an asymptotic statement. In practice, to see this scaling it is often necessary to go to n≫32n\gg 32. As an example of the sensitivity to width, we look at the 1/nα1/n^{\alpha} fit over large and small ranges of nn in Figure 7 during training. We find greater deviations from O(n−1)\mathcal{O}(n^{-1}) scaling when including smaller widths. More generally, experimentally testing convolutional networks with enough channels to convincingly confirm or rule out Conjecture 1 can be a challenge and we detail this in the Supplement.

3 Loss scaling

In this section we empirically study the performance scaling discussed in Section 3.2 for a four-hidden-layer CNN trained on 2-class CIFAR with 100 examples per class. These models exhibit the now familiar property that their performance does not get worse as the number of channels is increased.

We compare the training dynamics of a non-linear model and its linearized counterpart. We find that if both models are stopped at the optimal early stopping time for the non-linear model, then the non-linear model outperforms the linear model. This gap in performance fits well with the predicted O(n−1)\mathcal{O}(n^{-1}) scaling. However this does not represent a true performance gap between linear and non-linear model, but rather the fact that the linear and non-linear models achieve their maximum accuracy at different times. Indeed for late times we see the non-linear model under-performs the linear model, again with a gap scaling as O(n−1)\mathcal{O}(n^{-1}). As both linear and non-linear models over-fit, there is also a gap between the optimally stopped non-linear model and the infinite time predictions of the linear model. These results are summarized in Figure 8.

Discussion

We have presented a simple relation, Conjecture 1, for the asymptotic scaling of correlation functions with width and tested the predictions in a variety of CNN architectures. We used these scaling relations to study the training dynamics and performance of wide convolutional networks. At infinite width, CNNs evolve as linear models, with training controlled by the constant NTK. Our conjecture gives an asymptotically tight bound on the approach to constancy.

Away from infinite width the NTK is no longer constant, but the dynamics can still be systematically approximated in a large width expansion. We use this to predict an asymptotic O(n−1)\mathcal{O}(n^{-1}) scaling for the difference between the linearized loss and the full non-linear loss Equation (21). In Section 4.3 we presented evidence corroborating this prediction. Though the linearized and non-linear loss approach each other at infinite width, we found that their order can depend on the training time for which they are being compared. This same sensitivity is reflected in the accuracy. In particular, depending on the stopping criteria, the full finite width model can be either better or worse then the linear model.

One motivation for extending the analysis of to convolutional networks is to bridge the gap between our analytic understanding at infinite width and the empirically best performing finite width networks used in practice. Our analysis of the performance gap between linearized and non-linear models is a step in this direction. We hope the tools developed here can be extended to increasingly realistic scenarios.

Acknowledgements

The authors wish to thank Yasaman Bahri, Guy Gur-Ari, Jaehoon Lee, Aitor Lewkowycz, Sam Schoenholz, and Jascha Sohl-dickstein for useful discussions during the completion of this work.

References

Appendix A Expansion of deep-linear network maps

In this section, we complete the proof of Lemma 1. In the body we discussed convolution layers. Here we extend the analysis to skip and global average pooling layers.

Global average pooling

Here each fI(x)f_{I}(x) has the topology of a deep network without a the global average pooling layer.

Lemma 1 follows from repeated applications of (3), (23), and (24) to each such layer, and relabeling of indices so that II runs over all terms in the resulting sums. ∎

Appendix B Feynman diagrams for deep-linear networks

We are interested in computing correlation functions (Definition 1). This involves computing expectation values over the multi-variate Gaussian initial weight values. A central tool in computing these expectation values is Isserlis’ Theorem (sometimes referred to as Wick’s theorem). Which establishes that higher moments under a Gaussian distribution can be computed as sums of products of second moments. For example,

In general, keeping track of all the moments be cumbersome and Feynman diagrams are a useful book keeping tool. These diagrams were used in to compute the ensemble averages over initial weights for fully-connected networks. We begin by reviewing the key definitions and results and then extend the technology as is needed to prove Theorem 1.

We refer to TT as a derivative tensor. As above, if two derivative tensors in a correlation function, CC, have kk paired summed indices, we say that the tensors are contracted kk-times in CC.

We now describe the Feynman diagrams associated to a correlation function.

Let C(x1,…,xm)C(x_{1},\dots,x_{m}) be a correlation function for a network with dd hidden layers. The family Γ(C)\Gamma(C) is the set of all graphs that have the following properties.

There are mm vertices v1,…,vmv_{1},\dots,v_{m}, each of degree d+1d+1.

Each edge has a type t∈{U,W(1),…,W(d−1),V}t\in\{U,W^{(1)},\dots,W^{(d-1)},V\}. Every vertex has one edge of each type.

The graphs in Γ(C)\Gamma(C) are called the Feynman diagrams of CC.

Some example Feynman diagrams are shown in Figure 9.

For one hidden layer networks, the Feynman diagrams allow one to easily compute the scaling of a correlation function. Deep networks require additional technology, the double line graph.

Let γ∈Γ(C)\gamma\in\Gamma(C) be a Feynman diagram for a correlation function CC involving kk derivative tensors for a network of depth dd. Its double-line graph, DL(γ)\textrm{DL}(\gamma) is a graph with kdkd vertices of degree 2, defined by the following blow-up procedure.

Each vertex viv_{i} in γ\gamma is mapped to dd vertices vi(1),…,vi(d)v^{(1)}_{i},\dots,v^{(d)}_{i} in DL(γ)\textrm{DL}(\gamma).

Each edge (vi,vj)(v_{i},v_{j}) in γ\gamma of type UU is mapped to a single edge (vi(1),vj(1))(v^{(1)}_{i},v^{(1)}_{j}).

Each edge (vi,vj)(v_{i},v_{j}) in γ\gamma of type W(l)W^{(l)} is mapped to two edges (vi(l),vj(l))(v^{(l)}_{i},v^{(l)}_{j}), (vi(l+1),vj(l+1))(v^{(l+1)}_{i},v^{(l+1)}_{j}).

Each edge (vi,vj)(v_{i},v_{j}) in γ\gamma of type VV is mapped to a single edge (vi(d),vj(d))(v^{(d)}_{i},v^{(d)}_{j}).

The number of faces in γ\gamma is given by the number of loops in the double-line graph DL(γ)\textrm{DL}(\gamma).

Some example double line graphs are shown in Figure 10. With these definitions correlation functions of deep linear networks satisfy a theorem originally due to .

Let C(x1,…,xm)C(x_{1},\dots,x_{m}) be a correlation function of a deep linear network with dd hidden layers, and let γ∈Γ(C)\gamma\in\Gamma(C) be a Feynman diagram. The diagram represents a subset of terms that contribute to CC, and its asymptotic behavior is determined by the Feynman rules: the subset is O(nsγ)\mathcal{O}(n^{s_{\gamma}}) where sγ=lγ−dm2s_{\gamma}=l_{\gamma}-\frac{dm}{2}, and lγl_{\gamma} is the number of loops in the double-line diagram DL(γ)\textrm{DL}(\gamma). Furthermore, the correlation function is C=O(ns)C=\mathcal{O}(n^{s}), where s=max⁡γ∈Γ(C)sγs=\max_{\gamma\in\Gamma(C)}s_{\gamma}.

Below we generalize this construction to accommodate networks with convolution, skip, and GAP layers.

B.2 Extension

We must extend the above technology to our mixed correlation functions (Definition 3). Mixed correlation functions are expectations of maps of the form

Let CI1,…,Im(x1,…,xm)C_{I_{1},\ldots,I_{m}}(x_{1},\ldots,x_{m}) be a mixed correlation function for a collection of maps, {fI1,…,fIm}\{f_{I_{1}},\ldots,f_{I_{m}}\} with depths {d1,…,dm}\{d_{1},\ldots,d_{m}\}. The family Γ(CI1,…,Im)\Gamma(C_{I_{1},\ldots,I_{m}}) is the set of all graphs that have the following properties.

There are mm vertices v1,…,vmv_{1},\dots,v_{m}, where each viv_{i} has degree ki=di+1k_{i}=d_{i}+1.

Each edge has a type tt. Every vertex, viv_{i} has one edge of each type t∈{VαdIiIi,WαdI−1I(βdi−1I),…,Wα1I(β1I),Wα0I(0)}t\in\{V_{\alpha^{I_{i}}_{d_{I_{i}}}},W_{\alpha^{I}_{d_{I}-1}}^{(\beta^{I}_{d_{i}-1})},\ldots,W_{\alpha^{I}_{1}}^{(\beta^{I}_{1})},W_{\alpha^{I}_{0}}^{(0)}\}.

Let γ∈Γ(CI1,…,Im)\gamma\in\Gamma(C_{I_{1},\ldots,I_{m}}) be a Feynman diagram for a mixed correlation function CI1,…,ImC_{I_{1},\ldots,I_{m}} involving mm derivative tensors. Its double-line graph, DL(γ)\textrm{DL}(\gamma) is a graph with vertices of degree 2, defined by the following blow-up procedure.

Each vertex viv_{i} in γ\gamma of degree kik_{i} is mapped to ki−1k_{i}-1 vertices vi(1),…,vi(ki−1)v^{(1)}_{i},\dots,v^{({k_{i}}-1)}_{i} in DL(γ)\textrm{DL}(\gamma).

Each edge (vi,vj)(v_{i},v_{j}) in γ\gamma of type Wα(β)W_{\alpha}^{(\beta)} is mapped to two edges, (vi(ei),vj(ej))(v^{(e_{i})}_{i},v^{(e_{j})}_{j}) and (vi(ei+1),vj(ej+1))(v^{(e_{i}+1)}_{i},v^{(e_{j}+1)}_{j}).

Each edge (vi,vj)(v_{i},v_{j}) in γ\gamma of type Wα(0)W_{\alpha}^{(0)} is mapped to a single edge (vi(1),vj(1))(v^{(1)}_{i},v^{(1)}_{j}).

Each edge (vi,vj)(v_{i},v_{j}) in γ\gamma of type VαV_{\alpha} is mapped to a single edge (vi(ki−1),vj(kj−1))(v^{(k_{i}-1)}_{i},v^{(k_{j}-1)}_{j}).

Here, eie_{i} take values in {2,…,ki−2}\{2,\ldots,k_{i}-2\}. As in Definition 5, the number of faces in γ\gamma is given by the number of loops in the double-line graph DL(γ)\textrm{DL}(\gamma).

Example Feynman and double-line diagrams for mixed correlation functions are shown in Figure 11.

With the double line diagram defined, we can generalize Theorem 2 for the mixed correlation functions.

Let CI1,…,Im(x1,…,xm)C_{I_{1},\ldots,I_{m}}(x_{1},\dots,x_{m}) be a mixed correlation function. Let γ∈Γ(CI1,…,Im)\gamma\in\Gamma(C_{I_{1},\ldots,I_{m}}) be a Feynman diagram. The diagram represents a subset of terms that contribute to CI1,…,ImC_{I_{1},\ldots,I_{m}}, and its asymptotic behavior is determined by the Feynman rules: the subset is O(nsγ)\mathcal{O}(n^{s_{\gamma}}) where sγ=lγ−∑i=1mki−12s_{\gamma}=l_{\gamma}-\sum_{i=1}^{m}\frac{k_{i}-1}{2}, with kik_{i} the degree of the ii-th vertex, and lγl_{\gamma} the number of loops in the double-line diagram DL(γ)\textrm{DL}(\gamma). Furthermore, the mixed correlation function satisfies CI1,…,Im=O(ns)C_{I_{1},\ldots,I_{m}}=\mathcal{O}(n^{s}), where s=max⁡γ∈Γ(CI1,…,Im)sγs=\max_{\gamma\in\Gamma(C_{I_{1},\ldots,I_{m}})}s_{\gamma}.

We now use the Feynman rules (Theorem 3) to bound the scaling of a correlation function by the maximal number of connected components appearing in any single line Feynman diagram.

Let CI1,…,Im(x1,…,xm)C_{I_{1},\ldots,I_{m}}(x_{1},\dots,x_{m}) be a mixed correlation function. Let cγc_{\gamma} be the number of connected components of a graph γ∈Γ(CI1,…,Im)\gamma\in\Gamma(C_{I_{1},\ldots,I_{m}}). Then CI1,…,Im=O(ns)C_{I_{1},\ldots,I_{m}}=\mathcal{O}(n^{s}), where

It is enough to show that each connected component γ′\gamma^{\prime} in γ\gamma is bounded as O(nsγ′)\mathcal{O}(n^{s_{\gamma^{\prime}}}) where sγ′≤1−vγ′2s_{\gamma^{\prime}}\leq 1-\frac{v_{\gamma^{\prime}}}{2}. The graph DL(γ′)\textrm{DL}(\gamma^{\prime}) is a triangulation of a Riemann surface with ff faces ee edges, and vγ′v_{\gamma^{\prime}} vertices of degrees k1,…,kvγ′k_{1},\ldots,k_{v_{\gamma^{\prime}}}. The Feynman rules give

Using the relation e=∑i=1vγ′ki2e=\sum_{i=1}^{v_{\gamma^{\prime}}}\frac{k_{i}}{2} and the definition of the Euler character, χ=vγ′−e+f\chi=v_{\gamma^{\prime}}-e+f we have

The diagram DL(γ′)\textrm{DL}(\gamma^{\prime}) is a triangulation of a Riemann surface with at least one boundary, thus χ≤1\chi\leq 1 and sγ′≤1−vγ′2s_{\gamma^{\prime}}\leq 1-\frac{v_{\gamma^{\prime}}}{2}. ∎

We are now ready to prove Theorem 1 for deep-linear networks.

Let C(x1,…,xm)C(x_{1},\ldots,x_{m}) be a correlation function for a deep-linear network built out of dense, convolution, skip, and GAP layers. By Lemma 1 we can write

Thus, by Lemma 3 C(x1,…,xm)=O(ns)C(x_{1},\ldots,x_{m})=\mathcal{O}(n^{s}) where

We now show that cγ≤ne+no2 ∀ γc_{\gamma}\leq n_{e}+\frac{n_{o}}{2}\ \forall\,\gamma. Firstly note that the cluster graph GCG_{C} (Definition 2) is a sub-graph of all γ∈Γ(CI1,…,Im)\gamma\in\Gamma(C_{I_{1},\ldots,I_{m}}), thus cγ≤ne+noc_{\gamma}\leq n_{e}+n_{o} as each cluster in GCG_{C} can form at most one connected component in γ\gamma. Furthermore, note that each connected component in γ\gamma contains an even number of vertices, thus even clusters in GCG_{C} can form there own connected components in γ\gamma, but odd clusters must be paired in the connected components of γ\gamma. Thus, cγ≤ne+no2c_{\gamma}\leq n_{e}+\frac{n_{o}}{2}. ∎

Appendix C One-hidden-layer non-linear Networks

In this section we prove Theorem 1 for the case of networks with a single hidden layer. In this case, there are no skip connections, so we consider networks with a single convolutional layer terminated by either a gap or flatten layer.

It is convenient to adopt a notation that highlights the scaling with respect to the network width (number of convolutional channels). To this end, we write the network function as,

To write ff in this form, we have juggled the indexing over input pixels, channels, and kernels as follows.

X\mathbf{X} is a WH×kwkhcin\mathcal{W}\mathcal{H}\times k_{w}k_{h}c_{\textrm{in}} matrix. X{r,s},{a,b,j}:=xr+a,s+b;j\mathbf{X}_{\{r,s\},\{a,b,j\}}:=x_{r+a,s+b;j}.

For each ii, Ui\mathbf{U}_{i} is a kwkhcink_{w}k_{h}c_{\textrm{in}} vector. (Ui){a,b,j}:=Wa,b;ij(0)\left(\mathbf{U}_{i}\right)_{\{a,b,j\}}:=W^{(0)}_{a,b;ij}.

For each ii, Vi\mathbf{V}_{i} is a WH\mathcal{W}\mathcal{H} vector. For flatten models, (Vi){r,s}=Vr,s;i\left(\mathbf{V}_{i}\right)_{\{r,s\}}=V_{r,s;i}, while for GAP models (Vi){r,s}=Viδrs\left(\mathbf{V}_{i}\right)_{\{r,s\}}=V_{i}\delta_{rs}.

Here δrs\delta_{rs} is the Kronecker delta and cinc_{\textrm{in}} is the number of input channels. We have also dropped the normalization over input channel number, kernel size, and image size as they do not effect the scaling with respect to width.

If we adopt the notation R={r,s}R=\{r,s\}, A={a,b,j}A=\{a,b,j\}, and let UA,i\mathbf{U}_{A,i} and Vi,R\mathbf{V}_{i,R} be Gaussian distributed with unit variance.

With all of this notation out of the way, we can prove Theorem 1. An outline of the argument is the following. A general correlation function can be written as a sum of terms,

This form of the correlation function follows from computing the expectation over the weights V\mathbf{V} and evaluating all derivatives in the correlation function. These operations generate a sum of KK expectation values over U\mathbf{U} and α\alpha indexes the terms in this sum. Before completing the proof, as an explicit example, let us evaluate Equation (38) for the NTK,

In the general case, we argue that the maximum number of sums, rmax=max⁡αrαr_{\textrm{max}}=\max_{\alpha}r_{\alpha} is bounded as rmax≤ne+no2r_{\textrm{max}}\leq n_{e}+\frac{n_{o}}{2}, where nen_{e} and non_{o} are the number of even and odd clusters in the cluster graph GCG_{C}. We further argue that the Si1…irα(α)\mathcal{S}^{(\alpha)}_{i_{1}\ldots i_{r_{\alpha}}} are bounded by an nn-independent constant. These two statements establish Theorem 1.

To prove these results we again take a graphical approach. We introduce a new class of graphs to keep track of the index sums in CC.

Let C(x1,…,xm)C(x_{1},\dots,x_{m}) be a correlation function for a one-hidden-layer non-linear network. The family Γ′(C)\Gamma^{\prime}(C) is the set of all graphs that have the following properties.

There are mm vertices v1,…,vmv_{1},\dots,v_{m}, each of degree at least one.

Each edge has a type t∈{U,V}t\in\{U,V\}. Every vertex has one edge of type VV.

There is an edge (vi,vj)(v_{i},v_{j}) for f(xi)f(x_{i}), f(xj)f(x_{j}) contracted in CC.

Each graph γα∈Γ′(C)\gamma_{\alpha}\in\Gamma^{\prime}(C) corresponds to a term in the α\alpha sum (38). The number of index sums, rαr_{\alpha} is the number of connected components in γα\gamma_{\alpha}. To see this, note that we have one index sum for each factor of the network map f(x)f(x) (Equation (36)) in the correlation function CC. A contracted derivative between pairs of network maps in CC, results in a delta function eliminating one index sum. Similarly, the VV edges in γα\gamma_{\alpha} correspond to using Isserlis’ theorem to evaluate the Gaussian expectation over the Vi\mathbf{V}_{i} in CC. A single covariance as in (37) also eliminates an index sum due to the Kronecker delta factor. The result is that each connected component corresponds to a single sum.

We now argue for the bound on the maximal number of connected components.

Let C(x1,…,xm)C(x_{1},\dots,x_{m}) be a correlation function for a one-hidden-layer non-linear network, let γα∈Γ′(C)\gamma_{\alpha}\in\Gamma^{\prime}(C), and let cαc_{\alpha} denote the number of connected components in γα\gamma_{\alpha}. Further, let GCG_{C} be the cluster graph of CC and nen_{e} (non_{o}) denote the number of even (odd) clusters. Then cαc_{\alpha} satisfies.

First note that GCG_{C} is a sub-graph of γα\gamma_{\alpha}. As each vertex in γα\gamma_{\alpha} must have one VV edge, connected components in γα\gamma_{\alpha} have an even number of vertices, thus the even clusters in GCG_{C} can form their own connected components in γα\gamma_{\alpha} while an odd clusters in GCG_{C} must pair with at least one other odd cluster to form a connected component in γα\gamma_{\alpha}. ∎

An immediate consequence of this lemma is the bound rmax≤ne+no2r_{\textrm{max}}\leq n_{e}+\frac{n_{o}}{2}. We now prove Theorem 1 for one-hidden-layer non-linear networks.

We can bound the correlation function C(x1,…,xm)C(x_{1},\ldots,x_{m}) as,

Here we have introduced smaxs_{\textrm{max}} as a bound on the expectation values, smax=max⁡α,i1,…,irα∣Si1…irα(α)∣s_{\textrm{max}}=\max_{\alpha,i_{1},\ldots,i_{r_{\alpha}}}|\mathcal{S}^{(\alpha)}_{i_{1}\ldots i_{r_{\alpha}}}|. The expectations Si1…irα(α)S^{(\alpha)}_{i_{1}\ldots i_{r_{\alpha}}} can only take O(1)\mathcal{O}(1) different values, as the Ui\mathbf{U}_{i} are i.i.d. smaxs_{\textrm{max}} is the maximum over these O(1)\mathcal{O}(1) options. Thus C=O(nne+no2−m2)C=\mathcal{O}(n^{n_{e}+\frac{n_{o}}{2}-\frac{m}{2}}). ∎

Appendix D Late Time Behavior of GAP Networks

In this section we will briefly discuss some non-trivial features we see during training of convolutional neural networks with global average pooling. When training these models until convergence, we see a discontinuity in the NTK and the network function at late times that has to be avoided to see the theoretically predicted scaling behavior with width.

One such example is shown in Figure 12a, where the evolution of the NTK and the training loss and accuracy exhibits a discontinuity after about 250 steps. The evolution of the NTK for different widths is shown in Figure 12b, which shows the discontinuity and a high frequency oscillation that is width dependent. We also note that the effect gets smaller with larger width. The number of steps until this feature appears does depend on the hyperparameters in a systematic way, so they can be chosen such that this behavior can be avoided. It occurs earlier for deeper networks, and later for wider networks; later for smaller learning rates; and increasing the precision from float-32 to float-64 slightly delays it.

Appendix E Variance of NTK

Here we establish the claim that the variance of the NTK is O(n−1)\mathcal{O}(n^{-1}) for deep-linear networks with convolutional, skip, GAP layers as well as for one-hidden-layer non-linear CNNs.

In this case we can argue using Lemma 1 and the Feynman diagrams. The variance of the kernel takes the form

We are now in a position to use the Feynman diagrams to compute the scaling of Varθ[ΘI(x,x′)]\textrm{Var}_{\theta}\left[\Theta_{I}(x,x^{\prime})\right]. If we denote by C1;IC_{1;I} the expectation of ΘI\Theta_{I} and C2;IC_{2;I} the expectation of the square.

C1C_{1} can be computed from the double line diagrams associated to each graph in Γ(C1)\Gamma(C_{1}) and C2C_{2} can be computed from the graphs in Γ(C2)\Gamma(C_{2}). For the variance, we actually need to compute C12C_{1}^{2}. The value of C1C_{1} is given by summing the result of applying the Feynman rules to each diagram in Γ(C1)\Gamma(C_{1}). Thus C12C_{1}^{2} is given by applying the Feynman rules to every graph in Γ(C1)×Γ(C1)\Gamma(C_{1})\times\Gamma(C_{1}).

From the rules for drawing Feynman diagrams, Definition 6, every diagram γ∈Γ(C1)×Γ(C1)\gamma\in\Gamma(C_{1})\times\Gamma(C_{1}) is also a valid diagram in Γ(C2)\Gamma(C_{2}). The scaling of the variance can thus be read off by considering the double-line diagrams DL(γ)\textrm{DL}(\gamma) for γ∈Γ(C2)∖Γ(C1)×Γ(C1)\gamma\in\Gamma(C_{2})\setminus\Gamma(C_{1})\times\Gamma(C_{1}). These diagrams have four vertices, but a single connected component, thus the Feynman rules (Theorem 3) give Varθ[(x,x′)]=O(n−1)\textrm{Var}_{\theta}[(x,x^{\prime})]=\mathcal{O}(n^{-1})

One-hidden-layer non-linear convolutional networks

Here, we proceed by brute force calculation. Adopting the notation of Equation (36), the NTK can be written as

To simplify notation, we write the above as Θ(x,x′)=1n∑i=1nϕ[Ui,Vi]\Theta(x,x^{\prime})=\frac{1}{n}\sum_{i=1}^{n}\phi[\mathbf{U}_{i},\mathbf{V}_{i}]. The variance of the NTK can be written as

In arriving at the last line we have used the fact that Ui,Vi\mathbf{U}_{i},\mathbf{V}_{i} are i.i.d. and that Varθ[ϕ[U,V]]=O(1)\textrm{Var}_{\theta}\left[\phi[\mathbf{U},\mathbf{V}]\right]=\mathcal{O}(1).