Tensor Programs VI: Feature Learning in Infinite-Depth Neural Networks

Greg Yang, Dingli Yu, Chen Zhu, Soufiane Hayou

Introduction

Deep neural networks have showcased remarkable performance across a broad range of tasks, including image classification, game playing exemplified by AlphaGo , and natural language processing demonstrated by GPT-4 . A prevailing trend in developing these networks is to increase their size and complexity, with empirical evidence indicating that using the same computation resources, models with more parameters tend to exhibit better performance. There are two ways to increase any network size: width and depth. The properties of the width (given a fixed depth) have been extensively studied in the literature: recent work by Yang et al. identified the Maximal Update Parametrization (μ\muP) that guarantees maximal feature learning in the infinite width limit.Here maximal feature learning refers to Θ(1)\Theta(1) change in features in the infinite width limit. This should be contrasted with the lazy training regime where the change in features is of order Θ(n1/2)\Theta(n^{-1/2}). Another benefit of μ\muP is hyperparameter transfer which enables hyperparameter tuning on smaller models; the optimal hyperparameter choice for the smaller model remains optimal for larger models (i.e., models with larger width). However, despite the achievements of large-scale deep models and the theoretical understanding of scaling width, increasing the depth of neural networks still has both practical limitations and theoretical difficulties. In practice, increasing depth beyond some level often results in performance degradation and/or significant shifts in the optimal hyperparameters. In theory, unlike increasing width, increasing depth introduces new parameters that significantly change the training dynamics. In this paper, we aim to solve this problem by extending μ\muP to include depth scaling. We call the depth scaling Depth-μ\muP.

The issue of depth scaling has persisted over time. A decade ago, deep neural networks experienced significant degradation problems — having more than a few dozen layers would increase the training error instead of improving the model’s performance. This was partly due to the vanishing or exploding gradient problem that affects the efficient propagation of information through the network. The introduction of residual networks (ResNet) has partially resolved this issue, allowing for the training of deeper networks with improved performance. ResNet is constructed by layering residual blocks, which are composed of a series of convolutional layers and then an element-wise addition with the input. This element-wise addition (commonly referred to as skip connection) is a significant innovation of ResNet and remains an important ingredient in modern architectures including Transformers .

Specifically, in a residual architecture, the ll-th residual block is formulated as

where xl1x^{l-1} is the input, xlx^{l} is the output, WlW^{l} are the parameters of the block, and glg^{l} (often called the residual branch) is a mapping that defines the layer (e.g. a stack of convolutions in ResNet, or SelfAttention and MLP in a Transformer). In this work, we focus on the case where glg^{l} is a biasless perceptron with (or without) activation.

The stacking of many residual blocks causes an obvious issue even at the initialization — the norm of xlx^{l} grows with ll, so the last layer features do not have a stable norm when increasing the depth. Intuitively, one can stabilize these features by scaling the residual branches with a depth-dependent constant. However, scaling the residual branches with arbitrarily small constants might result in no feature learning in the large depth limit since the gradients will also be multiplied with the scaling factor.

When each block glg^{l} has only one layer (one matrix multiply), we identify the parametrization we call Depth-μ\muP as the optimal parametrization for deep networks. It maximizes both feature learning and feature diversityWe give a formal definition of feature learning and feature diversity later in the paper. among all possible parametrizations of block multiplier and learning rate with depth. Our framework extends the previous results on μ\muP which deals with optimal width scaling . It completes the width scaling and hence provides a full width and depth scaling recipe that guarantees maximal feature learning and hyperparameter transfer across width and depth. Depth-μ\muP contains the following modifications to the standard practice:

There is a multiplier for each residual branch before adding to its input, which is inversely proportional to the square root of LL (where LL is the depth). Formally, with a constant aa independent from LL,

We set the learning rate of WlW^{l} so that the update of WlW^{l} during training is proportional to 1/L1/\sqrt{L}. We derive different learning rate schemes for different optimization algorithms based on this principle. For Adam, because it is scale-invariant to the gradient, the learning rate of WlW^{l} is set to be η/L\eta/{\sqrt{L}}. On the other hand, the learning rate of WlW^{l} for SGD is set as a constant η\eta because the gradient of WlW^{l} is already of size 1/L1/\sqrt{L} due to the multiplier.

In block depth 11 (i.e., glg^{l} is a biasless perceptron, WlW^{l} is a single matrix), this scaling leads to the following properties:

At the initialization, each one of the LL residual blocks contributes Θ(1/L)\Theta(1/\sqrt{L}) to the main branch. These LL contributions are independent of each other, so the sum of them is of size Θ(1)\Theta(1).

During training, the contribution of the update of each residual block is Θ(1/L)\Theta(1/L) due to the combining effect of the learning rate and multiplier. The contributions of the updates are highly correlated, so they sum up to Θ(1)\Theta(1).

More detailed intuition of this scaling approach can be found in Section 3 where we provide a simple analysis with linear networks after one gradient step. We give a complete classification of depthwise parametrizations in section 7.

We thoroughly compare Depth-μ\muP with other scaling strategies with a branch multiplier Lα\propto L^{-\alpha} and parameter update Lγ\propto L^{-\gamma}.It implies that the effective learning rate is proportional to LγL^{-\gamma} for Adam and LαγL^{\alpha-\gamma} for SGD if the network is stable at initialization. As shown in Figure 1, the space of (α,γ)(\alpha,\gamma) is divided into several areas, each resulting in a different behavior when LL\to\infty:

Having α1/2\alpha\geq 1/2 is required to stabilize the network at initialization. This ensures that he hidden activations and the network output do not explode at initialization;

For any α+γ<1\alpha+\gamma<1, the network is unstable during training. The change in hidden activations or the network output explodes with depth during training;

For any α+γ>1\alpha+\gamma>1, training outcome is trivial. The change of the network vanishes as depth increases;

For any α+γ=1\alpha+\gamma=1 with α>1\alpha>1, the network is unfaithful (a formal definition will provided later in the paper). The hidden activations explode during training as depth increases;

For any α+γ=1\alpha+\gamma=1 and α(1/2,1]\alpha\in(1/2,1], we show that the network converges to a redundant limit that lacks feature diversity, in that close layers have similar outputs (in a neural ODE fashion).

The only choice of α\alpha and γ\gamma left is α=γ=1/2\alpha=\gamma=1/2, which corresponds to Depth-μ\muP.

The rigorous definitions and proofs are presented in Section 7.

2 Hyperparameter Transfer for Depth.

The optimality of Depth-μ\muP implies (under some assumptions) that the optimal hyperparameters of the networks also converge as the depth (LL) increases. This convergence suggests that the optimal hyperparameters of shallower networks are approximately equal to those of deeper networks. As a direct implication, we can leverage this property to infer the hyperparameters for deeper networks from the shallower ones, effectively reducing the cost associated with hyperparameter tuning. With Depth-μ\muP, we successfully train networks comprising thousands of residual blocks, while also showcasing the transferability of hyperparameters across depth.

3 Impossibility Results for Block Depth ≥2absent2\geq 2

While the block depth 1 case admits a positive result, we show that the block depth 2\geq 2 case does not and cannot (section 9). The basic issue is the weights in different layers within a block is forced to interact additively instead of multiplicatively when depth is large, if one wants to retain diversity. This causes block depth 2\geq 2 to have worse performance than block depth 11 and for the optimal hyperparameters to shift with depth. We demonstrate this pedagogically on resnet with MLP blocks but also on Megatron transformer trained on Common Crawl. These observations entail the need to rethink the current approach to hyperparameter transfer.

Related Works

The infinite-width limit of neural networks has been a topic of extensive research in the literature. Numerous studies have predominantly focused on examining the behavior of various statistical quantities at initialization. Some works have gone beyond the initialization stage to explore the dynamics of feature learning in neural networks.

With standard parametrization, a learning rate of order O(n1)\mathcal{O}(n^{-1}),We also obtain the lazy infinite-width limit with the NTK parametrization and a O(n1/2)\mathcal{O}(n^{-1/2}) learning rate. nn being the width, yields the so-called lazy training regime in the infinite-width limit, where the features remain roughly constant throughout training . This regime is also known as the Neural Tangent Kernel (NTK) regime and its convergence properties have been extensively studied in the literature .

Recent empirical studies (e.g. ) have provided compelling evidence that feature learning plays a crucial role in the success of deep learning. It is widely acknowledged that the remarkable performance achieved by deep neural networks can be attributed to their ability to acquire meaningful representations through the process of training. Consequently, scaling the network architecture emerges as a natural choice to enhance the performance of such models.

In this context, μ\muP (Maximal Update Parameterization), introduced in , has emerged as a promising approach for maximizing feature learning while simultaneously preventing feature explosion as the network width increases, given a fixed depth. Notably, μ\muP facilitates hyperparameter transfer across varying network widths. This means that instead of tuning hyperparameters directly on large models, one can optimize them on smaller models and utilize the same set of hyperparameters for larger models.

The derivation of μ\muP leverages the Tensor Programs framework , which provides valuable tools for capturing the behavior of neural networks in the infinite-width regime during the training process.

2 Depth Scaling

While increasing the width of neural networks can lead to improved performance, increasing the depth of the network also yields significant performance gains, and most state-of-the-art models use deep architectures. The introduction of skip connections played a pivotal role in enabling the training of deep networks. However, it became apparent that even with skip connections and normalization layers, training deep networks remains a challenging task . Moreover, tuning hyperparameters for large depth networks is a time-and-resource-consuming task.

To address the challenges associated with training deep networks, several studies have proposed scaling the network blocks using a depth-dependent scaler to ensure stability of features and gradients at initialization or in the kernel regime . However, these works lack insights into the dynamics with feature learning. For instance, one might argue that features can still experience explosive growth if the learning rate is not properly chosen. Therefore, an effective depth scaling approach should not only ensure stability at initialization but also provide guidelines for scaling the learning rate.

This motivation underlies the development of Depth-μ\muP, which offers a comprehensive framework for depth scaling. Depth-μ\muP encompasses block multipliers and learning rate scaling, providing a complete recipe for training deep networks. In the case of Multi-Layer Perceptrons (MLPs) (no skip connections), Jelassi et al. showed that a learning rate scaling of depth3/2depth^{-3/2} guarantees stability after the initial gradient step. However, it remains unclear how the learning rate should be adjusted beyond the first step, and this scaling is not suitable for architectures with residual connections.

Warm-Up: An Intuitive Explanation with Linear Networks

Let us begin with a simple example that provides the necessary intuition underpinning our depth scaling strategy. Given a depth LL, width nn, consider a linear residual network of the form

To simplify the analysis, we consider gradient updates based on a single datapoint. The first gradient step is given by

where η\eta is the learning rate, and G0lG^{l}_{0} is a matrix with update directions. For instance, we have the following expressions for G0lG^{l}_{0} with SGD and Adam:

AdamFor the sake of simplification, we consider SignSGD in this section, which can be seen as a memory-less version of Adam. The analysis is valid for any training algorithm that gives Θ(1)\Theta(1) gradients.: G0l=sign(1Lδxlxl1)G^{l}_{0}=\textrm{sign}\left(\frac{1}{\sqrt{L}}\delta x^{l}\otimes x^{l-1}\right).

where AL=l=1L[k>l(I+1LW0k)]G0l[k<l(I+1LW0k)]x0A_{L}=\sum_{l=1}^{L}\left[\prod_{k>l}\left(I+\frac{1}{\sqrt{L}}W^{k}_{0}\right)\right]G^{l}_{0}\left[\prod_{k<l}\left(I+\frac{1}{\sqrt{L}}W^{k}_{0}\right)\right]x^{0}. We argue that ALA_{L} behaves as Θ(L)\Theta(L) (in L2L_{2} norm). This is the due to the 1/L1/\sqrt{L} scaling factor. To see this, we further simplify the analysis by considering the case din=n=dout=1d_{in}=n=d_{out}=1 (single neuron per layer) and the squared loss. In this case, the term ALA_{L} simplifies to

With SGD, we have that G0l=1Lkl(1+1LW0k)x0δxLG^{l}_{0}=\frac{1}{\sqrt{L}}\prod_{k\neq l}\left(1+\frac{1}{\sqrt{L}}W^{k}_{0}\right)x_{0}\delta x^{L}, where δxL=(VxLy(ξ0))\delta x^{L}=(Vx^{L}-y(\xi_{0})) and y(ξ0)y(\xi_{0}) is the target output. Therefore, it is easy to see that

Hence, the magnitude of the first order term in eq. 2 is given by

which shows that the update is stable in depth as long as η=Θ(1)\eta=\Theta(1) in depth. More precisely, this is the maximal choice of learning rate that does not lead to exploding features as depth increases.

With Adam, we have G0l=±1G^{l}_{0}=\pm 1, and therefore we obtain

