Finite Depth and Width Corrections to the Neural Tangent Kernel

Boris Hanin, Mihai Nica

Introduction

Modern neural networks typically overparameterized: they have many more parameters than the size of the datasets on which they are trained. That some setting of parameters in such networks can interpolate the data is therefore not surprising. But it is a priori unexpected that not only can such interpolating parameter values can be found by stochastic gradient descent (SGD) on the highly non-convex empirical risk but that the resulting network function not only interpolates but also extrapolates to unseen data. In an overparameterized neural network N\mathcal{N} individual parameters can be difficult to interpret, and one way to understand training is to rewrite the SGD updates

of trainable parameters θ={θp}p=1P\theta=\{\theta_{p}\}_{p=1}^{P} with a loss L\mathcal{L} and learning rate λ\lambda as kernel gradient descent updates for the values N(x)\mathcal{N}(x) of the function computed by the network:

Relation (1) is valid to first order in λ.\lambda. It translates between two ways of thinking about the difficulty of neural network optimization:

The function space view where the loss L\mathcal{L}, which is a simple function of the network mapping x↦N(x)x\mapsto\mathcal{N}(x), is minimized over the manifold MN\mathcal{M}_{\mathcal{N}} of all functions representable by the architecture of N\mathcal{N} using gradient descent with respect to a potentially complicated Riemannian metric KNK_{\mathcal{N}} on MN.\mathcal{M}_{\mathcal{N}}.

Moreover, the joint statistical effects of depth and width on KNK_{\mathcal{N}} in finite size networks remain unclear, and the purpose of this article is to shed light on the simultaneous effects of depth and width on KNK_{\mathcal{N}} for finite but large widths nn and any depth dd. Our results apply to fully connected ReLU networks at initialization for which we will show:

In contrast to the regime in which the depth dd is fixed but the width nn is large, KNK_{\mathcal{N}} is not approximately deterministic at initialization so long as d/nd/n is bounded away from . Specifically, for a fixed input xx the normalized on-diagonal second moment of KNK_{\mathcal{N}} satisfies

Thus, when d/nd/n is bounded away from , even when both n,dn,d are large, the standard deviation of KN(x,x)K_{\mathcal{N}}(x,x) is at least as large as its mean, showing that its distribution at initialization is not close to a delta function. See Theorem 1.

Moreover, when L\mathcal{L} is the square loss, the average of the SGD update ΔKN(x,x)\Delta K_{\mathcal{N}}(x,x) to KN(x,x)K_{\mathcal{N}}(x,x) from a batch of size one containing xx satisfies

where n0n_{0} is the input dimension. Therefore, if d2/nn0>0,d^{2}/nn_{0}>0, the NTK will have the potential to evolve in a data-dependent way. Moreover, if n0n_{0} is comparable to nn and d/n>0d/n>0 then it is possible that this evolution will have a well-defined expansion in d/n.d/n. See Theorem 2.

In both statements above, ≃\simeq means is bounded above and below by universal constants. We emphasize that our results hold at finite d,nd,n and the implicit constants in both ≃\simeq and in the error terms O(d/n2)O(d/n^{2}) are independent of d,n.d,n. Moreover, our precise results, stated in §2 below, hold for networks with variable layer widths. We have denoted network width by nn only for the sake of exposition. The appropriate generalization of d/nd/n to networks with varying layer widths is the parameter

which in light of the estimates in (1) and (2) plays the role of an inverse temperature.

A number of articles have followed up on the original NTK work . Related in spirit to our results is the article , which uses Feynman diagrams to study finite width corrections to general correlations functions (and in particular the NTK). The most complete results obtained in are for deep linear networks but a number of estimates hold general non-linear networks as well. The results there, like in essentially all previous work, fix the depth dd and let the layer widths nn tend to infinity. The results here and in , however, do not treat dd as a constant, suggesting that the 1/n1/n expansions (e.g. in ) can be promoted to d/nd/n expansions. Also, the sum-over-path approach to studying correlation functions in randomly initialized ReLU nets was previously taken up for the foward pass in and for the backward pass in and .

