Implicit regularization of deep residual networks towards neural ODEs
Pierre Marion, Yu-Han Wu, Michael E. Sander, Gérard Biau
Introduction
Residual networks are a successful family of deep learning models popularized by breakthrough results in computer vision (He et al., 2016b). The key idea behind residual networks, namely the presence of skip connections, is now ubiquitous in deep learning, and can be found, for example, in Transformer models (Vaswani et al., 2017). The main advantage of skip connections is to allow successful training with depth of the order of a thousand layers, in contrast to vanilla neural networks, leading to significant performance improvement (e.g., Wang et al., 2022). This has motivated research on the properties of residual networks in the limit where the depth tends to infinity. One of the main explored directions is the neural ordinary differential equation (ODE) limit (Chen et al., 2018).
Before presenting neural ODEs, we first introduce the mathematical formalism of deep residual networks. We consider a single model throughout the paper to simplify the exposition, but most of our results apply to more general models, as will be discussed later. We consider the formulation
where is the continuous-depth version of the layer index. It is important to note that this correspondence holds for fixed limiting functions and . This is especially true at initialization, for example by setting the to zero and the to Gaussian matrices weight-tied across the depth. The initial residual network is then trivially equal to the neural ODE . Of course, more sophisticated initializations are possible, as shown, e.g., in Marion et al. (2022); Sander et al. (2022b). However, regardless of an ODE structure at initialization, a more challenging question is that of the structure of the network during and after training. Since the weights are updated during training, there is a priori no guarantee that an ODE limit still holds after training, even if it does at initialization.
The question of a potential ODE structure for the trained network is not a mere technical one. In fact, it is important for at least three reasons. First, it gives a precise answer to the question of the connection between (trained) residual networks and neural ODEs, providing more solid ground to a common statement in the community that both can coincide in the large-depth limit (see, e.g., Haber & Ruthotto, 2017; E et al., 2019; Dong et al., 2020; Massaroli et al., 2020; Kidger, 2022). Second, it opens exciting perspectives for understanding residual networks. Indeed, if trained residual networks are discretizations of neural ODEs, then it is possible to apply results from neural ODEs to the large family of residual networks. In particular, from a theoretical point of view, the approximation capabilities of neural ODEs are well understood (Teshima et al., 2020; Zhang et al., 2020) and it is relatively easy to obtain generalization bounds for these models (Hanson & Raginsky, 2022; Marion, 2023). From a practical standpoint, advantages of neural ODEs include memory-efficient training (Chen et al., 2018; Sander et al., 2022b) and weight compression (Queiruga et al., 2021). This is important because in practice memory is a bottleneck for training residual networks (Gomez et al., 2017). Finally, our analysis is a first step towards understanding the implicit regularization (Neyshabur et al., 2014; Vardi, 2023) of gradient descent for deep residual networks, that is, characterizing the properties of the trained network among all minimizers of the empirical risk.
Our first main contribution (Section 4.1) is to show that a neural ODE limit holds after training up to time , i.e., there exists a function such that the residual network converges, as tends to infinity, to the ODE
This large-depth limit holds for any finite training time . However, the convergence of the optimization algorithm as tends to infinity, which we refer to as the long-time limit to distinguish it from the large-depth limit , is not guaranteed without further assumptions, due to the non-convexity of the optimization problem. We attack the question (Section 4.2) when the width is large enough by proving a Polyak-Łojasiewicz (PL) condition, which is now state of the art in analyzing the properties of optimization algorithms for deep neural networks (Liu et al., 2022). The main assumption for our PL condition to hold is that the width of the hidden layers should be greater than some constant times the number of data . As a second main contribution, we show that the PL condition yields the long-time convergence of the gradient flow for residual networks with linear overparameterization. Finally, we prove the convergence with high probability in the long-time limit, namely the existence of functions and such that the discrete trajectory defined by the trained residual network (1) converges as both and tend to infinity to the solution of the neural ODE (2) with and . In addition, our approach points out that this limiting ODE interpolates the training data. Finally, our results are illustrated by numerical experiments (Section 5).
Related work
Several works study the large-depth convergence of residual networks to differential equations, but without considering the training dynamics (Thorpe & van Gennip, 2023; Cohen et al., 2021; Marion et al., 2022; Hayou, 2023). Closer to our setting, Cont et al. (2022) and Sander et al. (2022b) analyze the dynamics of gradient descent for deep residual networks, as we do, but with significant differences. Cont et al. (2022) consider a scaling factor in front of the residual branch, resulting in a limit that is not a neural ODE. In addition, only is trained. Furthermore, to obtain convergence in the long-time limit, it is assumed that the data points are nearly orthogonal. Sander et al. (2022b) prove the existence of an ODE limit for trained residual networks, but in the simplified case of a linear activation and under a more restricted setting.
Polyak-Łojasiewicz conditions are a modern tool to prove long-time convergence of overparameterized neural networks (Liu et al., 2022). These conditions are a relaxation of convexity, and mean that the gradients of the loss with respect to the parameters cannot be small when the loss is large. They have been applied to residual networks with both linear (Bartlett et al., 2018; Wu et al., 2019; Zou et al., 2020) and nonlinear activations (Allen-Zhu et al., 2019; Frei et al., 2019; Barboni et al., 2022; Cont et al., 2022; MacDonald et al., 2022). Building on the proof technique of Nguyen & Mondelli (2020) for non-residual networks, we need only a linear overparameterization to prove our PL condition, i.e., we require . This compares favorably with results requiring polynomial overparameterization (Allen-Zhu et al., 2019; Barboni et al., 2022) or assumptions on the data, either a margin condition (Frei et al., 2019) or a sample size smaller than the dimension of the data space (Cont et al., 2022; MacDonald et al., 2022).
Our paper can be related to a line of work on the implicit regularization of gradient-based algorithms for residual networks (Neyshabur et al., 2014). We show that the optimization algorithm does not just converge to any residual network that minimizes the empirical risk, but rather to the discretization of a neural ODE. Note that most implicit regularization results state that the optimization algorithm converges to an interpolator that minimizes some complexity measure, which can be a margin (Lyu & Li, 2020), a norm (Boursier et al., 2022), or a matrix rank (Li et al., 2021). Thus, an interesting next step is to understand if the neural ODE found by gradient flow actually minimizes some complexity measure, and to characterize its generalization properties.
Definitions and notation
This section is devoted to specifying the setup outlined in Section 1. Proofs are given in the appendix.
Gradient flow is the limit of gradient descent as the learning rate tends to zero. The parameters are set at time by the initialization, and then evolve according to the ODE
for . In the following, the dependence in is made explicit when necessary, e.g., we write instead of , and instead of .
It turns out that, without further assumptions, the gradient flow can diverge in finite time. This is because the dynamics are not (globally) Lipschitz continuous, breaking the conditions of the Picard-Lindelöf theorem (see Lemma 16) for existence and uniqueness of ODE solutions. A common practice (Goodfellow et al., 2016, Section 10.11.1) is to consider instead a clipped gradient flow
The (clipped) gradient flow (5) has a unique solution for all .
In Section 4.2, we make additional assumptions to prove the long-time convergence of the gradient flow. We then prove that these assumptions ensure that the dynamics of the gradient flow (4) are well defined, eliminating the need for clipping.
The neural ODE corresponding to the residual network (3) is defined by
Clearly, our choices of and at initialization are discretizations of the Lipschitz continuous (in fact, constant) functions and . Thus, Proposition 2 holds at initialization, and the residual network is equivalent to the trivial ODE . The next section shows that after training we obtain non-trivial dynamics, which still discretize neural ODEs.
Large-depth limit of residual networks
We study the large-depth limit of trained residual networks in two settings. In Section 4.1, we consider the case of a finite training time. We move in Section 4.2 to the case where the training time tends to infinity, which is tractable under a Polyak-Łojasiewicz condition. Proofs are given in the appendix.
We first consider the case where the neural network is trained with clipped gradient flow (5) on some training time interval , . This allows us to prove large-depth convergence to a neural ODE without further assumptions. We emphasize that stopping training after a finite training time is a common technique in practice, referred to as early stopping (Goodfellow et al., 2016, Section 7.8). It is considered as a form of implicit regularization, and our result sheds light on this intuition by showing that the complexity of the trained networks increases with .
The following proposition is a key step in proving the main theorem of this section.
Moreover, with probability at least 1-\exp\big{(}-\frac{3qm}{16}\big{)}, the following expressions hold for and :
where is the supremum of in Frobenius norm, and and depend on , , , and .
This proposition ensures that the size of the weights and the difference between successive weights remain bounded throughout training. We can now state the main result, which states the convergence, for any training time in , of the neural network to a neural ODE as . Recall that a sequence of functions of some variable is said to converge uniformly over to if .
Consider the residual network (3) with the training dynamics (5). Then the following statements hold as tends to infinity:
converges uniformly over and to .
Uniformly over , , and , the hidden layer converges to the solution at time of the neural ODE
Uniformly over and , the output converges to .
Let us sketch the proof of statement , which is the cornerstone of the theorem. A first key idea is to introduce in (8) the piecewise-constant continuous-depth interpolation of the weights, whose ambient space does not depend on , in contrast to the discrete weight sequence . Since the weights remain bounded during training by Proposition 3, the Arzelà-Ascoli theorem guarantees the existence of an accumulation point for . We show that the accumulation point is unique because it is the solution of an ODE satisfying the conditions of the Picard-Lindelöf theorem. The uniqueness of the accumulation point then implies the existence of a limit for the weights.
There are two notable byproducts of our proof. The first one is an explicit description of the training dynamics of the limiting weights , , and , as the solution of an ODE system, as presented in Appendix A.5. The second one, which we now describe, consists of norm bounds on the weights. Proposition 3 bounds the discrete weights and the difference between two consecutive weights respectively by some . The proof of Theorem 4 shows that this bound carries over to the continuous weights, in the sense that , , , and are uniformly bounded by , and and are uniformly Lipschitz continuous with Lipschitz constant . Formally, this last property means that, for any and ,
The boundedness and Lipschitz continuity of the weights are important features because they limit the statistical complexity of neural ODEs (Marion, 2023). More generally, norm-based bounds are a common approach in the statistical theory of deep learning (see, e.g., Bartlett et al., 2017, and references therein). Looking at the formula (7) for and , one can see in particular that the bounds diverge exponentially with , providing an argument in favor of early stopping.
Our approach so far characterizes the large-depth limit of the neural network for a finite training time , but two questions remain open. A first challenge is to characterize the value of the loss after training. A second one is to provide insight into the convergence of the optimization algorithm in the long-time limit, i.e., as tends to infinity. To answer these questions, we move to the setting where the width of the network is large enough, which allows us to prove a Polyak-Łojasiewicz condition and thereby the long-time convergence of the training loss to zero.
2 Convergence in the long-time limit for wide networks
Proving convergence of gradient-based optimization algorithms for neural networks is a major difficulty in deep learning theory. One direction recently explored considers sufficiently wide neural networks, and leverages the Polyak-Łojasiewicz (PL) condition. In our setting, they are written as follows (with the notation ):
For , the residual network (3) is said to satisfy the -local PL condition around a set of parameters if, for every set of parameters such that
The next important point is to observe that, under the setup of Section 3 and some additional assumptions, the residual network satisfies the local PL condition of Definition 1.
Assume that the sample points are i.i.d. such that . Then there exist (depending only on ) and such that, if
then, with probability at least , the residual network (3) satisfies the -local PL condition around its initialization, with and .
We emphasize that Proposition 5 requires the width to scale only linearly with the sample size , which improves on the literature (see Section 2). The other assumptions are mild. Note that our proof shows that the parameter is small if grows at most polynomially with (see Appendix B.5).
We are now ready to state convergence in the long-time and large-depth limits to a global minimum of the empirical risk, when the local PL condition holds and the norm of the targets is small enough.
for some depending on . Moreover, the following statements hold as and tend to infinity:
converges uniformly over to .
Uniformly over and , the hidden layer converges to the solution at time of the neural ODE
Uniformly over , the output converges to . Furthermore, for all .
This theorem proves two important results of separate interest. On the one hand, equation (10) shows the long-time convergence of the gradient flow for deep residual networks under the linear overparameterization assumption of Proposition 5. On the other hand, when both and tend to infinity, the network converges to a neural ODE that further interpolates the training data. Note that the order in which and tend to infinity does not matter by uniform convergence properties.
3 Generalizations to other architectures and initialization
To simplify the exposition, we have so far considered a particular residual architecture defined in (3). However, most of our results hold for a more general residual network of the form
It is easy to see that our residual network of interest (3) is a special case of the general model (11) if satisfies the assumptions of Section 3. However, other choices are possible, such as convolutional layers or a Lipschitz continuous version of Transformer (Kim et al., 2021). This latter application is particularly interesting in the light of the literature analyzing the Transformer architecture from a neural ODE point of view (Lu et al., 2019; Sander et al., 2022a; Geshkovski et al., 2023).
Numerical experiments
We now present numerical experiments to validate our theoretical findings, using both synthetic and real-world data. Experimental details are given in Appendix E.
We consider the residual network (3) with the initialization scheme of Section 3. So, the are initialized to zero and the to weight-tied standard Gaussian matrices. To ease the presentation, we consider the case where , and we do not train the weights and , which therefore stay equal to the identity. The activation function is GELU (Hendrycks & Gimpel, 2016), which is a smooth approximation of ReLU: . The sample points follow independent standard Gaussian distributions. Note that it does not hurt to take and independent since, in this subsection, our focus is on optimization results only and not on statistical aspects. The mean-squared error is minimized using full-batch gradient descent. The following experiments exemplify the large-depth (, ) and long-time (, finite) limits.
We now turn to the long-time training setup, training for iterations with . In Figure 2, we plot a specific (randomly-chosen) coefficient of matrices and across layers, for different training times. This illustrates Theorem 6 in a practical setting since, visually, the weights behave as a Lipschitz continuous function for any training time and converge to a Lipschitz continuous function as . We also display the loss as a function of the training time, corroborating the convergence of the loss to zero in Theorem 6.
2 Real-world data
Table 1 conveys several important messages. First, in accordance with our theory (Theorem 4), we obtain a neural ODE structure when using a smooth activation function and weight-tied initialization (lines and of Table 1). This is not the case when using the non-smooth ReLU activation and/or i.i.d. initialization. In fact, we prove in Appendix D that the smoothness of the weights is lost when training with ReLU in a simple setting, confirming this experimental observation. Furthermore, the third line of Table 1 shows that it is possible to obtain a reasonable accuracy with a neural ODE structure, which, as emphasized in Section 1, also comes with theoretical and practical advantages. Nevertheless, we obtain an improvement in accuracy in the cases corresponding to non-smooth weights, i.e., to a residual network that does not discretize an ODE. Extending our theory to such cases is left for future work.
Conclusion
We study the convergence of deep residual networks to neural ODEs. When properly scaled and initialized, residual networks trained with fixed-horizon gradient flow converge to neural ODEs as the depth tends to infinity. This result holds for very general architectures. In the case where both training time and depth tend to infinity, convergence holds under a local Polyak-Łojasiewicz condition. We prove such a condition for a family of deep residual networks with linear overparameterization.
The setting of neural ODE-like networks comes with strong guarantees, at the cost of some performance gap when compared with i.i.d. initialization as highlighted by the experimental section. Extending the mathematical large-depth study to the i.i.d. case is an interesting problem for future research. Previous work suggests that the correct limit object is then a stochastic differential equation instead of an ODE (Cohen et al., 2021; Cont et al., 2022; Marion et al., 2022).
P.M. is supported by a grant from Région Île-de-France and by MINES Paris - PSL. P.M. and Y.-H.W. are funded by a Google PhD Fellowship. M.S. is supported by the “Investissements d’avenir” program, reference ANR19-P3IA-0001, and by the European Research Council (ERC project NORIA). This work was granted access to the HPC resources of IDRIS under the allocation 2020-[AD011012073] made by GENCI.
References
In Section A, we give some results on the general residual network (11). In Section B, these results are instantiated in the specific case of the residual network (3), thus proving the results of the paper. Section C contains some lemmas that are useful for the proofs. We present in Section D a counter-example showing that a residual network with the ReLU activation can move away from the neural ODE structure during training. Finally, Section E presents some experimental details.
Appendix A Some results for general residual networks
Let , , and be generic normed spaces. Then a function of two variables is:
(Globally) Lipschitz continuous if there exists such that, for ,
Locally Lipschitz continuous in its first variable if, for any compacts , there exists such that, for ,
Equivalent definitions hold for a function of one variable. Moreover, is said to be uniformly Lipschitz continuous for in if there exists such that, for ,
and uniformly Lipschitz continuous for in any compact if, for any compact , there exists such that, for ,
Throughout, we refer to a Lipschitz continuous function with Lipschitz constant as -Lipschitz.
As explained in Section 4.3, most of our results are proven for the general residual network
For a vector , denotes the Euclidean norm. For a matrix , the operator norm induced by the Euclidean norm is denoted by , and the Frobenius norm is denoted by . Finally, we use the notation (resp. , ) to denote the function (resp. , ), since the parameters are considered as functions of the training time throughout this appendix.
First, in Section A.1, we study the case of the (clipped) gradient flow (5). We show that the weights and the difference between successive weights are bounded during the entire training. Section A.2 shows a similar result for the standard gradient flow (4) under a PL condition. In Section A.3, we show a generalized version of the Arzelà-Ascoli theorem, which allows us to prove the existence of a converging subsequence of the weights in the large-depth limit. Section A.4 is devoted to the convergence of the Euler scheme for parameterized ODEs. We then proceed to prove in Section A.5 our main result, i.e., the large-depth convergence of the gradient flow. The key step is to establish the uniqueness of the adherence point of the weights. Finally, in Section A.6, we prove the existence of a double limit for the weights and the hidden states when both the depth and the training time tend to infinity.
A.1 The trained weights are bounded in the finite training-time setup
Consider the residual network (12) initialized as explained in Appendix A and trained with the gradient flow (5) on , for some . Let
Moreover, there exist such that, for and ,
The following expressions for and hold:
defining the gradient flow (5) are locally Lipschitz continuous, hence the gradient flow is defined on a maximal interval by the Picard-Lindelöf theorem (see Lemma 16). Let us show by contradiction that . Assume that . If this is true, again by the Picard-Lindelöf theorem, we know that the parameters diverge to infinity at . However, for any , we have
Bounds on and by can be shown similarly. This contradicts the divergence of the parameters at . We conclude that the gradient flow is well defined on and that the bounds (17) hold.
It remains to bound the difference . We have, for and ,
Furthermore, for , , and ,
since is -Lipschitz, where is defined by (18), and . Therefore, for any ,
This bound shows that the pair belongs to the compact defined in (19) for every , , and . In particular, , and
For and ,
Moreover, for and ,
where we use (17) and (21) for the last inequality. Putting all the pieces together, we obtain
Applying Grönwall’s inequality (see, e.g., Dragomir, 2003), we conclude that , as desired. ∎
A.2 The trained weights are bounded under the local PL condition
Moreover, the following expression for hold:
defining the gradient flow (5) are locally Lipschitz continuous, hence the gradient flow is defined on a maximal interval by the Picard-Lindelöf theorem (see Lemma 16). Let us show by contradiction that . Assume that . If this is true, again by the Picard-Lindelöf theorem, we know that the parameters diverge to infinity at . In particular, there exist and such that
Let be the infimum of such times . Then, for and ,
and, by continuity of , , and , these inequalities also hold for . By definition, this means that the -local PL condition is satisfied for , and ensures that
Therefore, by definition of the gradient flow (4),
Thus, by Grönwall’s inequality, for ,
Furthermore, by (23) and the definition of , , , we have, for and ,
A quick scan through the proof of Proposition 7 reveals that by similar arguments, we have, for , , and ,
where the second inequality is a consequence of the Cauchy-Schwartz inequality. Let us now bound . We have, for ,
since and for . Therefore, by (25),
where the last inequality is a consequence of the definition of . Similarly, by (14) and (25),
This proves statement of the proposition. Moreover, the analysis above show that the derivatives of , , and are bounded by a bounded integrable function independent of and . This shows , together with the fact that the functions , , and admit limits as . Furthermore, the convergence towards their limit is uniform over and , as we show for example for . If we denote by its limit, and apply the same steps as for bounding , we obtain, for any ,
where the last inequality comes from the definition of . The bound is independent of , proving statement . Statement readily follows from (24).
To complete the proof, it remains to prove statement by bounding the differences . Now that we know that the weights are bounded, we can follow the same steps as in the proof of Proposition 7 and show the existence of , such that
where the second inequality uses the definition of . By Grönwall’s inequality,
A.3 Generalized Arzelà–Ascoli theorem
For , ,
For , and .
Note that if is a compact interval, then the existence of a (uniformly) convergent subsequence is guaranteed by the standard Arzelà–Ascoli theorem. Indeed, the uniform equicontinuity is a consequence of assumptions and , while provides a uniform bound. However, if is not compact, more involved arguments are needed.
Assume, without loss of generality, that is also bounded by . According to assumption , for and ,
Also, according to , for and ,
It follows that, for and ,
Therefore, with some simple algebra, we obtain
The statement of the proposition is then a consequence of the next three steps.
By considering (26) for the subsequence and letting , we have that, for any and ,
Let , , and . Then, by (26) and (27), it is possible to find such that, for any and satisfying and ,
Furthermore, there exists a finite set such that
In the sequel, we denote by an element of that is at distance at most from .
If is unbounded, then, by assumption and since is integrable, there exists some such that, for ,
The same inequality holds for by letting tend to infinity. If is bounded, we simply let .
We may then pick a finite set such that
Two cases may arise depending on the value of . If , then there exists an element of the set at distance at most from , and we denote it by . If , we let . According to (29) and (30), we then have in both cases that
To conclude, we have to bound the term uniformly over and . We first have
where the last inequality is a consequence of (31). The last term can be bounded as follows:
by using (28) and the fact that . Putting all the pieces together, we finally obtain
By taking large enough, independent of and , the sum of the last two terms can be made less than . Since is arbitrary, this concludes the proof. ∎
A consequence of this result is a simplified version for sequences of functions only indexed by and not , as follows.
A.4 Consistency of the Euler scheme for parameterized ODEs
Then tends to uniformly over , where is the unique solution of the ODE
Denote by the uniform Lipschitz constant of for . Since and is -Lipschitz, one has
where . A similar reasoning applies to the discrete scheme (32), using the discrete version of Grönwall’s inequality. More precisely, for any ,
Overall, we can consider a restriction of to a compact set depending only on , , and , which we will still denote by with a slight abuse of notation.Since is , it is therefore bounded and Lipschitz continuous, and we still let be its Lipschitz constant.
The next step is to recursively bound the size of this gap, first observing that . We have that
In the last inequality, we used the fact that is -Lipschitz. Since,by definition, = , we obtain, for ,
where is the Lipschitz constant of . By the discrete Grönwall’s inequality, we deduce that, for ,
This shows that the gaps converge to zero uniformly over as tends to infinity.
We conclude by observing that, for any ,
The results of Proposition 11 can be extended without much effort to two other related cases. First, the parameters may depend on some other variable , as long as all assumptions are verified uniformly over . Second, these parameters may converge to some limit parameters as both and go to infinity. This is encapsulated in the following two corollaries.
Then tends to uniformly over and , where is the unique solution of the ODE
Then tends to uniformly over as , where is the unique solution of the ODE
A.5 Large-depth convergence of the gradient flow
converges uniformly over and to .
Uniformly over , , and , the hidden layer converges to the solution at time of the neural ODE
Uniformly over and , the output converges to .
In the remainder, we prove the uniqueness of the accumulation point by showing that it is the solution of an ODE that satisfies the assumptions of the Picard-Lindelöf theorem. The statements to then follow easily.
Consider a general input , and let (recall that is defined by the forward propagation (12)). Corollary 12, with , , , , ensures that converges uniformly (over and ) to that is the solution at time of the ODE
We now turn our attention to the backpropagation recurrence (13), which defines the backward state . First observe that the convergence of implies that
The function is uniformly Lipschitz continuous for , as noted previously, and the same is true for since is Lipschitz continuous.
The function tends to uniformly over and , as seen in the beginning of the proof. More precisely, we know that tends to . Simple algebra and the fact that two successive iterates of (12) are separated by a distance proportional to show that both statements are equivalent. Furthermore, tends to uniformly over and as noted above.
The function is since is . We clearly have . Finally, is uniformly Lipschitz continuous for in any compact since is continuous.
Overall, we obtain that converges uniformly (over and ) to , the solution at time of the backward ODE
The term inside can be rewritten as
Since is , is locally Lipschitz continuous. Applying the first part of the proof to the specific case of , we know that and uniformly bounded, and that and converge uniformly to and . Therefore, the right-hand side of (37) converges uniformly over and to
A similar approach reveals that and are differentiable and that they verify the equations
which makes it a Banach space. We have to show that the mapping
is locally Lipschitz continuous with respect to this norm, where we recall that in (42) is the solution at time of the initial value problem
and is the solution at time of the initial value problem
To prove that the mapping (42) is locally Lipschitz continuous, we first check that it is well defined. Since is assumed to be only bounded (and not continuous), the solutions of the initial value problems (43) and (44) are well defined in the sense of the Caratheodory conditions, which are given in Lemma 17.
The norm inside the integral can be bounded by
Using Grönwall’s inequality, we obtain, for any ,
This shows that the function is locally Lipschitz continuous. One proves by similar arguments that the function is locally Lipschitz continuous. Thus, overall, the mapping (42) is locally Lipschitz continuous as a composition of locally Lipschitz continuous functions.
The uniform convergence of to is then easily shown by contradiction. Suppose that uniform convergence does not hold. If this is true, then there exists a subsequence that stays at distance from (in the sense of the uniform norm). Then arguments similar to the beginning of the proof show the existence of a second accumulation point, which is a contradiction. This shows the uniform convergence, yielding statements and of the theorem.
Finally, reapplying Corollary 12 with , , , , completes the proof by proving statements and . ∎
Interestingly, the proof of Theorem 14 provides us with an explicit description of the evolution of the continuous-depth limiting weights during training. With the notation of the proof, the continuous weights satisfy the training dynamics:
where we recall that is the solution at time of the initial value problem
and is the solution at time of the problem
These equations can be thought of as the continuous-depth equivalent of the backpropagation equations.
A.6 Existence of the double limit when L,t𝐿𝑡L,t tend to infinity
Consider the residual network (12), and assume that:
Then the following four statements hold as and tend to infinity:
Uniformly over and , the hidden layer converges to the solution at time of the ODE
Uniformly over , the output converges to . Furthermore, for .
The existence of limits and to and as and tend to infinity is given by Lemma 19. The same argument applies to , which provides a limit to the sequence. Furthermore, following the proof of the lemma, we see that the convergence of to is uniform over . Corollary 13, applied with , , , , then ensures that converges uniformly (over and ) to that is the solution at time of (45), as and tend to infinity. As a consequence, converges uniformly over to as . Furthermore, recall that
The left-hand side converges as to by assumption of the proposition, while the right-hand side converges to
Therefore, for , and the proof is complete. ∎
Appendix B Proofs of the results of the main paper
In this section, we prove the results of the main paper. Most of these results follow from those presented in Section A. The only substantial proof is that of Proposition 5, which shows the local PL condition. It uses a result of Nguyen & Mondelli (2020) involving the Hermite transform and the sub-Gaussian variance proxy, which we define briefly. We refer to Debnath & Bhatta (2014, Chapter 17) and Vershynin (2018, Sections 2.5.2 and 3.4.1), respectively, for more detailed explanations.
The -th normalized probabilist’s Hermite polynomial is given by
This family of polynomials forms an orthonormal basis of square-integrable functions for the inner product
Therefore, any function such that can be decomposed on this basis. The -th coefficient of this decomposition is denoted by .
For a matrix , we let and its minimum and maximum singular values, and similarly, and its minimum and maximum eigenvalues (whenever they exist).
Before delving into the proofs, we briefly describe the parts of this section that make use of the specific model (3). The most important one is the proof of Proposition 5, i.e., the proof that the residual network satisfies the -local PL condition. Additionally, in the proof of Proposition 3, the expressions for and are valid only for the specific model (3). Finally, in the proof of Theorem 6, the beginning of the proof reveals that condition (22) of Proposition 8 on can be expressed as a condition on the norm of the labels . This applies only to the specific model (3). Observe that, if one assumes that the general residual network of Section A satisfies the -local PL condition with given by (22), then the rest of the proof of Theorem 6 unfolds, and the conclusions of the theorem hold for the general model.
B.1 Proof of Proposition 1
Proposition 1 is a consequence of Proposition 7 with .
B.2 Proof of Proposition 2
Proposition 11, with , , , , gives the existence and uniqueness of the solution of the neural ODE (6). Moreover, inspecting the proof of Proposition 11, equations (35) gives that, for any input , the difference between the last hidden layer of the discrete residual network (3) and its continuous counterpart in the neural ODE (6) is bounded by
where is independent of and , and . The function is a piecewise-constant interpolation of with pieces of length . Since is Lipschitz continuous, the distance between and decreases as for some depending on but not on . This yields , where and are independent of and . Since and , the result is proven.
B.3 Proof of Proposition 3
Furthermore, due to our initialization scheme described in Section 3,
B.4 Proof of Theorem 4
B.5 Proof of Proposition 5
Now that we have introduced the necessary notation, we can proceed to prove some preliminary estimates. Since , we have, for ,
By Lemma 20, with probability at least 1-\exp\big{(}-\frac{qm}{16}\big{)}, one has . Together with the previous inequalities, this implies
where the second inequality is a consequence of Lemma 18, as follows:
Let us now bound and . We have
Moreover, by (46), for any ,
where the second inequality is a consequence of (48). Therefore, by (49),
Moving on to , the chain rule leads to
where denotes the element-wise product. Noting that and using (48), we obtain
It follows that . In addition,
Therefore, by Lemma 18, since ,
Collecting bounds, we conclude that, for ,
A similar proof reveals that, for ,
As a consequence, when , by Lemma 18,
by (47) and by definition of . Putting together the two bounds above as well as (47), (48), and (50), we obtain
where and . Thus, when , we have
for . As a consequence, for , returning to (52),
letting . Therefore,
where we used the inequality for . This proves the result, with
With appropriate values of and , the probability of failure can be made as small as
for any . This is possible first by choosing such that , then by choosing such that the first two terms are less than . Moreover, we refer the interested reader to Goel et al. (2020, Lemmas A.2 and A.9) for quantitative estimates of for ReLU and sigmoid activations. Finally, the expression (53) is essentially the same as the one appearing in Nguyen & Mondelli (2020, Theorem 3.3). As in this paper, we note that this expression is small if grows at most polynomially with , in which case the exponential term in dominates the polynomial term in .
B.6 Proof of Theorem 6
By Proposition 5, there exists such that, with probability at least , the residual network (3) satisfies the -local PL condition around its initialization, with
A close examination of the quantities involved in the definition of reveals that it depends only on , , , and . In particular, it does not depend on the dimension .
Appendix C Some technical lemmas
We start by recalling the Picard-Lindelöf theorem (see, e.g., Luk, 2017, for a self-contained presentation, and Arnold, 1992, for a textbook).
The next lemma gives conditions for the existence and uniqueness of the global solution of the initial value problem (54) when the assumption of continuity of in its second variable is removed, thereby generalizing the Picard-Lindelöf theorem.
Hence, by Grönwall’s inequality, for ,
Thus, , which is impossible. Hence the maximal solution of the restricted problem is defined on $U(s)\in Ds\in$. ∎
The next three lemmas recall well-known results from linear algebra, analysis, and random matrix theory. Recall that and denote respectively the minimum singular value and eigenvalue of a matrix.
If , then . Furthermore, if , then .
The first statement is a consequence of, e.g., Loyka (2015), which establishes that , yielding the first inequality since . As for the second one, we have
Since , the rightmost quantity is equal to , proving the second statement of the lemma. The third statement is similar. ∎
Hence, for and ,
The quantity follows a chi-squared distribution with degrees of freedom. Hence, according to Laurent & Massart (2000, Lemma 1), for ,
Taking , we see that
where the bound follows from . Since furthermore , we obtain
Finally, the last lemma of the section gives a lower bound on the smallest singular value of a matrix of the form , where is a bounded function applied element-wise and belongs to a family of random matrix. The lower bound involves the Hermite transform of , which is defined in Section B.
where is the sub-Gaussian variance proxy of the columns of .
Denoting by the -th row of and letting
our goal is to lower bound the smallest eigenvalue value of . Observe that
Appendix D Counter-example for the ReLU case.
This section gives a proof sketch to illustrate that, with the ReLU activation , the smoothness of the weights can be lost during training. More precisely, we show a case where successive weights are at distance at initialization and at distance after training.
As a consequence, the gradient flow equation for the even layers is, for ,
Due to the symmetry of these equations for and the fact that all the are equal, the parameters on each even layer coincide at all times and are equal to such that
An analysis of this ODE reveals that tends as to satisfying that
This can be seen by letting , and applying Grönwall’s inequality to . Therefore, as , one has and , where (56) implies that . This shows that the final weights are not smooth in the sense that the distance between two successive weights is .
This result contrasts sharply with Proposition 7, which shows that successive weights remain at a distance throughout training, when initialized as a discretization of a Lipschitz continuous function, and with a smooth activation function. In fact, Proposition 7 can be generalized to any initialization such that successive weights are at distance at initialization, which is the case in the counter-example. This means that the only broken assumption in our counter-example is the non-smoothness of the activation function. This non-smoothness causes the gradient flow dynamics for two successive weights to deviate, even though the weights are initially close to each other, because they are separated by the kink of ReLU at zero.
Appendix E Experimental details
We take , , . We train for iterations, and set the learning rate to . The scaling of the learning rate with is the equivalent of the factor in the gradient flow (4).
We take , , , , and train for iterations with a learning rate of .
We take . The first layer is a trainable convolutional layer with a kernel size of , a stride of , a padding of , and out channels. We then iterate the residual layers