where we have used the same arguments as before. In this case, the first order term in eq. 2 is given by

Therefore, the maximal learning rate that one can choose without exploding the features is given by η=Θ(L1/2)\eta=\Theta(L^{-1/2}).

Summary: By ensuring that parameter update is Θ(1/L)\Theta(1/\sqrt{L}), the features remain stable while feature update is Θ(1)\Theta(1). This Θ(1)\Theta(1) update is due to the accumulation of Θ(1/L)\Theta(1/L) correlated terms across depth.

2 Convergence when Depth goes to ∞\infty

Let us look at x1Lx^{L}_{1} again in the simple case din=dout=n=1d_{in}=d_{out}=n=1 and analyze its behaviour when LL\to\infty. This paragraph is only intended to give an intuition for the convergence. A rigorous proof of such convergence will be later presented in the paper. Let us consider the case with SGD training with learning rate η=1\eta=1 and let ML,l=kl(1+1LW0k)M_{L,l}=\prod_{k\neq l}\left(1+\frac{1}{\sqrt{L}}W_{0}^{k}\right) and τ=(Vx0Ly(ξ0))x0\tau=(Vx^{L}_{0}-y(\xi_{0}))x^{0}. With this, we have the following

WLOG, let us assume that x00>0x^{0}_{0}>0. Then, with high probability (the event that W0lLW^{l}_{0}\ll\sqrt{L}, for some notion of “\ll”, occurs with a probability of at least 1eLα1-e^{-L^{\alpha}} for some α>0\alpha>0)This follows from simple concentration inequalities for sub-exponential random variables., we have that x1L>0x^{L}_{1}>0. We can therefore look at log(x1L)\log(x^{L}_{1}) which simplifies the task. Taking the log and using Taylor expansion under a high probability event, we obtain

for some ϵ>0\epsilon>0. The first and third terms 1Ll=1LW0l\frac{1}{\sqrt{L}}\sum_{l=1}^{L}W^{l}_{0} and l=1L(W0l)2L\frac{\sum_{l=1}^{L}(W^{l}_{0})^{2}}{L} converge (almost surely) to a standard Gaussian and 11, respectively. The second term also converges naturally, since x0Lx^{L}_{0} converges in L2L_{2} to a Log-Normal random variable () and with a delicate treatment (involving high probability bounds), one can show that the term 1Ll=1L11+1LW0l\frac{1}{L}\sum_{l=1}^{L}\frac{1}{1+\frac{1}{\sqrt{L}}W^{l}_{0}} converges (in L2L_{2} norm) at large depth. This implies that one should expect x1Lx^{L}_{1} to have some notion of weak convergence as depth grows. Note that the same analysis becomes much more complicated for general width n>0n>0. To avoid dealing with high probability bounds, a convenient method consists of taking the width to infinity first nn\to\infty, then analyzing what happens as depth increases. We discuss this in the next section.

3 A Discussion on the General Case

The extension to the general width scenario (n>1n>1) necessitates a more intricate treatment of the term AlA_{l} to find optimal scaling rules, yet the proposed scaling remains optimal for general width. This preliminary analysis lays the groundwork for proposing a specific learning rate scaling scheme that maximizes feature learning. Moreover, demonstrating the optimality of this scaling strategy in the presence of non-linearities is a non-trivial task. The primary challenge stems from the correlation among the post-activations induced during the training process. Overcoming these challenges requires a rigorous framework capable of addressing the large depth limit of crucial quantities in the network.

For this purpose, we employ the Tensor Program framework to investigate the behavior of essential network quantities in the infinite-width-then-depth limit. By leveraging this framework, our theoretical findings establish that the aforementioned scaling strategy remains optimal for general networks with skip connections. Our framework considers the setup where the width is taken to infinity first, followed by depth. This represents the case where 1depthwidth1\ll depth\ll width, which encompasses most practical settings (e.g. Large Language Models).

A naive approach to depth scaling can be as follows: since the weights WtkW^{k}_{t} might become highly correlated during training, one has to scale the blocks with 1/L1/L. To understand this, let us assume a block multiplier of LαL^{-\alpha} and consider the scenario of perfect correlation where all weights are equal, i.e., Wtk=WW^{k}_{t}=W for every k1,,Lk\in{1,\dots,L}. In this case, the last layer features can be expressed as xL=(I+LαW)Lx0x^{L}=\left(I+L^{-\alpha}W\right)^{L}x_{0}. When α=1/2\alpha=1/2, the features are likely to exhibit an explosive growth with increasing depth, while opting for α=1\alpha=1 is guaranteed to stabilize the features.

However, in this paper, we demonstrate that this intuition does not align with practical observations. Contrary to expectations, the features do not undergo an explosive growth as the depth increases when α=1/2\alpha=1/2. This phenomenon is attributed to two key factors: random initialization and learning rate scaling with depth. These factors ensure that the weight matrices never become highly correlated in this particular fashion during the training process.

In summary, while a naive depth scaling strategy based on scaling blocks might suggest the need for α=1\alpha=1 to stabilize the features, our findings reveal that in practice, this is not the case. The interplay of random initialization and learning rate scaling effectively prevents the features from experiencing explosive growth, even with the choice of α=1/2\alpha=1/2.

SGD Training Dynamics of Infinitely Deep Linear Networks

In this section, we continue to study the linear neural network with residual connections under Depth-μ\muP. Using the Tensor Program framework , we rigorously derive the training dynamics of SGD for the linear residual network when the width and the depth sequentially go to infinity. The road map of our analysis consists the following three steps.

Since the network is linear, every random variable can be written as a linear combination of a set of zero-mean “base” random variables by the Master Theorem of Tensor Programs . Therefore, we can track the random variables by analyzing the coefficients of their corresponding linear combinations, along with the covariance between the “base” random variables.

Since the number of random variables and the number of “base” random variables scale linearly with LL, the coefficients of all random variables can be represented by a six-dimensional tensor, where two of the dimensions have shape LL. We then map the tensor to a set of functions whose input domain is ×\times. Finally, we claim that the functions converge when LL\to\infty, and identify their limits as the solution of a set of functional integrals.

In Section 10.1, we conduct a thorough empirical verification of our theory in the linear case. The experiments clearly show the convergence of deep linear residual networks under Depth-μ\muP.

1 Width Limit under μ𝜇\muP

Now when we look back to Program 1, the definitions of scalars and random variables should be clear (except for \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l}x_{t}^{l-1}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l\top}\widetilde{\delta}x_{t}^{l}\rangle). One can find straightforward correspondence between those and their finite counterpart, for example:

f˚t\mathring{f}_{t} corresponds to ftf_{t}, and χ˚t\mathring{\chi}_{t} corresponds to χt\chi_{t};

\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle corresponds to xtlx_{t}^{l} and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle corresponds to δ~xtl\widetilde{\delta}x_{t}^{l}. (Recall δ~xtl=nδxtl\widetilde{\delta}x_{t}^{l}=n\cdot\delta x_{t}^{l} is the normalized version of δxtl\delta x_{t}^{l}.)

By SGD, Wtl=W0l1Ls=0t1δxslxsl1W_{t}^{l}=W_{0}^{l}-\frac{1}{\sqrt{L}}\sum_{s=0}^{t-1}\delta x_{s}^{l}\otimes x_{s}^{l-1}, which corresponds to \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{t}^{l}x_{t}^{l-1}\rangle=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l}x_{t}^{l-1}\rangle-\frac{1}{\sqrt{L}}\sum_{s=0}^{t-1}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s}^{l}\rangle\langle x_{s}^{l-1}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l-1}\rangle.

Now we can dive into the definition of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l}x_{t}^{l-1}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l\top}\widetilde{\delta}x_{t}^{l}\rangle. Let W\mathcal{W} be the set of initial random matrices of size n×nn\times n, i.e., {W01,,W0L}\{W_{0}^{1},\ldots,W_{0}^{L}\}, and W=def{W:WW}\mathcal{W}^{\top}\mathbin{\overset{\text{{def}}}{=}}\{W^{\top}:W\in\mathcal{W}\}. Let VW\mathcal{V}_{W} denote the set of all vectors in training of the form WyWy for some yy. Then for every WWWW\in\mathcal{W}\cup\mathcal{W}^{\top}, and WyVWWy\in\mathcal{V}_{W}, we can decompose \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\rangle into the sum of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\dot{\rangle\mkern-3.0mu}\mkern 3.0mu, where \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu is a random variable that act as if WW were independent of yy, and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\dot{\rangle\mkern-3.0mu}\mkern 3.0mu is the random variable capturing the correlation part between WW and yy. Specifically, let us briefly track what happens to W0lxtl1W^{l}_{0}x^{l-1}_{t} during training. In the first step, we have W0lx0l1W^{l}_{0}x^{l-1}_{0} which has roughly Gaussian coordinates (in the large width limit). In this case, we have \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W^{l}_{0}x^{l-1}_{0}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu=0. After the first backprop, we have δx0l1=δx0l+1LW0lδx0l\delta x^{l-1}_{0}=\delta x^{l}_{0}+\frac{1}{\sqrt{L}}W^{l\top}_{0}\delta x^{l}_{0}, which means that the update in Wl1W^{l-1} will contain a term of the form W0lzW^{l\top}_{0}z for some vector zz. This implies that W0lx1l1W^{l}_{0}x^{l-1}_{1} will contain a term of the form W0lW0lzW^{l}_{0}W^{l\top}_{0}z^{\prime} for some vector zz^{\prime}. This term induces an additional correlation term that appears when we take the width to infinity. The \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W^{l}_{0}x^{l-1}_{1}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu is defined by isolating this additional correlation term from W0lW0lzW^{l}_{0}W^{l\top}_{0}z^{\prime}. The remaining term is Gaussian in the infinite-width limit, which defines the term \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W^{l}_{0}x^{l-1}_{1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu. Formally, we present the following definition.

We define \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\rangle\mathbin{\overset{\text{{def}}}{=}}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu+\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\dot{\rangle\mkern-3.0mu}\mkern 3.0mu for every WWWW\in\mathcal{W}\cup\mathcal{W}^{\top} and WyVWWy\in\mathcal{V}_{W}, where

\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu is a Gaussian variable with zero mean. WWW,Wy,WzVW\forall W\in\mathcal{W}\cup\mathcal{W}^{\top},Wy,Wz\in\mathcal{V}_{W},

W,WWW,WyVW,WzVW\forall W,W^{\prime}\in\mathcal{W}\cup\mathcal{W}^{\top},Wy\in\mathcal{V}_{W},W^{\prime}z\in\mathcal{V}_{W^{\prime}}, \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W^{\prime}z\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu are independent if WWW\neq W^{\prime}. \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu is also independent from \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle.

\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wy\dot{\rangle\mkern-3.0mu}\mkern 3.0mu is defined to be a linear combination of \{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}z\rangle:W^{\top}z\in\mathcal{V}_{W^{\top}}\}. Then we can unwind any \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y\rangle inductively as a linear combination of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bullet\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu, \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle, which allows us to fully define

2 Depthwise Scaling of Random Variables

As mentioned in 4.1, both \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l-1}\rangle can be written as linear combination of “base” random variables: \{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m}x_{s}^{m-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu\}_{s\in\{0,\ldots,t\},m\in[L]},\{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{s}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu\}_{s\in\{0,\ldots,t\},m\in[L]},\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle. Moreover, the coefficients of the linear combinations can be calculated in a recursive way: by expanding \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l}x_{t}^{l-1}\rangle using 4.1, we have

The recursive formula for \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle is similar.

Using this induction, we claim in the linear combinations, the coefficient of every \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bullet\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu is O(1/L)\mathcal{O}(1/\sqrt{L}), and the coefficient of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle is O(1)\mathcal{O}(1). We also claim the covariance between any pairs of random variables in the form of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l-1}\rangle is O(1)\mathcal{O}(1).

t,st,l,m\forall t,\forall s\leq t,\forall l,m, \forall\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y\rangle\in\{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle\},

t,s,l,m\forall t,s,l,m, \forall\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y\rangle\in\{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle\}, \forall\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}z\rangle\in\{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{s}^{m}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s}^{m}\rangle\},

The reasoning of 4.2 is provided in Appendix C. Note the computation of covariance can also be written as a recursive formula. The reasoning relies essentially on an inductive argument.

3 Infinite Depth Limit