2. Implications and Future Work

Taken together (1) and (2) above (as well as Theorems 1 and 2) show that in fully connected ReLU nets that are both deep and wide the neural tangent kernel KNK_{\mathcal{N}} is genuinely stochastic and enjoys a non-trivial evolution during training. This suggests that in the overparameterized limit n,d→∞n,d\rightarrow\infty with d/n∈(0,∞)d/n\in(0,\infty), the kernel KNK_{\mathcal{N}} may learn data-dependent features. Moreover, our results show that the fluctuations of both KNK_{\mathcal{N}} and its time derivative are exponential in the inverse temperature β=d/n.\beta=d/n.

It would be interesting to obtain an exact description of its statistics at initialization and to describe the law of its trajectory during training. Assuming this trajectory turns out to be data-dependent, our results suggest that the double descent curve that trades off complexity vs. generalization error may display significantly different behaviors depending on the mode of network overparameterization.

However, it is also important to point out that the results in show that, at least for fully connected ReLU nets, gradient-based training is not numerically stable unless d/nd/n is relatively small (but not necessarily zero). Thus, we conjecture that there may exist a “weak feature learning” NTK regime in which network depth and width are both large but 0<d/n≪10<d/n\ll 1. In such a regime, the network will be stable enough to train but flexible enough to learn data-dependent features. In the language of one might say this regime displays weak lazy training in which the model can still be described by a stochastic positive definite kernel whose fluctuations can interact with data.

Finally, it is an interesting question to what extent our results hold for non-linearities other than ReLU and for network architectures other than fully connected (e.g. convolutional and residual). Typical ConvNets, for instance, are significantly wider than they are deep, and we leave it to future work to adapt the techniques from the present article to these more general settings.

Formal Statement of Results

The three assumptions in (4) hold for vitually all standard network initialization schemes. The on-diagonal NTK is

We emphasize that although we have initialized the biases to zero, they are not removed them from the list of trainable parameters. Our first result is the following:

times a multiplicative error (1+O(∑i=1d1ni2))\left(1+O\left(\sum_{i=1}^{d}\frac{1}{n_{i}^{2}}\right)\right), where f≃gf\simeq g means ff is bounded above and below by universal constants times g.g. In particular, if all the hidden layer widths are equal (i.e. ni=nn_{i}=n, for i=1,…,d−1i=1,\ldots,d-1), we have

This result shows that in the deep and wide double scaling limit

the NTK does not converge to a constant in probability. This is contrast to the wide and shallow regime ni→∞n_{i}\rightarrow\infty and d<∞.d<\infty. is fixed.

times a multiplicative error of size (1+O(∑i=1d1ni2))\left(1+O\left(\sum_{i=1}^{d}\frac{1}{n_{i}^{2}}\right)\right), where as in Theorem 1, β=∑i=1d1/ni.\beta=\sum_{i=1}^{d}1/n_{i}. In particular, if all the hidden layer widths are equal (i.e. ni=nn_{i}=n, for i=1,…,d−1i=1,\ldots,d-1), we find

The remainder of this article is structured as follows. First, in §3 we introduce some notation about paths and edges in the computation graph of N\mathcal{N}. This notation will be used in the proofs of Theorems 1 and 2, which are outlined in §4 and particularly in §4.1 where give an in-depth but informal explanation of our strategy for computing moments of KNK_{\mathcal{N}} and its time derivative. Then, §5-§7 give the detailed argument. The computations in §5 explain how to handle the contribution to KNK_{\mathcal{N}} and ΔKN\Delta K_{\mathcal{N}} coming only from the weights of the network. They are the most technical and we give them in full detail. Then, the discussion in §6 and §7 show how to adapt the method developed in §5 to treat the contribution of biases and mixed bias-weight terms in KN,KN2K_{\mathcal{N}},K_{\mathcal{N}}^{2} and ΔKN\Delta K_{\mathcal{N}}. Since the arguments are simpler in these cases, we omit some details and focus only on highlighting the salient differences.

