W HY ( AND W HEN ) DOES L OCAL SGD G ENERALIZE B ETTER THAN SGD?
A BSTRACT
Local SGD is a communication-efficient variant of SGD for large-scale training, where multiple GPUs perform SGD independently and average the model parameters periodically.
It has been recently observed that Local SGD can not only achieve the design goal of reducing the communication overhead but also lead to higher test accuracy than the corresponding SGD baseline (Lin et al., 2020b), though the training regimes for this to happen are still in debate (Ortiz et al., 2021).
This paper aims to understand why (and when)
Local SGD generalizes better based on Stochastic Differential Equation (SDE) approximation.
The main contributions of this paper include (i) the derivation of an SDE that captures the long-term behavior of Local SGD in the small learning rate regime, showing how noise drives the iterate to drift and diffuse after it has reached close to the manifold of local minima, (ii) a comparison between the SDEs of Local SGD and SGD, showing that Local SGD induces a stronger drift term that can result in a stronger effect of regularization, e.g., a faster reduction of sharpness, and (iii) empirical evidence validating that having a small learning rate and long enough training time enables the generalization improvement over SGD but removing either of the two conditions leads to no improvement.
I NTRODUCTION
As deep models have grown larger, training them with reasonable wall-clock times has led to new distributed environments and new variants of gradient-based training.
Recall that Stochastic Gradient Descent (SGD) tries to solve min θ ∈ R d E ξ ∼ ˜ D
[ ℓ ( θ ; ξ )] ,
where θ ∈ R
d is the parameter vector of the model, ℓ ( θ ; ξ ) is the loss function for a data sample ξ drawn from the training distribution ˜ D , e.g., the uniform distribution over the training set.
SGD with learning rate η and batch size B does the following update at each step, using a batch of B independent ξ t, 1 , . . .
, ξ t,B ∼ ˜ D : [Equation] t
[Equation]
where g
[Equation]
Parallel SGD tries to improve wall-clock time when the batch size B is large enough. It distributes the gradient computation to K ≥ 2 workers, each of whom focuses on a local batch of B loc := B/K samples and computes the average gradient over the local batch.
Finally, g t is obtained by averaging the local gradients over the K workers.
However, large-batch training leads to a significant test accuracy drop compared to a small-batch training baseline with the same number of training steps or epochs (Smith et al., 2020; Shallue et al.,
[Figure]
T e s
[Figure]
A cc u r a c y
H = [Figure]
H
[Figure]
H [Figure] [Figure] ; Keskar et al., 2017; Jastrz˛ebski et al., 2017).
Reducing this generalization gap is the goal of much subsequent research. It was suggested that the generalization gap arises because larger batches lead to a reduction in the level of noise in batch gradient (see Appendix A for more discussion).
The
Linear Scaling Rule (Krizhevsky, 2014; Goyal et al., 2017; Jastrz˛ebski et al., 2017) tries to fix this by increasing the learning rate in proportion to batch size. This is found to reduce the generalization gap for (parallel) SGD, but does not entirely eliminate it.
To reduce the generalization gap further, Lin et al. (2020b) discovered that a variant of SGD, called
Local SGD (Yu et al., 2019; Wang & Joshi, 2019; Zhou & Cong, 2018), can be used as a strong component.
Perhaps surprisingly, Local SGD itself is not designed for improving generalization, but for reducing the high communication cost for synchronization among the workers, which is another important issue that often bottlenecks large-batch training (Seide et al., 2014; Strom, 2015; Chen et al., 2016; Recht et al., 2011).
Instead of averaging the local gradients per step as in parallel SGD,
Local SGD allows K workers to train their models locally and averages the local model parameters whenever they finish H local steps. Here every worker samples a new batch at each local step, and in this paper we focus on the case where all the workers draw samples with or without replacement from the same training set.
See Appendix C for the pseudocode.
More specifically, Lin et al.
(2020b) proposed Post-local SGD , a hybrid method that starts with parallel SGD (equivalent to Local SGD with H = 1 in math) and switches to Local SGD with
H > 1 after a fixed number of steps t 0 .
They showed through extensive experiments that Postlocal SGD significantly outperforms parallel SGD in test accuracy when t 0 is carefully chosen.
In
Figure 1, we reproduce this phenomenon on both CIFAR-10 and ImageNet.
As suggested by the success of Post-local SGD, Local SGD can improve the generalization of SGD by merely adding more local steps (while fixing the other hyperparameters), at least when the training starts from a model pre-trained by SGD.
But the underlying mechanism is not very clear, and there is also controversy about when this phenomenon can happen (see Section 2.1 for a survey).
The current paper tries to understand: Why does Local SGD generalize better?
Under what general conditions does this generalization benefit arise?
Previous theoretical research on Local SGD is mainly restricted to the convergence rate for minimizing a convex or non-convex objective (see Appendix A for a survey).
A related line of works (Stich, 2018;
Yu et al., 2019; Khaled et al., 2020) showed that Local SGD has a slower convergence rate compared with parallel SGD after running the same number of steps/epochs.
This convergence result suggests that Local SGD may implicitly regularize the model through insufficient optimization, but this does not explain why parallel SGD with early stopping, which may incur an even higher training loss, still generalizes worse than Post-local SGD.
Our Contributions.
In this paper, we provide the first theoretical understanding on why (and when) switching from parallel SGD to Local SGD improves generalization.
In Section 2.2, we conduct ablation studies on CIFAR-10 and ImageNet and identify a clean setting where adding local steps to SGD consistently improves generalization: if the learning rate is small and the total number of steps is sufficient, Local SGD eventually generalizes better than the corresponding (parallel) SGD baseline.
In Section 3.2, we derive a special SDE that characterizes the long-term behavior of Local SGD in the small learning rate regime, as inspired by a previous work (Li et al., 2021b) that proposed this type of SDE for modeling SGD. These SDEs can track the dynamics after the iterate has reached close to a manifold of minima.
In this regime, the expected gradient is near zero, but the gradient noise can drive the iterate to wander around.
In contrast to the conventional SDE (3) for
SGD, where the drift and diffusion terms are connected respectively to the expected gradient and gradient noise, the SDE we derived for Local SGD has drift and diffusion terms both connected to gradient noise.
Section 3.3 explains the generalization improvement of Local SGD over SGD by comparing the corresponding SDEs: increasing the number of local steps H strengthens the drift term of SDE while keeping the diffusion term untouched.
We hypothesize that having a stronger drift term can benefit generalization.
As a by-product, we provide a new proof technique that can give the first quantitative approximation bound for how well Li et al.
(2021b)’s
SDE approximates SGD.
Back to the discussion on the generalization gap between small- and large-batch training, we remark that this gap can occur early in training when the learning rate is very large (Smith et al., 2020) and Local SGD cannot prevent this gap in this phase. Instead, our theory suggests that Local SGD can reduce the gap in late training phases after decaying the learning rate.
W HEN DOES L OCAL SGD G ENERALIZE B ETTER ?
In our motivating example of Post-local SGD, switching from SGD to Local SGD can outperform running SGD alone (i.e., no switching) in test accuracy, but this improvement does not always arise and can depend on the choice of the switching time point.
Because of this, a necessary first step for developing a theoretical understanding of Local SGD is to identify under what general conditions Local SGD can improve the generalization of SGD by merely adding local steps.
2. T HE D EBATE ON L OCAL SGD
We first summarize a debate in the literature regarding when to switch from SGD to Local SGD in running Post-local SGD, which hints the conditions so that Local SGD can improve upon SGD.
Local SGD generalizes better than SGD on CIFAR-10.
Lin et al.
(2020b) empirically observed that Post-local SGD exhibits a better generalization performance than SGD.
Most of their experiments are conducted on CIFAR-10 and CIFAR-100 with multiple learning rate decays, and the algorithm switches from (parallel) SGD to Local SGD right after the first learning rate decay.
We refer to this particular choice of the switching time point as the first-decay switching strategy for short.
To justify this strategy, they empirically showed that the generalization improvement can be less significant if starting Local SGD from the beginning or right after the second learning rate decay.
It has also been observed by Wang & Joshi (2021) that running Local SGD from the beginning improves generalization, but the test accuracy improvement may not be large enough.
A subsequent work by Lin et al.
(2020a) showed that adding local steps to Extrap-SGD, a variant of SGD proposed therein, after the first learning rate decay also improves generalization, suggesting that the first-decay switching strategy can also be applied to the post-local variant of other optimizers.
Does Local SGD exhibit the same generalization benefit on large-scale datasets?
Going beyond CIFAR-10, Lin et al.
(2020b) conducted a few ImageNet experiments and showed that Postlocal SGD with first-decay switching strategy still leads to better generalization than SGD.
However, the improvement is sometimes marginal, e.g., 0 .
1% for batch size 8192 .
For the general case, they suggested that the time of switching should be tuned aiming at “capturing the time when trajectory starts to get into the influence basin of a local minimum” in a footnote, but no further discussion or experiments are provided to justify this guideline.
Ortiz et al.
(2021) conducted a more extensive evaluation on ImageNet (with a different set of hyperparameters) and concluded with the opposite: the first-decay switching strategy can hurt the validation accuracy.
Instead, switching at a later time, such as the second learning rate decay, leads to a better validation accuracy than SGD.
1 To explain this phenomenon, they conjecture that switching to Local SGD has a regularization effect that is beneficial only in the short-term, so it is always better to switch as late as possible.
They further conjecture that this discrepancy between CIFAR-10 and ImageNet is mainly due to the task scale.
On TinyImageNet, which is a spatially downscaled subset of ImageNet, the first-decay switching strategy indeed leads to better validation accuracy.
[Figure]
2. K EY F ACTORS : S MALL L EARNING R ATE AND S UFFICIENT T RAINING T IME
All the above papers agree that Post-local/Local SGD improves upon SGD to some extent.
However, it is in debate under what conditions the generalization benefit can consistently occur.
We now conduct ablation studies to identify the key factors so that adding local steps improves the generalization of SGD.
We run parallel SGD and Local SGD with the same learning rate η , local batch size B loc , and number of workers K .
We start training from the same initialization and compare their generalization after the same number of epochs.
As Post-local SGD can be viewed as Local SGD starting from an SGD-pretrained model, the initial point in our experiments can be either random or a checkpoint of SGD training.
See Appendix C for implementation details and Appendix M.2 for more details about the experimental setup.
The first observation we have is that the generalization benefits can be reproduced on both CIFAR10 and ImageNet in our setting (see Figure 1).
We remark that Post-local SGD and SGD in Lin et al.
(2020b);
Ortiz et al.
(2021) are implemented with accompanying Nesterov momentum terms.
The learning rate also decays a couple of times in training with Local SGD.
Nevertheless, our experiments show that the Nesterov momentum and learning rate decay are not necessary for Local SGD to generalize better than SGD.
Our main finding after further ablation studies is summarized below:
Finding 2.1.
Given a sufficiently small learning rate and a sufficiently long training time, Local
SGD exhibits better generalization than SGD, if the number of local steps H per round is tuned properly according to the learning rate.
This holds for both training from random initialization and from pre-trained models.
Now we go through each point of our main finding.
See also Appendix F for more plots.
Pretraining is not necessary.
In contrast to previous works claiming the benefits of Post-local
SGD over Local SGD (Lin et al., 2020b; Ortiz et al., 2021), we observe that Local SGD with random initialization also generalizes significantly better than SGD, as long as the learning rate is small and the training time is sufficiently long (Figure 2(a)).
Starting from a pretrained model may shorten the time to reach this generalization benefit to show up (Figure 2(b)), but it is not necessary.
Learning rate should be small.
We experiment with a wide range of learning rates to conclude that setting a small learning rate is necessary.
The learning rate is 0 .
32 for Figures 2(a) and 2(b) and is 0 .
16 for Figure 2(c).
As shown in Figure 2(d), Local SGD encounters optimization difficulty in the first phase where η is large ( η = 3 . 2 ), resulting in inferior final test accuracy.
Even for training from a pretrained model, the generalization improvement of Local SGD disappears for large learning rates (e.g., η = 1 . 6 in Figure 5(d)).
In contrast, if a longer training time is allowed, reducing the learning rate of Local SGD does not lead to test accuracy drop (Figure 5(c)).
Training time should be long enough.
To investigate the effect of training time, in Figures 2(b) and 2(c), we extend the training budget for the Post-local SGD experiments in Figureand observe that a longer training time leads to greater generalization improvement upon SGD.
On the other hand, Local SGD generalizes worse than SGD in the first few epochs of Figures 2(a) and 2(c); see Figures 5(a) and 5(b) for an enlarged view.
The number of local steps H should be tuned carefully.
The number of local steps H has a complex interplay with the learning rate η , but generally speaking, a smaller η needs a higher H to achieve consistent generalization improvement.
For CIFAR-10 with a post-local training budget of 250 epochs (see Figure 2(e)), the test accuracy first rises as H increases, and begins to fall as H exceeds some threshold for relatively large η (e.g., η ≥ 0 .
5 ) while keeps growing for smaller η (e.g., η < 0 .
For ImageNet with a post-local training budget of 50 epochs (see Figure 2(f)), the test accuracy first increases and then decreases in H for all learning rates.
Reconciling previous works.
Our finding can help to settle the debate presented in Section 2.1 to a large extent.
Simultaneously requiring a small learning rate and sufficient training time poses a trade-off when learning rate decay is used with a limited training budget: switching to Local SGD earlier may lead to a large learning rate, while switching later makes the generalization improvement of Local SGD less noticeable due to fewer update steps.
It is thus unsurprising that first-decay switching strategy is not always the best.
The need for sufficient training time does not contradict with Ortiz et al.
’s conjecture that Local SGD only has a “short-term” generalization benefit.
In their experiments, the generalization improvement usually disappears right after the next learning rate decay (instead of after a fixed amount of time).
We suspect that the real reason why the improvement vanishes is that the number of local steps H was kept as a constant, but our finding suggests tuning H after η changes.
In Figure 5(e), we reproduce this phenomenon and show that increasing H after learning rate decay retains the improvement.
Generalization performances at the optimal learning rate of SGD. In practice, the learning rate of SGD is usually tuned to achieve the best training loss/validation accuracy within a fixed training budget. Our finding suggests that when the tuned learning rate is small and the training time is sufficient, Local SGD can offer generalization improvement over SGD. As an example, in our experiments on training from an SGD-pretrained model, the optimal learning rate for SGD is 0 .
5 on CIFAR-10 (Figure 2(e)) and 0 .
064 on ImageNet (Figure 2(f)).
With the same learning rate as SGD, the test accuracy is improved by 1 . 1% on CIFAR-10 and 0 .
3% on ImageNet when using
Local SGD with H = 750 and H = 26 respectively.
The improvement could become even higher if the learning rate of Local SGD is carefully tuned.
T HEORETICAL A NALYSIS OF L OCAL SGD: T HE S LOW SDE
In this section, we adopt an SDE-based approach to rigorously establish the generalization benefit of Local SGD in a general setting.
Below, we first identify the difficulty of adapting the SDE framework to Local SGD.
Then, we present our novel SDE characterization of Local SGD around the manifold of minimizers and explain the generalization benefit of Local SGD with our SDE.
Notations.
We follow the notations in Section 1.
We denote by η the learning rate, K the number of workers, B the (global) batch size, B loc :=
B/K the local batch size, H the number of local steps, ℓ ( θ ; ζ ) the loss function for a data sample ζ , and ˜ D the training distribution.
Furthermore, we define L ( θ ) :=
E ξ ∼ ˜ D
[ ℓ ( θ ; ξ )] as the expected loss, Σ ( θ ) :
=
Cov ξ ∼ ˜ D [ ∇ ℓ ( θ ; ξ )] as the noise covariance of gradients at θ .
Let { W t } t ≥ 0 denote the standard Wiener process.
For a mapping
F : R d → R d , denote by ∂F ( θ ) the Jacobian at θ and ∂ 2 F ( θ ) the second order derivative at θ .
Furthermore, for any matrix M ∈ R d × d , ∂ 2 F ( θ )[ M ] = (cid:80) i ∈
[ d ] ⟨ ∂ 2 F i ∂ θ 2 , M ⟩ e i where e i is the i -th vector of the standard basis.
We write ∂ 2 ( ∇L )
( θ )
[ M ] as ∇ 3 L ( θ )[ M ] for short.
Local SGD. We use the following formulation of Local SGD for theoretical analysis. See also Appendix C for the pseudocode.
Local SGD proceeds in multiple rounds of model averaging, where each round produces a global iterate ¯ θ ( s ) .
In the ( s + 1) -th round, every worker k ∈
[ K ] starts with its local copy of the global iterate θ ( s ) k, 0 ← ¯ θ ( s ) and does H steps of SGD with local batches.
In the t -th local step of the k -th worker, it draws a local batch of B loc := B/K independent samples ξ ( s ) k,t, 1 , . . .
, ξ ( s ) k,t,B loc from a shared training distribution ˜ D and updates as follows:
[Equation]
The local updates on different workers are independent of each other as there is no communication.
After finishing the H local steps, the workers aggregate the resulting local iterates θ ( s ) k,H and assign the average to the next global iterate: ¯ θ ( s +1) ← 1 K (cid:80)
Kk =1 θ ( s ) k,H . 3. D IFFICULTY OF A DAPTING THE SDE F RAMEWORK TO L OCAL SGD A widely-adopted approach to understanding the dynamics of SGD is to approximate it from a continuous perspective with the following SDE (3), which we call the conventional SDE approximation .
Below, we discuss why it cannot be directly adopted to characterize the behavior of Local SGD.
[Equation]
It is proved by Li et al. (2019a) that this SDE is a first-order approximation to SGD, where each discrete step corresponds to a continuous time interval of η .
Several previous works adopt this SDE approximation and connect good generalization to having a large diffusion term (cid:112) ηB Σ 1 / 2 d W t in the SDE (Jastrz˛ebski et al., 2017; Smith et al., 2020), because a suitable amount of noise can be necessary for large-batch training to generalize well (see also Appendix A).
According to Finding 2.1, it is tempting to consider the limit η → 0 and see if Local SGD can also be modeled via a variant of the conventional SDE.
In this case the typical time length that guarantees a good SDE approximation error is O ( η − 1 ) discrete steps (Li et al., 2019a; 2021a).
However, this time scaling is too short for the difference to appear between Local SGD and SGD.
Indeed, Theorem 3.
below shows that they closely track each other for O ( η − 1 ) steps.
Theorem 3.1.
Assume that the loss function L is C 3 -smooth with bounded second and third order derivatives and that ∇ ℓ ( θ ; ξ ) is bounded.
Let T > 0 be a constant, ¯ θ ( s ) be the s -th global iterate of Local SGD and w t be the t -th iterate of SGD with the same initialization w
= ¯
θ (0) and same η, B loc , K .
Then for any H ≤ Tη and δ
= O (poly( η )) , it holds with probability at least 1 − δ that for all s ≤ TηH , ∥ ¯ θ ( s ) − w sH ∥
= O ( (cid:113) η log 1 ηδ ) .
We defer the proof to Appendix I. See also Appendix D for Lin et al.
(2020b)’s attempt to model Local SGD with multiple conventional SDEs and discussions on why it does not give much insight.
3. SDE A PPROXIMATION NEAR THE M INIMIZER M ANIFOLD
Inspired by a recent paper (Li et al., 2021b), our strategy to overcome the shortcomings of the conventional SDE is to design a new SDE that can guarantee a good approximation for O ( η − 2 ) discrete steps, much longer than the O ( η − 1 ) discrete steps for the conventional SDE.
Following their setting, we assume the existence of a manifold Γ consisting only of local minimizers and track the global iterate ¯ θ ( s ) around Γ after it takes ˜ O ( η − 1 ) steps to approach Γ .
Though the expected gradient ∇L is near zero around Γ , the dynamics are still non-trivial because the noise can drive the iterate to move a significant distance in O ( η − 2 ) steps.
Assumption 3.1.
The loss function L ( · ) and the matrix square root of the noise covariance Σ 1 / 2 ( · ) are C ∞ -smooth.
Besides, we assume that ∥∇ ℓ ( θ ; ξ ) ∥ 2 is bounded by a constant for all θ and ξ .
Assumption 3.2.
Γ is a C ∞ -smooth, ( d − m ) -dimensional submanifold of R d , where any ζ ∈ Γ is a local minimizer of L .
For all ζ ∈ Γ , rank( ∇ 2 L ( ζ ))
= m .
Additionally, there exists an open neighborhood of Γ , denoted as U , such that Γ = arg min θ ∈ U L ( θ ) .
Assumption 3.3.
Γ is a compact manifold.
The smoothness assumption on L is generally satisfied when we use smooth activation functions, such as Swish (Ramachandran et al., 2017), softplus and GeLU (Hendrycks & Gimpel, 2016), which work equally well as ReLU in many circumstances.
The existence of a minimizer manifold with rank( ∇ 2 L ( ζ ))
= m has also been made as a key assumption in Fehrman et al.
; Li et al.
(2021b); Lyu et al.
(2022), where rank( ∇ 2 L ( ζ ))
=
m ensures that the Hessian is maximally nondegenerate on the manifold and implies that the tangent space at ζ ∈ Γ equals the null space of ∇ 2 L ( ζ ) .
The last assumption is made to prevent the analysis from being too technically involved.
Our SDE for Local SGD characterizes the training dynamics near Γ .
For ease of presentation, we define the following projection operators Φ , P ζ for points and differential forms respectively.
Definition 3.1 (Gradient Flow Projection) .
Fix a point θ null / ∈ Γ .
For x ∈ R d , consider the gradient flow
d
x
( t ) d t = −∇L
( x ( t )) with x (0) =
x .
We denote the gradient flow projection of x as Φ( x ) .
Φ( x ) :=
lim t → + ∞ x ( t ) if the limit exists and belongs to Γ ; otherwise, Φ( x ) = θ null .
Definition 3.2.
For any ζ ∈ Γ and any differential form A d W t + b d t in Itô calculus, where A is a matrix and b is a vector, we use P ζ ( A d W t + b d t ) as a shorthand for the differential form [Equation] Φ
[Equation]
See Øksendal (2013) for an introduction to Itô calculus.
Here P ζ equals Φ( ζ + A d W t + b d t ) − Φ( ζ ) by Itô calculus, which means that P ζ projects an infinitesimal step from ζ , so that ζ after taking the projected step does not leave the manifold Γ .
It can be shown by simple calculus that ∂ Φ( ζ ) equals the projection matrix onto the tangent space of Γ at ζ .
We decompose the noise covariance Σ ( ζ ) for ζ ∈ Γ into two parts: the noise in the tangent space Σ ∥
( ζ ) :
= ∂
Φ( ζ ) Σ ( ζ ) ∂ Φ( ζ ) and the noise in the rest Σ ♢ ( ζ ) :
= Σ ( ζ ) − Σ ∥ ( ζ ) .
Now we are ready to state our SDE for Local SGD.
Definition 3.3 (Slow SDE for Local SGD) .
Given η, H > 0 and ζ 0 ∈ Γ , define ζ ( t ) as the solution of the following SDE with initial condition ζ (0) = ζ 0 :
[Equation]
Here (cid:98) Σ ♢ ( ζ ) , (cid:98) Ψ ( ζ )
∈ R
d × d are defined as
[Equation]
where { v i } d i =1 is a set of eigenvectors of ∇ 2 L ( ζ ) that forms an orthonormal eigenbasis, and λ 1 , . . .
, λ d are the corresponding eigenvalues.
Additionally, ψ ( x ) := e − x − 1+ x x for x ̸ = 0 and ψ (0) = 0 .
The use of P ζ keeps ζ ( t ) on the manifold Γ through projection.
Σ 12 ∥ ( ζ ) introduces a diffusion term to the SDE in the tangent space.
The two drift terms involve (cid:98) Σ ♢ ( · ) and (cid:98) Ψ ( · ) , which can be intuitively understood as rescaling the entries of the noise covariance in the eigenbasis of Hessian.
In the special case where ∇ 2 L = diag( λ 1 , · · · , λ d ) ∈ R d × d , we have (cid:98) Σ ♢ ,i,j = 1 λ i + λ j Σ 0 ,i
[Equation] j . (cid:98) Ψ
i
[Equation] Σ 0 ,i,j .
ψ ( x ) is a monotonically increasing function, which goes from 0 to 1 as x goes from 0 to infinity (see Figure 9)
We name this SDE as the Slow SDE for Local SGD because we will show that each discrete step of Local SGD corresponds to a continuous time interval of η 2 instead of an interval of η in the conventional SDE.
In this sense, our SDE is “slower” than the conventional SDE (and hence can track a longer horizon).
This Slow SDE is inspired by Li et al.
(2021b).
Under nearly the same set of assumptions, they proved that SGD can be tracked by an SDE that is essentially equivalent to (4) with K = 1 , namely, without the drift-II term.
[Equation]
We refer to (7) as the Slow SDE for SGD .
We remark that the drfit-II term in (4) is novel and is the key to separate the generalization behaviors of Local SGD and SGD in theory.
We will discuss this point later in Section 3.3.
Now we present our SDE approximation theorem for Local SGD.
Theorem 3.2.
Let Assumptions 3.1 to 3.3 hold.
Let T > 0 be a constant and ζ ( t ) be the solution to (4) with the initial condition ζ (0) =
Φ(¯ θ (0) )
∈ Γ .
If H is set to αη for some constant α > 0 , then for any C 3 -smooth function g
[Equation]
[Equation] where ˜ O ( · ) hides log factors and constants that are independent of η but can depend on g ( θ ) .
Theorem 3.3.
For δ = O (poly( η )) , with probability at least 1 − δ , it holds for all O ( 1 α log 1 η ) ≤ s ≤ Tαη that Φ(¯ θ ( s ) )
∈ Γ and ∥ ¯ θ ( s ) − Φ(¯ θ ( s ) )
∥ 2 =
O ( (cid:113) αη log αηδ ) , where O ( · ) hides constants independent of η , α and δ .
Theorem 3.2 suggests that the trajectories of the manifold projection and the solution to the Slow
SDE (4) are close to each other in the weak approximation sense.
That is, { Φ(¯ θ ( s ) ) } and { ζ ( t ) } cannot be distinguished by evaluating test functions from a wide function class, including all polynomials.
This measurement of closeness between the iterates of stochastic gradient algorithms and their SDE approximations is also adopted by Li et al.
(2019a; 2021a) ; Malladi et al.
, but their analyses are for conventional SDEs.
Theorem 3.3 further states that the iterate ¯ θ ( s ) keeps close to its manifold projection after the first few rounds. Remark 3.1.
To connect to Finding 2.1, we remark that our theorems (1) do not require the model to be pre-trained (as long as the gradient flow starting with θ (0) converges to Γ ); (2) give better bounds for smaller η ; (3) characterize a long training horizon ∼ η − 2 .
The need for tuning H will be discussed in Section 3.3.3.
Technical Contribution. The proof technique for Theorem 3.2 is novel and significantly different from the Slow SDE analysis of SGD in Li et al.
(2021a).
Their analysis uses advanced stochastic calculus and invokes Katzenberger’s theorem (Katzenberger, 1991) to show that SGD converges to the Slow SDE in distribution, but no quantitative error bounds are provided. Also, due to the local updates and multiple aggregation steps in Local SGD, it is unclear how to extend Katzenberger’s theorem to our case.
To overcome this difficulty, we develop a new approach to analyze the Slow SDEs, which is based on the method of moments (Li et al., 2019a) and can provide the quantitative error bound ˜ O ( η 0 . 25 ) in weak approximation. See Appendix J for our proof outline.
A by-product of our result is the first quantitative approximation bound for the Slow SDE approximation for SGD, which can be easily obtained by setting K = 1 .
3. I NTERPRETATION OF THE S LOW SDE S
In this subsection, we compare the Slow SDEs for SGD and Local SGD and provide an important insight into why Local SGD generalizes better than SGD: Local SGD strengthens the drift term in the Slow SDE, which makes the implicit regularization of stochastic gradient noise more effective.
3.3. I NTERPRETATION OF THE S LOW SDE FOR SGD.
The Slow SDE for SGD (7) consists of the diffusion and drift-I terms.
The former injects noise into the dynamics in the tangent space; the latter one drives the dynamics to move along the negative gradient of 12 B ⟨∇ 2 L ( ζ ) , (cid:98) Σ ♢ ( ζ ) ⟩ projected onto the tangent space, but ignoring the dependency of (cid:98) Σ ♢ ( ζ ) on ζ .
This can be connected to the class of semi-gradient methods which only computes a part of the gradient (Mnih et al., 2015; Sutton & Barto, 1998; Brandfonbrener & Bruna, 2020).
In this view, the long-term behavior of SGD is similar to a stochastic semi-gradient method minimizing the implicit regularizer 12 B ⟨∇ 2 L ( ζ ) , (cid:98) Σ ♢ ( ζ ) ⟩ on the minimizer manifold of the original loss L .
Though the semi-gradient method may not perfectly optimize its objective, the above argument reveals that SGD has a deterministic trend toward the region with a smaller magnitude of Hessian, which is commonly believed to correlate with better generalization (Hochreiter & Schmidhuber, 1997; Keskar et al., 2017; Neyshabur et al., 2017; Jiang et al., 2020) (see Appendix A for more discussions).
In contrast, the diffusion term can be regarded as a random perturbation to this trend, which can impede optimization when the drift-I term is not strong enough.
Based on this view, we conjecture that strengthening the drift term of the Slow SDE can help SGD to better regularize the model, yielding a better generalization performance.
More specifically, we propose the following hypothesis, which compares the generalization performances of the following generalized Slow SDEs.
Note that ( 1 B , 12 B ) -Slow SDE corresponds to the Slow SDE for SGD (7).
Definition 3.4.
For κ 1 , κ 2 ≥ 0 , define ( κ 1 , κ 2 ) -Slow SDE to be the following:
[Equation]
Hypothesis 3.1.
Starting at a minimizer ζ 0 ∈ Γ , run ( κ 1 , κ 2 ) -Slow SDE and ( κ 1 , κ ′ 2 ) -Slow SDE respectively for the same amount of time T > 0 and obtain ζ ( T ) , ζ ′ ( T ) .
If κ 2 > κ ′ 2 , then the expected test accuracy at ζ ( T ) is better than that at ζ ′ ( T ) .
Due to the No Free Lunch Theorem, we do not claim that our hypothesis is always true, but we do believe that the hypothesis holds when training usual neural networks (e.g., ResNets, VGGNets) on standard benchmarks (e.g., CIFAR-10, ImageNet).
Example: Training with Label Noise Regularization.
To exemplify the generalization benefit of having a larger drift term, we follow a line of theoretical works (Li et al., 2021b; Blanc et al., 2020; Damian et al., 2021) to study the case of training over-parameterized neural nets with label noise regularization.
For a C -class classification task, the label noise regularization is as follows: every time we draw a sample from the training set, we make the true label as it is with probability 1 − p , and replace it with any other label with equal probability pC − 1 .
When we use cross-entropy loss, the Slow SDE for SGD turns out to be a simple deterministic gradient flow on Γ (instead of a semigradient method) for minimizing the trace of Hessian: d ζ ( t )
= − 1 4 B ∇ Γ tr( ∇ 2 L ( ζ ))
d t , where ∇ Γ f stands for the gradient of the function f projected to the tangent space of Γ .
Checking the validity of our hypothesis reduces to the following question: Is minimizing the trace of Hessian beneficial to generalization?
Many works prove positive results in concrete settings, including the line of works we just mentioned.
We refer the readers to Appendix G for further discussion.
3.3. L OCAL SGD S TRENGTHENS THE D RIFT T ERM IN S LOW SDE.
Based on Hypothesis 3.1, we argue that Local SGD improves generalization by strengthening the drift term of the Slow SDE .
First, it can be seen from (4) that the Slow SDE for Local SGD has an additional drfit-II term.
Similar to the drift-I term of the Slow SDE for SGD, this drift-II term drives the dynamics to move along the negative semi-gradient of K − 1 2 B ⟨∇ 2 L ( ζ ) , (cid:98) Ψ ( ζ ) ⟩ (with the dependency of (cid:98) Ψ ( ζ ) on ζ ignored).
Combining it with the implicit regularizer induced by the drift-I term, we can see that the long-term behavior of Local SGD is similar to a stochastic semi-gradient method minimizing the implicit regularizer 12 B ⟨∇ 2 L ( ζ ) , (cid:98) Σ ♢ ( ζ ) ⟩ + K − 1 2 B ⟨∇ 2 L ( ζ ) ,
(cid:98) Ψ
( ζ ) ⟩ on Γ .
Comparing the definitions of (cid:98) Σ ⋄ ( ζ ) (5) and (cid:98) Ψ ( ζ ) (6), we can see that (cid:98) Ψ ( ζ ) is basically a rescaling of the entries of (cid:98) Σ ⋄ ( ζ ) in the eigenbasis of Hessian, where the rescaling factor ψ ( ηH · ( λ i + λ j )) for each entry is between 0 and 1 (see Figure 9 for the plot of ψ ).
When ηH is small, the rescaling factors should be close to ψ (0) = 0 , then (cid:98) Ψ ( ζ ) ≈ 0 , leading to almost no additional regularization.
On the other hand, when ηH is large, the rescaling factors should be close to ψ (+ ∞ ) = 1 , so (cid:98) Ψ ( ζ ) ≈ (cid:98) Σ ⋄ ( ζ ) .
We can then merge the two implicit regularizers as K 2 B ⟨∇ 2 L ( ζ ) , (cid:98) Σ ♢ ( ζ ) ⟩ , and (4) becomes the ( 1 B , K 2 B ) -Slow SDE, which is restated below:
[Equation]
From the above argument we know how the Slow SDE of Local SGD (4) changes as ηH transitions from 0 to + ∞ . Initially, when ηH = 0 , (4) is the same as the ( 1 B , 12 B ) -Slow SDE for SGD.
Then increasing ηH strengthens the drift term of (4).
As ηH → + ∞ , (4) transitions to the ( 1 B , K 2 B ) -Slow SDE, where the drift term becomes K times larger.
According to Hypothesis 3.1, the ( 1 B , K 2 B ) -Slow SDE generalizes better than the ( 1 B , 12 B ) -Slow SDE, so Local SGD with ηH = + ∞ should generalize better than SGD. When ηH is chosen realistically as a finite value, the generalization performance of Local SGD interpolates between these two cases, which results in a worse generalization than ηH = + ∞ but should still be better than SGD.
Based on our Slow SDE approximations, we now discuss how the number of local steps H affects the generalization of Local SGD.
When η is small but finite, tuning H offers a trade-off between regularization strength and SDE approximation quality.
Larger α := ηH makes the regularization stronger in the SDE (as discussed in Section 3.3.2), but the SDE itself may lose track of Local SGD, which can be seen from the error bound
O
( (cid:112) αη log( α/ηδ )) in Theorem 3.3. Therefore, we expect the test accuracy to first increase and then decrease as we gradually increase H .
Indeed, we observe in Figures 2(e) and 2(f) that the plot of test accuracy versus H is unimodal for each η .
It is thus necessary to tune H for the best generalization.
When H is tuned together with other hyperparameters, such as learning rate η , our Slow SDE approximation recommends setting H to be at least Ω( η − 1 ) so
that α :=
ηH does not vanish in the Slow SDE.
Since larger α gives a stronger regularization effect, the optimal H should be set to the largest value so that the Slow SDE does not lose track of Local SGD. Indeed, we empirically observed that when H is tuned optimally, α increases as η decreases, suggesting that the optimal H grows faster than Ω( η − 1 ) . See Figure 5(f).
C ONCLUSIONS
In this paper, we analyze the long-term generalization behavior of Local SGD in the small learning rate regime by deriving the Slow SDE for Local SGD as a generalization of that for SGD (Li et al., 2021b). We attribute the generalization improvement over SGD to the larger drift term in the SDE for
Local SGD. Our empirical validation shows that Local SGD indeed induces generalization benefits with small learning rate and long enough training time.
The main limitation of our work is that our analysis does not imply any direct theoretical separation between SGD and Local SGD in test accuracy, which requires a much deeper understanding of the loss landscape and the Slow SDEs and is left for future work.
Another direction for future work is to design distributed training methods that provably generalize better than SGD based on the theoretical insights obtained from Slow SDEs.
A CKNOWLEDGEMENT AND D ISCLOSURE OF F UNDING
The work of Xinran Gu and Longbo Huang is supported by the Technology and Innovation Major
Project of the Ministry of Science and Technology of China under Grant 2020AAA0108400 and 2020AAA0108403, the Tsinghua University Initiative Scientific Research Program, and Tsinghua
Precision Medicine Foundation 10001020109.
The work of Kaifeng Lyu and Sanjeev Arora is supported by funding from NSF, ONR, Simons Foundation, DARPA and SRC.
C ONTENTS 1 Introduction
2 When does Local SGD Generalize Better? 2.
The Debate on Local SGD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Key Factors: Small Learning Rate and Sufficient Training Time . . . . . . . . . .
3 Theoretical Analysis of Local SGD: The Slow SDE 3.
Difficulty of Adapting the SDE Framework to Local SGD . . . . . . . . . . . . . .
SDE Approximation near the Minimizer Manifold . . . . . . . . . . . . . . . . . .
Interpretation of the Slow SDEs . . . . . . . . . . . . . . . . . . . . . . . . . . . Interpretation of the Slow SDE for SGD. . . . . . . . . . . . . . . . . . . Local SGD Strengthens the Drift Term in Slow SDE. . . . . . . . . . . . . Theoretical Insights into Tuning the Number of Local Steps . . . . . . . .
4 Conclusions
A Additional Related Works
C Implementation Details of Parallel SGD, Local SGD and Post-local SGD
D Modeling Local SGD with Multiple Conventional SDEs
E Additional Interpretation of the Slow SDEs
E.1 Understanding the Diffusion Term in the Slow SDE . . . . . . . . . . . . . . . . .
E.2 The Effect of Global Batch Size on Generalization . . . .
F Additional Experimental Results
G Discussions on Local SGD with Label Noise Regularization
{+G.
+}
The Slow SDE for Local SGD with Label Noise Regularization . . . . . . . . . . .
G The Equivalence of Enlarging the
Learning Rate and Adding Local Steps . .
H Deriving the Slow SDE after Applying the LSR
I Proof of Theorem 3.
J Proof Outline of Main Theorems
K Proof Details of Main Theorems
K.1 Additional Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
[Table]
Mapping . . . . . . . . . . . . . . . . .
[Table] [Table]
K
[Table] K
[Table] [Table] notations . . . .
K [Table]
5.2 Proof for Subphase 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K [Table] [Table]
Proof for Subphase 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
[Table]
Manifold . . . .
K.6.
notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K [Table] [Table] Proof
[Table] the [Table] Probability Bounds . . . . . . . . . . . . . . . . . . . .
[Table]
7 Summary of the dynamics and Proof of Theorems J.1 and J.2 . . . . . . . . . . . .
K [Table]
8 Proof of Theorem 3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
[Table]
Computing the Moments for One “Giant Step” . . . . . . . . . . . . . . . . . . . [Table]
[Table] of Weak Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K.10.1 Preliminaries and additional notations . . . . . . . . . . . . . . . . . . . . {+K.10.
+}
Proof of the approximation in our context . . . . . . . . . . . . . . . . . .
L Deriving
the Slow SDE for Label Noise Regularization
M Experimental Details
M.1 Post-local SGD Experiments in Section 1 . . . . . . . . . . . . . . . . . . . . . .
M.2 Experimental Details for Figures 2 and 5 . . . . . . . . . . . . . . . . . . . . . . .
M.3 Details for Experiments in Figure 6 . . . . . . . . . . . . . . . . . . . . . . . . . .
M.4 Details for Experiments on the Effect of the Diffusion Term . . . . . . . . . . . . . M.5 Details for Experiments on the Effect of Global Batch Size . . . . . . . . . . . . .
M.6 Details for Experiments on Label Noise Regularization . . . . . . . . . . . . . . .
A A DDITIONAL R ELATED W ORKS
Optimization aspect of Local SGD.
Local SGD is a communication-efficient variant of parallel
SGD, where multiple workers perform SGD independently and average the model parameters periodically.
Dating back to Mann et al.
(2009) and Zinkevich et al.
(2010), this strategy has been widely adopted to reduce the communication cost and speed up training in both scenarios of data center distributed training (Chen & Huo, 2016;
Zhang et al., 2014; Povey et al., 2014; Su & Chen, 2015) and
Federated Learning (McMahan et al., 2017; Kairouz et al., 2021).
To further accelerate training,
Wang & Joshi (2019) and Haddadpour et al.
(2019) proposed adaptive schemes for the averaging frequency, and Basu et al.
combined Local SGD with gradient compression.
Motivated to theoretically understand the empirical success of Local SGD, a lot of researchers analyzed the convergence rate of Local SGD under various settings, e.g., homogeneous/heterogeneous data and convex/non-convex objective functions.
Among them, Yu et al.
; Stich (2018); Khaled et al.
Woodworth et al.
(2020a) focus on the homogeneous setting where data for each worker are independent and identically distributed (IID).
Li et al.
(2019b)
; Karimireddy et al.
Glasgow et al.
; Woodworth et al.
(2020b)
; Wang et al.
(2022) study the heterogeneous setting, where workers have non-IID data and local updates may induce “client drift” (Karimireddy et al., 2020) and hurt optimization.
The error bound of Local SGD obtained by these works is typically inferior to that of SGD with the same global batch size for fixed number of iterations/epochs and becomes worse as the number of local steps increases, revealing a trade-off between less communication and better optimization.
In this paper, we are interested in the generalization aspect of Local SGD in the homogeneous setting, assuming the training loss can be optimized to a small value.
Gradient noise and generalization.
The effect of stochastic gradient noise on generalization has been studied from different aspects, e.g., changing the order of learning different patterns Li et al.
(2019a)
, inducing an implicit regularizer in the second-order SDE approximation Smith et al.
Li et al. (2019a).
Our work follows a line of works studying the effect of noise in the lens of sharpness, which is long believed to be related to generalization Hochreiter & Schmidhuber (1997);
Neyshabur et al.
Keskar et al.
(2017) empirically observed that large-batch training leads to worse generalization and sharper minima than small-batch training.
Wu et al.
; Hu et al.
(2017); Ma & Ying (2021) showed that gradient noise destabilizes the training around sharp minima, and Kleinberg et al.
Zhu et al.
; Xie et al. (2021); Ibayashi & Imaizumi (2021) quantitatively characterized how SGD escapes sharp minima.
The most related papers are Blanc et al.
; Damian et al.
; Li et al.
(2021b), which focus on the training dynamics near a manifold of minima and study the effect of noise on sharpness (see also Section 3.2).
Though the mathematical definition of sharpness may be vulnerable to the various symmetries in deep neural nets (Dinh et al., 2017), sharpness still appears to be one of the most promising tools for predicting generalization (Jiang et al., 2020; Foret et al., 2021).
Improving generalization in large-batch training.
The generalization issue of the large-batch (or full-batch) training has been observed as early as (Bengio, 2012; LeCun et al., 2012).
As mentioned in Section 1, the generalization issue of large-batch training could be due to the lack of a sufficient amount of stochastic noise.
To make up the noise in large-batch training, Krizhevsky (2014)
; Goyal et al.
(2017) empirically discovered the Linear Scaling Rule for SGD, which suggests enlarging the learning rate proportionally to the batch size.
Jastrz˛ebski et al.
(2017) adopted an SDE-based analysis to justify that this scaling rule indeed retains the same amount of noise as small-batch training (see also Section 3.1).
However, the SDE approximation may fail if the learning rate is too large (Li et al., 2021a), especially in the early phase of training before the first learning rate decay (Smith et al., 2020).
Shallue et al.
(2019) demonstrated that generalization gap between small- and large-batch training can also depend on many other training hyperparameters.
Besides enlarging the learning rate, other approaches have also been proposed to reduce the gap, including training longer (Hoffer et al., 2017), learning rate warmup (Goyal et al., 2017), LARS (You et al., 2018), LAMB (You et al., 2020).
In this paper, we focus on using Local SGD to improve generalization, but adding local steps is a generic training trick that can also be combined with others, e.g.,
Local LARS (Lin et al., 2020b), Local Extrap-SGD (Lin et al., 2020a).
B A DDITIONAL D ISCUSSIONS
Connection to the conventional wisdom that the diffusion term matters more.
As mentioned in Section 3.1, it is believed in the literature is that a large diffusion term in the conventional SDE leads to good generalization. One may think that the diffusion term in the Slow SDE corresponds to that in the conventional SDE, and thus enlarging the diffusion term rather than the drift term should lead to better generalization. However, we note that both the diffusion and drift terms in the Slow SDEs result from the long-term effects of the diffusion term in the conventional SDE (Slow SDEs become stationary if Σ = 0 ).
This means our view characterizes the role of gradient noise in more detail, and therefore, goes one step further on the conventional wisdom.
Slow SDEs for neural nets with modern training techniques.
In modern neural net training, it is common to add normalization layers and weight decay ( L 2 -regularization) for better optimization and generalization.
However, these techniques lead to violations of our assumptions, e.g., no fixed point exists in the regularized loss (Li et al., 2020; Ahn et al., 2022).
Still, a minimizer manifold can be expected to exist for the unregularized loss.
Li et al.
(2022) noted that the drift and diffusion around the manifold proceeds faster in this case, and derived a Slow SDE for SGD that captures
O ( 1 η log 1 η ) discrete steps instead of O ( 1 η 2 ) .
We believe that our analysis can also be extended to this case, and that adding local steps still results in the effect of strengthening the drift term.
C I MPLEMENTATION D ETAILS OF P ARALLEL SGD, L OCAL SGD AND P OST - LOCAL SGD
In this section, we present the formal procedures for Parallel SGD, Local SGD and Post-local SGD.
Given a training dataset and a data augmentation function, Algorithms 1 and 2 show the implementations of distributed samplers for sampling local batches with and without replacement.
Then
Algorithms 3 to 5 show the implementations of parallel SGD, Local SGD and Post-local SGD that can run with either of the samplers.
Sampling with replacement.
Our theory analyzes parallel SGD, Local SGD and Post-local SGD when local batches are sampled with replacement (Algorithm 1).
That is, local batches consist of IID samples from the same training distribution ˜ D , where ˜ D serves as an abstraction of the distribution of an augmented sample drawn from the training dataset.
The mathematical formulations are given in Section 1.
Sampling without replacement.
Slightly different from our theory, we use the sampling without replacement (Algorithm 2) in our experiments unless otherwise stated.
This sampling scheme is standard in practice: it is used by Goyal et al.
(2017) for parallel SGD and by Lin et al.
(2020b); Ortiz et al.
(2021) for Post-local/Local SGD.
This sampling scheme works as follows.
At the beginning of every epoch, the whole training dataset is shuffled and evenly partitioned into K shards.
Each worker takes one shard and samples batches without replacement.
When all workers pass their own shard, the next epoch begins and the whole dataset is reshuffled.
An alternative view is that the workers always share the same dataset.
For each epoch, they perform local steps by sampling batches of data without replacement until the dataset contains too few data to form a batch.
Then another epoch starts with the dataset reloaded to the initial state.
Discrepancy in Sampling Schemes.
We argue that this discrepancy between theory and experiments on sample schemes is minor.
Though sampling without replacement is standard in practice, most previous works, e.g., Wang & Joshi (2019);
Li et al.
(2021a)
; Zhang et al.
analyze sampling with replacement for technical simplicity and yields meaningful results.
Moreover, even if we change the sampling scheme to with replacement, Local SGD can still improve the generalization of SGD (by merely adding local steps).
See Appendix F for the experiments.
We believe that the reasons for better generalization of Local SGD with either sampling scheme are similar and leave the analysis for sampling without replacement for future work.
augmentation :=
D|
// number of local batches per worker per epoch
1 Input : loss function ℓ ( θ ; ξ ) , initial parameter θ2 Hyperparameters : total number of iterations T , learning rate η , local batch size B loc 3 for t = 0 , · · · , T − 1 do for each worker k do in parallel ( ξ k,t, 1 , . . . , ξ k,t,B loc ) ← Sample() ; // sample a local batch g k,t ← 1 B loc (cid:80) B loc i =1 ∇ ℓ ( θ t ; ξ k,t,i ) ; // computing the local gradient end g t ← 1 K (cid:80)
Kk =1 g k,t ; // all-Reduce aggregation of local gradients θ t +1 ← θ t − η t g t ; // update the model 10 end
1 Input : loss function ℓ ( θ ; ξ ) , initial parameter ¯ θ (0) 2 Hyperparameters : total number of rounds R , number of local steps H per round 3 Hyperparameters : learning rate η , local batch size B loc 4 for s = 0 , . . .
, R − 1 do for each worker k do in parallel θ ( s ) k, 0 ← ¯ θ (0) ; // maintain a local copy of the global iterate for t = 0 , . .
, H − 1 do ( ξ ( s ) k,t, 1 , . . . , ξ ( s ) k,t,B loc ) ← Sample() ; // sample a local batch g ( s ) k,t ← 1 B loc (cid:80) B loc i =1 ∇ ℓ ( θ ( s ) k,t ; ξ ( s ) k,t,i ) ; // computing the local gradient θ ( s ) k,t +1 ← θ ( s ) k,t − η g ( s ) k,t ; // update the local model end end
// all-Reduce aggregation of local iterates 14 end
D M ODELING L OCAL SGD WITH M ULTIPLE C ONVENTIONAL SDE S
Lin et al.
(2020b) tried to informally explain the success of Local SGD by adopting the argument that larger diffusion term in the conventional SDE leads to better generalization (see Section 3. and appendix A).
Basically, they attempted to write multiple SDEs, each of which describes the
H -step local training process of each worker in each round (from θ ( s ) k, 0 to θ ( s ) k,H ).
The key difference between each of these SDEs and the SDE for SGD (3) is that the former one has a larger diffusion term because the workers use batch size B loc instead of B :
[Equation]
Lin et al.
(2020b) then argue that the total amount of “noise” in the training dynamics of Local SGD is larger than that of SGD.
However, it is hard to see whether it is indeed larger, since the model averaging step at the end of each round can reduce the variance in training and may cancel the effect of having larger diffusion terms.
More formally, a complete modeling of Local SGD following this idea should view the sequence of global iterates { ¯ θ ( s ) } as a Markov process { X ( s ) } .
Let P X
( x , B, t ) the distribution of X ( t ) in (3) with initial condition X (0)
=
x .
Then the Markov transition should be X ( s +1)
= 1 K (cid:80)
Kk =1 X ( s ) k,H , where X ( s ) 1 ,H , . . .
, X ( s ) K,H are K independent samples from P X
( X ( s ) , B loc , Hη ) , i.e., sampling from (10).
Consider one round of model averaging.
It is true that P X ( X ( s ) , B loc , Hη ) may have a larger variance than the corresponding SGD baseline P X ( X ( s ) , B, Hη ) because the former one has a smaller batch size.
However, it is unclear whether X ( s +1) also has a larger variance than P X
( X ( s ) , B, Hη ) .
This is because X ( s +1) is the average of K samples, which means we have to compare 1 K times the variance of P X ( X ( s ) , B loc , Hη ) with the variance of P X ( X ( s ) , B, Hη ) .
Then it is unclear which one is larger.
In the special case where Hη is small, P X ( X ( s ) , B loc , Hη ) is approximately equal to the following
Gaussian distribution:
[Equation]
Then averaging over K samples gives
[Equation]
which is exactly the same as the Gaussian approximation of the SGD baseline.
This means there do exist certain cases where Lin et al.
(2020b)’s argument does not give a good separation between
Local SGD and SGD.
Moreover, we do not gain any further insights from this modeling since it is hard to see how model averaging interacts with the SDEs.
E A DDITIONAL I NTERPRETATION OF THE S LOW SDE S E. U NDERSTANDING THE D IFFUSION T ERM IN THE S LOW SDE
So far, we have discussed why adding local steps enlarges the drift term in the Slow SDE and why enlarging the drift term can benefit generalization. Besides this, here we remark that another way to accelerate the corresponding semi-gradient method for minimizing the implicit regularizer is to reduce the diffusion term, so that the trajectory more closely follows the drift term. More formally, we propose the following:
Hypothesis E.1.
Starting at a minimizer ζ 0 ∈ Γ , run ( κ 1 , κ 2 ) -Slow SDE and ( κ 1 , κ ′ 2 ) -Slow SDE respectively for the same amount of time T > 0 and obtain ζ ( T ) , ζ ′ ( T ) .
If Σ ∥ ̸≡ 0 and κ 1 < κ ′ 1 , then the expected test accuracy at ζ ( T ) is better than that at ζ ′ ( T ) .
[Figure]
Test accuracy improves as we increase K with fixed η and H to reduce
See Appendix
Here we exclude the case of Σ ∥ ≡ 0 because in this case the diffusion term in the Slow SDE is always zero.
To verify Hypothesis E.1, we set the product α := ηH large, keep H, η fixed, increase the number of workers K , and compare the generalization performances after a fixed amount of training steps (but after different numbers of epochs).
This case corresponds to the (
[Figure]
Slow SDE, so adding more workers should reduce the diffusion term.
As shown in Figure 3, a higher test accuracy is indeed achieved for larger K .
Implication: Enlarging the learning rate is not equally effective as adding local steps.
Given that Local SGD improves generalization by strengthening the drift term, it is natural to wonder if enlarging the learning rate of SGD would also lead to similar improvements.
While it is true that enlarging the learning rate effectively increases the drift term, it also increases the diffusion term simultaneously, which can hinder the implicit regularization by Hypothesis E.1.
In contrast, adding local steps does not change the diffusion term.
As shown in Figure 6(a), even when the learning rate of SGD is increased, SGD still underperforms Local SGD by about 2% in test accuracy.
On the other hand, in the special case of where Σ ∥ ≡ 0 , Hypothesis E.1 does not hold, and enlarging the learning rate by √ K results in the same Slow SDE as adding local steps (see Appendix G for derivation).
Then these two actions should produce the same generalization improvement, unless the learning rate is so large that Slow SDE loses track of the training dynamics.
As an example of such a special case, an experiment with label noise regularization is presented in Figure 8.
E. T HE E FFECT OF G LOBAL B ATCH S IZE ON G ENERALIZATION
In this section, we discuss the effect of global batch size on the generalization of Local SGD.
Given that the computation power of a single worker is limited, we consider the case where the local batch size B loc is fixed and the global batch size B = KB loc is tuned by adding or removing the workers.
This scenario is relevant to the practice because one may want to know the maximum parallelism possible to train the neural net without causing generalization degradation.
For SGD, previous works have proposed the Linear Scaling Rule (LSR) (Krizhevsky, 2014; Goyal et al., 2017; Jastrz˛ebski et al., 2017): scaling the learning rate η
(cid:55)→ κη linearly with the global batch size B (cid:55)→ κB yields the same conventional SDE (3) under a constant epoch budget, hence leading to almost the same generalization performance as long as the SDE approximation does not fail.
We show in Theorem H.1 that the LSR does not change the Slow SDE of SGD either.
Experiments in Figure 4 show that the LSR indeed holds nicely when we continue training with small learning rates from the same CIFAR-10 and ImageNet checkpoints as in Figure 2.
Here we choose K =and K = 256 as the base settings for CIFAR-10 and ImageNet, respectively, and then tune the learning rate to maximize the test accuracy.
As shown in Figures 4(a) and 4(b), the optimal learning rate turns out to be small enough that the LSR can be applied to scale the global batch size with only a minor change in test accuracy.
Now, assuming the learning rate is scaled as LSR, we study how to tune the number of local steps H for Local SGD for better generalization.
A natural choice is to tune H in the base settings and keep α unchanged via scaling H
(cid:55)→ H/κ .
Then the following SDE can be derived (see Theorem H.2):
[Equation]
[Figure]
Compared with (4), the drift-II term here is rescaled by a positive factor.
Again, when α is large, we can follow the argument in Section 3.3.2 to approximate (cid:98) Ψ ( ζ ) ≈ (cid:98) Σ ♢ ( ζ ) and obtain the following ( 1 B , κKB ) -Slow SDE:
[Equation]
The drift term of the above SDE is always stronger than SGD (7), as long as there exists more than one worker after the scaling (i.e., κK > 1 ).
As expected from Hypothesis 3.1, we observed in the experiments that the generalization performance of Local SGD is always better than or at least comparable to SGD across different batch sizes (see Figures 4(a) and 4(b)).
Taking a closer look into the drift term in the Slow SDE (14), we can find that it scales linearly with κ .
According to Hypothesis 3.1, the SDE is expected to generalize better when adding more workers ( κ > 1 ) and to generalize worse when removing some workers ( κ < 1 ).
For the latter case, we indeed observed that the test accuracy of Local SGD drops when removing workers.
For the case of adding workers, however, we also need to take into account that the LSR specifies a larger learning rate and causes a larger SDE approximation error for the same α , which may cancel the generalization improvement brought by strengthening the drift term.
In the experiments, we observed that the test accuracy does not rise when adding more workers to the base settings.
Since α also controls the regularization strength (Section 3.3.3), it would be beneficial to decrease α for large batch size so as to better trade-off between regularization strength and approximation quality.
In Figures 4(c) and 4(d), we plot the optimal value of α for each batch size, and we indeed observed that the optimal α drops as we scale up K .
Conversely, a smaller batch size (and hence a smaller learning rate) allows for using a larger α to enhance regularization while still keeping a low approximation error (Theorem 3.3).
The test accuracy curves in Figures 4(a) and 4(b) indeed show that setting a larger α can compensate for the accuracy drop when reducing the batch size.
F A DDITIONAL E XPERIMENTAL R ESULTS
In this section, we present additional experimental results to further verify our finding.
Supplementary Plot: Training time should be long enough.
Figures 5(a) and 5(b) show enlarged views for Figures 2(a) and 2(c) respectively, showing that Local SGD can generalize worse than SGD in the first few epochs.
Supplementary Plot: Learning rate should be small.
Figure 5(c) shows that reducing the learning rate from 0 .
32 to 0 .
064 does not lead to test accuracy drop for Local SGD on CIFAR-10, if the training time is allowed to be longer and the number of local steps H is set properly.
Figure 5(d) presents the case where, with a large learning rate, the generalization improvement of Local SGD disappears even starting from a pre-trained model.
Supplementary Plot: Reconciling our main finding with Ortiz et al.
In Figure 5(e), the generalization benefit of Local SGD with H = 24 becomes less significant after the learning rate decay at epoch 226 , which is consistent with the observation by Ortiz et al.
(2021) that the generalization benefit of Local SGD usually disappears after the learning rate decay.
But we can preserve the improvement by increasing H to 900 .
Here, we use Local SGD with momentum.
Supplementary Plot: Optimal α gets larger for smaller η .
In Figure 5(f), we summarize the optimal α := ηH that enables the highest test accuracy for each learning rate in Figure 2(f).
We can see that the optimal α increases as we decrease the learning rate.
The reason is that the approximation error bound O ( (cid:113)
αη log αηδ ) in Theorem 3.3 decreases with η , allowing for a larger value of α to better regularize the model.
[Figure]
[Figure]
[Figure]
y
[Figure]
SGD generalizes worse even with extensively tuned learning rates.
In Figure 6(a), we run SGD from both random initialization and the pre-trained model for another 3 , 000 epochs with various learning rates and report the test accuracy.
We can see that none of the SGD runs beat Local SGD with the fixed learning rate η = 0 .
Therefore, the inferior performance of SGD in Figures 2(a) and 2(b) is not due to the improper learning rate and Local SGD indeed generalizes better.
SGD with larger batch sizes performs no better.
In Figure 6(b), we enlarge the batch size of
SGD and report the test accuracy for various learning rates.
We can see that SGD with larger batch sizes performs no better and none of the SGD runs outperform Local SGD with the fixed learning rate η = 0 .
This result is unsurprising since it is well established in the literature (Jastrz˛ebski et al., 2017; Smith et al., 2020; Keskar et al., 2017) that larger batch size typically leads to worse generalization.
See Appendix A for a survey of empirical and theoretical works on understanding and resolving this phenomenon.
Sampling with or without replacement does not matter.
Note that there is a slight discrepancy in sampling schemes between our theoretical and experimental setup: the update rules (1) and (2) assume that data are sampled with replacement while most experiments use sampling without replacement (Appendix C).
To eliminate the effect of this discrepancy, we conduct additional experiments on Post-local SGD using sampling with replacement (see Figure 6(c)) and Post-local SGD significantly outperforms SGD.
G D ISCUSSIONS ON L OCAL SGD WITH L ABEL N OISE R EGULARIZATION G. T HE S LOW SDE FOR L OCAL SGD WITH L ABEL N OISE R EGULARIZATION
In this subsection, we present the Slow SDE for Local SGD in the case of label noise regularization and show that Local SGD indeed induces a stronger regularization term, which presumably leads to better generalization.
Theorem G.1 (Slow SDE for Local SGD with label noise regularization) .
For a C -class classification task with cross-entropy loss, the slow SDE of Local SGD with label noise has the following form:
[Equation]
where F ( x ) := (cid:82) x 0 ψ ( y )
d y and is interpreted as a matrix function.
Additionally, ∇ Γ f stands for the gradient of a function f projected to the tangent space of Γ .
Proof.
See Appendix L. Note that the magnitude of the RHS in (15) becomes larger as H increases.
By letting H to go to infinity, we further have the following theorem.
Theorem G.2.
As the number of local steps H goes to infinity, the slow SDE of Local SGD with label noise (15) can be simplified as: [Equation] [Equation] Proof.
We obtain the corollary by simply taking the limit.
By L’Hospital’s rule,
[Equation]
Therefore,
[Equation]
Substituting (17) into (15) yields (16).
As introduced in Section 3.3, the Slow SDE for SGD with label noise regularization has the following form:
[Equation]
[Equation]
which is a deterministic flow that keeps reducing the trace of Hessian. [Figure] As the trace of Hessian can be seen as a measure for the sharpness of the local loss landscape, (18) indicates that SGD with label noise regularization has an implicit bias toward flatter minima, which presumably promotes generalization (Hochreiter & Schmidhuber, 1997; Keskar et al., 2017; Neyshabur et al., 2017).
More concretely, Blanc et al.
(2020) and Li et al.
(2021b) connect minimizing the trace of Hessian to finding sparse or low-rank solutions for training two-layer linear nets.
Damian et al.
(2021) empirically showed that good generalization correlates with a smaller trace of Hessian in training ResNets with label noise. Besides, Ma & Ying (2021) connect the trace of Hessian to the smoothness of the function represented by a deep neural net. From Theorems G.1 and G.2, we can conclude that Local SGD accelerates the process of sharpness reduction, thereby leading to better generalization.
Furthermore, the regularization effect gets stronger for larger H and is approximately K times that of SGD.
We also conduct experiments on non-augmented CIFAR-10 with label noise regularization to verify our conclusion.
As shown in Figure 7, increasing the number of local steps indeed gives better generalization performance.
G. T HE E QUIVALENCE OF E NLARGING THE L EARNING R ATE AND A DDING L OCAL S TEPS
In this subsection, we explain in detail why training with label noise regularization is a special case where enlarging the learning rate of SGD can bring the same generalization benefit as adding local steps.
TWhen we scale up the learning rate of SGD η (cid:55)→ κη (while keeping other hyperparameters unchanged), the corresponding Slow SDE is (18) with time horizon κ 2 T instead of T , where SGD tracks a continuous interval of κ 2 η 2 per step instead of η 2 . After rescaling the time horizon to T so that SGD tracks a continuous interval of η 2 per step, we obtain [Equation]
Let κ = √ K in (19) and we obtain the same Slow SDE as (16), which is for Local SGD with a large number of local steps. In Figure 8, we conduct experiments to verify that SGD indeed achieves comparable test accuracy to that of Local SGD with a large H if its learning rate is scaled up by √ K that of Local SGD. H D ERIVING THE S LOW SDE AFTER A PPLYING THE LSR
In this section, we derive the Slow SDEs for SGD and Local SGD after applying the LSR in Appendix E.2. The results are formally summarized in the following theorems. Theorem H.1 (Slow SDE for SGD after applying the LSR) . Let Assumptions 3.1 to 3.3 hold.
Assume that we run SGD with learning rate η ′ = κη and the number of workers K ′ =
κK for some constant κ > 0 .
Let T > 0 be a constant and ζ ( t ) be the solution to (7) with the initial condition ζ (0) = Φ( θ 0 ) ∈ Γ . Then for any C 3 -smooth function g ( θ ) , max
[Equation] E [ g (Φ( θ s )] − E [ g ( ζ ( sη ′ 2 /κ )] (cid:12)(cid:12) = ˜ O ( η ′ 0 . 25 ) , where ˜ O ( · ) hides log factors and constants that are independent of η ′ but can depend on g ( θ ) . [Figure]
Proof.
Replacing B with κB in the original Slow SDE for Local SGD (7) gives the following Slow SDE: [Equation] [Figure]
[Equation]
[Figure]
[Equation] Note that the continuous time horizon for (20) is κT instead of T since after applying the LSR, SGD tracks a continuous interval of κ 2 η 2 per step instead of η 2 while the total number of steps is scaled down by κ . We can then rescale the time scaling to obtain (7) that holds for T . Theorem H.2 (Slow SDE for Local SGD after applying the LSR) .
Let Assumptions 3.1 to 3.3 hold.
Assume that we run Local SGD with learning rate η ′ = κη , the number of workers K ′ = κK , and the number of local steps H ′ = ακη for some constants α, κ > 0 . Let T > 0 be a constant and ζ ( t ) be the solution to (21) with the initial condition ζ (0) = Φ(¯ θ (0) )
∈ Γ . Then for any C 3 -smooth function g ( θ ) , max 0 ≤ s ≤ κTH ′ η ′ 2 (cid:12)(cid:12) E [ g (Φ(¯ θ ( s ) )] − E [ g ( ζ ( sH ′ η ′ 2 /κ )] (cid:12)(cid:12) =
˜ O ( η ′ 0 . 25 ) , where ˜ O ( · ) hides log factors and constants that are independent of η ′ but can depend on g ( θ ) .
[Equation]
Proof. Replacing B with κB in the original Slow SDE for Local SGD (4) gives the following Slow SDE:
[Equation]
Note that the continuous time horizon for (22) is κT instead of T since after applying the LSR,
Local SGD tracks a continuous interval of κ 2 η 2 per step instead of η 2 while the total number of steps is scaled down by κ .
We can then rescale the time scaling to obtain (21) that holds for T .
I P ROOF OF T HEOREM 3.
This section presents the proof for Theorem 3.1.
First, we introduce some notations that will be used throughout this section.
For the sequence of Local SGD iterates { θ ( s ) k,t : k ∈
[ K ] , 0 ≤ t ≤ H, s ≥ 0 } , we introduce an auxiliary sequence { ˆ u t } t ∈ N , which consists of GD iterates from ¯ θ (0) : ˆ u
[Equation] = [Equation] [Equation]
[Equation] (ˆ u t ) .
For convenience, let ˆ u ( s ) t :
= ˆ u sH + t and z k,sH + t :=
z ( s ) k,t . We will use ˆ u ( s ) t and ˆ u sH + t , z ( s ) k,t and z k,sH + t interchangeably.
Recall that we have assumed that L is C 3 -smooth with bounded second and third order derivatives.
Let ν 2 :=
sup θ ∈ R
d ∥∇ 2 L ( θ ) ∥ 2 and ν 3 :
= sup θ
∈ R
d ∥∇ 3 L ( θ ) ∥ 2 .
Since ∇ ℓ ( θ ; ζ ) is bounded, the gradient noise z ( s ) k,t is also bounded. We denote by σ max an upper bound such that ∥ z ( s ) k,t ∥ 2 ≤ σ max holds for all s, k, t .
To prove Theorem 3.1, we will show that both Local SGD iterates ¯ θ ( s ) and SGD iterates w sH track
GD iterates ˆ u sH closely with high probability.
For each client k , define the following sequence { ˆ Z k,t : t ≥ 0 } , which will be used in the proof for bounding the overall effect of noise.
[Equation]
The following lemma shows that ˆ Z k,t is concentrated around the origin.
Lemma I.1 (Concentration property of { ˆ Z k,t } ) .
With probability at least 1 − δ , the following holds simultaneously for all k ∈
[ K ] , 0 ≤ t <
⌊ Tη ⌋ :
[Equation]
where ˆ C 1 := exp( Tν 2 ) .
Proof.
For each ˆ Z k,t , construct a sequence { ˆ Z k,t,t ′ } tt ′ {+=
+} : ˆ Z k,t,t ′ : = t
[Equation]
Since ∥∇ 2 L (ˆ u l ) ∥ 2 ≤ ν 2 for all l ≥ 0 , the following holds for all 0 ≤ τ < t − 1 and 0 < t <
⌊ Tη ⌋ :
[Equation]
t − 1 (cid:89)
[Equation]
≤
[Equation]
≤
[Equation]
= ˆ [Equation] So { ˆ Z k,t,t ′ } tt ′ {+=
+} is a martingale with ∥
ˆ Z k,t,t ′ − ˆ Z k,t,t ′ − 1 ∥ 2 ≤ ˆ C 1 σ max .
Since ˆ Z k,t = ˆ Z k,t,t , by Azuma-Hoeffding’s inequality,
[Equation]
Taking union bound on all k ∈
[ K ] and 0 ≤ t ≤ ⌊ T η ⌋ , we can conclude that with probability at least 1 − δ ,
[Equation]
The following lemma states that, with high probability, Local SGD iterates θ ( s ) k,t and ¯ θ ( s ) closely track the gradient descent iterates ˆ u sH for ⌊ THη ⌋ rounds.
Lemma I.2.
For δ = O (poly( η )) , the following inequalities hold with probability at least 1 − δ :
[Equation]
and
[Equation]
where ˆ C 3 is a constant independent of η and H .
Proof.
Let ˆ ∆ ( s ) k,t := θ ( s ) k,t − ˆ u ( s ) t and ¯ ∆ ( s ) :
= ¯ θ ( s ) − ˆ u ( s ) 0 be the differences between the Local SGD and GD iterates.
According to the update rule for θ ( s ) k,t and ˆ u ( s ) t ,
[Equation]
[Equation]
Subtracting (23) by (24) gives
[Equation]
25) where ˆ v ( s ) k,t is a remainder term with norm ∥ ˆ v ( s ) k,t ∥ 2 ≤ ν 3 2 ∥ ˆ ∆ ( s ) k,t ∥ 22 .
For the s -th round of Local SGD, we can apply (25) t times to obtain the following:
[Equation]
Here
[Equation]
T can be expressed in the following form:
[Equation]
Substituting in t =
H and taking the average
[Equation]
we derive the following recursion:
[Equation]
Applying (27) s times yields
[Equation]
[Equation]
Substitute (28) into (26) and we have
[Equation]
By Cauchy-Schwartz inequality and triangle inequality
[Equation]
we have
[Equation]
where ˆ C 1 = exp( ν 2 T ) .
Below we prove by induction that for δ
= O (poly( η )) , if
[Equation]
then there exists a constant ˆ C 2 such that for all k ∈
[ K ] , 0 ≤ s < ⌊ TηH ⌋ and 0 ≤ t ≤ H ,
[Equation]
First, for all k ∈ [ K ] , ∥ ˆ ∆ (0) k, 0 ∥ 2 = 0 and hence (31) holds.
Assuming that (31) holds for all ˆ ∆ ( r ) k ′ ,τ where k ′ ∈
[ K ] , 0 ≤ r < s , 0 ≤ τ ≤ H and r = s , 0 ≤ τ < t , then by (29), for all k ∈
[ K ] , the following holds:
[Equation]
Let ˆ C 2 ≥ 6 ˆ C 21 σ max √ 2 T .
Then for sufficiently small η , (31) holds.
By Lemma I.1, (30) holds with probability at least 1 − δ .
Furthermore, notice that ¯ θ ( s ) − ˆ u sH =
1 K (cid:80) k ∈
[ K ] ˆ ∆ ( s − 1) k,H .
Hence we have the lemma.
The iterates of standard SGD can be viewed as the local iterates on a single client with the number of local steps ⌊ Tη ⌋ .
Therefore, we can directly apply Lemma I.2 and obtain the following lemma about the SGD iterates w t .
Corollary I.1.
For δ = O (poly( η )) , the following holds with probability at least 1 − δ :
[Equation]
where ˆ C 3 is the same constant as in Lemma I.2.
Applying Lemma I.2 and Corollary I.1 and taking the union bound, we have Theorem 3.1.
J P ROOF O UTLINE OF M AIN T HEOREMS
We adopt the general framework proposed by Li et al. (2019a) to bound the closeness of discrete algorithms and SDE solutions via the method of moments.
However, their framework is not directly applicable to our case since they provide approximation guarantees for discrete algorithms with learning rate η for O ( η − 1 ) steps while we want to capture Local SGD for O ( η − 2 ) steps.
To overcome this difficulty, we treat R grp :=
⌊ 1 αη β ⌋ rounds as a “giant step” of Local SGD with an “effective” learning rate η 1 − β , where β is a constant in (0 , 1) , and derive the recursive formulas to compute the moments for the change in every step, every round, and every R grp rounds.
The formulation of the recursions requires a detailed analysis of the limiting dynamics of the iterate and careful control of approximation errors.
The dynamics of the iterate can be divided into two phases: the approaching phase (Phase 1) and the drift phase (Phase 2).
The approaching phase only lasts for O (log 1 η ) rounds, during which the iterate is quickly driven to the minimizer manifold by the negative gradient and ends up within only ˜
O ( √ η ) from Γ (see Appendix K.5).
After that, the iterate enters the drifting phase and moves in the tangent space of Γ while staying close to Γ (see Appendix K.6). The closeness of the iterates (local and global) and Γ is summarized in the following theorem.
Theorem J.1 (Closeness of the iterates and Γ ) . For δ = O (poly( η )) , with probability at least 1 − δ , for all O (log 1 η ) ≤ s ≤ ⌊ T/ ( Hη 2 ) ⌋ , Φ [Equation]
[Equation] Also, for all O (log 1 η ) ≤ s < ⌊ T/ ( Hη 2 ) ⌋ , k ∈ [ K ] and 0 ≤ t ≤ H ,
[Equation] Here, O ( · ) hides constants independent of η and δ .
To control the approximation errors, we also provide a high probability bound for the change of the manifold projection within R grp rounds. Theorem J.2 (High probability bound for the change of manifold projection) .
For δ = O (poly( η )) , with probability at least 1 − δ , for all 0 ≤ s ≤ ⌊ T/ ( Hη 2 ) ⌋ − R grp and 0 ≤ r ≤ R grp , Φ(¯ θ ( s ) ) ,
[Equation] where O ( · ) hides constants independent of η and δ .
The proof of Theorems J.1 and J.2 is based on the analysis of the dynamics of the iterate and presented in Appendix K.7. Utilizing Theorems J.1 and J.2, we move on to estimate the first and second moments of the change of the manifold projection every R grp rounds.
However, the randomness during training might drive the iterate far from the manifold (with a low probability, though), making the dynamics intractable. To tackle this issue, we construct a well-behaved auxiliary sequence { ˆ θ ( s ) k,t } , which is constrained to the neighborhood of Γ and equals the original sequence { θ ( s ) k,t } with high probability (see Definition K.5). Then we can formulate recursions for the change of manifold projection of the auxiliary sequence using the nice properties near Γ . The estimate of moments is summarized in Theorem K.2.
Finally, based on the moment estimates, we apply the framework in Li et al. (2019a) to show that the manifold projection and the SDE solution are weak approximations of each other in Appendix K.10.
K P ROOF D ETAILS OF M AIN T HEOREMS
The detailed proof is organized as follows.
In Appendix K.1, we introduce the notations that will be used throughout the proof.
To establish preliminary knowledge, Appendix K.2 provides explicit expression for the projection operator Φ( · ) , and Appendix K.3 presents lemmas about gradient descent (GD) and gradient flow (GF).
Based on the preliminary knowledge, we construct a nested working zone to characterize the closeness of the iterate and Γ in Appendix K.4.
Appendices K.5 to K. make up the main body of the proof.
Specifically, Appendices K.5 and K.6 analyze the dynamics of Local SGD iterates for phases 1 and 2, respectively.
Utilizing these analyses, we provide the proof of Theorems J.1 and J.2 in Appendix K.7 and the proof of Theorem 3.3 in Appendix K.8.
Then we derive the estimation for the first and second moments of one “giant step ” Φ(¯ θ ( s + R grp ) )
− Φ(¯ θ ( s ) ) in Appendix K.9.
Finally, we prove the approximation theorem 3.2 in Appendix K.10.
K. A DDITIONAL N OTATIONS
Let R tot :=
⌊ THη 2 ⌋ be the total number of rounds.
Denote by ϕ ( s ) the manifold projection of the global iterate at the beginning of round s .
Let x ( s ) k,t := θ ( s ) k,t − ϕ ( s ) be the difference between the local iterate and the manifold projection of the global iterate.
Also define ¯ x ( s ) H :
= 1 K (cid:80) k ∈
[ K ] x ( s ) k,H and ¯ x ( s ) 0 :
= 1 K (cid:80) k ∈ [ K ] x ( s ) k, 0 which is the average of x ( s ) k,t among K workers at step 0 and H .
Then for all k ∈ [ K ] , x ( s ) k, 0 = ¯ x ( s )
= ¯ θ ( s ) − ϕ ( s ) .
Finally, Since ∇ ℓ ( θ ; ζ ) is bounded, the gradient noise z ( s ) k,t is also bounded and we denote by σ max the upper bound such that ∥ z ( s ) k,t ∥ 2 ≤ σ max , ∀ s, k, t .
We first introduce the notion of µ -PL. We will later show that there exists a neighborhood of the minimizer manifold Γ where L satisfies µ -PL. Definition K.1 (Polyak-Łojasiewicz Condition) . For µ > 0 , we say a function L ( · ) satisfies µPolyak-Łojasiewicz condition (abbreviated as µ -PL) on set U if
[Equation]
We then introduce the definitions of the ϵ -ball at a point and the ϵ -neighborhood of a set. For θ ∈ R d and ϵ > 0 , B ϵ ( θ ) := { θ ′ : ∥ θ ′ − θ ∥ 2 < ϵ } is the open ϵ -ball centered at θ . For a set Z ⊆ R d ,
Z ϵ := (cid:83) θ ∈Z B ϵ ( θ ) is the ϵ -neighborhood of Z .
K.
C OMPUTING THE D ERIVATIVES OF THE L IMITING M APPING
In subsection, we present lemmas that relate the derivatives of the limiting mapping Φ( · ) to the derivatives of the loss function L ( · ) .
We first introduce the operator V H .
Definition K.2.
For a semi-definite symmetric matrix H ∈ R d × d , let λ j , v j be the j -th eigenvalue and eigenvector and v j ’s form an orthonormal basis of R d .
Then, define the operator V H :
R d × d →
R d × d as
[Equation]
Intuitively, this operator projects M to the base matrix v i v ⊤ j and sums up the projections with weights
[Equation]
Additionally, for θ ∈ Γ , denote by T θ and T ⊥ θ the tangent and normal space of Γ at θ respectively.
Lemmas K.1 to K.4 are from Li et al.
(2021b).
We include them to make the paper self-contained.
Lemma K.1 (Lemma C.1 of Li et al.
(2021b)) .
For any θ ∈ Γ and any v ∈ T θ (Γ) , it holds that ∇ 2 L ( θ ) v = 0 .
Lemma K.2 (Lemma 4.3 of Li et al.
(2021b)) .
For any θ ∈ Γ , ∂ Φ( θ ) ∈ R d × d is the projection matrix onto the tangent space T θ (Γ) .
Lemma K.3 (Lemma C.4 of Li et al.
(2021b)) .
For any θ ∈ Γ , u ∈ R d and v ∈ T θ (Γ) , it holds that
[Equation]
Lemma K.4 (Lemma C.6 of Li et al.
(2021b)) .
For any θ ∈ Γ and Σ ∈ span { uu ⊤ | u ∈ T ⊥ θ (Γ) } , [Equation]
Φ [Equation] [Equation]
(cid:11) [Equation] [Equation] [Equation]
Lemma K.5.
For all θ ∈ Γ , u , v ∈ T θ (Γ) , it holds that
[Equation]
Proof.
This proof is inspired by Lemma C.4 of Li et al.
(2021b).
For any θ ∈ Γ , consider a parameterized smooth curve v ( t ) , t ≥ 0 on Γ such that v (0)
= θ and v ′ (0)
= v .
Let P ∥ ( t ) =
∂ Φ( v ( t )) , P ⊥ ( t ) =
I − ∂ Φ( v ( t )) and H ( t ) = ∇ 2 L ( v ( t )) .
By Lemma C.1 and 4.3 in Li et al.
(2021b),
[Equation]
Take the derivative with respect to t on both sides,
[Equation]
⇒ P
[Equation]
t )
H
[Equation]
P ′⊥
[Equation]
P
[Equation]
At t = 0 , we have
P ∥
[Equation]
WLOG let H (0) =
diag( λ 1 , · · · , λ d ) , ∈ R d × d , where λ i = 0 for all m < i ≤ d .
Therefore
P ⊥ (0) =
(cid:20) I m   (cid:21) , P ∥ (0) =
(cid:20) {+
+}
I d − m (cid:21) .
Decompose P ′∥ (0) , H (0) and H ′ (0) as follows. P
[Equation]
Substituting the decomposition into (33), we have
[Equation]
Therefore, H ′ 22 (0) =
and
[Equation]
Any u ∈ T θ (Γ) can be decomposed as u = [ 0 , u 2 ] ⊤ where u 2 ∈ R
d − m .
With this decomposition, we have P ∥ (0) H ′
(0) u
= 0 .
Also, note that H ′ (0) =
∇ 3 L ( θ )[ v ] .
Hence,
[Equation]
∇
[Equation]
L
[Equation]
θ
[Equation]
[ vu T ] =
[Equation]
K. P RELIMINARY L EMMAS FOR GD AND GF
In this subsection, we introduce a few useful preliminary lemmas about gradient descent and gradient flow.
Before presenting the lemmas, we introduce some notations and assumptions that will be used in this subsection.
Assume that the loss function L ( θ ) is ρ -smooth and µ -PL in an open, convex neighborhood U of a local minimizer θ ∗ .
Denote by L ∗ :
= L ( θ ∗ ) the minimum value for simplicity.
Let ϵ ′ be the radius of the open ϵ ′ -ball centered at θ ∗
such that B ϵ
( θ ∗ ) ⊆
U .
We also define a potential function ˜Ψ( θ ) :
= (cid:112) L ( θ ) − L ∗ .
Consider gradient descent iterates { ˆ u t } t ∈ N following the update rule ˆ u t
+1 =
ˆ u t − η ∇L (ˆ u t ) .
We first introduce the descent lemma for gradient descent.
Lemma K.6 (Descent lemma for GD) .
If ˆ u t ∈ U and η ≤ 1 ρ , then η 2 ∥∇L (ˆ u t ) ∥ 22 ≤ L (ˆ u t ) − L (ˆ u t +1 ) , and
L ( ˆ u t +1 ) − L ∗ ≤ (1 − µη ) ( L ( ˆ u t ) − L ∗ ) .
Proof.
By ρ -smoothness,
[Equation]
By the definition of µ -PL, we have
[Equation]
Then we prove the Lipschitzness of ˜Ψ( θ ) .
Lemma K.7 (Lipschitzness of ˜Ψ( θ ) ) .
˜Ψ( θ ) is √ 2 ρ -Lipschitz for θ ∈ U .
That is, for any θ 1 , θ 2 ∈ U ,
[Equation]
Proof.
Fix θ
and θ 2 .
Denote by θ ( t ) :
= (1 − t )
θ 1 + t θ 2 the convex combination of θ 1 and θwhere t ∈ [0 , 1] .
Further define f ( t ) :
= ˜Ψ( θ ( t )) .
Below we consider two cases.
Case 1.
If ∀ t ∈ (0 , 1) , f ( t ) > 0 , then f ( t ) is differentiable on (0 , 1) .
[Equation]
By ρ -smoothness of L , for all θ ∈ U ,
[Equation]
Since (cid:112) L ( θ ( t )) − L ∗ > 0 for all t ∈ (0 , 1) , ∥∇L ( θ ( t ))
∥ 2 √ L ( θ ( t ))
−L ∗ ≤ √ 2 ρ .
Therefore,
[Equation]
Case 2.
If ∃ t ′ ∈ (0 , 1) such that f ( t ′ )
= 0 , then
[Equation]
Since θ ( t ′ ) minimizes L in an open set, ∇L ( θ ( t ′ ))
= 0 .
By ρ -smoothness of L , for all θ ∈ U ,
[Equation]
Therefore,
[Equation]
Then we have
[Equation]
Combining case 1 and case 2, we conclude the proof.
Below we introduce a lemma that relates the movement of one step gradient descent to the change of the potential function.
Lemma K.8 (Lemma G.1 in Lyu et al.
If ˆ u t ∈ U and η ≤ 1 /ρ 2 then
[Equation]
Proof.
[Equation]
where the two inequalities uses Lemma K.6.
By µ -PL, ˜Ψ(ˆ u t ) ≤ 1 √ 2 µ ∥∇L (ˆ u t ) ∥ 2 .
Therefore, we have ˜Ψ(ˆ
u t ) − ˜Ψ(ˆ
u t +1 ) ≥ √
[Equation]
ˆ u
[Equation] [Equation] [Equation] Based on Lemma K.8, we have the following lemma that bounds the movement of GD over multiple steps.
Lemma K.9 (Bounding the movement of GD) .
If ˆ u 0 is initialized such that ∥ ˆ u 0 − θ ∗ ∥ 2 ≤ 14 (cid:113) µρ ϵ ′ , then for all t ≥ 0 , ˆ u t ∈ B ϵ ′ ( θ ∗ ) and
[Equation]
Proof.
We prove the proposition by induction.
When t = 0 , it trivially holds.
Assume that the proposition holds for ˆ u τ , 0 ≤ τ < t .
For step t , since ˆ u τ ∈ B ϵ ′ ( θ ∗ ) , we apply Lemma K.8 and obtain
[Equation]
Further by ρ -smoothness of L ( · ) ,
[Equation]
Therefore, ∥ ˆ u t − θ ∗ ∥ 2 ≤ ∥ ˆ u t − ˆ u 0 ∥ 2 + ∥ ˆ u 0 − θ ∗ ∥ 2 < ϵ ′ , which concludes the proof.
Finally, we introduce a lemma adapted from Thm.
D.4 of which bounds the movement of GF.
Lyu et al.
Lemma K.10.
Assume that ∥ θ 0 − θ ∗ ∥ 2 < (cid:113) µρ ϵ ′ .
The gradient flow θ ( t ) = − d L [Equation] t [Equation]
d t starting at θ 0 converges to a point in U and
[Equation]
Proof.
Let T :=
inf { t : θ / ∈ U } .
Then for all t < T ,
[Equation]
By µ -PL, ∥∇L ( θ ) ∥ 2 ≥ (cid:112) 2 µ ( L ( θ ) − L ∗ ) .
Hence, d
[Equation]
Integrating both sides, we have
[Equation]
where the second inequality uses ρ -smoothness of L .
Therefore, T = + ∞ and θ ( t ) converges to some point in U .
K.
C ONSTRUCTION OF WORKING ZONES
We construct four nested working zones (Γ ϵ 0 , Γ ϵ 1 , Γ ϵ 2 , Γ ϵ 3 ) in the neighborhood of Γ .
Later we will show that the local iterates θ ( s ) k,t ∈ Γ ϵ 2 and the global iterates ¯ θ ( s ) ∈ Γ ϵ 0 with high probability after O (log 1 η ) rounds. The following lemma illustrates the properties the working zones should satisfy. Lemma K.11 (Working zone lemma) .
There exists constants ϵ 0 < ϵ 1 < ϵ 2 < ϵ 3 such that (Γ ϵ 0 , Γ ϵ 1 , Γ ϵ 2 , Γ ϵ 3 ) satisfy the following properties: L satisfies µ -PL in Γ ϵ 3 for some µ > 0 . Any gradient flow starting in Γ ϵ 2 converges to some point in Γ . Then, by Falconer (1983), Φ( · ) is C ∞ in Γ ϵ 2 .
Any θ ∈ Γ ϵ 1 has an ϵ 1 -neighborhood
B ϵ 1 ( θ ) such that B ϵ 1 ( θ ) ⊆ Γ ϵ 2 . 4. Any gradient descent starting in Γ ϵ 0 with sufficiently small learning rate will stay in Γ ϵ 1 . Proof.
Let ¯ θ (0) be initialized such that Φ(¯ θ (0) ) ∈ Γ .
Let Z be the set of all points on the gradient flow trajectory starting from ¯ θ (0) and Z ϵ be the ϵ -neighborhood of Z , where ϵ is a positive constant.
Since the gradient flow converges to ϕ (0) , Z and Z ϵ are bounded.
We construct four nested working zones.
By Lemma H.3 in Lyu et al.
(2022), there exists an ϵ 3neighborhood of Γ , Γ ϵ 3 , such that L satisfies µ -PL for some µ > 0 .
Let M be the convex hull of Γ ϵ 3 ∪ Z ϵ and M ϵ 4 be the ϵ 4 -neighborhood of M where ϵ 4 is a positive constant.
Then M ϵ 4 is bounded.
Define ρ 2 = sup θ ∈M ϵ 4 ∥∇ 2 L ( θ ) ∥ 2 and ρ 3 = sup M ϵ 4 ∥∇ 3 L ( θ ) ∥ 2 .
By Lemma K.10, we can construct an ϵ 2 -neighborhood of Γ where ϵ 2 < (cid:113) µρ 2 ϵ 3 such that all GF starting in Γ ϵ 2 converges to Γ .
By Falconer (1983), Φ( · ) is C 2 in Γ ϵ 3 .
Define ν 1 = sup θ ∈ Γ ϵ 3 ∥ ∂ Φ( θ ) ∥ 2 and ν 2 = sup θ ∈ Γ ϵ 3 ∥ ∂ 2 Φ( θ ) ∥ 2 .
We also construct an ϵ 1 neighborhood of Γ , Γ ϵ 1 , where ϵ 1 ≤ 12 ϵ 2 < 12 (cid:113) µρ 2 ϵsuch that all θ ∈ Γ ϵ 1 has an ϵ 1 neighborhood where Φ is well defined.
Finally, by Lemma K.9, there exists an ϵ 0 -neighborhood of Γ where ϵ 0 ≤ 14 (cid:113) µρ 2 ϵ 1 such that all gradient descent iterates starting in Γ ϵ 0 with η ≤ 1 ρ 2 will stay in Γ ϵ 1 .
Note that the notions of Z ϵ , M ϵ 4 , ρ 2 , ρ 3 , ν 1 , and ν 2 defined in the proof will be useful in the remaining part of this section.
When analyzing the limiting dynamics of Local SGD, we will show that all θ ( s ) k,t stays in Γ ϵ 2 ,
˜ u
( s ) t ∈ Γ ϵ 1 , ¯ θ ( s ) ∈
Γ ϵ 0 with high probability after O (log 1 η ) rounds.
K. P HASE 1: I TERATE A PPROACHING THE M ANIFOLD
The approaching phase can be further divided into two subphases.
In the first subphase, ¯ θ (0) is initialized such that ϕ (0) ∈ Γ .
We will show that after a constant number of rounds s 0 , ¯ θ ( s 0 ) goes to the inner part of Γ ϵ 0 such that ∥ ¯ θ ( s 0 ) − ϕ (0) ∥ 2 ≤ cϵ 0 with high probability, where 0 < c < 1 and the constants will be specified later (see Appendix K.5.2).
In the second subphase, we show that the iterate can reach within ˜ O ( √ η ) distance from Γ after O (log 1 η ) rounds with high probability (see
Appendix K.5.3).
K.5. A DDITIONAL NOTATIONS
Consider an auxiliary sequence { ˜ u ( s ) t } where ˜ u ( s )
= ¯ θ ( s ) and ˜ u ( s ) t +1 = ˜
u ( s ) t − η ∇L (˜ u ( s ) t ) , 0 ≤ t ≤
H − 1 .
Define ˜ ∆ ( s ) k,t := θ ( s ) k,t − ˜ u ( s ) t to be the difference between the local iterate and the gradient descent iterate.
Notice that ˜ ∆ ( s ) k, 0 = 0 , for all k and s .
Consider a gradient flow { u ( t ) } t ≥ 0 with the initial condition u (0)
=
¯ θ (0) and converges to ϕ (0) ∈ Γ .
For simplicity, let u ( s ) t := u ( sα + tη ) be the gradient flow after s rounds plus t steps.
Let s 0 be the smallest number such that ∥ u ( s 0 )
[Equation]
[Equation]
[Equation]
µρ [Equation] ϵ 0 .
Note that s 0 is a constant independent of η .
In this subsection, the minimum value of the loss in Appendix K.3 corresponds to the loss value on Γ , i.e., L ∗ =
L ( ϕ ) , ∀ ϕ ∈ Γ .
We also define the following sequence { ˜ Z ( s ) k,t } Ht =0 that will be used in the proof.
Define
[Equation]
K P ROOF FOR S UBPHASE
First, we have the following lemma about the concentration of ˜ Z ( s ) k,t .
Lemma K.12 (Concentration property of { ˜ Z ( s ) k,t } Ht =0 ) .
Given ¯ θ ( s ) such that ˜ u ( s ) t ∈ Γ ϵ 3 ∪ Z ϵ for all 0 ≤ t ≤ H , then with probability at least 1 − δ ,
[Equation]
[Equation]
where ˜ C 1 := exp( αρ 2 ) .
Proof.
For each ˜ Z ( s ) k,t , construct a sequence { ˜ Z ( s ) k,t,t ′ } tt ′ =0 :
[Equation]
Since ˜ u ( s ) t ∈ Γ ϵ 3 ∪ Z ϵ , we have ∥∇ 2 L (˜ u ( s ) t ) ∥ 2 ≤ ρ 2 for all 0 ≤ t ≤ H .
Then, for all τ and t , (cid:13)(cid:13)(cid:13)(cid:13)(cid:13) t [Equation] +
[Equation]
Notice that for all 0 ≤ t ≤ H , { ˜ Z ( s ) k,t,t ′ } tt ′ =0 is a martingale with ∥ ˜ Z ( s ) k,t,t ′ − ˜ Z ( s ) k,t,t [Equation] − 1 ∥ 2 ≤ ˜ C 1 σ max .
By Azuma-Hoeffding’s inequality,
[Equation]
Taking a union bound on all k ∈ [ K ] and 0 ≤ t ≤ H , we can conclude that with probability at least 1 − δ ,
[Equation]
The following lemma states that the gradient descent iterates will closely track the gradient flow with the same initial point.
Lemma K.13.
Denote G := sup t ≥
∥∇L ( u ( t ))
∥ 2 as the upper bound of the gradient on the gradient flow trajectory.
If ∥ ˜ u ( s ) t − u ( s ) t ∥ 2 = O ( √ η ) , then for all 0 ≤ t ≤ H , the closeness of ˜ u
( s ) t and u ( s ) t is bounded by
[Equation]
where ˜ C 1 = exp( αρ 2 ) .
Proof.
We prove by induction that
[Equation]
ρ [Equation] When t = 0 , (34) holds trivially.
Assume that (34) holds for 0 ≤ τ ≤ t , then
[Equation]
By smoothness of L ,
[Equation]
≤ ρ 2 ηG. Since ρ 22 η 2 G (cid:80) t − 1 τ =0 (1 + ρ 2 η ) τ ≤ ηG (1 + ρ 2 η ) t ≤ exp( αρ 2 ) ηG , then ∥ ˜ u ( s ) t − u ( s ) t ∥ 2 = O ( √ η ) , which implies that ˜ u ( s ) t ∈ M ϵ 4 .
Hence, ∥∇L (˜ u ( s ) t ) − L ( u ( s
[Equation]
t
[Equation]
∥
[Equation]
≤ ρ 2 ∥ ˜ u ( s ) t − u ( s ) t ∥ 2 .
By triangle inequality,
[Equation]
2 G
[Equation]
, which concludes the induction step.
Appling 1 + ρ 2 η ≤ exp( ρ 2 η ) , we have the lemma.
Utilizing the concentration probability of { ˜ Z ( s ) k,t } , we can obtain the following lemma which implies that the Local SGD iterates will closely track the gradient descent iterates with high probability.
Lemma K.14.
Given ¯ θ ( s ) such that ˜ u ( s ) t ∈ Γ ϵ 3 ∪ Z ϵ for all 0 ≤ t ≤ H , then for δ = O (poly( η )) , with probability at least 1 − δ , there exists a constant ˜ C 3 such that
[Equation]
and
[Equation]
Proof.
Since ˜ u ( s ) t ∈ Γ ϵ 3 ∪ Z ϵ for all 0 ≤ t ≤ H , we have ∥∇ 2 L (˜ u ( s ) t ) ∥ 2 ≤ ρ 2 .
According to the update rule for θ ( s ) k,t and ˜ u
( s ) t ,
[Equation]
Subtracting (36) from (35) gives
[Equation]
Here, ˜ v ( s ) k,t = [Equation] − [Equation]
[Equation]
,t
[Equation]
θ
[Equation]
k
[Equation]
+ β (
[Equation]
k
[Equation] t [Equation] u ( s ) k,t , where β ( s ) k,t ∈ (0 , 1) depends on θ ( s ) k,t and ˜ u
( s ) t .
Therefore, ∥ ˜ v ( s ) k,t ∥ 2 ≤ ρ 3 2 ∥ ˜ ∆ ( s ) k,t ∥
if θ ( s ) k,t ∈ M ϵ 4 .
Applying (37) t times, we have
[Equation]
By Cauchy-Schwartz inequality, triangle inequality and the definition of ˜ Z ( s ) k,t , if for all 0 ≤ τ ≤ t −and k ∈ [ K ] , θ ( s ) k,τ ∈ M ϵ 4 , then we have
[Equation]
Applying Lemma K.12 and substituting in the value of H , we have that with probability at least 1 − δ , [Equation]
[Equation]
Now we show by induction that for δ
= O (poly( η )) , when (39) holds, there exists a constant ˜ C 2 > 2 σ max √
α ˜ C [-
-]1 such that ∥ ˜ ∆
[Equation]
When t = 0 , ˜ ∆ ( s ) k, 0 = 0 .
Assume that ∥ ˜ ∆ ( s ) k,τ ∥ 2 ≤ ˜ C 2 (cid:113) η log 2 αKηδ , for all k ∈ [ K ] , 0 ≤ τ ≤ t − 1 .
Then for all 0 ≤ τ ≤ t − 1 , θ ( s ) k,τ ∈ M ϵ 4 .
Therefore, we can apply (38) and obtain
[Equation]
Given that ˜ C 2 ≥ 2 σ max √ 2 α ˜ C 1 and δ = O (poly( η )) , when η is sufficiently small, ∥ ˜ ∆ ( s ) k,t ∥ 2 ≤ ˜ C 2 (cid:113)
η log 2 αKηδ .
To sum up, for δ
= O (poly( η )) , with probability at least 1 − δ , ∥ ˜ ∆ ( s ) k,t ∥ 2 ≤ ˜ C 2 (cid:113) η log 2 αKηδ for all k ∈ [ K ] , 0 ≤ t ≤ H .
By triangle inequality,
[Equation]
The combination of Lemma K.13 and Lemma K.14 leads to the following lemma, which states that the Local SGD iterate will enter Γ ϵ 1 after s 0 rounds with high probability.
Lemma K.15.
Given ¯ θ (0) such that Φ(¯ θ (0) )
∈ Γ , then for δ
= O (poly( η )) , there exists a positive constant ˜ C 4 such that with probability at least 1 − δ ,
[Equation]
Proof.
First, we prove by induction that for δ
= O (poly( η )) , when
[Equation]
the closeness of ¯ θ ( s ) and u ( s ) 0 is bounded by
[Equation]
When s = 0 , ¯ θ (0) =
u (0)0 .
Assume that (41) holds for round s .
Then by Lemma K.13, for all 0 ≤ t ≤ H ,
[Equation]
Therefore, for sufficiently small η , ˜ u ( s ) t ∈
Z ϵ , ∀ 0 ≤ t ≤ H .
Combing the above inequality with
Lemma K.14, we have
[Equation]
which concludes the induction.
Therefore, when (40) holds, there exists a positive constant ˜ C 4 such that
[Equation]
By definition of u ( s 0 )
[Equation]
Finally, according to Lemma K.12, (40) holds with probability at least 1 − δ .
K.5. P ROOF FOR S UBPHASE
In subphase 2, we show that the iterate can reach within ˜ O ( √ η ) distance from Γ after O (log 1 η ) rounds with high probability.
The following lemma manifests how the potential function ˜Ψ(¯ θ ( s ) )
evolves after one round.
Lemma K.16.
Given ¯ θ ( s ) ∈ Γ ϵ 0 , for δ
= O (poly( η )) , with probability at least 1 − δ , θ ( s ) k,t ∈ Γ ϵ 2 ,
[Equation]
and
[Equation]
where ˜ C 5 is a positive constant.
Proof.
Since ¯ θ ( s ) ∈ Γ ϵ 0 , then for all 0 ≤ t ≤ H , ˜ u ( s ) t ∈ Γ ϵ 1 by the definition of the working zone.
By Lemma K.6, for η ≤ 1 ρ 2 ,
[Equation]
Specially, for t =
H ,
[Equation]
Therefore,
[Equation]
According to the proof of Lemma K.14, for δ
= O (poly( η )) , when
[Equation]
there exists a constant ˜ C 3 such that
[Equation]
and
[Equation]
Since ˜ u ( s ) t {+∈ Γ ϵ 1 , ∀ 0 ≤ t ≤ H , ¯ θ ( s +
+}
) ∈
Γ ϵ 2 and ¯ θ ( s ) k,t ∈ Γ ϵ 2 , ∀ 0 ≤ t ≤ H , k ∈
[ K ] .
By Lemma K.7, ˜Ψ( · ) is √ 2 ρ 2 -Lipschitz in M ϵ 4 .
Therefore, when (42) holds, there exists a constant ˜ C 5 := √ 2 ρ 2 ˜ C 3 such that
[Equation]
and
[Equation]
Finally, by Lemma K.12, (42) holds with probability at least 1 − δ .
We are thus led to the following lemma which characterizes the evolution of the potential ˜Ψ(¯ θ ( s ) ) and ˜Ψ( θ ( s ) k,t ) over multiple rounds.
Lemma K.17.
Given ∥ ¯ θ (0) − ϕ (0) ∥ 2 ≤ 12 (cid:113) µρ 2 ϵ 0 , for δ
= O (poly( η )) and any integer 1 ≤ R ≤
R tot , with probability at least 1 − δ ,
[Equation]
Furthermore,
[Equation]
Proof.
We prove induction that for δ
= O (poly( η )) , when
[Equation]
then for all 0 ≤ s ≤ R , (43) and (44) hold.
When s = 0 , ¯ θ (0) ∈
Γ ϵ 0 and (43) trivially holds.
By Lemma K.16, (44) holds.
Assume that (43) and (44) hold for round s − 1 .
Then for round s , by Lemma K.16, ¯ θ ( s ) ∈
Γ ϵ 2 and
[Equation]
where the second inequality comes from the induction hypothesis.
By Lemma K.10,
[Equation]
Here, the last inequality uses ˜Ψ( ¯ θ (0) ) ≤ (cid:112) ρ 2 2 ∥ ¯ θ ( s ) − ϕ (0) ∥ 2 ≤ 1 2 (cid:112) µ 2 ϵ 0 .
Hence, when η is sufficiently small, ¯ θ ( s ) ∈ Γ ϵ 0 .
Still by Lemma K.16, ¯ θ ( s ) k,t ∈ Γ ϵ 2 and
[Equation]
Finally, according to Lemma K.12, (45) holds with probability at least 1 − δ .
The following corollary is a direct consequence of Lemma K.17 and Lemma K.10.
Corollary K.1.
Let s 1 :=
⌈ 20 αµ log 1 η ⌉ .
Given ∥ ¯ θ (0) − ϕ (0) ∥ 2 ≤ 12 (cid:113) µρ 2 ϵ 0 , for δ
= O (poly( η )) , with probability at least 1 − δ ,
[Equation]
where ˜ C 6 is a constant.
Proof.
Substituting in R = s 1 to Lemma K.17 and applying ∥ ¯ θ ( s 1 ) − ϕ
( s ) ∥ 2 ≤ (cid:113) 2 µ ˜Ψ(¯ θ ( s 1 ) ) for ¯ θ ( s 1 )
∈
Γ ϵ 0 , we have the lemma.
Finally, we provide a high probability bound for the change of the projection on the manifold after s 1 rounds ∥
ϕ
( s 1 ) − ϕ
(0) ∥ 2 .
Lemma K.18.
Let s 1 :=
⌈ 20 αµ log 1 η ⌉ .
Given ∥ ¯ θ (0) − ϕ (0) ∥ 2 ≤ 12 (cid:113) µρ 2 ϵ 0 .
For δ = O (poly( η )) , with probability at least 1 − δ ,
[Equation]
Proof.
From Lemma K.17, for δ
= O (poly( η )) , when
[Equation]
then ¯ θ ( s ) ∈
Γ ϵ 0 , for all 0 ≤ s ≤ s 1 .
By the definition of Γ ϵ 0 , ˜ u ( s ) t ∈ Γ ϵ 1 , for all 0 ≤ t ≤ H, 0 ≤ s ≤ s 1 .
By triangle inequality, ∥ ϕ ( s 1 ) − ϕ (0) ∥ 2 can be decomposed as follows.
[Equation]
By Lemma K.14, when (47) hold , then for all
≤ s < s 1 − 1 ,
[Equation]
This implies that ¯ θ ( s +1)
∈
B ϵ 1 (˜ u ( s ) H ) .
Since for all θ ∈ Γ ϵ 2 , ∥ ∂ Φ( θ ) ∥ 2 ≤ ν 1 , then Φ( · ) is ν 1Lipschitz in B ϵ 1 (˜ u ( s ) H ) .
This gives
[Equation]
Then we analyze ∥ ¯ θ ( s +1)
− ˜ u
( s ) H ∥ 2 .
By Lemma K.9 and the definition of Γ ϵ 0 and Γ ϵ 1 , there exists ϕ ∈ Γ such that ˜ u ( s ) t ∈ B ϵ 1 ( ϕ ) , ∀ 0 ≤ t ≤ H .
Therefore, we can expand Φ(˜ u ( s ) t +1 ) as follows:
[Equation]
where c ( s ) t ∈ (0 , 1) .
Then we have ∥
[Equation]
By Lemma K.6, η 2 ∥∇L
(˜ u ( s ) t ) ∥ 22 ≤ L (˜ u ( s ) t ) − L (˜ u ( s ) t +1 ) .
Therefore,
[Equation]
[Equation]
where the last inequality uses Cauchy-Schwartz inequality and Lemma K.17.
Summing up (50)
[Equation]
we obtain
[Equation]
where ˜ C 7 is a constant.
Substituting (49) and (51) into (48)
[Equation]
for sufficiently small η
[Equation]
we have
[Equation]
where ˜ C 8 is a constant.
Finally, according to Lemma K.12, (47) holds with probability at least 1 − δ .
K. P HASE 2: I TERATES S TAYING C LOSE TO M ANIFOLD
In this subsection, we show that ∥ x ( s ) k,t ∥ 2 = ˜ O ( √ η ) and ∥ ¯ θ ( s + r ) − ¯ θ ( s ) ∥
= ˜ O ( η 0 .
5 − 0 .
5 β ) , ∀ 0 ≤ r ≤ R grp with high probability.
K.6. A DDITIONAL NOTATIONS
Before presenting the lemmas, we define the following martingale { m ( s ) k,t } Ht =0 that will be useful in the proof:
[Equation]
We also define ˜ P : R d → R d × d as an extension of ∂ Φ : [Equation]
[Equation]
otherwise .
Finally, we define a martingale { Z ( s ) t
[Equation]
K.6. P ROOF FOR THE H IGH P ROBABILITY B OUNDS
A direct application of Azuma-Hoeffding’s inequality yields the following lemma.
Lemma K.19 (Concentration property of m ( s ) k,t ) .
With probability at least 1 − δ , the following holds:
[Equation]
where ˜ C 9 is a constant.
Proof.
Notice that ∥ m ( s ) k,t +1 − m ( s ) k,t ∥ 2 ≤ σ max .
Then by Azuma-Hoeffdings inequality,
[Equation]
Taking union bound on K clients, H local steps and R grp rounds, we obtain that the following inequality holds with probability at least 1 − δ :
[Equation]
Substituting in H = αη and R grp =
⌊ 1 αη β ⌋ yields the lemma.
Again applying Azuma-Hoeffding’s inequality, we have the following lemma about the concentration property of Z ( s ) t .
Lemma K.20 (Concentration property of Z ( s ) t ) .
With probability at least 1 − δ , the following inequality holds:
[Equation]
Proof.
Notice that ∥ Z ( s ) t +1 − Z ( s [Equation] t ∥ 2 ≤ ν 2 σ max , ∀ 0 ≤ t ≤
[Equation]
− 1 and ∥
Z
[Equation]
By Azuma-Hoeffding’s inequality,
[Equation]
Taking union bound on R grp rounds, we obtain that the following inequality holds with probability at least 1 − δ :
[Equation]
Substituting in H = αη and R grp =
⌊ 1 αη β ⌋ yields the lemma.
We proceed to present a direct corollary of Lemma K.17 which provides a bound for the potential function over R grp rounds.
Lemma K.21.
Given ∥ ¯ θ (0) − ϕ (0) ∥ 2 ≤ C 0 (cid:113) η log 1 η where C 0 is a constant, then for δ =
O (poly( η )) , with probability at least 1 − δ ,
[Equation]
and
[Equation]
where C 1 is a constant that can depend on C 0 .
Furthermore,
[Equation]
where ˜ C 9 is a constant independent of C 0 .
Proof.
By ρ 2 -smoothness of L , ˜Ψ(¯ θ (0) ) ≤ C 0 (cid:113) ηρ 2 2 log 1 η .
Substituting R grp =
⌊ 1 αη β ⌋ and ˜Ψ(¯ θ (0) ) ≤ C 0 (cid:113) ηρ 2 2 log 1 η into Lemma K.17, for δ
= O (poly( η )) , with probability at least 1 − δ , (52) and (53) where C 1 is a constant that can depend on C 0 .
Furthermore, for round ¯ θ ( R grp ) ,
[Equation]
where ˜ C 9 is a constant independent of C 0 .
Lemma K.22.
Given ∥ ¯ θ (0) − ϕ (0) ∥ 2 ≤ C 0 (cid:113) η log 1 η where C 0 is a constant, then for δ =
O (poly( η )) , with probability at least 1 − δ , for all 0 ≤ s 0 < R grp , 0 ≤ t ≤ H , k ∈
[ K ] ,
[Equation]
where C 2 is a constant that can depend C 0 .
Furthermore,
[Equation]
where ˜ C 11 is a constant independent of C 0 .
Proof.
Decomposing x ( s ) k,t by triangle inequality, we have
[Equation]
We first bound ∥ ¯ θ ( s ) − ϕ ( s ) ∥ 2 .
By Lemma K.21, for δ = O (poly( η )) , with probability at least [Equation]
[Equation]
and
[Equation]
56) where C 2 is a constant that may depend on C 0 and ˜ C 10 is a constant independent of C 0 .
When (54) and (56) hold, by Lemma K.10,
[Equation]
[Equation] Then we bound ∥ θ ( s ) k,t − ¯ θ ( s ) ∥ 2 .
By the update rule, we have
[Equation]
Still by triangle inequality, we have
[Equation]
Due to ρ 2 -smoothness of L , when (55) holds,
[Equation]
By Lemma K.19, with probability at least 1 − δ 2 ,
[Equation]
Combining (59) and (60), when (55) and (56) hold simultaneously, there exists a constant C 3 which can depend on C 0 such that
[Equation]
By triangle inequality,
[Equation]
Combining (57), (58) and (61), we complete the proof.
Then we provide high probability bounds for the movement of ϕ ( s ) within R grp rounds.
Lemma K.23.
Given ∥ ¯ θ (0) − ϕ
[Equation]
[Equation]
[Equation]
η log 1 η where C 0 is a constant, then for δ =
O (poly( η )) , with probability at least 1 − δ ,
[Equation]
where C 4 is a constant that can depend on C 0 .
Proof.
By the update rule of Local SGD,
[Equation]
Averaging among K clients gives
[Equation]
By Lemma K.
[Equation]
for δ = O (poly( η ))
[Equation]
the following holds with probability at least 1 − δ/ 3 ,
[Equation]
When (62) and (63) hold, we can expand Φ(¯ θ ( s +1) ) as follows:
[Equation]
where a ( s ) ∈ (0 , 1) .
Telescoping from round 0 to s − 1 , we have
[Equation]
From (63) [Equation] we can bound ∥T ( s ) 3 ∥ 2 by ∥T ( s ) 3 ∥ 2 ≤ 12 ν 2 C 22 η log 3 ηδ .
We proceed to bound ∥T ( s ) 1 ∥ 2 .
When (62) and (63) hold, we have ∂ Φ
[Equation]
¯
[Equation] s ) [Equation] where b ( s ) k,t ∈ (0 , 1) .
By Lemma K.17, with probability at least 1 − δ/ 3 , the following holds:
[Equation]
When (62), (63) and (64) hold simultaneously, we have for all 0 ≤ s < R grp ,
[Equation]
Finally, we bound ∥ (cid:80) s − 1 r =0 T ( r ) 2 ∥ 2 .
By Lemma K.20, the following inequality holds with probability at least 1 − δ/ 3 :
[Equation]
When (62), (63) and (65) hold simultaneously, we have
[Equation]
Combining the bounds for ∥T ( s ) 1 ∥ 2 , ∥ (cid:80) s r =0 T ( r ) 2 ∥ 2 and ∥T ( s ) 3 ∥ 2 and taking union bound, we obtain that for δ
= O (poly( η )) , the following inequality holds with probability at least 1 − δ :
[Equation]
where C 4 is a constant that can depend on C 0 .
K. S UMMARY OF THE DYNAMICS AND P ROOF OF T HEOREMS J.1 AND J.
Based on the results in Appendix K.5 and Appendix K.6, we summarize the dynamics of Local SGD iterates and then present the proof of Theorems J.1 and J.2 in this subsection.
For convenience, we first introduce the definition of global step and δ -good step .
Definition K.3 (Global step) .
Define I as the index set { ( s, t ) : s ≥ 0 , 0 ≤ t ≤ H } with lexicographical order, which means ( s 1 , t 1 ) ⪯ ( s 2 , t 2 ) if and only if s 1 < s 2 or ( s
= s 2 and t 1 ≤ t 2 ).
A global step is indexed by ( s, t ) corresponding to the t -th local step at round s .
Definition K.4 ( δ -good step) .
In the training process of Local SGD, we say the global step ( s, t ) ⪯ ( R tot , 0) is δ -good if the following inequalities hold:
[Equation]
Applying the concentration properties of ˜ Z ( r ) k,τ , m ( r ) k,τ and Z ( r ) H (Lemmas K.20, K.19 and K.12) yields the following theorem.
Theorem K.1.
For δ = O (poly( η )) , with probability at least 1 − δ , all global steps ( s, t ) ⪯ ( R tot , 0) are δ -good.
In the remainder of this subsection, we use O ( · ) notation to hide constants independent of δ and η .
Below we present a summary of the dynamics of Local SGD when ¯ θ (0) is initialized such that Φ(¯ θ (0) ) ∈ Γ and all global steps are δ -good.
Phase 1 lasts for s
+ s
=
O (log 1 η ) rounds.
At the end of phase 1, the iterate reaches within O ( (cid:113) η log 1 ηδ ) from Γ , i.e., ∥ ¯ θ ( s 0 + s 1 ) − ϕ
( s 0 + s 1 ) ∥ 2 =
O ( (cid:113) η log 1 ηδ ) .
The change of the projection on manifold over s 0 + s 1 rounds, ∥ ϕ ( s 1 + s 0 ) − ϕ (0) ∥ 2 , is bounded by O (log 1 η (cid:113) η log 1 ηδ ) .
After s 0 + s 1 rounds, the dynamic enters phase 2 when the iterates stay close to Γ with ¯ θ ( s ) ∈
Γ ϵ 2 , ∀ s 0 + s 1 ≤ s ≤ R tot and θ ( s ) k,t ∈ Γ ϵ 2 , ∀ k ∈
[ K ] , ( s 0 + s 1 , 0) ⪯ ( s, t ) ⪯ ( R tot , 0) .
Furthermore, ∥ x ( s ) k,t ∥ 2 and ∥ ¯ x ( s ) H ∥ 2 satisfy the following equations:
[Equation]
Moreover, for s 0 + s 1 ≤ s ≤ R tot − R grp , the change of the manifold projection within R grp rounds can be bounded as follows:
[Equation]
After combing through the dynamics of Local SGD iterates during the approaching and drift phase, we are ready to present the proof of Theorems J.1 and J.2, which are direct consequences of the lemmas in Appendix K.5 and K.6.
Proof of Theorem J.1.
By Lemmas K.15, K.22 and Corollary K.1, for δ = O (poly( η )) , when all global steps are δ -good, ¯ θ ( s ) ∈ Γ ϵ 2 , ∀ s 0 + s 1 ≤ s ≤ R tot and θ ( s ) k,t ∈ Γ ϵ 2 , ∀ k ∈
[ K ] , ( s 0 + s 1 , 0) ⪯ ( s, t ) ⪯ ( R tot , 0) and ∥ x ( s ) k,t ∥ 2 , ∥ ¯ x ( s ) H ∥ 2 satisfy the following equations:
[Equation]
Hence ∥ ¯ x ( R tot
[Equation]
[Equation]
) by smoothness of L and
Lemma K.10.
According to Theorem K.1, with probability at least 1 − δ , all global steps are δ -good, thus completing the proof. Proof of Theorem J.2.
By Lemma K.23, for δ = O (poly( η )) , when all global steps are δ -good, then ∀
[Equation]
R tot − R grp ,
[Equation] Also, by Lemma K.18, when all global steps are δ -good, the change of projection on manifold over s 0 + s 1 rounds (i.e., Phase 1), ∥ ϕ ( s 0 + s 1 ) − ϕ (0) ∥ 2 is bounded by ˜ O ( √ η ) . According to Theorem K.1, with probability at least 1 − δ , all global steps are δ -good, thus completing the proof. K. P ROOF OF T HEOREM 3.
In this subsection, we explicitly derive the dependency of the approximation error on α .
The proofs are quite similar to those in Appendix K.5 and hence we only state the key proof idea for brevity.
With the same method as the proofs in Appendix K.5.2, we can show that with high probability, ∥ ¯ θ ( s ) − ϕ ( s ) ∥ 2 ≤ 12 (cid:113) µρ 2 after s ′
= O (1) rounds.
Below we focus on the dynamics of Local SGD thereafter.
We first remind the readers of the definition of { ˜ Z sk,t } :
[Equation]
We have the following lemma that controls the norm of the matrix product (cid:81) t − 1 l
= τ +
( I − η ∇ 2 L (˜ u ( s ) l )) .
Lemma K.24.
Given ¯ θ ( s ) ∈ Γ ϵ 0 , then there exists a positive constant C ′ 3 independent of α such that for all 0 ≤ τ < t ≤ H ,
[Equation]
Proof.
Since ¯ θ ( s ) ∈ Γ ϵ 0 , then ˜ u ( s )
t ∈
Γ
ϵ 1 for all 0 ≤ t ≤ H .
We first bound the minimum eigenvalue of ∇ 2 L (˜ u ( s ) t ) .
Due to the PL condition, by Lemma K.6, for η ≤ 1 ρ 2 , L [Equation] , ∀
[Equation]
H.
Therefore,
[Equation]
Let C ′
= ρ 3 (cid:113) ρ 2 µ .
By Weyl’s inequality,
[Equation]
where the last two inequalities use Lemmas K.10 and K.7 respectively.
Therefore, for all 0 ≤ t ≤ H and 0 ≤ τ ≤ t − 1 ,
[Equation]
For sufficiently small η , there exists a constant C ′ 2 such that
[Equation]
Substituting (67) into (66), we obtain the lemma.
Based on Lemma K.24, we obtain the following lemma about the concentration property of ˜ Z ( s ) k,t , which can be derived in the same way as Lemma K.12.
Lemma K.25.
Given ¯ θ ( s ) ∈ Γ ϵ 0 , then with probability at least 1 − δ ,
[Equation]
where C ′ 3 is defined in Lemma K.24.
The following lemma can be derived analogously to Lemma K.14 but the error bound is tighter in terms of its dependency on α .
Lemma K.26.
Given ¯ θ ( s ) ∈ Γ ϵ 1 , then for δ
= O (poly( η )) , with probability at least 1 − δ , there exists a constant C ′ 4 independent of α such that
[Equation]
and
[Equation]
Then, similar to Lemma K.17, we can show that for δ
= O (poly( η )) and simultaneously
all s ≥ s ′
+ s ′ 1 where s ′
= O ( 1 α log 1 η ) , it holds with probability at least 1 − δ that ∥ ¯ θ ( s ) − ϕ ( s ) ∥ 2 =
O ( (cid:113) αη log αηδ ) .
Note that to eliminate the dependency of the second term’s denominator on α in (44), we can discuss the cases of α > c
and α < c 0 respectively where c 0 can be an arbitrary positive constant independent of α .
For the case of α < c 0 group ⌈ c 0 α ⌉ rounds together and repeat the arguments in this subsection to analyze the closeness between Local SGD and GD iterates as well as the evolution of loss.
K. C OMPUTING THE M OMENTS FOR O NE “G IANT S TEP ”
In this subsection, we compute the first and second moments for the change of manifold projection every R grp rounds of Local SGD.
Since the randomness in training might drive the iterate out of the working zone, making the dynamic intractable, we analyze a more well-behaved sequence { ˆ θ ( s ) k,t : ( s, t ) ⪯ ( R tot , 0) , k ∈ [ K ] } which is equal to { θ ( s ) k,t } with high probability.
Specifically, ˆ θ ( s ) k,t equal to θ ( s ) k,t if the global step ( s, t ) is η 100 -good and is set as a point ϕ null ∈ Γ otherwise. The formal definition is as follows. [Figure] Definition
K.
(Well-behaved sequence) .
Denote by E ( s [Equation] t the event { global step ( s, t ) is η 100 -good } .
Define a well-behaved sequence ˆ θ
[Equation] k [Equation] t
[Equation]
ϕ null
[Equation] ¯ [Equation] which satisfies the following update rule:
[Equation]
By Theorem K
[Equation]
[Equation] with probability at least 1 − η 100 , ˆ θ ( s ) k,t = θ ( s ) k [Equation] ∀ k ∈ [ K ] , ( s, t ) ⪯ ( R tot , 0) .
Similar to { θ ( s ) k,t } , we define the following variables with respect to { ˆ θ ( s ) k,t } :
[Equation]
Notice that ˆ x ( s ) k, 0 = ˆ x ( s ) avg , 0 for all k ∈
[ K ] .
Finally, we introduce the following mapping Ψ ( θ ) :
Γ → R d × d , which is closely related to (cid:98) Ψ defined in Theorem 3.2.
Definition K.6.
For θ ∈ Γ , we define the mapping Ψ ( θ ) :
Γ → R d × d :
[Equation]
j ∈ [Equation] [Equation] where λ i , v i are the i -th eigenvalue and eigenvector of ∇ 2 L ( θ ) and v i ’s form an orthonormal basis of R d .
Additionally, ψ ( x ) := e − x − 1+ x x and ψ (0) = 0 ; see Figure 9 for a plot.
Remark K.1.
Intuitively, Ψ ( θ ) rescales the entries of Σ ( θ ) in the eigenbasis of ∇ 2 L ( θ ) .
When ∇ 2 L ( θ ) =
diag( λ 1 , · · · , λ d ) ∈ R d × d , where λ i = 0 for all m < i ≤ d , Ψ( Σ 0 )
i,j = ψ ( ηH ( λ i + λ j ))Σ 0 ,i,j .
Note that Ψ ( θ ) can also be written as
[Equation]
where ⊕ denotes the Kronecker sum A ⊕ B
=
A ⊗ I
d
+ I d ⊗ B , vec( · ) is the vectorization operator of a matrix and ψ ( · ) is interpreted as a matrix function.
Now we are ready to present the result about the moments of ˆ ϕ
( s + R grp ) − ˆ ϕ ( s ) .
Theorem K.2.
For s 0 + s 1 ≤ s ≤ R tot − R grp and 0 < β < 0 .
5 , the first and second moments of ˆ ϕ
( s + R grp )
− ˆ ϕ ( s ) are as follows:
[Equation]
where ˜ O ( · ) hides log terms and constants independent of η .
Remark K.2.
By Theorem K.1 and the definition of ˆ θ ( s ) k,t , (70) and (71) still hold when we replace ˆ ϕ ( s ) with ϕ ( s ) and replace ˆ ϕ ( s + R grp ) with ϕ ( s + R grp ) .
We shall have Theorem K.2 if we prove the following theorem, which directly gives Theorem K. with a simple shift of index.
For brevity, denote by ∆ ˆ ϕ ( s ) :
=
ˆ ϕ ( s ) − ˆ ϕ (0) , Σ 0 :
= Σ ( ˆ ϕ (0) ) , Σ 0 , ∥ := Σ ∥ ( ˆ ϕ (0) ) .
Theorem K.3.
Given ∥ ˆ θ (0)avg − ˆ ϕ (0) ∥ 2 = O ( (cid:113) η log 1 η ) , for 0 < β < 0 . 5 , the first and second moments of ∆ ˆ ϕ ( R grp ) are as follows:
[Equation]
We will prove Theorem K.3 in the remainder of this subsection.
For convenience, we introduce more notations that will be used throughout the proof.
Let H 0 :
= ∇ 2 L ( ˆ ϕ (0) ) .
By Assumption 3.2, rank( H 0 ) = m .
WLOG, assume H 0 =
diag( λ 1 , · · · , λ d ) ∈ R d × d , where λ i = 0 for all m < i ≤ d and λ 1 ≥ λ 2 · · · ≥ λ m .
By Lemma K.2, ∂ Φ( ˆ ϕ (0) ) is the projection matrix onto the tangent space
T ˆ ϕ (0) (Γ) (i.e. the null space of ∇ 2 L ( ˆ ϕ (0) ) ) and therefore, ∂ Φ( ˆ ϕ (0) ) =
(cid:20)
I d − m (cid:21) .
Let
P ∥ := ∂ Φ( ˆ ϕ (0) ) and P ⊥ :
= I d − P ∥ .
Let ˆ A ( s ) avg :=
E [ˆ x ( s ) avg ,H ˆ x ( s ) ⊤ avg ,H ] , ˆ q ( s ) t := E
[ˆ x ( s ) k,t ] and ˆ B ( s ) t :=
E [ˆ x ( s ) k,t ∆ ˆ ϕ ( s ) ⊤ ] .
The latter two notations are independent of k since ˆ θ ( s ) 1 ,t , . . , ˆ θ ( s ) K,t are identically distributed.
The following lemma computes the first and second moments of the change of manifold projection every round.
Lemma K.27.
Given ∥ ˆ θ (0)avg − ˆ ϕ (0) ∥ 2 = O ( (cid:113) η log 1 η ) , for 0 ≤ s < R grp , the first and second moments of ˆ ϕ ( s +1)
− ˆ ϕ
( s ) are as follows:
[Equation]
Proof.
By Taylor expansion, we have
[Equation]
Rearrange the terms and we obtain:
[Equation]
Moreover,
[Equation]
Noticing that ˆ x ( s ) k,H ∆ ˆ ϕ ( s ) ⊤ are identically distributed for all k ∈ [ K ] , we have E [ˆ x ( s ) avg ,H ∆ ˆ ϕ ( s ) ⊤ ] = 1 K (cid:80) k ∈ [ K ] E
[ˆ x ( s ) k,H ∆
ˆ ϕ ( s ) ⊤ ]
= ˆ B ( s ) H .
Then taking expectation of both sides of (74) gives
[Equation]
Again taking expectation of both sides of (75) yields
[Equation]
By Lemmas K.22 and K.23, the following holds simultaneously with probability at least 1 − η 100 :
[Equation]
Furthermore, since for all k ∈ [ K ] and ( s, t ) ⪯ ( R tot , 0) , ˆ θ ( s ) k,t stays in Γ ϵ 2 which is a bounded set, ∥ ∆ ˆ ϕ ( s ) ∥ 2 and ∥ ˆ x ( s ) avg ,H ∥ 2 are also bounded.
Therefore, we have
[Equation]
which concludes the proof.
We compute ˆ A ( s ) avg , ˆ q ( s ) t and ˆ B ( s ) t by solving a set of recursions, which is formulated in the following lemma.
Additionally, define ˆ A ( s ) t :
[Equation]
t ˆ
[Equation]
] and ˆ
[Equation]
Lemma K.28.
Given ∥ ˆ θ (0)avg − ˆ ϕ (0) ∥ 2 = O ( (cid:113) η log 1 η ) , for 0 ≤ s < R grp and 0 ≤ t < H , we have the following recursions. [Equation]
[Equation]
Moreover,
[Equation]
Proof.
We first derive the recursion for ˆ q ( s ) t .
Recall the update rule for ˆ θ ( s ) k,t :
[Equation]
[Equation]
where the second and third equality perform Taylor expansion.
Taking expectation on both sides gives
[Equation]
By Theorem K.1, with probability at least 1 − η 100 , ˆ e ( s ) k,t = 0 , ∀ k ∈ [ K ] , ( s, t ) ⪯ ( R grp , 0) .
Also notice that both ˆ θ ( s ) k,t and ϕ null belong to the bounded set Γ ϵ 2 .
Therefore, ∥ ˆ e ( s ) k,t ∥ 2 is bounded and we have E [ ∥ ˆ e ( s ) k,t ∥ 2 ]
=
O ( η 100 ) .
Combining this with (76) to (78) yields (79).
Secondly, we derive the recursion for ˆ B ( s ) t .
Multiplying both sides of (87) by ∆ ˆ ϕ ( s ) ⊤ and taking expectation, we have
[Equation]
Still by Theorem K.1 and (76) to (78), we have (82).
Thirdly, we derive the recursion for ˆ A ( s ) t .
By (87), we have
[Equation]
which establishes (80).
Fourthly, we derive the recursion for ˆ M ( s ) t .
Multiplying both sides of (87) by ˆ x ( s ) l,t +1 and taking expectation, l ̸
= k , we obtain
[Equation]
By a similar argument to the proof of Lemma K. [Equation] we have
[Equation]
which yields (81)
[Equation] Now we proceed to prove (83) to (86).
By definition of ˆ A ( s ) avg ,
[Equation]
which demonstrates (83)
Then we derive (84)
[Equation] By definition of ˆ x ( s +1) avg , 0 ,
[Equation]
Hence,
[Equation]
By (76) and (78)
[Equation]
we obtain (84).
By (74),
[Equation]
Combining (88) and (89) gives
[Equation]
Therefore,
[Equation]
Finally
[Equation]
we apply Lemma K.27 to derive (85)
[Equation]
which concludes the proof.
With the assumption that the hessian at ˆ ϕ (0) is diagonal, we have the following corollary that formulates the recursions for each matrix element.
Corollary K.2.
Given ∥ ˆ θ (0)avg − ˆ ϕ (0) ∥ 2 = O ( (cid:113) η log 1 η ) , for 0 ≤ s < R grp and 0 ≤ t < H , we have the following elementwise recursions. [Equation] d.
[Equation]
Having formulated the recursions, we are ready to solve out the explicit expressions.
We will split each matrix into four parts and them one by on.
Specifically, a matrix M can be split into P ∥ MP ∥ in the tangent space of Γ at ˆ ϕ (0) , P ⊥ MP ⊥ in the normal space, along with P ∥ MP ⊥ and P ⊥ MP ∥ across both spaces.
We first compute the elements of P ⊥ ˆ A ( s ) t P ⊥ and P ⊥
ˆ A ( s )
avg P ⊥ .
Lemma K.29 (General formula for P ⊥ ˆ A ( s ) t P ⊥ and P ⊥
ˆ A ( s ) avg P ⊥ ) .
Let R 0 :=
⌈ 10 λ m α log 1 η ⌉ .
Then for 1 ≤ i ≤ m, 1 ≤ j ≤ m and R 0 ≤ s < R grp ,
[Equation]
For s < R 0 , ˆ A ( s ) t,i,j = ˜
O ( η ) and ˆ A ( s ) avg , , i,j = ˜
O ( η ) .
Proof.
For 1 ≤ i ≤ m, 1 ≤ j ≤ m , λ i > 0 , λ j > 0 .
By (90),
[Equation]
where the second inequality uses (cid:80) t − 1 τ =
[Equation]
η
[Equation]
λ
[Equation]
+ λ
[Equation]
where the second equality uses M ( s +1)
[Equation]
By (93) and (94),
[Equation]
Then we obtain ˆ
[Equation]
Notice that | 1 − ( λ i + λ j ) η | < 1 and (1 − ( λ i
[Equation]
λ j )
[Equation]
H ≤
[Equation]
λ
[Equation]
= exp( − ( λ i + λ j ) α ) .
Therefore,
[Equation]
Then we have
[Equation]
Finally, we demonstrate that for s ≥ R 0 , ˆ A ( s ) 0 ,i,j and ˆ A ( s ) avg ,i,j is approximately equal to η ( λ i + λ j ) KB loc Σ 0 ,i,j .
By (96), when s ≥ R 0 , (1 − ( λ i + λ j ) η ) sH =
O ( η 10 ) , which gives
[Equation]
For s < R 0 , since ˆ A (0)
=
ˆ x ( s ) avg , 0 ˆ x ( s ) ⊤ avg , 0 =
˜ O ( η ) , we have ˆ A ( s ) avg , , i,j = ˜
O ( η ) and ˆ A ( s ) t,i,j = ˜
O ( η ) .
Secondly, we compute P ∥
ˆ A ( s ) t P ⊥ and P ∥
ˆ A ( s )
avg P ⊥ .
Lemma K.30 (General formula for P ⊥
ˆ A ( s ) t P ∥ and P ⊥ ˆ A ( s ) avg P ∥ ) .
For 1 ≤ i ≤ m, m < j ≤ d , ˆ A ( s
[Equation]
Proof.
Note that for 1 ≤ i ≤ m, m < j ≤ d and λ i > 0 , λ j = 0 .
By (90) and (94),
[Equation]
By (91) and (94), ˆ M ( s ) t,i,j = ˜
O ( η 1 . 5 − 0 .
5 β ) .
Then,
[Equation]
Similar to Lemma K.30, we have the following lemma for the general formula of P ∥
ˆ A ( s ) t P ⊥ and
P ∥
ˆ A ( s )
avg P ⊥ .
Lemma K.31 (General formula for P ∥
ˆ A ( s ) t P ⊥ and P ∥
ˆ A ( s ) avg P ⊥ ) .
For m < i ≤ d and 1 ≤ j ≤ m ,
[Equation]
Finally, we derive the general formula for P ∥
ˆ A ( s ) t P ∥ and P ∥
ˆ A ( s ) avg P ∥ .
Lemma K.32 (General formula for P ∥
ˆ A ( s ) t P ∥ and P ∥
ˆ A ( s ) avg P ∥ ) .
For m < i ≤ d and m <
j ≤ d ,
[Equation]
Proof.
Note that for m < i ≤ d , m < j ≤ d and λ i = λ
j = 0 .
(90) is then simplified as
[Equation]
Therefore,
[Equation]
According to (91), ˆ M ( s ) t,i,j = ˜
O ( η 1 . 5 − 0 .
5 β ) for m < i ≤ d and m < j ≤ d .
Combining (91), (94) and (97) yields
[Equation]
Now, we move on to compute the general formula for ˆ B ( s ) t .
Lemma K.33 (The general formula for P ⊥ ˆ B ( s ) t P ∥ ) .
Note that for 1 ≤ i ≤ m and m < j ≤ d , when R 0 :=
⌈ 10 λ m α log 1 η ⌉ ≤ s < R grp ,
[Equation]
For s < R 0 , ˆ B ( s ) t,i,j = ˜
O ( η ) .
Proof.
Note that for 1 ≤ i ≤ m , λ i > 0 .
By (92), ˆ
[Equation]
( s )
[Equation]
1 ,i,j =
[Equation]
Hence,
[Equation]
According to (95),
[Equation]
Then we have
[Equation]
where the second equality uses (96) and the last inequality uses ˆ B (0) = ˆ x
[Equation]
0)avg [Equation] ∆ ˆ ϕ
[Equation]
= 0 .
For s ≥ R 0 , ˆ
[Equation] [Equation]
which gives
[Equation]
Therefore,
[Equation]
For s < R 0 , ˆ A ( s ) avg , , i,j = ˜
O ( η ) and therefore, ˆ B ( s ) t,i,j = ˜
O ( η ) .
Lemma K.34 (General formula for the elements of P ⊥ ˆ B ( s ) t P ⊥ ) .
For 1 ≤ i ≤ m and 1 ≤ j ≤ m , , ˆ B ( s ) t,i,j = ˜ O ( η 1 . 5 − β ) .
Proof.
Note that for 1 ≤ i ≤ m , λ i > 0 .
By (92),
[Equation]
Hence, ˆ B
[Equation]
By (95),
[Equation]
where the last inequality uses ˆ B (0)0 = 0 .
Lemma K.35 (General formula for P ∥
ˆ B ( s ) t ) .
For m < i ≤ d , ˆ B ( s ) t,i,j = ˜ O ( η 1 . 5 − β ) .
Proof.
Note that λ i = 0 for m < i ≤ d .
By (92) and (95),
[Equation]
Therefore,
[Equation]
Having obtained the expressions for ˆ B ( s ) t , ˆ A ( s ) t and ˆ A ( s ) avg , we now provide explicit expressions for the first and second moments of the change of manifold projection every round in the following two lemmas.
Lemma K.36.
The expectation of the change of manifold projection every round is
[Equation]
where R 0 :
= ⌈ 10 λ m α log 1 η ⌉ .
Proof.
We first compute E [ ˆ ϕ ( s +1)
− ˆ ϕ
( s ) ] .
By (72), we only need to compute P ∥
ˆ q ( s ) H by relating it to these matrices.
Multiplying both sides of (79) by P ∥ gives
[Equation]
Similarly, according to (85), we have
[Equation]
Combining (99) and (100) yields
[Equation]
( η 1 . 5 − β ) .
By Lemmas K.29, K.32 and K.30, for s ≤ R {+
+}
= ⌊ 10 λα log 1 η ⌋ , ˆ A ( s ) t =
˜ O ( η ) , ˆ A ( s ) avg =
˜ O ( η ) and ˆ B ( s ) t =
˜ O ( η ) .
Therefore, E [ ˆ ϕ ( s +1) − ˆ ϕ ( s ) ]
=
˜ O ( η ) .
For s > R 0 , ˆ A ( s − 1) avg = ˆ A ( s )
[Equation]
˜ O [Equation]
η 1 . 5 − 0 .
5 β ) .
Substituting (101) into (72) gives
[Equation]
Below we compute T 1 and T 2 for s > R 0 respectively.
By Lemma K.3,
[Equation]
By Lemma K.4,
[Equation]
Therefore, for s > R 0 ,
[Equation]
where we apply Lemma K.32.
Similarly, for s > R 0 ,
[Equation]
where we apply Lemma K.35.
Hence,
[Equation]
We move on to show that
[Equation]
Similar to the way we compute ˆ A ( s ) t , ˆ A ( s ) avg and ˆ B ( s ) t , we compute T 2 by splitting T 3 into four matrices and then substituting them into the linear operator − η P ∥ ∇ 3 L ( ˆ ϕ (0) )
[ · ] one by one.
First, we show that
[Equation]
where ψ ( · ) is interpreted as an elementwise matrix function here.
By Lemmas K.29 and K.34, for 1 ≤ i ≤ m , 1 ≤ j ≤ m and s > R 0 ,
[Equation]
Therefore,
[Equation]
Then we simplify T 4 .
Notice that
[Equation]
Therefore,
T [Equation] =
[Equation]
+ O
[Equation]
η ) .
Substituting T 4 back into the expression for (cid:80) H − 1 t =
ˆ A ( s ) t,i,j gives
H − 1 (cid:88) t
[Equation]
Combining the elementwise results
[Equation]
we obtain the following matrix form expression:
[Equation]
By Lemma K.4, we have (104).
Secondly, we show that for s > R 0 , [Equation]
[Equation]
where ψ ( · ) is interpreted as an elementwise matrix function here.
By symmetry of ˆ A ( s ) t ’s and ∇ 3 L ( [Equation] ϕ [Equation]
[Equation]
Therefore
[Equation]
we only have to evaluate
[Equation]
To compute the elements of (cid:80) H − 1 t =
P ⊥ ( ˆ A ( s ) t
+ ˆ B ( s ) t ) P ∥
[Equation]
we combine Lemmas K.30 and K.33 to obtain that for 1 ≤ i ≤ m and m < j ≤ d ,
[Equation]
[Equation]
and
[Equation]
Therefore, the matrix form of (cid:80) H − 1 t =
P ⊥ ( ˆ A ( s ) t
+ ˆ B ( s ) t ) P ∥ is
H − 1 (cid:88) t =
[Equation]
where ψ ( · ) is interpreted as an elementwise matrix function here.
Furthermore, by Lemma K.35, (cid:80) H − 1 t =
ˆ B ( s ) t =
˜ O ( η 0 .
5 − β ) .
Applying Lemma K.3, we have (105).
Finally, directly applying
Lemma K.5, we have
[Equation]
[Equation] Notice that ψ ( Σ 0 , ∥ ) = 0 where ψ ( · ) operates on each element.
Combining (104), (105) and (106), we obtain (103).
By (102) and (103), we have (98).
Lemma K.37.
The second moment of the change of manifold projection every round is
[Equation]
where R 0 :
= ⌈ 10 λ m α log 1 η ⌉ .
Proof.
Directly apply Lemma K.32 and Lemma K.27 and we have the lemma.
With Lemmas K.36 and K.37, we are ready to prove Theorem K.3.
Proof of Theorem K.3.
We first derive E [∆ ˆ ϕ ( R grp ) ] .
Recall that R grp =
⌊ 1 αη
[Equation]
where 0 < β < 0 . 5 .
By Lemma K.36,
[Equation]
Then we compute E [∆ ˆ ϕ ( R grp )
∆ ˆ ϕ ( R grp ) ⊤ ] .
[Equation]
where the last inequality uses E [( ˆ ϕ ( s +1) − ˆ ϕ ( s ) ) E [(
[Equation] ϕ ( s ′ +1) − ˆ ϕ ( s ′ ) )
⊤ ] =
˜ O ( η 2 ) .
K. P ROOF OF W EAK A PPROXIMATION
We are now in a position to utilize the estimate of moments obtained in previous subsections to prove the closeness of the sequence { ϕ ( s ) }
⌊ T/ ( Hη 2 ) ⌋ s = and the SDE solution { ζ : t ∈ [0 , T ] } in the sense of weak approximation.
Recall the SDE that we expect the manifold projection { Φ(¯ θ ( s ) ) }
⌊ T/ ( Hη 2 )
⌋ s
= to track:
[Equation]
According to Lemma K.3 and Lemma K.4, the drift term in total can be written as the following form:
[Equation]
Then by definition of P ζ , (107) is equivalent to the following SDE:
[Equation]
[Equation] Therefore, we only have to show that ϕ ( s ) closely tracks { ζ ( t ) } satisfying Equation (108).
By
Lemma K.11, there exists an ϵ 3 neighborhood of Γ , Γ ϵ 3 , where Φ( · ) is C ∞ -smooth.
Due to compactness of Γ , Γ ϵ 3 is bounded and the mappings ∂ 2 Φ( · ) , ∂ Φ( · ) , Σ 1 / 2 ( · ) , Σ ( · ) and Ψ ( · ) are all Lipschitz in Γ ϵ 3 .
By Kirszbraun theorem, both the drift and diffusion term of (108) can be extended as Lipschitz functions on R d .
Therefore, the solution to the extended SDE exists and is unique.
We further show that the solution, if initialized as a point on Γ , always stays on the manifold almost surely.
As a preparation, we first show that Γ has no boundary.
Lemma K.38.
Under Assumptions 3.1 to 3.3, Γ has no boundary.
Proof.
We prove by contradiction.
If Γ has boundary ∂ Γ , WLOG, for a point p ∈ ∂ Γ , let the
Hessian at p be diagonal with the form ∇ 2 L ( p ) =
diag( λ 1 , · · · , λ d ) where λ i > 0 for 1 ≤ i ≤ m and λ i = 0 for m < i ≤ d .
Denote by x i : j :=
( x i , x i +1 , · · · , x j ) ( i ≤ j ) the ( j − i + 1) -dimensional
vector formed by the i -th to j -th coordinates of x .
Since ∂ ( ∇L ( p ))
∂ p 1: m = diag( λ 1 , · · · , λ m ) is invertible, by the implicit function theorem, there exists an open neighborhood V of p m +1:
d such that ∇L ( v ) = 0 , ∀ v ∈ V .
Then,
L ( v ) =
L ( p ) =
min θ ∈ U L ( θ ) and hence V ⊂ Γ , which contradicts with p ∈ ∂ Γ .
Therefore, Γ is a closed manifold (i.e., compact and without boundary).
Then we have the following lemma stating that Γ is invariant for (108).
Lemma K.39.
Let ζ ( t ) be the solution to (108) with ζ (0) ∈ Γ , then ζ ( t ) ∈ Γ for all t ≥ 0 .
In other words, Γ is invariant for (108) .
Proof.
According to Filipovi´c (2000) and Du & Duan (2007), for a closed manifold M to be viable for the SDE d X ( t )
=
F ( X ( t ))
d t + B
( X ( t ))
d W t where F : R d → R d and B : R d → R d are locally Lipschitz, we only have to verify the following Nagumo type consistency condition:
[Equation]
where D[ · ] is the Jacobian operator and B j ( x ) denotes the j -th column of B ( x ) .
In our context, since for ϕ ∈ Γ , ∂ Φ( ϕ ) is a projection matrix onto T ϕ (Γ) , each column of ∂ Φ( ϕ ) Σ 1 / 2 ( ϕ ) belongs to T ϕ (Γ) , verifying the second condition.
Denote by P ⊥ ( ϕ ) :
= I d − ∂ Φ( ϕ )
the projection onto the normal space of Γ at ϕ .
To verify the first condition, it suffices to show that
P ⊥ ( ϕ ) µ ( ϕ ) = 0 .
We evaluate (cid:80) j P ⊥ ( ϕ )D
[ B j ( ϕ )]
B j ( ϕ ) as follows.
[Equation]
where the last inequality uses Lemma K.3.
Again applying Lemma K.3, we have
[Equation]
Combining (109) and (110), we can verify the first condition.
In order to establish Theorem 3.2, it suffices to prove the following theorem, which captures the closeness of ϕ ( s ) and ζ ( t ) every R grp rounds.
Theorem K.4.
If ∥ ¯ θ (0) − ϕ (0) ∥ 2 =
O ( (cid:113) η log 1 η ) and ζ (0) =
ϕ (0) ∈ Γ , then for R grp =
⌊ 1 αη 0 .
75 ⌋ every test function g ∈ C 3 ,
[Equation]
where C g > 0 is a constant independent of η but can depend on g ( · ) and b > 0 is a constant independent of η and g ( · ) .
K.10. P RELIMINARIES AND ADDITIONAL NOTATIONS
We first introduce a general formulation for stochastic gradient algorithms (SGAs) and then specify the components of this formulation in our context.
Consider the following SGA:
[Equation]
where x n ∈ R
d is the parameter, η e is the learning rate, h ( · , · ) is the update which depends on x n and a random vector ξ n sampled from some distribution Ξ( x n ) .
Also, consider the following
Stochastic Differential Equation (SDE).
[Equation]
where b ( · ) : R d → R d is the drift function and σ ( · ) : R d × d → R d × d is the diffusion matrix.
Denote by P X ( x , s, t ) the distribution of X ( t ) with the initial condition X ( s ) = x .Define ˜ ∆ ( x , n ) :
= X ( n +1)
η e − x , where X ( n +1) η e ∼ P X ( x , nη e , ( n + 1) η e ) , which characterizes the update in one step.
In our context, we view the change of manifold projection over R grp :=
[Equation] [Equation]
rounds as one “giant step".
Hence the ϕ ( nR grp ) corresponds to the discrete time random variable x n corresponds to and ζ ( t ) corresponds to the continuous time random variable X t .
According to
Theorem K.2, we set
[Equation]
Due to compactness of Γ , b ( · ) and σ ( · ) are Lipschitz on Γ .
As for the update in one step, ˜ ∆ ( · , · ) is defined in our context as:
[Equation]
where ζ ( n +1) η e ∼ P ζ ( ϕ , nη e , ( n + 1) η e ) and ϕ ∈ Γ .
For convenience, we further define
[Equation]
We use C g,i to denote constants that can depend on the test function g and independent of η e .
The following lemma relates the moments of ˜ ∆ ( ϕ , n ) to b ( ϕ ) and σ ( ϕ ) .
Lemma K.40.
There exists a positive constant C 0 independent of η e and g such that for all ϕ ∈ Γ ,
[Equation]
The lemma below states that the expectation of the test function is smooth with respect to the initial value.
Proof.
Noticing that (i) the solution to (108) always stays on Γ almost surely if its initial value ζ (0) belongs to Γ , (ii) b ( · ) and σ ( · ) are C ∞ and (iii) Γ is compact, we can directly apply Lemma B.3 in
Malladi et al.
and Lemma 26 in Li et al.
(2019a) to obtain the above lemma.
The following lemma states that the expectation of g ( ζ ( t )) for g ∈ C 3 is smooth with respect to the initial value of the SDE solution.
Lemma K.41.
Let s ∈ [0 , T ] , ϕ ∈ Γ and g ∈ C 3 .
For t ∈ [ s, T ] , define
[Equation]
Then u ( · , s, t ) ∈ C 3 uniformly in s, t .
Proof.
A slight modification of Lemma B.4 in Malladi et al.
(2022) will give the above lemma.
K.10. P ROOF OF THE APPROXIMATION IN OUR CONTEXT
For β ∈ (0 , 0 . 5) , define γ 1 := 1 . 5 − 2 β 1 − β , γ 2 :=
1 1 − β , and then 1 < γ 1 < 1 . 5 , 1 <
γ 2 < 2 .
We introduce the following lemma which serves as a key step to control the approximation error.
Specifically, this lemma bounds the difference in one step change between the discrete process and the continuous one as well as the product of higher orders.
Lemma K.42.
If ∥ ¯ θ (0) − ϕ (0) ∥ 2 =
O ( (cid:113) η log 1 η ) , then there exist positive constants C 1 and b independent of η e and g such that for all 0 ≤ n < ⌊ T/η e ⌋ , 1.
[Equation]
E (cid:34)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) 6 (cid:89)
[Equation]
=
[Equation]
[Equation]
s (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)
[Equation]
E (cid:34)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) 6 (cid:89)
[Equation]
[Equation]
Proof.
According to Appendix K.7, we have
[Equation]
Since γ 1 < 1 . 5 and γ 2 <
[Equation]
we can utilize Theorem K.3 and conclude that there exist positive constants C 2 and b independent of η e and g such that
[Equation]
Combining (111) - (113) with Lemma K.40 gives the above lemma.
Lemma K.43.
For a test function g ∈ C 3 , let u l,n ( ϕ ) :
= u ( ϕ , lη e , nη e ) =
E ζ t ∼P ζ ( ϕ ,lη e ,nη e ) [ g ( ζ t )] .
If ∥ ¯ θ (0) − ϕ (0) ∥ 2 =
O ( (cid:113) η log 1 η ) , then for all 0 ≤ l ≤ n − 1 and 1 ≤ n ≤ ⌊ T/η e ⌋ ,
[Equation]
where C g, 1 is a positive constant independent of η and ˆ ϕ ( lR grp ) but can depend on g .
Proof.
By Lemma K.41, u l,n ( ϕ ) ∈ C 3 for all l and n .
That is, there exists K (
· ) ∈ G such that for all l, n , u l,n ( ϕ ) and its partial derivatives up to the third order are bounded by K ( ϕ ) .
By the law of total expectation and triangle inequality,
[Equation]
] (cid:12)(cid:12)(cid:12) (cid:124) (cid:123)(cid:122) (cid:125)
A+
η 100 E [ | u l +1 ,n ( ˆ ϕ ( lR grp ) + ∆ ( l ) ) | | ˆ ϕ ( lR grp ) , ¯ E ( lR grp )] (cid:124) (cid:123)(cid:122) (cid:125) A+
η 100 E [ | u l +1 ,n ( ˆ ϕ ( lR grp ) + ˜ ∆ ( l ) ) | | ˆ ϕ ( lR grp ) , ¯ E ( lR grp )] (cid:124) (cid:123)(cid:122) (cid:125) A.
We first bound A 2 and A 3 .
Since ˆ ϕ ( lR grp ) ∈ Γ , both ˆ ϕ ( lR grp ) + ∆ ( l ) and ˆ ϕ ( lR grp ) + ˜ ∆ ( l ) belong to Γ .
Due to compactness of Γ and smoothness of u l +1 ,n ( · ) on Γ , there exist a positive constant C g,such that A 2 + A 3 ≤ C g, 2 η 100 .
We proceed to bound A 1 .
Expanding u l +1 ,n ( · ) at ˆ ϕ ( lR grp ) and by triangle inequality,
[Equation]
where the remainders R and ˜ R are
[Equation]
] , for some θ
[Equation]
˜ θ ∈ (0 , 1) .
Since ˆ ϕ ( lR grp ) belongs to Γ which is compact
[Equation]
there exists a constant C g,such that for all 1 ≤ i, j ≤ d, 0 ≤ l ≤ n − 1 , 1 ≤ n ≤ ⌊ T/η e ⌋ ,
[Equation]
By Lemma K.42,
[Equation]
Now we bound the remainders.
By Cauchy-Schwartz inequality,
[Equation]
Since ˆ ϕ ( lR grp ) and ˆ ϕ ( lR grp ) + ∆ ( l ) both belong to Γ which is compact, there exists a constant C g,such that for all 1 ≤ i, j, p ≤ d , 0 ≤ l ≤ n − 1 and 1 ≤ n ≤ ⌊ T/η e ⌋ ,
[Equation]
Combining the above inequality with Lemma K.42, we have
[Equation]
Hence, for all 1 ≤ n ≤ ⌊ T/η e ⌋ , 0 ≤ l ≤ n − 1 ,
[Equation]
Similarly, we can show that there exists a constant C g, 5 such that for all 1 ≤ n ≤ ⌊ T/η e ⌋ , 0 ≤ l ≤ n − 1 ,
[Equation]
Combining the bounds on A 1 to A 3 , we have the lemma.
Finally, we prove Theorem K.4.
Proof.
For 0 ≤ l ≤ n , define the random variable ˆ ζ l,n which follows the distribution
P ζ ( ˆ ϕ ( lR grp ) , l, n ) conditioned on ˆ ϕ ( lR grp ) .
Therefore, P (ˆ ζ n,n = ˆ ϕ ( nR grp ) )
= 1 and ˆ ζ 0 ,n ∼ ζ nη e .
Denote by u ( ϕ , s, t ) :
=
E ζ t ∼P ζ ( ϕ ,s,t ) [ g ( ζ t )] and T l +1 ,n := u l +1 ,n ( ˆ ϕ ( lR grp ) + ∆ ( l ) , ( l +1) η e , nη e ) − u l
[Equation]
[Equation]
l
[Equation]
[Equation]
[Equation]
Noticing that E
[ T l +1 ,n | E ( nR grp )]
=
E [ E [ T l +1 ,n | ˆ ϕ ( lR grp ) , E ( lR grp )] | E ( nR grp )] , we can apply
Lemma K.43 and obtain that for all 0 ≤ n ≤ ⌊ T/η e ⌋ ,
[Equation]
Notice that η γ 1 e + η γ 2 e = η 0 .
5 − β + η β
and T
, C g, 1 are both constants that are independent of η e .
Let β = 0 .
and we have Theorem K.4.
Having established Theorem K.4, we are thus led to prove Theorem 3.2.
Proof of Theorem 3.2.
Denote by s cls = s
+ s
=
O (log 1 η ) , which is the time the global iterate ¯ θ ( s ) will reach within ˜ O
( η ) from Γ with high probability.
Define ˜ ζ ( t ) to be the solution to the limiting SDE (108) conditioned on E ( s cls )and ˜ ζ (0) =
ϕ ( s cls ) .
By Theorem K.4, we have
[Equation]
ϕ [Equation] nR
[Equation]
s
[Equation]
− g (˜ ζ
[Equation]
nη 0 .
[Equation]
| ϕ
[Equation]
s
[Equation]
E
[Equation]
s
[Equation]
] (cid:12)(cid:12)(cid:12) ≤ C g η
[Equation]
log 1 η ) b , where R grp =
⌊ 1 αη 0 .
Noticing that (i) g ∈ C 3 (ii) b , σ ∈ C ∞ and (iii) ζ ( t ) , ˜ ζ ( t ) ∈ Γ , t ∈ [0 , ∞ ) almost surely, we can conclude that given E ( s cls )
[Equation]
Then there exists positive constant b ′ independent of η and g , and C ′ g which is independent of η but can depend on g such that
[Equation]
We can view the random variable pairs { ( ϕ ( nR grp + s cls ) , ζ nη 0 .
+ s cls αη ) :
n = 0 , · · · , ⌊ T/η 0 .
75 ⌋} as reference points and then approximate the value of g ( ϕ ( s ) ) and g ( ζ ( sHη 2 )) with the value at the nearest reference points.
By Lemmas K.18 and K.23, for 0 ≤ r ≤ R grp and 0 ≤ s ≤ R tot − r ,
E [ ∥ ϕ ( s +
[Equation]
) − ϕ ( s ) ∥ 2 ] =
˜ O ( η 0 . 375 ) .
Since the values of ϕ ( s ) and ζ are restricted to a bounded set, g ( · ) is Lipschitz on that set.
Therefore, we have the theorem.
L D ERIVING THE S LOW SDE FOR L ABEL N OISE R EGULARIZATION
In this section, we formulate how label noise regularization works and provide a detailed derivation of the theoretical results in Appendix G.
Consider training a model for C -class classification on dataset D
= { ( x i , y i ) }
Ni =1 , where x i denotes the input and y i ∈
[ C ] denotes the label.
Denote by ∆ C − 1 + the ( C − 1) -open simplex.
Let f ( θ ; x ) ∈ ∆ C − 1 + be the model output on input x with parameter θ , whose j -th coordinate f j ( θ ; x ) stands for the probability of x belonging to class j .
Let ℓ ( θ ; x , y ) be the cross entropy loss given input x and label y , i.e, ℓ ( θ ; x , y )
=
− log f y ( θ ; x ) .
Adding label noise means replacing the true label y with a fresh noisy label ˆ y every time we access the sample.
Specifically, ˆ y is set as the true label y with probability 1 − p and as any other label with probability pC − 1 , where p is the fixed corruption probability.
The training loss is defined as
L ( θ ) =
1 N (cid:80) Ni
[Equation]
1 E [ ℓ ( θ ; x i , ˆ y i )] , where the expectation is taken over the stochasticity of ˆ y i .
Notice that given a sample ( x , y ) ,
[Equation]
By the property of cross-entropy loss, (114) attains its global minimum if and only if f j = pC − 1 , for all j ∈ [ C ] , j ̸ = y and f y = 1 − p .
Due to the large expressiveness of modern deep learning models, there typically exists a set S ∗ :
= { θ | f i ( θ ) =
E [ˆ y i ] , ∀ i ∈
[ N ] } such that all elements of S ∗ minimizes L ( θ ) .
Then, the manifold Γ is a subset of S ∗ .
The following lemma relates the noise covariance Σ ( θ ) :
= 1 N (cid:80) i ∈
[ N ] E [( ∇ ℓ ( θ ; x i , ˆ y i ) − ∇L ( θ )) ( ∇ ℓ ( θ ; x i , ˆ y i ) − ∇L ( θ ))
⊤ ] to the hessian ∇ 2 L ( θ ) for all θ ∈ S ∗ .
Lemma L.1.
If f ( θ ; x i , ˆ y i ) is C 2 -smooth on R d given any i ∈
[ N ] , ˆ y i ∈
[ C ] and S ∗ ̸ = ∅ , then for all θ ∈ S ∗ , Σ ( θ )
= ∇ 2 L ( θ ) .
Proof.
Since L ( · ) is C 2 -smooth, ∇L ( θ ) = 0 for all θ ∈ S ∗ .
To prove the above lemma, it suffices to show that ∀ i ∈
[ N ] , E [ ∇ ℓ ( θ ; x i , ˆ y i ) ∇ ℓ ( θ ; x i , ˆ y i ) ⊤ ] = ∇ 2 L ( θ ) .
W.L.O.G, let y =
and therefore for all θ ∈ S ∗ , f
[Equation]
x
[Equation]
= [Equation] [Equation] Additionally, let h ( x ) :=
− log( x ) , x ∈ R + .
The stochastic gradient ∇ ℓ ( θ ; x , ˆ y ) follows the distribution:
[Equation]
Then the covariance of the gradient noise is:
[Equation]
And the hessian is:
[Equation]
Since (cid:80) j ∈ [ C ] f i = 1 ,
[Equation]
Also, notice that h ′ ( x ) = − 1 x .
Therefore,
[Equation]
[Equation] Substituting (115) and (116) into the expression of T gives T = 0 , which simplifies ∇ 2 L ( θ ) as the following form:
[Equation]
Again notice that h ′′ ( x ) = h ′ ( x ) for all x ∈ R
+ .
Therefore, ∇ 2 L ( θ ) =
Σ ( θ ) .
With the property Σ ( θ ) = ∇ 2 L ( θ ) , we are ready to prove Theorem G.1.
Proof of Theorem G.1.
Recall the general form of the slow SDE:
[Equation]
[Equation] where Ψ is defined in Definition K.6.
Since for ζ ∈ Γ , Σ ( ζ ) = ∇ 2 L ( ζ ) , then ∂
[Equation]
Now we show that
[Equation]
Since ∇ 2 L ( ζ ) = Σ ( ζ ) , V ∇ 2 L ( ζ ) [ Σ ] = 12 I .
By Lemma K.4,
[Equation]
Finally, we show that
[Equation]
Define ˆ ψ ( x ) :
= xψ ( x )
=
e − x − 1 + x .
By definition of Ψ( ζ ) , when Σ ( ζ ) = ∇ 2 L ( ζ ) , Ψ( ζ )
=
ˆ ψ (2 ηH ∇ 2 L ( ζ )) , where ˆ ψ ( · ) is interpreted as a matrix function.
Since ψ (2 ηH ∇ 2 L ( ζ )) ∈ span { uu ⊤ | u ∈ T ⊥ ζ (Γ) } , by Lemma K.4,
[Equation]
By the chain rule, we have (120).
Combining (118),(119) and (120) gives the theorem.
M E XPERIMENTAL D ETAILS
In this section, we specify the experimental details that are omitted in the main text.
Our experiments are conducted on CIFAR-10 (Krizhevsky et al., 2009) and ImageNet Russakovsky et al.
Our code is available at https://github.com/hmgxr128/Local-SGD .
Our implementation of ResNet-56 (He et al., 2016) and VGG-16 (Simonyan & Zisserman, 2015) is based on the high-starred repository by Wei Yang
and we use the implementation of ResNet-50 from torchvision 0.3.1.
We run all CIFAR-10 experiments with B loc =
128 on 8 NVIDIA Tesla P100 GPUs while ImageNet experiments are run on 8 NVIDIA A5000 GPUS with B loc = 32 .
All ImageNet experiments are trained with ResNet-50.
We generally adopt the following training strategies.
We do not add any momentum unless otherwise stated.
We follow the suggestions by Jia et al.
and do not add weight decay to the bias and learnable parameters in the normalization layers.
For all models with BatchNorm layers, we go through 100 batches of data with batch size B loc to estimate the running mean and variance before evaluation.
Experiments on both datasets follow the standard data augmentation pipeline in He et al.
(2016) except the label noise experiments.
Additionally, we use FFCV (Leclerc et al., 2022) to accelerate data loading for ImageNet training.
Slightly different from the update rule of Local SGD in Section 1, we use sampling without replacement unless otherwise stated.
See Appendix C for implementation details and discussion.
M. P OST - LOCAL SGD E XPERIMENTS IN S ECTION
CIFAR-10 experiments.
We simulate 32 clients with B = 4096 .
We follow the linear scaling rule and linear learning rate warmup strategy suggested by Goyal et al.
We first run 250 epochs of
SGD with the learning rate gradually ramping up from 0 .
1 to 3 .
2 for the first 50 epochs.
Resuming from the model obtained at epoch 250 , we run Local SGD with η = 0 .
Note that we conduct grid search for the initial learning rate among { 0 . 005 , 0 . 01 , 0 . 05 , 0 . 1 , 0 . 15 , 0 . 2 } and choose the learning rate with which parallel SGD ( H = 1 ) achieves the best test accuracy.
We also make sure that the optimal learning rate resides in the middle of the set.
The weight decay λ is set as 5 × 10 − 4 .
As for the initialization scheme, we follow Lin et al.
(2020b) and Goyal et al.
Specifically, we use
Kaiming Normal (He et al., 2015) for the weights of convolutional layers and initialize the weights of fully-connected layers by a Gaussian distribution with mean zero and standard deviation 0 .
The weights for normalization layers are initialized as one.
All bias parameters are initialized as zero.
We report the mean and standard deviation over 5 runs.
ImageNet experiments.
We simulate 256 workers with B = 8192 .
We follow the linear scaling rule and linear learning rate warmup strategy suggested by Goyal et al.
We first runepochs of SGD where the learning rate linearly ramps up from 0 .
5 to 16 for the first 5 epochs and then decays by a factor of 0 . 1 at epoch 50 .
Resuming from epoch 100 , we run Local SGD with η = 0 .
Note that we conduct grid search for the initial learning rate among { 0 . 05 , 0 . 1 , 0 . 5 , 1 } and choose the learning rate with which parallel SGD ( H = 1 ) achieves the best test accuracy.
We also make sure that the optimal learning rate resides in the middle of the set.
The weight decay λ is set as 1 × 10 − 4 and we do not add any momentum.
The initialization scheme follows the implementation of torchvision 0.3.1.
We report the mean and standard deviation over 3 runs.
M. E XPERIMENTAL D ETAILS FOR F IGURES 2 AND
CIFAR-10 experiments.
We use ResNet-56 for all CIFAR-10 experiments in the two figures.
We simulate 32 workers with B = 4096 and set the weight decay as 5 × 10 − 4 .
For Figures 2(a) and 2(b), we set η = 0 .
32 , which is the same as the learning rate after decay in Figure 1(a).
For Figure 2(a), we adopt the same initialization scheme introduced in the corresponding paragraph in Appendix M.1.
For Figures 2(b), 2(e) and 5(c), we use the model at epoch 250 in Figure 1(a) as the pre-trained model.
Additionally, we use a training budget of 250 epochs for Figure 2(e).
In Figure 5(e), we use
Local SGD with momentum 0 .
9 , where the momentum buffer is kept locally and never averaged.
We run SGD with momentum 0 .
9 for 150 epochs to obtain the pre-trained model, where the learning [Figure] rate ramps up from 0 .
05 to 1 .
6 linearly in the first 150 epochs.
Note that we conduct grid search for the initial learning rate among { 0 . 01 , 0 . 05 , 0 . 1 , 0 . 15 , 0 . 2 } and choose the learning rate with which parallel SGD ( H = 1 ) achieves the highest test accuracy.
We also make sure that the optimal learning rate resides in the middle of the set.
Resuming from epoch 150 , we run Local SGD H =(i.e., SGD) and 24 with η = 0 .
16 and decay η by 0 .
1 at epoch 226 .
For Local SGD H = 900 , we resume from the model at epoch 226 of H = 24 with η = 0 .
We report the mean and standard deviation over 3 runs for Figures 2(a), 2(b) and 5(c), and over 5 runs for Figure 2(e).
ImageNet experiments.
We simulate 256 clients with B = 8192 and set the weight decay as 1 × 10 − 4 .
In Figure 2(d) , both Local SGD and SGD start from the same random initialization.
We warm up the learning rate from 0 .
1 to 3 .
2 in the first 5 epochs and decay the learning rate by a factor of 0 .
1 at epochs 50 and 100 .
For Figures 2(c), 2(f) and 5(d), we use the model at epochin Figure 1(b) as the pre-trained model.
In Figure 2(c), we set the learning rate as 0 .
16 , which is the same as the learning rate after epoch 100 in Figure 1(b).
Finally, in Figures 2(c), 2(f), 5(b) and 5(d), we report the mean and average over 3 runs.
M. D ETAILS FOR E XPERIMENTS IN F IGURE
For all experiments in Figure 6, we train a ResNet-56 model on CIFAR-10.
We report mean test accuracy over three runs and the shaded area reflects the standard deviation.
For Figure 6(a), we use the same setup as Figures 2(a) and 2(b) for training from random initialization and from a pre-trained model respectively except the learning rate.
For Figure 6(b), we resume from the model obtained at epoch 250 in Figure 1(a) and train for another 250 epochs.
For Figure 6(c), we follow the same procedure as Figure 1(a) except that we use sampling with replacement.
We also ensure that the total numbers of iterations in Figures 1(a) and 6(c) are the same.
M. D ETAILS FOR E XPERIMENTS ON THE E FFECT OF THE D IFFUSION T ERM
CIFAR-10 experiments.
The model we use is ResNet-56.
For Figure 3(a), we first run SGD with batch size 128 and learning rate η = 0 .
5 for 250 epochs to obtain the pre-trained model.
The initialization scheme is the same as the corresponding paragraph in Appendix M.1.
Resuming from epoch 250 with η = 0 .
05 , we run Local SGD with K = 16 until epoch 6000 and run all other setups for the same number of iterations.
We report the mean and standard deviation over 3 runs.
ImageNet experiments.
For Figures 3(b) and 4(b), we start from the model obtained at epoch 100 in Figure 1(b).
In Figure 3(b), we run Local SGD with K = 256 for another 150 epochs with η = 0 .
We run all other setups for the same number of iterations with the same learning rate.
M. D ETAILS FOR E XPERIMENTS ON THE E FFECT OF G LOBAL B ATCH S IZE
CIFAR-10 experiments.
The model we use is ResNet-56.
We resume from the model obtained in
Figure 1(a) at epoch 250 and train for another 250 epochs.
The local batch size for all runs is B loc = 128 . We first make grid search of η for SGD with K = 16 among { 0 . 04 , 0 . and find that the final test accuracy varies little across different learning rates (within 0 . Then we choose η = 0 .
For the green curve in Figure 4(a), we search for the optimal H for K = 16 and keep α fixed when scaling η with K .
For the red curve in Figure 4(a), we search for the optimal H for each K among { 6 , 12 , 60 , 120 , 300 , 750 , 1500 , 3000 , 6000 , 12000 , 24000 } and also make sure that H does not exceed the total number of iterations for 250 epochs.
The learning curves for constant and optimal α are visualized in Figures 10(a) and 10(c) respectively.
We report the mean and standard deviation over three runs.
ImageNet experiments. We start from the model obtained at epoch 100 in Figure 1(b) and train for another 50 epochs. The local batch size for all runs is B loc = 32 . We first make grid search among { 0 . 032 , 0 . 064 , 0 .
32 } for H = 1 to achieve the best test accuracy and choose H = 0 .
For the orange curve in Figure 4(b), we search H among { 2 , 4 , 6 , 13 , 26 , 52 , 78 , 156 } for K = 256 to achieve the optimal test accuracy and the keep α constant as we scale η with K .
To obtain the optimal
H for each K , we search among { 6240 , 7800 , 10400 , 12480 , 15600 , 20800 , 24960 , 31200 } for K = 16 , { 1600 , 3120 , 4160 , 5200 , 6240 , 7800 , 10400 } for K = 32 , { 312 , 480 , 520 , 624 , 800 , 975 , 1040 , 1248 , 1560 , 1950 } for K = 64 , and { 1 , 2 , 3 , 6 , 13 } for K = 512 . The learning curves for constant and optimal α are visualized in Figures 10(b) and 10(d) respectively. We report the mean and standard deviation over three runs. M. D ETAILS FOR E XPERIMENTS ON L ABEL N OISE R EGULARIZATION
For all label noise experiments, we do not use data augmentation, use sampling with replacement, and set the corruption probability as 0 . 1 .
We simulate 32 workers with B = 4096 in Figure 7 and 4 workers with B = 512 in Figure 8.
We use ResNet-56 with GroupNorm with the number of groups 8 for Figure 7(a) and VGG-16 without normalization for Figures 7(b) and 8.
Below we list the training details for ResNet-56 and VGG-16 respectively.
ResNet-56.
As for the model architecture, we replace the batch normalization layer in Yang’s implementation with group normalization such that the training loss is independent of the sampling order.
We also use Swish activation (Ramachandran et al., 2017) in place of ReLU to ensure the smoothness of the loss function.
We generate the pre-trained model by running label noise SGD with corruption probability p = 0 .
1 for 500 epochs ( 6 , 000 iterations).
We initialize the model by the same strategy introduced in the first paragraph of Appendix M.1.
Applying the linear warmup scheme proposed by Goyal et al.
(2017), we gradually ramp up the learning rate η from 0 .
1 to 3 .
2 for the first 20 epochs and multiply the learning rate by 0 .
1 at epoch 250 .
All subsequent experiments in Figure 7(a) (a) use learning rate 0 .
The weight decay λ is set as 5 × 10 − 4 .
Note that adding weight decay in the presence of normalization accelerates the limiting dynamics and will not affect the implicit regularization on the original loss function (Li et al., 2022).
VGG-16.
We follow Yang’s implementation of the model architecture except that we replace maximum pooling with average pooling and use Swish activation (Ramachandran et al., 2017) to make the training loss smooth.
We initialize all weight parameters by Kaiming Normal and all bias parameters as zero.
The pre-trained model is obtained by running label noise SGD with total batch size 4096 and corruption probability p = 0 .
1 for 6000 iterations.
We use a linear learning rate warmup from 0 .
1 to 0 .
5 in the first 500 iterations.
All runs in Figures 7(b) and 8 resume from the model obtained by SGD with label noise.
In Figure 7(b), we use learning rate η = 0 . 1 .
In Figure 8, we set η = 0 .
005 for H = 97 , 000 and η = 0 .
01 for SGD ( H = 1 ).
The weight decay λ is set as zero.