Now we formalize our argument above and obtain the formula describing the dynamics of the network when LL\to\infty. We first write the coefficients of the linear combinations as a six dimensional tensor Γt,s,a,b,l,m\mathbf{\Gamma}_{t,s,a,b,l,m}, where t,s{0,,T1},a,b{0,1},l,m[L]t,s\in\{0,\ldots,T-1\},a,b\in\{0,1\},l,m\in[L]. Specifically, Γt,s,a,b,l,m\mathbf{\Gamma}_{t,s,a,b,l,m} represents the derivative of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle w.r.t. \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m}x_{s}^{m-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{s}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu. Here, we use to denote kets appears in the forward pass (\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m}x_{s}^{m-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu), and 11 to denote kets in the backward pass (\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{s}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu). Formally, \mathbf{\Gamma}_{t,s,0,0,l,m}=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m}x_{s}^{m-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}, \mathbf{\Gamma}_{t,s,0,1,l,m}=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{s}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}, \mathbf{\Gamma}_{t,s,1,0,l,m}=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m}x_{s}^{m-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}, \mathbf{\Gamma}_{t,s,1,1,l,m}=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{s}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}.

For s=1s=-1, \Gamma_{t,-1,0,0}\left(p,q\right)=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{\lceil Lp\rceil}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle},\Gamma_{t,-1,0,1}\left(p,q\right)=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{\lceil Lp\rceil}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle},\Gamma_{t,-1,1,0}\left(p,q\right)=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{\lceil Lp\rceil}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle},\Gamma_{t,-1,1,1}\left(p,q\right)=\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{\lceil Lp\rceil}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle}.

Here l,ml,m are normalized to $sotheinputdomainofso the input domain of\Gammasareidenticalfordifferents are identical for differentL;;\mathbf{\Gamma}_{t,s,a,b,l,m}ismultipliedbyis multiplied by\sqrt{L}becausebecause\mathbf{\Gamma}_{t,s,a,b,l,m}=\mathcal{O}(1/\sqrt{L})by4.2;andtheextraby 4.2; and the extras=-1casehelpsusalsocapturethederivativew.r.t.case helps us also capture the derivative w.r.t.\mathchoice{\scalebox{0.7}[1.0]{\talloblong\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\talloblong\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\talloblong\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\talloblong\scriptscriptstyle\talloblong}}U\rangleandand\mathchoice{\scalebox{0.7}[1.0]{\talloblong\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\talloblong\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\talloblong\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\talloblong\scriptscriptstyle\talloblong}}nV\rangle$.

Using this definition of Γ\Gamma and CC, it is convenient to write their recursive formula in the following lemma.

Γ\Gamma and CC can be computed recursively as follows:

where l=Lp1l=\lceil Lp\rceil-1 if a=0a=0, and l=Lpl=\lceil Lp\rceil if a=1a=1.

The proof of Lemma 4.3 is straightforward from Program 1. In Appendix C, we also give a formal proof that Γ\Gamma and CC converge when LL grows to infinity, in the case where LL is powers of 22. The restriction on LL being powers of 22 is imposed for the convenience of the proof, and the convergence of Γ\Gamma and CC is true in the general case. Moreover, we derive the infinite depth behavior based on the recursion of Γ\Gamma and CC in Lemma 4.3.

This gives a convergence in distribution:

In the LL\to\infty limit, the kets \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x^{L}_{s}\rangle,s=0,1,\ldots, converge in distribution as a zero-mean Gaussian process with kernel

Thus, for each fixed neuron index α\alpha, the collection {xαsL}s0\{x^{L}_{\alpha s}\}_{s\geq 0} converges in distribution to a zero-mean Gaussian process with kernel Ct,s,1(1)C_{t,s,1}(1) in the nn\to\infty then LL\to\infty limit.

For audience familiar with stochastic processes, we in fact have a weak convergence of the entire continuous-depth-indexed process \{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x^{p}_{s}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\delta x^{p}_{s}\rangle\}_{p\in,s\geq 0} in the Skorohod topology.

What Causes Hyperparameter Transfer?

In a popular misconception, hyperparameter transfer is implied by the existence of a limit. For example, the fact that μ\muP transfers hyperparameters, in this misconception, is because of the existence of the feature learning limit (aka the μ\mu limit), the limit of μ\muP as width goes to infinity. However, this is not the case. Indeed, there are a plethora of infinite-width limits, such as the NTK limit, but there can only be one way how the optimal hyperparameters scale, so existence cannot imply transfer. In a stronger version of this misconception, transfer is implied by the existence of a “feature learning” limit. But again, this is False, because there are infinite number of feature learning limits (where the μ\mu limit is the unique maximal one).

Instead, what is true is that the optimal limit implies the transfer of optimal hyperparameters. For example, in the width limit case, μ\muP is the unique parametrization that yields a maximal feature learning limit. Compared to all other limits, this is obviously the optimal one. Hence μ\muP can transfer hyperparameters across width.

So far, there is no a priori definition for the “optimality” of a limit: One can only tell by classifying all possible limits; it turns out only a small number of different behavior can occur in the limit, and thus one can manually inspect for which limit is the optimal one.

Similarly, in this work, to derive a depthwise scaling that allows transfer, we need to classify all possible infinite depth limits — and Depth-μ\muP will turn out to be optimal in a sense that we define later in the paper.There are important nuances here that will be spelled out in an upcoming paper. For example, if the space of hyperparameters is not chosen correctly, then it could appear that no limit is optimal in any manner. For example, if one in (widthwise) SP, one only thinks about the 1D space of the global learning rate, then all infinite-width limits are defective — and indeed there is no hyperparameter transfer where the bigger always does better. More interestingly than the width case, here we have multiple modes of feature learning when taking the depth limit and it is important to discern which mode of feature learning is optimal. Thus, again, it is insufficient to derive any one limit, even with feature learning, and be able to infer it yields HP transfer.

In section 10, we provide experiments with 1/L1/L block scaling (α,γ)=(1,0)(\alpha,\gamma)=(1,0), aka ODE scaling, which provably induces feature learning in the infinite-depth limit, but is sub-optimal. Our results show a significant shift in the optimal learning rate with this parametrization.

Preliminaries for the General Case

For the general case, we recall and extend the notation from the previous sections and also define new ones.

1 Unified Scaling for SGD, Adam, and All Entrywise Optimizers

We extend the definition of entrywise update () for depth scaling, allowing us to study the unified depth scaling for SGD, Adam, and other optimization algorithms that perform only entrywise operations.

where gs,s=0,,tg_{s},s=0,\ldots,t, are the gradients of ww at time ss.

For SGD, Qt(ndLδg0,,ndLδgt)=ndLδgtQ_{t}(n^{d}L^{\delta}g_{0},\ldots,n^{d}L^{\delta}g_{t})=n^{d}L^{\delta}g_{t}, and the “true” learning rate is ηnc+dLγ+δ\eta n^{-c+d}L^{-\gamma+\delta}. For Adam,

and the “true” learning rate is ηncLγ\eta n^{-c}L^{-\gamma}.

The purpose of multiplying the gradients ndLδn^{d}L^{\delta} before QtQ_{t} is to make sure the inputs to QtQ_{t} are Θ(1)\Theta(1) w.r.t. nn and LLIt is called faithfulness in Yang and Littwin .; otherwise, the update might be trivial when nn and LL become large. For example, if gradients are o(1)o(1) entrywise, then, in Adam, directly feeding gradients to QtQ_{t} will always give an output of because of the constant ϵ>0\epsilon>0.

In this paper, we will only consider d,δd,\delta such that ndLδgn^{d}L^{\delta}g is Θ(1)\Theta(1).Note c,d,δ,γ,ηc,d,\delta,\gamma,\eta in Definition 6.1 can be different for parameters, so it is possible to make every parameter to satisfy the condition. As a result, the output of QtQ_{t} is also Θ(1)\Theta(1) in general. Therefore, ncLγn^{-c}L^{-\gamma} decides the scale of the update and should be our focus. We call ηncLγ\eta n^{-c}L^{-\gamma} the effective learning rate.

2 μ𝜇\muP and Widthwise Scaling

Maximal update parametrization (μ\muP) considers the change of initialization and learning rate of each weight matrix in the network when width scales up.Reparametrization is also included in the original μ\muP, but it is not necessary for the purpose of this paper. It provides a unique initialization and learning rate of each weight matrix as a function of width nn that makes the update of each weight matrix maximal (up to a constant factor). The benefit of μ\muP is not only the theoretical guarantee but also the hyperparameter stability when scaling up the width .

In this paper, we assume the widthwise scaling follows μ\muP. That is, the cc in the effective learning rate ηncLγ\eta n^{-c}L^{-\gamma} and the initialization variance of each weight matrix follows Table 2.

3 Our Setup

We consider an LL-hidden-layer residual network with biasless perceptron blocks:

In general, without mean subtraction, the mean of ϕ\phi will dominate the depthwise dynamics. For example, when ϕ\phi is relu, each layer will only add nonnegative quantities to xlx^{l} that on average is positive. Its accumulation over depth either causes the network output to blow up if the multiplier LαL^{-\alpha} is too large, or lack feature diversity otherwise. As we shall see, mean subtraction removes this failure mode and enable more powerful infinite-depth limits.Note that using an odd nonlinearity will also achieve similar results because they have no mean under a symmetrically distributed input, which is approximately the case for hlh^{l} throughout training. This is the case for ϕ\phi = identity that we discussed earlier. But it turns out odd nonlinearities minimize feature diversity, so mean subtraction is a much better solution.

We independently initialize each entry of WlW^{l} from N(0,n1)\mathcal{N}(0,n^{-1})

The gradients of WlW^{l} are multiplied by nLδnL^{\delta} before being processed by QtQ_{t}: i.e., the update at time tt is

where gs,s=0,,tg_{s},s=0,\ldots,t, are the gradients of WlW^{l} at time ss and QtQ_{t} is applied entrywise.

Classification of Depthwise Parametrizations

In this section, we provide a comprehensive description of the impact of depth parametrization on stability and update size. For this purpose, we only have two scalings to keep track of: the branch multiplier and the learning rate scaling because the initialization scale is fixed by the faithfulness property (defined below). Requiring that the features don’t blow up at initialization means that the branch multipliers must be at most Θ(1/L)\Theta(1/\sqrt{L}). Assuming the updates are faithful (i.e., input to gradient processing functions are Θ(1)\Theta(1) entrywise), the update size can be at most 1/L1/L for the hidden layers, by an (Jacobian) operator-norm argument, but potentially much less. Naively speaking, there can be a trade-off between update size and initialization: if initialization is large, then the update may need to be small so as not to blow up the other parts of the network; likewise if the initialization is small, then the update size can be larger. But one may be surprised that a careful calculation shows that there is no trade-off: we can maximize both initialization and update size at the same time.

Remark: in this section, we state the results as “claims” instead of theorems. In Appendix F.4, we provide “heuristic” proofs that can be made rigorous under non-trivial technical conditions. We also showcase the correctness of the claims by proving them rigorously in our linear setting in Appendix D. We believe this additional layer of complexity is unneeded and does not serve the purpose of this paper.

A training routine is the package of η\eta, Q\bm{Q}, and the input batches.

stable during training if for any training routine, any time t0t\geq 0, l[L]l\in[L], we have

where the symbol ‘Δ\Delta’ refers to the change after one gradient step.

We say the parametrization is stable if it is stable both at initialization and during training.

We say a parametrization is faithful at step tt if htl=Θ(1)\bm{h}_{t}^{l}=\Theta(1) for all l[L]l\in[L]. We say the parametrization is faithful if it is faithful for all tt. We also say it is faithful at initialization (resp. faithful during training) if this is true at t=0t=0 (resp. for t1t\geq 1).

Note faithfulness here refers to “faithfulness to ϕ\phi”, meaning the input to ϕ\phi is Θ(1)\Theta(1). This is different from the definition of faithfulness in Yang and Littwin , where faithfulness refers to “faithfulness to QQ” meaning the input to QQ is Θ(1)\Theta(1). “faithfulness to QQ” is already assumed in this work as mentioned in Section 6.1.

We say a parametrization induces feature learning in the limit “nn\to\infty, then LL\to\infty”, if there exist a training routine, and t1t\geq 1, and any λ>0\lambda>0, we have ΔhtλL=Θ(1)\Delta\bm{h}_{t}^{\lfloor\lambda L\rfloor}=\Theta(1).

We are now ready to state the main results. The next claim provides a necessary and sufficient condition under which a parametrization is stable at initialization.

A parametrization is stable at initialization iff α1/2\alpha\geq 1/2.

Claim 7.1 is not new and similar results were reported by Hayou et al. . However, Hayou et al. focuses on initialization and lacks a similar stability analysis during training. In the next result, we identify two different behaviours depending on the scaling of the learning rate.

Consider a parametrization that is stable at initialization. Then the following hold (separately from each other).

It is stable during training as well iff α+γ1\alpha+\gamma\geq 1.

It is nontrivial iff α+γ1\alpha+\gamma\leq 1.

Therefore, it is both stable and nontrivial iff α+γ=1\alpha+\gamma=1.