Notation

If each edge ee in the computational graph of N\mathcal{N} is assigned a weight W^e\widehat{W}_{e}, then associated to a path γ\gamma is a collection of weights:

Next, for an edge e∈[ni−1]×[ni]e\in[n_{i-1}]\times[n_{i}] in the computational graph of N\mathcal{N} we will write

for the layer of e.e. In the course of proving Theorems 1 and 2, it will be useful to associate to every Γ∈Γk(n⃗)\Gamma\in\Gamma^{k}(\vec{n}) an unordered multi-set of edges EΓ.E^{\Gamma}.

to be the unordered multiset of edges in the complete directed bi-paritite graph Kn,n′K_{n,n^{\prime}} oriented from [n][n] to [n′].[n^{\prime}]. For every E∈Σk(n,n′)E\in\Sigma^{k}(n,n^{\prime}) define its left and right endpoints to be

where L(E),R(E)L(E),R(E) are unordered multi-sets.

for the set of all possible edge multisets realized by paths in ΓZk.\Gamma_{Z}^{k}. On a number of occasions, we will also write

We will moreover say that for a path γ\gamma an edge e=(α,β)∈[ni−1]×[ni]e=(\alpha,\beta)\in[n_{i-1}]\times[n_{i}] in the computational graph of N\mathcal{N} belongs to γ\gamma (written e∈γe\in\gamma) if

Finally, for an edge e=(α,β)∈[ni−1]×[ni]e=(\alpha,\beta)\in[n_{i-1}]\times[n_{i}] in the computational graph of N\mathcal{N}, we set

for the normalized and unnormalized weights on the edge corresponding to ee (see (3)).

Overview of Proof of Theorems 1 and 2

and have suppressed the dependence on x,N.x,\mathcal{N}. Similarly, we have

and have used that the loss on the batch {x}\{x\} is given by L(x)=12(N(x)−N∗(x))2\mathcal{L}(x)=\frac{1}{2}\left(\mathcal{N}(x)-\mathcal{N}_{*}(x)\right)^{2} for some target value N∗(x).\mathcal{N}_{*}(x). To prove Theorem 1 we must estimate the following quantities:

To prove Theorem 2, we must control in addition

We prove Proposition 3 in §5 below. The proof already contains all the ideas necessary to treat the remaining moments. In §6 and §7 we explain how to modify the proof of Proposition 3 to prove the following two Propositions:

up to a multiplicative error of 1+O(d/n2).1+O(d/n^{2}). When d/nd/n is small, this expression is bounded above and below by a constant times

Thus, since Propositions 3 and 4 also give

where the weight of a path wt⁡(γ)\operatorname{wt}(\gamma) was defined in (10) and includes both the product of the weights along γ\gamma and the condition that every neuron in γ\gamma is open at xx. The path γ\gamma begins at some neuron in the input layer of N\mathcal{N} and passes through a neuron in every subsequent layer until ending up at the unique neuron in the output layer (see (7)). Being a product over edge weights in a given path, the derivative of wt⁡(γ)\operatorname{wt}(\gamma) with respect to a weight WeW_{e} on an edge ee of the computational graph of N\mathcal{N} is:

There is a subtle point here that wt⁡(γ)\operatorname{wt}(\gamma) also involves indicator functions of the events that neurons along γ\gamma are open at x.x. However, with probability 11, the derivative with respect to WeW_{e} of these indicator functions is identically at x.x. The details are in Lemma 11.

Obtain an exact formula for the expectation in (18):

Observe that the dependence of F(Γ,e1,e2)F(\Gamma,e_{1},e_{2}) on e1,e2e_{1},e_{2} is only up to a multiplicative constant:

The precise relation is (24). This shows that, up to universal constants,

This is captured precisely by the terms Ij,IIjI_{j},II_{j} defined in (27),(28).

Notice that F∗(Γ)F_{*}(\Gamma) depends only on the un-ordered multiset of edges E=EΓ∈Σeven4E=E^{\Gamma}\in\Sigma_{even}^{4} determined by Γ\Gamma (see (14)). We therefore change variables in the sum from the previous step to find

where a loop in EE occurs when the four paths interact. More precisely, a loop occurs whenever all four paths pass through the same neuron in some layer (see Figures 1 and 2).

Finally, we use Proposition 10 to obtain for this expectation estimates above and below that match up multiplicative constants.

Proof of Proposition 3

We begin with the well-known formula for the output of a ReLU net N\mathcal{N} with biases set to and a linear final layer with one neuron:

The weight of a path wt⁡(γ)\operatorname{wt}(\gamma) was defined in (10) and includes both the product of the weights along γ\gamma and the condition that every neuron in γ\gamma is open at xx. As explained in §3, the inner sum in (19) is over paths γ\gamma in the computational graph of N\mathcal{N} that start at neuron aa in the input layer and end at the output neuron and the random variables W^γ(i)\widehat{W}_{\gamma}^{(i)} are the normalized weights on the edge of γ\gamma between layer i−1i-1 and layer ii (see (9)). Differentiating this formula gives sum-over-path expressions for the derivatives of N\mathcal{N} with respect to both xx and its trainable parameters. For the NTK and its first SGD update, the result is the following:

where the sum is over collections Γ\Gamma of two paths in the computation graph of N\mathcal{N} and edges ee that lie on both paths. Similarly, almost surely,

Lemma 7 is proved in §5.2. The expression (20) is simple to evaluate due to the delta function in H(Γ,e).H(\Gamma,e). We obtain:

where in the second-to-last equality we used that the number of paths in the comutational graph of N\mathcal{N} from a given neuron in the input to the output neuron equals ∏i=1,…,dni\prod_{i=1,\ldots,d}n_{i} and in the last equality we used that nd=1.n_{d}=1. This proves the first equality in Theorem 1.

It therefore remains to evaluate (21) and (22). Since they are so similar, we will continue to discuss them in parallel. To start, notice that the expression F(Γ,e1,e2)F(\Gamma,e_{1},e_{2}) appearing in (21) and (22) satisfies

For the remainder of the proof we will write

The advantage of F∗(Γ)F_{*}(\Gamma) is that it does not depend on e1,e2.e_{1},e_{2}. Observe that for every a=(α1,α2,α3,α4)∈[n0]even4a=(\alpha_{1},\alpha_{2},\alpha_{3},\alpha_{4})\in[n_{0}]_{even}^{4}, we have that either α1=α2\alpha_{1}=\alpha_{2}, α1=α3\alpha_{1}=\alpha_{3}, or α1=α4\alpha_{1}=\alpha_{4}. Thus, by symmetry, the sum over Γeven4(n⃗)\Gamma_{even}^{4}(\vec{n}) in (21) and (22) takes only four distinct values, represented by the following possibilities:

keeping track of which paths γ1,…,γ4\gamma_{1},\ldots,\gamma_{4} begin at the same neuron in the input layer to N.\mathcal{N}. Hence, since

To evaluate Ij, IIjI_{j},\,II_{j} let us write

for the indicator function of the event that paths γα,γβ\gamma_{\alpha},\gamma_{\beta} pass through the same edge between layers i−1,ii-1,i in the computational graph of N\mathcal{N}. Observe that

To simplify Ij,i1,i2I_{j,i_{1},i_{2}} and IIj,i1,i2II_{j,i_{1},i_{2}} observe that F∗(Γ)F_{*}(\Gamma) depends only on Γ\Gamma only via the unordered edge multi-set (i.e. only which edges are covered matters; not their labelling)