From Claim 7.1 and Claim 7.2, having α+γ=1\alpha+\gamma=1 and α1/2\alpha\geq 1/2 is a necessary and sufficient condition for a parametrization to be stable and nontrivial throughout training. In the next result, we therefore restrict our analysis to such parametrizations and study their faithfulness.

Consider a stable and nontrivial parametrization. The following hold (separately from each other).

It is faithful at initialization iff α1/2\alpha\geq 1/2. As a result, α=1/2\alpha=1/2 is the minimal choice of α\alpha that guarantees faithfulness.

It is faithful during training iff α1\alpha\leq 1.

Therefore, a stable and nontrivial parametrization is faithful iff α[1/2,1]\alpha\in[1/2,1].

The first claim follows from well-known calculations of randomly initialized residual networks . For the second claim, the intuition here is just that if α+γ=1\alpha+\gamma=1 and α>1\alpha>1 then γ<0\gamma<0, i.e., the update size blows up with depth. This would then cause the input to the nonlinearities to blow up with size.

One might argue that faithfulness at initialization is not important (e.g. features at initialization could converge to zero without any stability or triviality issues) and what matters is faithfulness throughout training. It turns out that faithfulness at initialization plays a crucial role in the optimal use of network capacity. To see this, we first define the notion of feature diversity exponent, which relates to the similarity in the features of adjacent layers.

We say a parametrization has feature diversity exponent κ0\kappa\geq 0 if κ\kappa is the maixmal value such that for all λ\lambda\in and sufficiently small ϵ>0\epsilon>0, and all time tt,

where Ω(1)\Omega(1) should be interpreted in the limit “nn\to\infty, then LL\to\infty, then ϵ0\epsilon\to 0”. We say a parametrization is redundant if κ=0\kappa=0.

In other words, the feature diversity exponent κ\kappa is a measure of how different the outputs are in layers that are close to each other. With κ=0\kappa=0, the output of each layer is essentially the same as the output of the previous layer in the sense that the rate of change from one layer to the next is bounded (at least locally), and hence the network is intuitively “wasting” parameters.

Consider a stable and nontrivial parametrization that is furthermore faithful during training (but not necessarily at initialization). Then it is redundant if α(1/2,1]\alpha\in(1/2,1].

To understand the intuition behind Claim 7.4, let us see what happens when α>1/2\alpha>1/2. In this case, the randomness of the initialization weights will have no impact on training trajectory as depth increases. To see this, consider some layer index λL\lfloor\lambda L\rfloor. The blocks are divided by LαL^{\alpha} which is larger than the magnitude of accumulated randomness (of order (λL)1/2(\lambda L)^{1/2}). This basically destroys all the randomness from initialization and therefore the randomness in the learned features will consist only of that coming from UU and VV (input and output matrices). When depth goes to infinity, the contribution of the randomness in two adjacent layers becomes less important, we end up with adjacent layers becoming very similar because the gradients to these layers are highly correlated.

In contrast, we have the following result, which defines Depth-μ\muP.

α=γ=1/2\alpha=\gamma=1/2 is the unique parametrization that is stable, nontrivial, faithful, induces feature learning, and achieves maximal feature diversity with κ=1/2\kappa=1/2.

In terms of feature diversity, a phase transition phenomenon occurs when α=1/2\alpha=1/2. More precisely, for Depth-μ\muP, we can show that n1/2xt(λ+ϵ)LxtλL=O(ϵ1/2)n^{-1/2}\left\|{\bm{x}^{\lfloor(\lambda+\epsilon)L\rfloor}_{t}-\bm{x}_{t}^{\lfloor\lambda L\rfloor}}\right\|=\mathcal{O}(\epsilon^{1/2}) while the same quantity is O(ϵ)\mathcal{O}(\epsilon) for all α(1/2,1]\alpha\in(1/2,1], which suggests that Depth-μ\muP yields rough path for xt\bm{x}_{t}. This allows the features to change significantly from one layer to the next, hence efficiently using the parameters. For readers who are familiar with rough path theory, the 1/21/2 continuity exponent is a result of Brownian increments in the path.The reader might ask whether we can obtain an exponent smaller than 1/21/2. This is indeed possible, but it will entail using correlated weights. We leave this question for future work.

Moreover, with α=1\alpha=1, there is a phenomenon of feature collapse in the sense that the features will be contained in the σ\sigma-algebra generated by the input and output layers, but contains no randomness from the hidden layers (see Section F.2). Intuitively, the case of α=1\alpha=1 is analogous to width situation, where deep mean field collapses to a single neuron (all neurons become essentially the same). For depth, the features (layers) are still relatively different but the redundancy does not allow significant variety in these features.

2 Sublety: Layerwise (local) linearization but not global linearization

We say a parametrization induces layerwise linearization iff each layer can be linearized without changing the network output when LL\to\infty, that is, l[L]\forall l\in[L],

A stable and nontrivial parametrization induces layerwise linearization iff α[1/2,1)\alpha\in[1/2,1).

However, note that this does not imply the entire network is linearized (w.r.t. all the parameters in the sense of Neural Tangent Kernel). In our setup, where the input and output layers are initialized at a constant scale (w.r.t. LL), it is actually not possible to have a kernel limit. Even in our linear case in Section 4, one can see the learned model is not linear.

If the initialization of the output layer is LL times larger than our setup (assuming LnL\ll n so the widthwise scaling still follows μ\muP), it may induce a parametrization that can linearize the entire network. In that situation, the learning rate has to be LL times smaller than Depth-μ\muP to obtain stability during training, so the change of parameters is also LL times smaller, which can lead to the linearization of the entire network. Since we focus on maximal feature learning, the rigorous argument is beyond the scope of this paper.

Feature Diversity

In this section, we show that the choice of nonlinearity and placement of nonlinearities can affect feature diversity greatly.

Gradient diversity is an important factor toward feature diversity. Observe that the gradient δxl\delta x^{l} at xlx^{l} is continuous in ll in the limit LL\to\infty. In a linear model (or the pre-nonlin model, where nonlinearity is put before the weights), this causes δhl=Lαδxl\delta h^{l}=L^{-\alpha}\delta x^{l} to be very similar between neighboring blocks. As a result (because the weights WlW^{l} receives an update proportional to δhlxl1\delta h^{l}\otimes x^{l-1}), in the next forward pass, neighboring blocks contribute very similarly to the main branch xlx^{l}. This leads to a waste of model capacity.

2 Pre-Nonlin Leads to Poor Performance

For example, in Figure 2, for a relu pre-nonlin resnet (i.e. blocks are given by Wlϕ(xl1)W^{l}\phi(x^{l-1}) instead of ϕ(Wlxl1)\phi(W^{l}x^{l-1})), we see that although Depth-μ\muP indeed transfers hyperparameters (as predicted by our theory), the performance is dramatically worse than the post-nonlin resnet in Figure 10, and depth gives no performance gains beyond 8 layers. Specifically, it is because δhl=Lαδxl\delta h^{l}=L^{-\alpha}\delta x^{l} like the linear case, and ϕ(xl1)\phi(x^{l-1}) is also similar between neighboring blocks. As a result, the gradient of the weights WlW^{l}, proportional to δhlϕ(xl1)\delta h^{l}\otimes\phi(x^{l-1}), has little diversity compared to nearby blocks.

3 Maximizing Feature Diversity with Absolute Value Nonlinearity

Indeed, as shown in Figure 3, swapping in absolute value for ϕ\phi dramatically improves the training performance of deep (block depth 1) resnets.

In general, in lieu of absolute value, any even nonlinearity would suffice.

4 Feature Diversity is in Tension with Layerwise Linearization

The reason that ϕ(hl)\phi^{\prime}(h^{l}) can decorrelate δhl\delta h^{l} is very much related to layerwise linearization. Recall that in Depth-μ\muP, hlh^{l} can be decomposed to a zero-mean Gaussian part h^l\widehat{h}^{l} of size Θ(1)\Theta(1) and a correction term h˙l\dot{h}^{l} of size Θ(L1/2)\Theta(L^{-1/2}) (corresponding to the decomposition \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}h^{l}\rangle=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}h^{l}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu+\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}h^{l}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu). h^l\widehat{h}^{l} is independent from h^m\widehat{h}^{m} for mlm\neq l but h˙l\dot{h}^{l} can be very strongly correlated to all other h˙m\dot{h}^{m}. Thus, ϕ(hl)\phi^{\prime}(h^{l}) can decorrelate δhl\delta h^{l} precisely because h^l\widehat{h}^{l} dominates h˙l\dot{h}^{l}, and this is also precisely the reason we have layerwise linearization.

In the 1/L1/L scaling (α,γ)=(1,0)(\alpha,\gamma)=(1,0), h^l\widehat{h}^{l} is on the same order as h˙l\dot{h}^{l} and layerwise linearization does not occur, but also ϕ(hl)\phi^{\prime}(h^{l}) can no longer effectively decorrelated δhl\delta h^{l}.

Once again, we remind the reader that layerwise linearization in this case is not detrimental (in this block depth 1 case) because h^l\widehat{h}^{l} in fact accumulate contributions from the learned features of all previous blocks and thus strongly depends on the learning trajectory (in contrast to the (widthwise) NTK case where h^l\widehat{h}^{l} is already determined at initialization).

Block Depth 2 and Above

Remark on notation: Here and in the next section, all big-O notation is in LL only; the scaling in width is assumed to be in μ\muP.

In most of this work, we have considered depth-1 MLP for glg^{l} in eq. 1, it’s straightforward to derive and classify the infinite-width-then-infinite-depth limits for larger depths in each block. In particular, the following 1/L1/\sqrt{L} scaling still makes sense in this more general setting with block depth kk and leads to a well defined limit:

This is what we call Depth-μ\muP in the block depth 1 case, but we shall not use this name in the general block depth case because this parametrization is no longer optimal.What we exactly mean by optimal will be explained below.

A very clear symptom of this is that the performance of block-depth-2 resnets is worse than that of block-depth-1 networks, when matching parameter count, although they can (but not always) catch up after training for a long time (figs. 4 and 5).

Simultaneously, we are seeing nontrivial or even significant hyperparameter shifts as the total number of blocks increases (fig. 6).

2 Defect of 1/L1𝐿1/\sqrt{L} Scaling in Block Depth 2

The reason that the 1/L1/\sqrt{L} scaling is no longer fine in the block depth 2\geq 2 case is the linearization of the multiplicative interaction between the layers in the block. Indeed, just like the block depth 1 case, the 1/L1/\sqrt{L} scaling forces the weight updates ΔW\Delta W of each weight matrix to be Θ(L)\Theta(\sqrt{L}) smaller than the initialization W0W_{0}. Thus, within the block, the training dynamics when depth LL is large is in the kernel regime, where the contribution to the block output g(x;W)g(x;W^{\bullet}) is only a summation, instead of product, of individual contributions from each layer’s weights updates.

When aggregated over all LL blocks, the result is that there is only multiplicative interaction of ΔW\Delta W across blocks but not within layers. In other words, the network output is dominated, for example in the linear case, by the contributions of the form MLM1M^{L}\cdots M^{1} where each MlM^{l} can be one of I,W0l2W0l1,W0l2ΔWl1,I,W_{0}^{l2}W_{0}^{l1},W_{0}^{l2}\Delta W^{l1}, or ΔWl2W0l1\Delta W^{l2}W_{0}^{l1}, but NOT ΔWl2ΔWl1\Delta W^{l2}\Delta W^{l1}. All other contributions (which all involve within-block interactions like ΔWl2ΔWl1\Delta W^{l2}\Delta W^{l1}) are subleading. In the general nonlinear case, replacing the block

will achieve the same performance as depth LL\to\infty, where hl=W0l2ϕ(hl)h^{l}_{\wedge}=W_{0}^{l2}\phi(h^{l}_{\vee}) and hl=W0l1xl1h^{l}_{\vee}=W_{0}^{l1}x^{l-1}.

When block depth k=1k=1 (our main subject of study in this work), all interactions are included but this is no longer true when k>1k>1.

In fig. 7, the heatmap of loss as a function of block multiplier and learning rate demonstrates this vividly for block depth 2.

The optimal sublevel set of (learning rate, block multiplier) has slope 2\approx-2 when the number of blocks is 212^{1}. In other words, around the optimum, double the learning rate while dividing the block multiplier by 4 has similar performance. This is because ΔWl1\Delta W^{l1} and ΔWl2\Delta W^{l2} interact multiplicatively, so that doubling their sizes leads to quadrupling their contribution to the block output. The simultaneous decrease of block multiplier by 4 then roughly keep their contribution invariant in size.

On the other hand, the optimal sublevel set has slope 1\approx-1 when the depth is 2102^{10}: Doubling the learning rate while halving the block multiplier has similar performance. This reflects the fact that ΔWl1\Delta W^{l1} and ΔWl2\Delta W^{l2} now interact additively.

Intermediate depths interpolate this phenomenon, as seen in the plot for depth 252^{5}.

In the same heatmaps, one can see the optimal (learning rate, block multiplier) (in the 1/L1/\sqrt{L} parametrization) shifts from the middle of the grid to the upper left as depth goes from 252^{5} to 2102^{10}, demonstrating the lack of hyperparameter transfer.

This change in slope is seen in relu networks as well, with or without layernorm.

Finally, we note that the 1/L1/\sqrt{L} scaling still yields a LL\to\infty limit where the network still learns features as a whole, even though within each block this is no longer true. Thus, this is another reminder that mere "feature learning" does not imply "hyperparameter transfer"!

3 Classification of Parametrizations

These heatmaps already demonstrate that no parametrization of (global learning ratemeaning, the learning tied across all layers in a block, block multiplier) can transfer hyperparameters robustly, because any such parametrization can only shift the heatmaps but not stretch them, so one cannot "transfer" a sublevel set of one slope into a sublevel set of another slope.

But even if we allow learning rate to vary between layers in a block, no stable, faithful, nontrivial parametrization can avoid the linearization problem described above.

Indeed, for this to happen, the weight update ΔWli\Delta W^{li} must be at least of order Ω(1)\Omega(1) (size of initialization) for some ii. But this would contribute a drift term to the block output gl=gl(xl1;W)g^{l}=g^{l}(x^{l-1};W^{\bullet}) that is as large as the noise term. This then implies that either the parametrization is unstable (if the block multiplier LαL^{-\alpha} is Ω(1/L)\Omega(1/{L})) or lacks feature diversity (if the block multiplier LαL^{-\alpha} is O(1/L)O(1/L)).

\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}W^{l1}x^{l-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu is independent and zero-mean across ll (the noise term), while \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}W^{l1}x^{l-1}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu+\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\Delta W^{l2}W^{l1}x^{l-1}\rangle is correlated across ll (the drift term). \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}W^{l1}x^{l-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu is always Θ(1)\Theta(1) because the W0l2,W0l1W^{l2}_{0},W^{l1}_{0} are. If ΔWl2\Delta W^{l2} is Ω(1)\Omega(1), then \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\Delta W^{l2}W^{l1}x^{l-1}\rangle=\Omega(1) as well, making the drift term as large as the noise term. If ΔWl1\Delta W^{l1} is Ω(1)\Omega(1), then \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}\Delta W^{l1}x^{l-1}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu=\Omega(1), causing \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}W^{l1}x^{l-1}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}W_{0}^{l1}x^{l-1}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu+\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l2}\Delta W^{l1}x^{l-1}\dot{\rangle\mkern-3.0mu}\mkern 3.0mu to be Ω(1)\Omega(1).One can also observe that if ΔWl1=Ω(1)\Delta W^{l1}=\Omega(1), then by symmetry the backward pass suffers the same problem. But for general block depth, this argument does not say anything about the middle layers, while the argument presented above implies that ΔWli\Delta W^{li} cannot be Ω(1)\Omega(1) for any ii.

The same argument can be straightforwardly adapted to nonlinear MLPs (with mean subtraction) and arbitrary block depth 2\geq 2, and as well to general nonlinearities that are not necessarily positive-homogeneous, with hyperparameter space enlarged to include initialization.

4 So What is the Optimal Parametrization?

All of the above considerations suggest that we are missing crucial hyperparameters in our consideration when increasing the complexity of each block. Our study right now is akin to the naive study of the 1-dimensional hyperparameter space of the global learning rate in SP. Discovering these missing hyperparameters will be an important question for future work.

Experiments

In Section 4, we showed that a complete description of the training dynamics of linear networks can be formulated in terms of Γ\Gamma and CC. In this section, we provide empirical results supporting our theoretical findings. We first verify the finite-depth recursive formula for Γ\Gamma in Lemma 4.3 is the correct limit when the width goes to infinity, then proceed to show that the infinite-depth limit is the correct one.

In Figure 8, we train a series of 6464-layer linear networks of width 27,28,,2132^{7},2^{8},\ldots,2^{13} with 1,5,101,5,10 steps on MNIST, and plot the root mean squareThe root mean square of a vector x=(x1,,xn)x=(x_{1},\ldots,x_{n}) is i=1nxi2n\sqrt{\frac{\sum_{i=1}^{n}x_{i}^{2}}{n}}, which is denoted as “l2” in Figures 8 and 9. of the layer outputs using solid lines. We also compute the infinite width limit of the corresponding statistics using the recursive formula for Γ\Gamma and plot them as dashed horizontal lines. For clarity of the figure, we only plot the statistics of the input layer, output layer, and hidden layers of index 16, 32, 48, and 64. It is clear that as the width grows, the solid lines converge to the dashed lines consistently across the training steps. It indicates that our computation of the infinite width limit is correct.

We verify that the infinite width limit above converges when the depth grows. We consider linear networks of the same architecture but vary the depth from 242^{4} to 292^{9}. We again compute the root mean square values of the layer outputs using the recursive formula for Γ\Gamma, and plot them in Figure 9 with depth being xx-axis. For clarity of the figure, we only plot the statistics of the input layer, output layer, and hidden layers of index L/4L/4, L/2L/2, 3L/43L/4, and LL. One can observe that the statistics of the layer outputs converge quickly when the depth grows from 242^{4} to 292^{9}, which verifies our convergence result.

2 Hyperparameter Transfer

In this section, we provide empirical evidence to show the optimality of Depth-μ\muP scaling and the transferability of some quantities across depth. We train vanilla residual network with block depth 1 (1 MLP layer in each residual block) on CIFAR-10 dataset using Adam optimizer, batch size 6464, for 5050 epochs (input and output layers are fixed). The network is parameterized as follows

and the weights are trained with the rule

where the learning rate η\eta and the block multiplier aa are the hyperparameters.Note that η\eta here is the constant, and the effective learning rate is given by ηn1Lγ\eta n^{-1}L^{-\gamma}. The values of α,γ\alpha,\gamma depend on the parametrization of choice. For Depth-μ\muP, we have α=γ=1/2\alpha=\gamma=1/2, and for standard parametrization, we have α=0,γ=1\alpha=0,\gamma=1.In standard parametrization, there is generally no rule to scale the learning rate with depth, and the optimal learning rate is typically found by grid search. Here, we assume that in standard parametrization, the learning rate is scaled by L1L^{-1} to preserve faithfulness. In our experiments, we assume base depth 88, meaning that we replace LL by L/8L/8 in the parametrization above.

In Figure 10, we show the training loss versus learning rate for depths 2k2^{k}, for k{3,4,10}k\in\{3,4\dots,10\}. For Depth-μ\muP, a convergence pattern can be observed for the optimal learning rate as depth grows. Optimal learning rates for small depths (e.g. L=23L=2^{3}) exhibit a mild shift which should be expected, as our theory shows convergence in the large depth limit. However, starting from depth L=26L=2^{6}, the optimal learning rate is concentrated around 10310^{-3}. For parametrization that only scales the multiplier but not LR (α=1/2\alpha=1/2, γ=0\gamma=0), we observe the optimal learning rate shifts significantly. For standard parametrization without any depth scaling (α=γ=0\alpha=\gamma=0), the optimal learning rate exhibits a more significant shift as depth grows. Moreover, even if one picks the optimal learning rate for each depth, the performance still degrades when the depth is very large, suggesting that standard parametrization is not suitable for depth scaling. Additional figures with multiple time slices are provided in Appendix G.

In Section 5, we explained when and why hyperparameter transfer occurs. Precisely, to obtain HP transfer, one needs to classify all feature learning limits and choose the optimal one. We introduced the notion of feature diversity and showed that Depth-μ\muP is optimal in the sense that it maximizes feature diversity. To show that optimality is needed for HP transfer, we train a resnet with (α,γ)=(1,0)(\alpha,\gamma)=(1,0) which is also a feature learning limit. Figure 11 shows that in this case the learning rate exhibits a significant shift with depth. Interestingly, the constant η\eta in this case seems to increase with depth, suggesting that the network is trying to break from the ODE limit, which is sub-optimal. Note that in Figure 10, with Depth-μ\muP we obtain better training loss compared to the ODE parametrization in Figure 11.

Our theory considers only Mean Substraction (MS), and Figure 10 shows the results with MS. To see wether LN affects HP transfer, we train resnets with the same setup as Figure 10 with absolute value non-linearity and LN applied to xl1x^{l-1} before matrix multiplication with WlW^{l} (preLN). We keep MS after non-linearity although it can be removed since LN is applied in the next layer. Our results, reported in Figure 12 suggest that Depth-μ\muP guarantees learning rate transfer with LN as well.

In Figure 13, we investigate the stability of the hyperparameter aa in Depth-μ\muP as depth increases. The results suggest that the optimal value of this constant converges as depth grows, which suggest transferability. Additional experiments with multiple time slices are provided in Appendix G.

3 What Happens in a Transformer?

Because transformers have block depth 2, as discussed in section 9, we have plenty of reasons to suspect that no parametrization of (learning rate, block multiplier) will be able to robustly transfer hyperparameters across depth for transformers.

Here we do a large scale experiment using Megatron trained on Common Crawl and catalogue our observations.We train the models for 3900 steps, using cosine decay schedule with 500 warmup steps. We use a sequence length of 4096, batch size 256, resulting in approximately 4B tokens per training run. In summary, in our particular setup (which should be close to most large language model pretraining), we see that the 1/L1/\sqrt{L} scaling seems to transfer hyperparameters at the end of training (LABEL:{fig:megatron-scaling-shifts}(Right)). However, we also see that 1) deeper does worse in initial training (LABEL:{fig:megatron-deeper-worse}(Left)), and 2) optimal hyperparameters scale like Θ(1)\Theta(1) in the middle of training (Figure 16(Left)). Combined with the theoretical insights of Section 9, this leads us to conclude that while the 1/L1/\sqrt{L} scaling can potentially be practically useful in transformer training, it is likely to be brittle to architectural and algorithmic changes, or even simple things like training time.

In fact, we observe that transformers are insensitive to the block multiplier aa (Figure 14), so that the only relevant hyperparameter is really just learning rate. Thus, empirically measuring the scaling trend of the optimal learning rate, as done in modern large scale pretraining, can be a practically more robust way to transfer hyperparameters.

Here LL is the number of transformer layers, each of which consists of an attention layer and an MLP layer (each of which has depth 2).

4 Feature Diversity

In this section, we empirically verify our claims about feature diversity exponent (Claims 7.4 and 7.5). We use the same setup as in the last section, i.e., we train deep residual networks of width n=256n=256 on CIFAR-10 dataset with Adam and batch size 6464. In Figure 17, we compare two parametrizations, Depth-μ\muP (α=γ=1/2\alpha=\gamma=1/2) and the ODE parametrization (α,γ)=(1,0)(\alpha,\gamma)=(1,0). We measure xt(λ+ϵ)LxtλL=defd(ϵ)\left\|\bm{x}^{\lfloor(\lambda+\epsilon)L\rfloor}_{t}-\bm{x}_{t}^{\lfloor\lambda L\rfloor}\right\|\mathbin{\overset{\text{{def}}}{=}}d(\epsilon) at t=1000t=1000 for the two parametrizations and varying depth. For each parametrization and depth LL, we rescale function dd by multiplying a constant cc such that cd(1/256)=1c\cdot d(1/256)=1, and then plot the rescaled function cdc\cdot d for a clean presentation. One can observe clearly that Depth-μ\muP has feature diversity exponent (almost) 1/21/2 for any LL, while the curves for ODE parametrization move from ϵ1/2\epsilon^{1/2} to ϵ\epsilon when LL grows. This exactly fits our theory that Depth-μ\muP maximizes the feature diversity, while other parametrizations (even with feature learning) have smaller feature diversity exponents that should go to in the infinite depth limit.

In Figure 18, we measure d(ϵ)d(\epsilon) at t=100,500,1000t=100,500,1000, and rescale it by dividing additional ϵ0.5\epsilon^{0.5} and a constant cc such that d(1/256)cϵ0.5=1\frac{d(1/256)}{c\cdot\epsilon^{0.5}}=1, and then plot the rescaled function d/(cϵ0.5)d/(c\cdot\epsilon^{0.5}) for a clean comparison between dd and ϵ0.5\epsilon^{0.5}. We observe that for both Depth-μ\muP and ODE parametrization, the slopes of the curves grow along with LL and tt. The growth along tt can be explained by the cumulative correlation between layers. The growth along LL for ODE parametrization is because the independent components between nearby layers decrease when LL grows. We do not have a clear understanding for the growth along LL for Depth-μ\muP and we leave it as a future work.

In Figure 19, we plot the same curves as in Figure 18 but comparing ReLU activation and absolute value activation under Depth-μ\muP. We observe that the slope of the curves for absolute value activation is smaller than ReLU activation. It matches our theory that absolute value activation increases feature diversity.