defined in Definition 3. Hence, we find that for j=1,2,3,4, i1,i2=1,…,d,j=1,2,3,4,\,i_{1},i_{2}=1,\ldots,d,

The counts in Ij,∗,i1,i2I_{j,*,i_{1},i_{2}} and IIj,∗,i1,i2II_{j,*,i_{1},i_{2}} have a convenient representation in terms of

Informally, the event C^(E,i1,i2)\widehat{C}(E,i_{1},i_{2}) indicates the presence of a “collision” of the four paths in Γ\Gamma before the earlier of the layers i1,i2i_{1},i_{2}, while C(E,i1,i2)C(E,i_{1},i_{2}) gives a “collision” between layers i1,i2i_{1},i_{2}; see Section 4.1 for the intuition behind calling these collisions. We also write

Finally, for E∈Σa,even4(n⃗)E\in\Sigma_{a,even}^{4}(\vec{n}), we will define

That is, a loop is created at layer ii if the four edges in EE all begin at occupy the same vertex in layer i−1i-1 but occupy two different vertices in layer i.i. We have the following Lemma.

Suppose E∈Σaj,even4E\in\Sigma_{a_{j},even}^{4} for some j=1,2,3,4.j=1,2,3,4. For each i1,i2∈{1,…,d},i_{1},i_{2}\in\{1,\ldots,d\},

We prove Lemma 8 in §5.3 below. Assuming it for now, observe that

Observe that every unordered multi-set four edge multiset E∈Σeven4E\in\Sigma_{even}^{4} can be obtained by starting from some V∈Γ2V\in\Gamma^{2}, considering its unordered edge multi-set EVE^{V} and doubling all its edges. This map from Γ2\Gamma^{2} to Σeven4\Sigma_{even}^{4} is surjective but not injective. The sizes of the fibers is computed by the following Lemma.

Fix E∈Σeven4E\in\Sigma_{even}^{4}. The number of V∈ΓZ2V\in\Gamma_{Z}^{2} so that E=2⋅EVE=2\cdot E^{V} is 2#loops(V)+1{∣V(0)∣=2},2^{\#\text{loops}(V)+{\bf 1}_{\{\left|V(0)\right|=2\}}}, where as in (35),

Since the number of VV in Γ2(n⃗)\Gamma^{2}(\vec{n}) with specified V(0)V(0) equals ∏i=1dni2,\prod_{i=1}^{d}n_{i}^{2}, we find that so that for each x≠0,x\neq 0, we have

Here, Ex\mathcal{E}_{x} is the expectation with respect to the probability measure on V=(v1,v2)∈Γ2V=(v_{1},v_{2})\in\Gamma^{2} obtained by taking v1,v2v_{1},v_{2} independent, each drawn from the products of the measure (x12/∥x∥22,…,xn02/∥x∥22)\left(x_{1}^{2}/\left\lVert x\right\rVert_{2}^{2},\ldots,x_{n_{0}}^{2}/\left\lVert x\right\rVert_{2}^{2}\right) on [n0][n_{0}] and the uniform measure on [ni], i=1,…,d.[n_{i}],\,i=1,\ldots,d.

We are now in a position to complete the proof of Theorems 1 and 2. To do this, we will evaluate the expectations Ex\mathcal{E}_{x} above to leading order in ∑i1/ni\sum_{i}1/n_{i} with the help of the following elementary result which is proven as Lemma 18 in .

Let A0,A1,…,AdA_{0},A_{1},\ldots,A_{d} be independent events with probabilities p0,…,pdp_{0},\ldots,p_{d} and B0,…,BdB_{0},\ldots,B_{d} be independent events with probabilities q0,…,qdq_{0},\ldots,q_{d} such that

Denote by XiX_{i} the indicator that the event AiA_{i} happens, Xi:=1{Ai}X_{i}:={\bf 1}_{\left\{A_{i}\right\}}, and by YiY_{i} the indicator that BiB_{i} happens, Yi=1{Bi}Y_{i}={\bf 1}_{\{B_{i}\}}. Further, fix for every i∈1,…,di\in 1,\ldots,d some αi≥1,Ki≥1\alpha_{i}\geq 1,K_{i}\geq 1 as well as γi>0\gamma_{i}>0. Define