Acknowledgement

We thank Huishuai Zhang, Jeremy Bernstein, Edward Hu, Michael Santacroce, Lucas Liu for their helpful comments and discussion. D. Yu was supported by NSF and ONR. Part of this work was done during D. Yu’s internship at Microsoft.

Author Contributions

GY developed the core theory and ran experiments in early part of the exploratory stage and most experiments in the final draft. DY worked on and proved key claims for linear resnets (including the limiting equations, convergence, and classification of parametrization), drafted the very first version of the paper, and ran experiments verifying the theoretical claims (including the convergence of linear case and feature diversity separation). CZ ran experiments in later part of the exploratory stage. They revealed the viability of Depth-μ\muP in the block depth 1 case, in contrast to the general block depth case. CZ also ran the Megatron experiments in the final version of the paper. SH contributed to brainstorming since the beginning of the project, wrote the warm-up section on linear networks, formalized the notion of feature diversity exponent, and helped transforming experimental results into plots and visualizations.

References

Appendix A Notations

This section provides an introduction to the new TP notations from . We only require the definition of the inner and outer products in this paper.

A.1 The Tensor Program Ansatz: Representing Vectors via Random Variables

From the Tensor Programs framework , we know that as width becomes large, the entries of the (pre-)activation vectors and their gradients will become roughly iid, both at initialization and training. Hence any such vector’s behavior can be tracked via a random variable that reflects the distribution of its entries. While we call this the “Tensor Program Ansatz”, it is a completely rigorous calculus.

Because we will often need to multiply a ket with a diagonal matrix, we introduce a shorthand:

if x\bm{x} is n×kn\times k and χ\bm{\chi} is a kk-dimensional vector.

A.1.2 Outer Product

Likewise, if both x\bm{x} and y\bm{y} have shape n×kn\times k, the expression

which corresponds to the limit of 1nwxy\frac{1}{n}\bm{w}^{\top}\bm{x}\bm{y}^{\top}. This definition of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bm{x}\rangle\langle\bm{y}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}} makes the expressions

unambiguous (since any way of ordering the operations give the same answer).

A.1.3 Nonlinear Outer Product

where \left(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y^{1}\rangle^{\mathord{\mathchoice{\kern 1.0pt\framebox{\displaystyle 1}\kern 1.0pt}{\kern 1.0pt\framebox{\textstyle 1}\kern 1.0pt}{\kern 0.7pt\framebox{\scriptstyle 1}\kern 0.7pt}{\kern 0.5pt\framebox{\scriptscriptstyle 1}\kern 0.5pt}}},\ldots,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y^{k}\rangle^{\mathord{\mathchoice{\kern 1.0pt\framebox{\displaystyle 1}\kern 1.0pt}{\kern 1.0pt\framebox{\textstyle 1}\kern 1.0pt}{\kern 0.7pt\framebox{\scriptstyle 1}\kern 0.7pt}{\kern 0.5pt\framebox{\scriptscriptstyle 1}\kern 0.5pt}}},\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bm{z}\rangle^{\mathord{\mathchoice{\kern 1.0pt\framebox{\displaystyle 1}\kern 1.0pt}{\kern 1.0pt\framebox{\textstyle 1}\kern 1.0pt}{\kern 0.7pt\framebox{\scriptstyle 1}\kern 0.7pt}{\kern 0.5pt\framebox{\scriptscriptstyle 1}\kern 0.5pt}}}\right) is an iid copy of \left(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y^{1}\rangle,\ldots,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y^{k}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bm{z}\rangle\right) independent from \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bm{x}\rangle and the expectation is taken only over the former. This is just like, in the finite nn case,

where \otimes denotes outer product of vectors and expectation is taken over everything.

Note \phi(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bm{x}\rangle\langle\bm{y}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}) is not the image of the operator \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bm{x}\rangle\langle\bm{y}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}} under ϕ\phi in the continuous function calculus of operators, but rather a “coordinatewise application” of ϕ\phi. For example, if ϕ(t)=t2\phi(t)=t^{2}, then \phi(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\rangle\langle y\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}) is not \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\rangle\langle y\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\rangle\langle y\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}, the latter being what typically “squaring an operator” means, but rather \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\rangle^{2}\langle y\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}^{2}=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\odot x\rangle\langle y\odot y\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}.

For readers familiar with the Tensor Programs papers, this new “bra-ket” notation (aka Dirac notation) relates to the old ZZ^{\bullet} notation by

Appendix B Infinite-Width Limit with the Bra-ket notation

As before, when the width nn of the program goes to infinity, one can infer how the program behaves via a calculus of random variables. We define them below via the new ket notation instead of the earlier ZZ notation.

We recursively define the random variable \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\rangle (called a ket) for each vector xx and deterministic number θ˚\mathring{\theta} for each scalar θ\theta in the program. For a vector WxWx in the program, we also define random variables \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu and \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\dot{\rangle\mkern-3.0mu}\mkern 3.0mu (called hat-ket and dot-ket respectively) such that \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\rangle=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu+\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\dot{\rangle\mkern-3.0mu}\mkern 3.0mu. These are the same as Z^\widehat{Z} and Z˙\dot{Z} in the old TP notation and they satisfy

Every dot-ket is a linear combination of previous kets, expressed by the following equation

eq. 9 is the same equation as in[25, Zdot] but formulated much more succinctly in the bra-ket notation:

There is an alternative notion for \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\dot{\rangle\mkern-3.0mu}\mkern 3.0mu in Yang and Littwin that write

This is more convenient to write as we introduce the operator view.

We can see the ket \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}Wx\rangle as the result of the action of an operator on the ket \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x\rangle.

Let WW be an initial matrix in a Tensor Program. We define \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}},\widehat{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}W\widehat{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}},\dot{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}W\dot{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}} to be the linear operators on kets To be rigorous, we need to specify the “Hilbert space” of kets. This is somewhat pedantic and not crucial to the key points of this paper, but the Hilbert space can be constructed as follows: Let σ(π)\sigma(\pi) be the σ\sigma-algebra generated by the kets of the program π\pi. Let \Sigma(\pi)\mathrel{\raisebox{-1.29167pt}{\mathbin{\overset{\text{{def}}}{=}}}}\bigcup_{\pi^{\prime}\supseteq\pi}\sigma(\pi) be the union (more precisely, the direct limit) of σ(π)\sigma(\pi^{\prime}) over all programs π\pi^{\prime} extending π\pi. Then the Hilbert space in question is the L2L^{2} space of random variables over the Σ\Sigma of our program. that act by

Any linear operator that is equal to \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}} for some initial matrix WW is called an initial operator.

We also define the adjoint relations between the operators:

In the SGD case, the parameter update of WlW^{l} is simple. With the operator notation and outer product notation, we can write

In this work, Δ\Delta denotes change for one step, i.e.,

Δˉ\bar{\Delta} denotes total change, i.e.,

which we write succinctly \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bar{\Delta}W_{t}^{l}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}=-\eta\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}\bm{h}^{l}_{<t}\rangle{}_{\bm{\chi}}\langle\bm{x}^{l-1}_{<t}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}. (Compared to Yang and Littwin , Δ\Delta and Δˉ\bar{\Delta} are changed from δ\delta and Δ\Delta because we want to use δ\delta for gradients instead of dd, which is now used for depth differentiation).

For the rest of the paper, we write \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bar{\Delta}W_{t}^{l}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}=-\eta\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}\bm{h}^{l}_{<t}\rangle{}_{\bm{\chi}}\langle\bm{x}^{l-1}_{<t}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}} for convenience. The generalization to eq. 10 follows Yang and Littwin .

Appendix C Details of the linear case

Here we provide a proof sketch of 4.2, the formal prove is implied by the existence of Γ\Gamma and CC in the infinite depth limit.

The claims can be reasoned by induction on tt and ll. Let us take \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle as an example, since \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{t}^{l-1}\rangle is symmetric with \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle. By expanding the definition of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle, we have

Note by induction, \langle x_{s}^{l-1}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l-1}\rangle=\mathcal{O}(1) and \frac{\partial x_{t}^{l-1}}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l\top}\widetilde{\delta}x_{s}^{l}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}=\mathcal{O}(1/\sqrt{L}), so

Then by unwinding \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s^{\prime}}^{m^{\prime}}\rangle and noting that by induction, s<t\forall s<t, \frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s^{\prime}}^{m^{\prime}}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m}x_{s}^{m-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}=\mathcal{O}\left(\frac{1}{\sqrt{L}}\right), \frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s^{\prime}}^{m^{\prime}}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{s}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu}=\mathcal{O}\left(\frac{1}{\sqrt{L}}\right), \frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s^{\prime}}^{m^{\prime}}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U\rangle}=\mathcal{O}\left(1\right), \frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s^{\prime}}^{m^{\prime}}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}nV\rangle}=\mathcal{O}\left(1\right), we have

Also by unwinding, \forall\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}y\rangle\in\{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{s}^{m}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{s}^{m}\rangle\},

C.2 Formal recursive formula of ΓΓ\Gamma and C𝐶C

By the same way of expanding \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle and \langle y\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{l}\rangle, we formally derive the recursive formula for Γ\Gamma and CC below.

Γ\Gamma can be computed recursively as follows:

q(0,1],Γt,1,0,q(0,q)=ξt\forall q\in(0,1],\Gamma_{t,-1,0,q}(0,q)=\xi_{t},

For l=1,,Ll=1,\ldots,L, rt\forall r\leq t, p(l1L,lL]\forall p\in\left(\frac{l-1}{L},\frac{l}{L}\right], q(0,1]\forall q\in(0,1], b{0,1}\forall b\in\{0,1\},

f˚t=Γt,1,0,1(1,1)\mathring{f}_{t}=\Gamma_{t,-1,0,1}(1,1),

q(0,1],Γt,1,1,1(1,q)=χ˚t\forall q\in(0,1],\Gamma_{t,-1,1,1}(1,q)=\mathring{\chi}_{t},

For l=L,,1l=L,\ldots,1, rt\forall r\leq t, p(l2L,l1L]\forall p\in\left(\frac{l-2}{L},\frac{l-1}{L}\right], q(0,1]\forall q\in(0,1], b{0,1}\forall b\in\{0,1\},

The proof is straightforward from Program 1. The recursive nature of Γ\Gamma and CC yields the following infinite-depth behavior.

In the limit LL\to\infty, we have p,q(0,1],b{0,1}\forall p\in,q\in(0,1],b\in\{0,1\}:

tT,s<t,a{0,1},b{0,1}\forall t\leq T,s<t,a\in\{0,1\},b\in\{0,1\}, p,q(0,1]\forall p\in,q\in(0,1],

The proof is by induction on tt. We will prove the following claims (A) (B) (C) (D) on t>0t>0 given they are satisfied for any s<ts<t. For t=0t=0, (A) (B) (C) (D) are trivial.

p{0,1L,,1},q(0,1]\forall p\in\{0,\frac{1}{L},\ldots,1\},q\in(0,1],

Γs,r,a,bL(p,q)c|\Gamma^{L}_{s,r,a,b}(p,q)|\leq c, Cs,r,aL(p)c|C^{L}_{s,r,a}(p)|\leq c.

Cs,r,aL(p)C^{L}_{s,r,a}(p) is cc-Lipschitz w.r.t. pp, and Γs,r,a,bL(p,q)\Gamma^{L}_{s,r,a,b}(p,q) is cc-Lipschitz w.r.t. pp.

Γs,r,0,1L(p1L,p+1L)Γs,r,0,1L(p1L,p)c/L|\Gamma^{L}_{s,r,0,1}(p-\frac{1}{L},p+\frac{1}{L})-\Gamma^{L}_{s,r,0,1}(p-\frac{1}{L},p)|\leq c/L, Γs,r,1,0L(p,p)Γs,r,1,0L(p,p1L)c/L|\Gamma^{L}_{s,r,1,0}(p,p)-\Gamma^{L}_{s,r,1,0}(p,p-\frac{1}{L})|\leq c/L.

(A) indicates that {Γs,r,a,b2k}k\{\Gamma^{2^{k}}_{s,r,a,b}\}_{k} and {Cs,r,a2k}k\{C^{2^{k}}_{s,r,a}\}_{k} converge. We only care about r<sr<s because Cs,s,aLC^{L}_{s,s,a} will never be used, and Γs,s,a,bL\Gamma^{L}_{s,s,a,b} is known: for p{0,1L,,1}p\in\{0,\frac{1}{L},\ldots,1\},

In the following subsections, we will prove inductively on increasing order of all L>LL>L^{\prime} and L=2kL=2^{k}, and increasing order of p{0,1/L,,1}p\in\{0,1/L,\ldots,1\} that s<t\forall s<t,

Γt,s,0,1L(p,p+2L)Γt,s,0,1L(p,p+1L)c2exp(c1p)/L|\Gamma^{L}_{t,s,0,1}(p,p+\frac{2}{L})-\Gamma^{L}_{t,s,0,1}(p,p+\frac{1}{L})|\leq c_{2}\exp(c_{1}p)/L;

For s<ts<t, Γt,s,0,bL(p,q)Γt,s,0,bL(p1L,q)tcc2exp(c1(p1L))/L|\Gamma^{L}_{t,s,0,b}(p,q)-\Gamma^{L}_{t,s,0,b}(p-\frac{1}{L},q)|\leq tcc_{2}\exp(c_{1}(p-\frac{1}{L}))/L;

Γt,s,0,bL(p,q)c2exp(c1(p12L))|\Gamma^{L}_{t,s,0,b}(p,q)|\leq c_{2}\exp(c_{1}(p-\frac{1}{2L}));

Γt,s,0,bL/2(p,q)Γt,s,0,bL(p,q)c3c2exp(c1(p12L))/L|\Gamma^{L/2}_{t,s,0,b}(p,q)-\Gamma^{L}_{t,s,0,b}(p,q)|\leq c_{3}c_{2}\exp(c_{1}(p-\frac{1}{2L}))/L;

Ct,s,0L(p+1L)Ct,s,0L(p)c4c2exp(c1(p1L))/L|C^{L}_{t,s,0}(p+\frac{1}{L})-C^{L}_{t,s,0}(p)|\leq c_{4}c_{2}\exp(c_{1}(p-\frac{1}{L}))/L;

Ct,s,0L(p+1L)c2exp(c1p)|C^{L}_{t,s,0}(p+\frac{1}{L})|\leq c_{2}\exp(c_{1}p);

Ct,s,0L/2(p+1L)Ct,s,0L(p+1L)c5c2exp(c1p)/L,|C^{L/2}_{t,s,0}(p+\frac{1}{L})-C^{L}_{t,s,0}(p+\frac{1}{L})|\leq c_{5}c_{2}\exp(c_{1}p)/L,

where c2=max{ξt2,ξt}exp(c1/2L)c_{2}=\max\{\xi_{t}^{2},|\xi_{t}|\}\exp(c_{1}/{2L^{\prime}}), c3=3ctc_{3}=3ct, c4=4t(t+1)c2+2tcc_{4}=4t(t+1)c^{2}+2tc, c5=c4+1c_{5}=c_{4}+1, c1=c3t(4ct+2c4+29)+tc(3c4+14)+c(2c4+2c)c_{1}=c^{3}t(4ct+2c_{4}+29)+tc(3c_{4}+14)+c(2c_{4}+2c).

Similar bounds also apply to Γt,s,1,b\Gamma_{t,s,1,b} and Ct,s,1C_{t,s,1} by induction on decreasing order of pp.

Combining both backward pass and forward pass at time tt shows (A)(B)(C)(D) also hold for s=ts=t with a larger (but constant) cc. Thus, (A)(B)(C)(D) hold for any constant ss by induction on training steps.

𝑝2𝐿\Gamma^{L}_{t,s,0,1}(p,p+\frac{2}{L}) and Γt,s,0,1L(p,p+1L)\Gamma^{L}_{t,s,0,1}(p,p+\frac{1}{L}) Assume p1/Lp\geq 1/L (p=0p=0 is trivial), let q=p+1/L,q=p+2/Lq=p+1/L,q^{\prime}=p+2/L, note that Γs,s,1,bL(p,q)=Γs,s,1,bL(p,q)\Gamma_{s,s,1,b}^{L}(p,q)=\Gamma_{s,s,1,b}^{L}(p,q^{\prime}) since p+1/Lqqp+1/L\leq q\leq q^{\prime}, so for r<tr<t,

Again assume p1/Lp\geq 1/L (p=0p=0 is trivial because c2ξtexp(c1/2L)c_{2}\geq|\xi_{t}|\exp(c_{1}/2L)), since Γt,r,0,bL(p1L,q)c2exp(c1(p1L))|\Gamma^{L}_{t,r,0,b}(p-\frac{1}{L},q)|\leq c_{2}\exp(c_{1}(p-\frac{1}{L})), we can bound Γt,r,0,bL(p,q)|\Gamma^{L}_{t,r,0,b}(p,q)|:

When p=0p=0, it is trivial. When p=1/Lp=1/L, it is also trivial by Lipschitz w.r.t. pp, which results

we compare it with Γt,r,0,bL(p,q)\Gamma_{t,r,0,b}^{L}\left(p,q\right) expanded based on its previous two steps

In order to bridge the two above, namely matching the inputs for Γ\Gamma and CC, we need a middle term

Now we can bound Γt,r,0,bL(p,q)Γ~t,r,0,bL(p,q)|\Gamma^{L}_{t,r,0,b}\left(p,q\right)-\widetilde{\Gamma}^{L}_{t,r,0,b}\left(p,q\right)|, and Γ~t,r,0,bL(p,q)Γt,r,0,bL/2(p,q)|\widetilde{\Gamma}^{L}_{t,r,0,b}\left(p,q\right)-\Gamma^{L/2}_{t,r,0,b}\left(p,q\right)| separately, which add up to be the bound for Γt,r,0,bL(p,q)Γt,r,0,bL/2(p,q)|\Gamma^{L}_{t,r,0,b}\left(p,q\right)-\Gamma^{L/2}_{t,r,0,b}\left(p,q\right)|.

In sum, as c12(c3+c5+ct+c4+5)3c_{1}\geq\frac{2(c_{3}+c_{5}+ct+c_{4}+5)}{3},

𝑝1𝐿C_{t,s,0}(p+\frac{1}{L}) in forward pass (Proof for C1, B1, A1) Now consider Ct,s,0LC^{L}_{t,s,0}. By expanding

Since Ct,s,bLC^{L}_{t^{\prime},s^{\prime},b} and Γs,s,0,bL\Gamma^{L}_{s,s^{\prime},0,b} are bounded and Lipschitz,

Since Ct,s,0L(p)c2exp(c1(p1L))|C^{L}_{t,s,0}(p)|\leq c_{2}\exp(c_{1}(p-\frac{1}{L})), we bound Ct,s,0L(p+1L)C^{L}_{t,s,0}(p+\frac{1}{L}) as:

we will prove that for p{2/L,4/L,,1}p\in\{2/L,4/L,\ldots,1\},

Then by (C1), for p{1/L,3/L,,11/L}p\in\{1/L,3/L,\ldots,1-1/L\},

Suppose p{2/L,4/L,,1}p\in\{2/L,4/L,\ldots,1\}, we compare Ct,s,0L(p+1L)Ct,s,0L(p1L)C^{L}_{t,s,0}(p+\frac{1}{L})-C^{L}_{t,s,0}(p-\frac{1}{L}) and Ct,s,0L/2(p+1L)Ct,s,0L/2(p1L)C^{L/2}_{t,s,0}(p+\frac{1}{L})-C^{L/2}_{t,s,0}(p-\frac{1}{L}). Intuitively, both of them are O(1/L)\mathcal{O}(1/L), and their difference is O(1/L2)\mathcal{O}(1/L^{2}). In particular, both of them can be written into four parts:

and Ct,s,0L/2(p+1L)Ct,s,0L/2(p1L)=E1L/2+E2L/2+E3L/2+E4L/2C^{L/2}_{t,s,0}(p+\frac{1}{L})-C^{L/2}_{t,s,0}(p-\frac{1}{L})=\mathcal{E}_{1}^{L/2}+\mathcal{E}_{2}^{L/2}+\mathcal{E}_{3}^{L/2}+\mathcal{E}_{4}^{L/2} where EiL/2\mathcal{E}_{i}^{L/2} is defined in the same way as EiL\mathcal{E}_{i}^{L} but with CL/2C^{L/2} and ΓL/2\Gamma^{L/2} instead of CLC^{L} and ΓL\Gamma^{L}. Next we bound EiLEiL/2|\mathcal{E}_{i}^{L}-\mathcal{E}_{i}^{L/2}| one by one:

The only hard part to bound in EiLEiL/2|\mathcal{E}_{i}^{L}-\mathcal{E}_{i}^{L/2}| is

Bounding E2LE2L/2|\mathcal{E}_{2}^{L}-\mathcal{E}_{2}^{L/2}| is similar to E1LE1L/2|\mathcal{E}_{1}^{L}-\mathcal{E}_{1}^{L/2}|, where we first bound

For E3LE3L/2|\mathcal{E}_{3}^{L}-\mathcal{E}_{3}^{L/2}|, we first simplify

For E4LE4L/2|\mathcal{E}_{4}^{L}-\mathcal{E}_{4}^{L/2}|, we use

which is used in E2LE2L/2|\mathcal{E}_{2}^{L}-\mathcal{E}_{2}^{L/2}|. Finally,

Therefore, since c1=c3t(4ct+2c4+29)+tc(3c4+14)+c(2c4+2c)c_{1}=c^{3}t(4ct+2c_{4}+29)+tc(3c_{4}+14)+c(2c_{4}+2c),

Appendix D Classification of Depthwise Parametrizations in Linear Case

We discuss the classification results on the linear residual networks with SGD training and give rigorous proofs for the claims in this simplified setting. Recall the linear residual networks:

where hl=Wlxlh^{l}=W^{l}x^{l}, and the effective learning rate of WlW^{l} is ηn1Lγ\eta n^{-1}L^{-\gamma}. Without loss of generality, we assume η=a=1\eta=a=1.

Since \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{0}^{l-1}\rangle is independent from \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l}x_{0}^{l-1}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu, we have

Therefore, \langle x_{0}^{L}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{0}^{L}\rangle=\Theta(1) iff α1/2\alpha\geq 1/2, otherwise (1+L2α)LeL2α+1(1+L^{-2\alpha})^{L}\approx e^{L^{-2\alpha+1}} explodes with large LL.

A similar argument stands for h0lh^{l}_{0} and f0f_{0}. Therefore, we have proved Claim 7.1.

Similarly, we can get the stability of the first backward pass, i.e., δ~x0l=Θ(1)\widetilde{\delta}x_{0}^{l}=\Theta(1) for α1/2\alpha\geq 1/2. Given α1/2\alpha\geq 1/2, we can also settle the size of δ~h0\widetilde{\delta}h_{0} that

D.2 After the first step of gradient update

Now we look at the second forward pass, and assume the input is the same, i.e., \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{1}^{0}\rangle=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{0}^{0}\rangle, we have

Now we write b^{l}=L^{\gamma}\frac{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{1}^{l-1}\rangle}{\partial\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l\top}\widetilde{\delta}x_{0}^{l}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu} and c^{l}=-\langle x_{0}^{l-1}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{1}^{l-1}\rangle, then

By expanding \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{0}^{l-1}\rangle=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{0}^{l}\rangle+L^{-\alpha}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l\top}\widetilde{\delta}x_{t}^{l}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu=\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{0}^{L}\rangle+\sum_{m=l}^{L}L^{-\alpha}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{m\top}\widetilde{\delta}x_{t}^{m}\widehat{\rangle\mkern-3.0mu}\mkern 3.0mu, we have

Note the four terms in eq. 11 are independent of each other.

Now it is easy to compute clc^{l} because only the first two terms in eq. 11 have correlation with x0lx_{0}^{l}:

with α1/2\alpha\geq 1/2. For blb^{l}, we have the following recursive formula:

Finally, we can reason about the f˚1\mathring{f}_{1} (note f˚0=0\mathring{f}_{0}=0, so Δf˚1=f˚1\Delta\mathring{f}_{1}=\mathring{f}_{1}), which indicates whether the parametrization is stable during the first stepWe need Δx\Delta x and Δh\Delta h for stability, but they are similar to Δf˚1\Delta\mathring{f}_{1}., and whether the parametrization is nontrivial for the first step:

Therefore, we have proved Claim 7.2 that the parametrization is stable during training iff α+γ1\alpha+\gamma\geq 1, and is nontrivial iff α+γ1\alpha+\gamma\leq 1.

Although there is no activation in the linear case, we still prove Claim 7.3 to enlighten the proof of the general case.

At the initialization, h0lh_{0}^{l} and x0l1x_{0}^{l-1} have the same size, therefore, faithfulness is equivalent to stability, which means it happens iff α1/2\alpha\geq 1/2.

During training, we can expand \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}h_{1}^{l}\rangle in a similar way to eq. 11 as

Therefore, it is faithful iff γ0\gamma\geq 0. It is equivalent to α1\alpha\leq 1 because we have α+γ=1\alpha+\gamma=1.

To simplify the analysis, we assume that ϵL\epsilon L is always an integer. We first expand x1l+ϵLx1lx_{1}^{l+\epsilon L}-x_{1}^{l}