Then, if γi≥1\gamma_{i}\geq 1 for every ii, we have:

where by convention α0=γ0=1.\alpha_{0}=\gamma_{0}=1. In contrast, if γi≤1\gamma_{i}\leq 1 for every ii, we have:

Since ∣V(d)∣=1\left|V(d)\right|=1, we may also write

Putting this together with (42) and noting that

where in the last inequality we used that 1+x≥ex−x2/21+x\geq e^{x-x^{2}/2} for x≥0.x\geq 0. Since e−1/n1+1/nd≃1,e^{-1/n_{1}+1/n_{d}}\simeq 1, we conclude

When combined with (23) this gives the lower bound in Proposition 3. The matching upper bound is obtained from (46) in the same way using the opposite inequality from Proposition 10.

This completes the proof of Proposition 3, modulo the proofs of Lemmas 6-9, which we supply below. □\square

With probability 1,1, either there exists ii so that y(i)=0y^{(i)}=0 or, for every i∈[d],j∈[ni]i\in[d],j\in[n_{i}] we have yj(i)≠0.y_{j}^{(i)}\neq 0.

Lemma 11 shows that for our fixed xx, with probability 1,1, the derivative of each ξj(i)\xi_{j}^{(i)} in (19) vanishes. Hence, almost surely, for any edge ee in the computational graph of N:\mathcal{N}:

This proves the formulas for KN,KN2.K_{\mathcal{N}},K_{\mathcal{N}}^{2}. To derive the result for ΔKN,\Delta K_{\mathcal{N}}, we write

where the loss L\mathcal{L} on a single batch containing only xx is 12(N(x)−N∗(x))2.\frac{1}{2}\left(\mathcal{N}(x)-\mathcal{N}_{*}(x)\right)^{2}. We therefore find

Using (47) and again applying Lemma 11, we find that with probability 11

To complete the proof of Lemma 6 it therefore remains to check that this last term has mean 0.0. To do this, recall that the output layer of N\mathcal{N} is assumed to be linear and that the distribution of each weight is symmetric around (and hence has vanishing odd moments). Thus, the expectation over the weights in layer dd has either 11 or 33 weights in it and so vanishes. □\square

2. Proof of Lemma 7

Lemma 7 is almost a corollary of of Theorem 3 in and Proposition 2 in . The difference is that, in , the biases in N\mathcal{N} were assumed to have a non-degenerate distribution, whereas here we’ve set them to zero. The non-degeneracy assumption is not really necessary, so we repeat here the proof from with the necessary modifications.

If x=0,x=0, then N(x)=0\mathcal{N}(x)=0 for any configuration of weights since the network biases all vanish. Will therefore suppose that x≠0.x\neq 0. Let us first show (20). We have from Lemma 6 that

To compute the inner expectation, write Fj\mathcal{F}_{j} for the sigma algebra generated by the weight in layers up to and including jj. Let us also define the events:

where we recall from (2) that x(j)x^{(j)} are the post-activations in layer j.j. Supposing first that ee is not in layer dd, the expectation becomes

Thus, the expectation in (48) becomes 1nd−11{γ1(d−1)=γ2(d−1)γ1(d)=γ2(d)}\frac{1}{n_{d-1}}{\bf 1}_{\left\{\begin{subarray}{c}\gamma_{1}(d-1)=\gamma_{2}(d-1)\\ \gamma_{1}(d)=\gamma_{2}(d)\end{subarray}\right\}} times

Note that given Fd−2,\mathcal{F}_{d-2}, the pre-activations yj(d−1)y_{j}^{(d-1)} of different neurons in layer d−1d-1 are independent. Hence,

Recall that by assumption, the weight matrix W^(d−1)\widehat{W}^{(d-1)} in layer d−1d-1 is equal in distribution to −W^(d−1).-\widehat{W}^{(d-1)}. This replacement leaves the product ∏k=12W^γk(d−1)\prod_{k=1}^{2}\widehat{W}_{\gamma_{k}}^{(d-1)} unchanged but changes 1{yγ1(d−1)>0}{\bf 1}_{\{y_{\gamma_{1}}^{(d-1)}>0\}} to 1{yγ1(d−1)≤0}{\bf 1}_{\{y_{\gamma_{1}}^{(d-1)}\leq 0\}}. On the event Sd−1S_{d-1} (which occurs whenever yγk(d−2)>0y_{\gamma_{k}}^{(d-2)}>0) we have that yγ1(d−1)≠0y_{\gamma_{1}}^{(d-1)}\neq 0 with probability 11 since we assumed that the distribution of each weight has a density relative to Lebesgue measure. Hence, symmetrizing over ±W^(d)\pm\widehat{W}^{(d)}, we find that

Similarly, if ee is in layer i,i, then we automatically find that γ1(i−1)=γ2(i−1)\gamma_{1}(i-1)=\gamma_{2}(i-1) and γ1(i)=γ2(i)\gamma_{1}(i)=\gamma_{2}(i), giving an expectation of 1/ni−11{γ1(i)=γ2(i)γ1(i−1)=γ2(i−1)}1/n_{i-1}{\bf 1}_{\left\{\begin{subarray}{c}\gamma_{1}(i)=\gamma_{2}(i)\\ \gamma_{1}(i-1)=\gamma_{2}(i-1)\end{subarray}\right\}}. Proceeding in this way yields

which is precisely (20). The proofs of (21) and (22) are similar. We have

As before let us first assume that edges e1,e2e_{1},e_{2} are not in layer dd. Then,

Again symmetrizing with respect to ±W^(d)\pm\widehat{W}^{(d)} and using that the pre-activation of different neurons are independent given the activations in the previous layer we find that, on the event {yγk(d−2)>0}\{y_{\gamma_{k}}^{(d-2)}>0\},

where LL is the event that ∣Γ(d−1)∣=∣Γ(d)∣=1\left|\Gamma(d-1)\right|=\left|\Gamma(d)\right|=1 and e1,e2e_{1},e_{2} are not in layer d−1d-1. Proceeding in this way one layer at a time completes the proofs of (21) and (22). □\square

3. Proof of Lemma 8

For each i=1,…,di=1,\ldots,d there exists unique k=1,…,#loops(E)k=1,\ldots,\#\text{loops}(E) so that

We will say that two layers i,j=1,…,di,j=1,\ldots,d belong to the same loop of EE if exists k=1,…,#loops(E)k=1,\ldots,\#\text{loops}(E) so that

We proceed layer by layer to count the number of Γ∈Γaj,even4\Gamma\in\Gamma_{a_{j},even}^{4} satisfying Γ(0)=aj\Gamma(0)=a_{j} and EΓ=E.E^{\Gamma}=E. To do this, suppose we are given Γ(i−1)∈[ni−1]4\Gamma(i-1)\in[n_{i-1}]^{4} and we have L(E(i))=2L(E(i))=2. Then Γ(i−1)\Gamma(i-1) is some permutation of (α1,α1,α2,α2)(\alpha_{1},\alpha_{1},\alpha_{2},\alpha_{2}) with α1≠α2.\alpha_{1}\neq\alpha_{2}. Moreover, for j=1,2j=1,2 there is a unique edge (with multiplicity 22) in E(i)E(i) whose left endpoint is αj.\alpha_{j}. Therefore, Γ(i−1)\Gamma(i-1) determines Γ(i)\Gamma(i) when L(E(i))=2.L(E(i))=2. In contrast, suppose L(E(i))=1.L(E(i))=1. If R(E(i))=1,R(E(i))=1, then E(i)E(i) consists of a single edge with multiplicity 4,4, which again determines Γ(i−1),Γ(i)\Gamma(i-1),\Gamma(i). In short, Γ(i)\Gamma(i) determines Γ(j)\Gamma(j) for all jj belonging to the same loop of EE as i.i. Therefore, the initial condition Γ(0)=aj\Gamma(0)=a_{j} determines Γ(i)\Gamma(i) for all i≤i1i\leq i_{1} and the conditions e1∈γ1,e2∈γ2e_{1}\in\gamma_{1},e_{2}\in\gamma_{2} determine Γ\Gamma in the loops of EE containing the layers of e1,e2.e_{1},e_{2}.