With α+γ=1\alpha+\gamma=1, it is clear that the first term is Θ(LαϵL)=Θ(ϵ1/2Lα+1/2)\Theta(L^{-\alpha}\sqrt{\epsilon L})=\Theta(\epsilon^{1/2}L^{-\alpha+1/2}), the second term has size Θ(ϵ)\Theta(\epsilon), and the third term has size Θ(LϵLα)=Θ(ϵLα+1/2)\Theta(\sqrt{L}\cdot\epsilon L^{-\alpha})=\Theta(\epsilon L^{-\alpha+1/2}). Therefore, there are only two cases here: if α=1/2\alpha=1/2, the overall size is Θ(ϵ1/2+ϵ)=Θ(ϵ1/2)\Theta(\epsilon^{1/2}+\epsilon)=\Theta(\epsilon^{1/2}); if α>1/2\alpha>1/2, the first and the third term vanish as LL\to\infty, so the overall size is Θ(ϵ)\Theta(\epsilon). In sum, we have proved Claims 7.4 and 7.5.

Claim 7.6 is trivial in this simplified setting because layerwise linearization is always true for linear nets. To enlighten the proof of the general case, we recap that \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\Delta W_{1}^{l}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{1}^{l-1}\rangle=L^{-\gamma}c^{l}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\widetilde{\delta}x_{0}^{l}\rangle=\Theta(L^{-\gamma}), which is much smaller than \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{l}x_{1}^{l-1}\rangle=\Theta(1) when γ>0\gamma>0. If there were an activation function, the linearization would bring an error of o(Lγ)o(L^{-\gamma}) in h1lh_{1}^{l}, which means an error of o(Lγα)=o(L1)o(L^{-\gamma-\alpha})=o(L^{-1}) to x1lx_{1}^{l}.

D.3 Beyond one step

The argument above is in general tracking the derivatives and covariance, in other words, Γ\Gamma and CC in the Depth-μ\muP case.

Now we generalize Lemma 4.3, and obtain the following recursion for Γ\Gamma and CC

where l=Lp1l=\lceil Lp\rceil-1 if a=0a=0, and l=Lpl=\lceil Lp\rceil if a=1a=1.

Then all the claims can be reasoned by tracking the order of Γ\Gamma and CC.

𝛼𝛾1\alpha+\gamma=1 and α1\alpha\leq 1. The parametrizations with α+γ=1\alpha+\gamma=1 and α1\alpha\leq 1 are all nontrivial, stable, and faithful. However, there is a large gap between α=1/2\alpha=1/2 (Depth-μ\muP) and α>1/2\alpha>1/2 in terms of the difficulty of tracking Γ\Gamma and CC. For α>1/2\alpha>1/2, we can see that Ct,s,a=Θ(1)C_{t,s,a}=\Theta(1), Γt,1,a,b=Θ(1)\Gamma_{t,-1,a,b}=\Theta(1) and Γt,s,a,b=o(1)\Gamma_{t,s,a,b}=o(1) for s0s\geq 0. In this case, we can simplify the recursion by ignoring Γt,s,a,b\Gamma_{t,s,a,b} with s0s\geq 0:

where l=Lp1l=\lceil Lp\rceil-1 if a=0a=0, and l=Lpl=\lceil Lp\rceil if a=1a=1. Note Γt,1,a,b(p,q)\Gamma_{t,-1,a,b}(p,q) is simplified to a function that only depends on pp because Γt,1,a,b(p,q)\Gamma_{t,-1,a,b}(p,q) is constant when fixing pp.

This simplification means the randomness in any W0lW_{0}^{l} does not have an effect on the dynamics in the infinite depth limit — the complicated functional integrals for α=1/2\alpha=1/2 in 4.4 are simplified to be ODEs when α>1/2\alpha>1/2. This ODE dynamic also directly implies that the feature diversity exponent is 0 for α>1/2\alpha>1/2.

Appendix E Nonlinear Depth-μ𝜇\muP Limit

When the nonlinearity ϕ\phi is nontrivial, the distribution of the final representations xsLx^{L}_{s} may be highly non-Gaussian because of complex compositions of ϕ\phi and ϕ\phi^{\prime}, as one would suspect from known examples of large width limits. This is indeed the case for finite depth LL. But in fact, when LL\to\infty, {xsL}s0\{x^{L}_{s}\}_{s\geq 0} becomes a Gaussian process again!

The kernel of the limiting GP can be computed in a similar way as in the linear case:

where (z,y)N(0,Cb(p){t,s})(z,y)\sim\mathcal{N}(0,C^{b}(p)|_{\{t,s\}}).

For sufficiently smooth nonlinearity ϕ\phi, in the LL\to\infty limit, the kets \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x^{L}_{s}\rangle,s=0,1,\ldots, converge in distribution as a zero-mean Gaussian process with kernel

as defined in Definition E.1. Thus, for each fixed neuron index α\alpha, the collection {xαsL}s0\{x^{L}_{\alpha s}\}_{s\geq 0} converges in distribution to a zero-mean Gaussian process with kernel Ct,s,1(1)C_{t,s,1}(1) in the nn\to\infty then LL\to\infty limit.

We frame this as a claim because we do not want to get into the details of what “sufficiently smooth nonlinearity” means here, nor do we give a proof. Instead, we give an intuitive justification.

First, in Depth-μ\muP, we can Taylor expand each block

In this reasoning, the coefficients of a good linear combination correspond to Γ\Gamma in Definition E.1, and filling in the details of the induction yields the recursive formula in Definition E.1.

Finally, because a good linear combination is a large sum of independent terms, the central limit theorem tells us that \{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x^{l}_{t}\rangle,\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\delta x^{l}_{t}\rangle\}_{l,t} converge in distribution to a Gaussian process. ∎

Claim E.1 is good news for theorists, that we have such a simple form for a fundamental architecture. At the same time, one may worry that this Gaussian form lacks expressivity. But in fact, some common architecture or algorithm choices would make the limit non-Gaussian. For example, the use of adaptive optimizers like Adam or SignSGD. Or the addition of a nonlinearity before the matrix multiply, i.e., “prenonlin”, (in addition to the one afterward, “postnonlin”).

In general, one obtains a stochastic differential equation with McKean-Vlasov elements describing the evolution of xtlx^{l}_{t} over depth and time. However, the stochastic integral involved is not the usual Ito or Stratonovich integral because the depthwise evolution requires integrating non-adapted process against Brownian motion. Instead, we need to use Skorohod integral and the SDE is only defined in the sense of Malliavin calculus. This is not just a mathematical nitpick; rather, assuming Ito calculus (which amounts to assuming incorrect independence between certain quantities) will lead to the wrong predictions and calculations. Malliavin calculus is intimately connected to Tensor Programs and we shall develop their relationship as well as the theory of the general infinite-depth limit in a future work.

Appendix F Heuristics for the proofs in the general case

The notation in this section is mostly defined in appendix A. The complete notation is defined in .

where V=Θ(1/n)V=\Theta(1/n) coordinatewise, δ~xl=Θ(1)\widetilde{\delta}x^{l}=\Theta(1) coordinatewise and Wl=Θ(1n)W^{l}=\Theta(\frac{1}{\sqrt{n}}) coordinate-wise.

Similar to the linear case, one can show that under technical conditions (mostly on the activation function) that the infinite-depth limit of the TP follows the dynamics

where λ\lambda\in refers to the fractional layer index (λ\lambda represents layer index λL\lfloor\lambda L\rfloor as LL\to\infty), tt refers to the training step, \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}W_{0}^{\lambda}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}} the matrix operator (defined in Appendix B), and the tilde symbol refers to the “normalized” version of the object, i.e., multiply the ket with (dλ)c(d\lambda)^{c} for some cc such that the multiplication (normalized ket) is Θ(1)\Theta(1) w.r.t. LL, and same for the normalized operators. We also simplify δ~\widetilde{\delta} to δ\delta if it is already under wider tilde symbol. The first term represents a Gaussian noise.

Similar to the forward prop, we obtain the following dynamics for the infinite-depth TP

Here the (dλ)3/2(d\lambda)^{3/2} term got dropped. The individual terms can be simplified as follows

where the other terms from the product rule drops out because

F.2 1/L1𝐿1/L branches

where the equality follows because \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{\lambda}\rangle is contained the σ\sigma-algebra of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U_{0},V_{0}\rangle,so \dot{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}W_{0}^{\lambda}\dot{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}x_{t}^{\lambda}\rangle=0. Since \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bar{\Delta}W_{t}^{\lambda}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\in\sigma(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U_{0},V_{0}\rangle)\otimes\sigma(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U_{0},V_{0}\rangle), \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}\bar{\Delta}W_{t}^{\lambda}\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{\lambda}\rangle\in\sigma(\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U_{0},V_{0}\rangle), and the expectation is really just over \widehat{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}W_{0}^{\lambda}\widehat{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}x_{t}^{\lambda}\rangle.

F.2.2 Backward

Here the \widehat{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}W_{0}^{\lambda\top}\widehat{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}} and \dot{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}}W_{0}^{\lambda\top}\dot{\mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}} drop out because the former is zero-mean and indepenent from \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U_{0},V_{0}\rangle and the latter drops out because \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}x_{t}^{\lambda}\rangle is contained the σ\sigma-algebra of \mathchoice{\scalebox{0.7}[1.0]{\displaystyle\talloblong}}{\scalebox{0.7}[1.0]{\textstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptstyle\talloblong}}{\scalebox{0.7}[1.0]{\scriptscriptstyle\talloblong}}U_{0},V_{0}\rangle.

F.3.2 Backward

F.4 Justifications of the claims

Claim 7.2. Stability during training when α+γ1\alpha+\gamma\geq 1 is straightforward (some technical conditions on the activation function are required). This is because the weight updates are of order LαγL^{-\alpha-\gamma} and feature updates involve no more than LL terms of size LαγL^{-\alpha-\gamma} (plus higher order terms that do not contribute to the update in the large depth limit). When α+γ>1\alpha+\gamma>1, the contribution of a sum of at most LL terms of order LαγL^{-\alpha-\gamma} will decrease to zero, and the network output ftf_{t} will converge to f0f_{0} in this case, yielding a trivial limit. However, when α+γ=1\alpha+\gamma=1, the updates remain important in the infinite depth limit, yielding a non-trivial limit.

Claim 7.3. Consider a stable and nontrivial parametrization (i.e. α+γ=1\alpha+\gamma=1). Faithfulness at initialization is achieved only when α1/2\alpha\geq 1/2. This was proven in in a more general setup. Faithfulness during training is ensured as long as α1\alpha\leq 1 because feature updates are always Θ(1)\Theta(1) in depth. With α>1\alpha>1, γ<0\gamma<0 and the weight updates explode with depth in this case, which yield exploding behaviour for h\bm{h}.

Claim 7.4 When α(1/2,1]\alpha\in(1/2,1], we obtain smooth limiting dynamics when LL\to\infty as demonstrated in Section F.3. This limiting process is a smooth process (no Brownian jumps) that satisfies the required definition of redundancy.

Claim 7.5. It remains to prove that Depth-μ\muP is non-redundant. This is a result of the limiting dynamics in this case (Section F.1) . With Depth-μ\muP, the randomness of the initialization in the hidden layer remains present throughout training, inducing a Brownian-like term that breaks redundancy.

Claim 7.6. In Depth-μ\muP, WtlW0lW_{t}^{l}-W_{0}^{l} is Θ(1/L)\Theta(1/\sqrt{L}) which is much smaller than W0lW_{0}^{l}. Therefore, ϕ(Wtlxtl1)ϕ(W0lxtl1)ϕ(W0lxtl1)((WtlW0l)xtl1)=o(1/L)\phi(W^{l}_{t}\bm{x}_{t}^{l-1})-\phi(W^{l}_{0}\bm{x}_{t}^{l-1})-\phi^{\prime}(W_{0}^{l}\bm{x}_{t}^{l-1})\odot((W_{t}^{l}-W_{0}^{l})\bm{x}_{t}^{l-1})=o(1/\sqrt{L}), thus satisfies 7.7. Similar to the depth-μ\muP case, for α[1/2,1)\alpha\in[1/2,1), the activation in the forward pass can be linearized which indicates layerwise linearization when α+γ=1\alpha+\gamma=1.

Appendix G Additional Experiments

G.2 Experiments with Block Depth 2

Currently, our theory covers resnets with block depth 1, and our experiments confirm the theoretical findings. We conducted similar experiments for clock depth 2 (i.e. the residual block consists of 2 fully connected layers) to see whether the learning rate transfers with Depth-μ\muP. The results are reported in Figure 21. The results show a significant shift in the learning rate which might indicate that as block depth increases, adjustments are needed to stabilize hyperparameters with depth.

G.3 Other experiments