4. Proof of Lemma 9

The proof of Lemma 9 is essentially identical to the proof of Lemma 8. In fact it is slightly simpler since there are no distinguished edges e1,e2e_{1},e_{2} to consider. We omit the details. □\square

Proof of Proposition 4

to be the event that the pre-activations of the neurons zkz_{k} are positive.

where Z1, Γ(Z,Z)2, wt⁡(γ)Z^{1},\,\Gamma_{(Z,Z)}^{2},\,\operatorname{wt}(\gamma) are defined in §3. Further, almost surely,

The proof of this result is a small modification of the proof of Lemma 6 and hence is omitted. Taking expectations, we therefore obtain the following analog to Lemma 7.

where for Γ=(γ1,…,γ4)∈Γ(Z,Z),even4\Gamma=(\gamma_{1},\ldots,\gamma_{4})\in\Gamma_{(Z,Z),even}^{4} we have

The proof is identical to the argument used in §5.2 to establish Lemma 7, so we omit the details. The relation (51) is easy to simplify:

Since the inner sum in (54) is independent of β\beta by symmetry, we find

where for the second estimate we applied Lemma 9 and have written Z′′′=(1,z2)Z^{\prime\prime\prime}=(1,z_{2}). Thus, as in the derivation of (42), we find that

Putting this together with (54) completes the proof of Lemma 14. ∎

as claimed in the statement Proposition 4. □\square

Proof of Proposition 5

Here, for a neuron ZZ and a=(a1,a2)∈[n0]2a=(a_{1},a_{2})\in[n_{0}]^{2} we’ve denoted by Γ(Z,Z,a)4\Gamma_{(Z,Z,a)}^{4} the set of four tuples (γ1,…,γ4)(\gamma_{1},\ldots,\gamma_{4}) of paths in the computational graph of N\mathcal{N} where γ1,γ2\gamma_{1},\gamma_{2} start from ZZ and γ3,γ4\gamma_{3},\gamma_{4} start at neurons a1,a2a_{1},a_{2} respectively. The analog of Lemmas 7 and 13 (with essentially the same proof), gives that the expectation in the previous line equals

which, up to a multiplicative constant equals

which is independent of e.e. Thus, we find

where if Γ=(γ1,…,γ4)\Gamma=\left(\gamma_{1},\ldots,\gamma_{4}\right) we recall that T3,4i(Γ)T_{3,4}^{i}(\Gamma) is the indicator function of the event that paths γ3,γ4\gamma_{3},\gamma_{4} pass through the same edge in the computational graph of N\mathcal{N} at layer ii (see (29)).

As in the proof of Proposition 3, observe that G^Z(Γ)T3,4i(Γ)\widehat{G}_{Z}(\Gamma)T_{3,4}^{i}(\Gamma) depends only on the unordered multiset of edges EΓE^{\Gamma} in Γ\Gamma. Thus, we find that

Applying Proposition 10 as in the end of the proof of Propositions 3 and 4 we conclude

plus a term that has mean 0.0. Therefore, as in Lemma 7, we find

where T2,3i(E)T_{2,3}^{i}(E) is as in (29), the sum is over unordered edge multisets EE (see (14)), and we’ve set

As in Lemma 8, the counting term satisfies

This completes the proof of Proposition 5. □\square

References