VASSO: Variance Suppression for Sharpness-Aware Minimization Thanks: B. Li is with Department of Computer Science at ETH Zürich, 8092 Zürich, Switzerland. Email: bingcong.li@inf.ethz.ch . Y. Zhang and G. B. Giannakis are with the Department of Electrical and Computer Engineering, University of Minnesota, Minneapolis, MN 55455, USA. Emails: {zhan7453, georgios}@umn.edu. Most of this work was performed when B. Li was at the Univ. of Minnesota. Bingcong Li, Yilang Zhang, Georgios B. Giannakis Abstract Sharpness-aware minimization (SAM) has well-documented merits in enhancing generalization of deep neural network models. Accounting for sharpness in the loss function geometry, where neighborhoods of ‘flat minima’ heighten generalization ability, SAM seeks ‘flat valleys’ by minimizing the maximum loss provoked by an adversarial perturbation within the neighborhood. Although critical to account for sharpness of the loss function, in practice SAM suffers from ‘ over-friendly adversaries,’ which can curtail the outmost level of generalization. To avoid such ‘friendliness,’ the present contribution fosters stabilization of adversaries through variance suppression (VASSO). VASSO offers a general approach to provably stabilize adversaries. In particular, when integrating VASSO with SAM, improved generalizability is numerically validated on extensive vision and language tasks. Once applied on top of a computationally efficient SAM variant, VASSO offers a desirable generalization-computation tradeoff. I Introduction Deep neural network (DNN) models have advanced the notion of “learning from data,” and they have markedly improved performance across various application tasks in vision and language [ 1 , 2 ] . Unfortunately, their overparametrization renders them prone to overfit on training data [ 3 ] , which hampers their generalization ability on unseen data. This shortcoming has been underscored in practice, and points to a gap in evaluating performance of training. Common approaches to improving generalizability of DNNs include regularization and data augmentation [ 4 ] . While it is a default choice to integrate regularization such as weight decay and dropout when training in practice, these methods are often insufficient for DNNs, especially when dealing with complicated network architectures [ 5 ] . Another line of efforts resorts to suitable optimization schemes, attempting to find a generalizable local minimum. For example, stochastic gradient descent (SGD) outperforms Adam on certain overparameterized problems owing to its convergence to maximum margin solutions [ 6 ] . Decoupling weight decay from Adam has been empirically seen to facilitate generalizability for many language tasks [ 7 ] . Unfortunately, the underlying mechanism promoting generalization remains elusive, and whether the generalization merits carry over to other intricate learning problems calls for extra theoretical investigations. Our main focus is sharpness-aware minimization (SAM) – a compelling optimization approach that facilitates state-of-the-art generalizability by exploiting areas of sharpness and flatness in the loss landscape [ 8 , 5 ] . A high-level interpretation of sharpness is how markedly the loss fluctuates in the neighboring parameter space. Large-scale empirical studies have shown that sharpness-based measures highly correlate with generalization [ 9 ] , and flat minima improve generalizability [ 10 , 8 , 5 ] . This can be conceptually understood using Fig. 1 , where the test loss only slightly increases in flat valleys under distributional shifts. A number of approaches have embraced sharpness to boost generalization. The work in [ 10 ] suggests that the batchsize of SGD impresses solution flatness. Entropy SGD leverages the local entropy in search of a flat valley [ 11 ] . Different from prior works, SAM induces flatness by explicitly minimizing the adversarially perturbed loss, defined as the maximum loss of a neighboring area. Through such a perturbed loss, SAM has boosted generalization in various vision and language tasks [ 5 , 12 ] . The mechanism behind SAM’s success has been theoretically investigated based on arguments of implicit regularization; see e.g., [ 13 , 14 , 15 ] . The notion of a perturbing adversary, or the adversary for short, is central to SAM’s improved generalization because it effectively measures sharpness through the loss difference with the original model [ 8 , 16 , 17 ] . In practice however, accounting for sharpness is undermined by what can be viewed as a friendly adversary . Confined by the stochastic linearization for computational efficiency, SAM’s adversary only captures the sharpness for a particular minibatch, and can become a friend on other data samples. Because ‘global sharpness’ is not approached accurately, the friendly adversary challenges SAM from attaining its utmost generalizability. To overcome this challenge, the present work advocates va riance s uppre s si o n (VASSO 1 1 1 VASSO coincides with the Greek nickname for Vasiliki. ) to alleviate ‘friendliness’ by stabilizing adversaries. VASSO is a general approach that can be seamlessly integrated with SAM variants to theoretically and numerically demonstrate gain in generalization. This work focuses particularly on two of the most valuable use cases. The first one is to integrate VASSO with vanilla SAM. The resultant algorithm, also referred to as VASSO, has a provable stabilized adversary that showcases favorable numerical performance over SAM for a wide spectrum of deep learning tasks. The second application of VASSO manifests in trading off generalization for computational efficiency. At one extreme, the drastically improved generalization of SAM incurs the cost of two backpropagations per iteration. The opposite extreme is SGD, where low computational cost comes at the price of a moderate level of generalization. Recent research has enriched this tradeoff by developing lightweight SAM variants. For instance, LookSAM computes the extra stochastic gradient once every few iterations, and reuses it in a fine-grained manner to approximate the additional gradient [ 18 ] . ESAM obtains its adversarial vector based on stochastic weight perturbation, and further saves computation by selecting a subset of the minibatch data for gradient computation [ 19 ] . The computational burden of SAM can also be lowered by switching between SAM and SGD following a predesigned schedule [ 20 ] , or adaptively as in [ 21 ] . SAF connects SAM with distillation to reduce computational complexity [ 22 ] . However, most of these works reuse the stochastic linearization of SAM, which reduces their ability to cope with friendly adversaries, and prevents them from attaining a desirable generalization-computation tradeoff. To this end, VASSO is combined here with a computationally efficient SAM variant [ 20 ] . For a prescribed computational budget, the resultant algorithm termed efficient VASSO (eVASSO), leads to markedly improved generalization. Fig. 1: Intuition on why flat minima boost generalization. Solid (dotted) curve denotes training (test) loss. The red bar indicates the gap between training and test loss. Clearly, this gap is smaller on flat valleys. All in all, our contributions can be summarized as follows. ❖ A friendly adversary is identified as an obstacle challenging generalizability of SAM. Experiments demonstrate that it can even nullify the generalization benefits. ❖ Variance suppression is developed to handle this issue by stabilizing adversaries. The theoretically guaranteed stability promotes refined global sharpness estimates, and thus alleviates the impact of friendly adversaries. The merits of VASSO are demonstrated also experimentally on tasks such as image classification, domain generalization, label noise, and neural machine translation. ❖ VASSO improves the generalization-computation tradeoff when integrated with computationally efficient SAM variants such as eSAM. For the same generalization level, the resultant approach, eVASSO, saves 57\% and 70\% computational overhead relative to eSAM and SAM, respectively. This work broadens and innovates over [ 23 ] in three directions: (i) a computationally efficient algorithm is developed and analyzed to desirably trade off generalization for computation in sharpness-aware minimization; (ii) numerical tests incorporate more challenging tasks such as domain generalization; and (iii) further elaboration and insights are included to improve intuition. Notation . Bold lowercase (capital) letters denote column vectors (matrices); \|\mathbf{x}\| stands for \ell_{2} norm of vector \mathbf{x} ; and \langle\mathbf{x},\mathbf{y}\rangle is the inner product of \mathbf{x} and \mathbf{y} . \mathbb{S}_{\rho}(\mathbf{x}) denotes the surface of a ball with radius \rho centered at \mathbf{x} , i.e., \mathbb{S}_{\rho}(\mathbf{x}):=\{\mathbf{x}+\rho\mathbf{u}~|~\|\mathbf{u}\|=1\} . II The known, the good, and the challenge This section starts with a recap of SAM (i.e., the known), followed by refined analyses and SAM’s convergence upshot (i.e., the good). Next, the notion of a friendly adversary that confines generalizability is elaborated and illustrated numerically. II-A The known Aiming at a minimum with a flat basin, SAM enforces small loss around the entire neighborhood in the parameter space [ 8 ] . This idea is formulated as a minimax problem \displaystyle\min_{\mathbf{x}}\max_{\|\bm{\epsilon}\|\leq\rho}f\big(\mathbf{x}+\bm{\epsilon}\big) (1) with \rho denoting the radius of the considered neighborhood, and f(\mathbf{x}):=\mathbb{E}_{\cal B}[f_{\cal B}(\mathbf{x})] the possibly nonconvex objective, where \mathbf{x} is the neural network parameter, and {\cal B} is a random minibatch of data. Formulation ( 1 ) captures the implicit sharpness measure \max_{\|\bm{\epsilon}\|\leq\rho}f\big(\mathbf{x}+\bm{\epsilon}\big)-f(\mathbf{x}) , which effectively drives the optimization trajectory towards the desirable flat valley [ 17 ] . The inner maximization in ( 1 ) has a natural interpretation as finding an adversarial model for \mathbf{x}_{t} , where t denotes the iteration index. Critical as it is, such an adversary prompts stochastic linearization to avoid full gradient computation, that is, \displaystyle\bm{\epsilon}_{t} \displaystyle=\argmax_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t}+\bm{\epsilon})\stackrel{{\scriptstyle(a)}}{{\approx}}\argmax_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t})+\langle\nabla f(\mathbf{x}_{t}),\bm{\epsilon}\rangle \displaystyle\stackrel{{\scriptstyle(b)}}{{\approx}}\argmax_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t})+\langle\mathbf{g}_{t}(\mathbf{x}_{t}),\bm{\epsilon}\rangle (2) where linearization (a) relies on the first-order Taylor expansion of f(\mathbf{x}_{t}+\bm{\epsilon}) that is typically accurate when choosing \rho small. Consider next replacing \nabla f(\mathbf{x}_{t}) in (b) with a stochastic gradient \mathbf{g}_{t}(\mathbf{x}_{t}) on minibatch {\cal B}_{t} to reduce the computational burden of \nabla f(\mathbf{x}_{t}) . Catalyzed by the stochastic linearization in ( II-A ), it is possible to express SAM’s adversary in closed form as \displaystyle\textbf{SAM:}~~~~\bm{\epsilon}_{t}=\rho\frac{\mathbf{g}_{t}(\mathbf{x}_{t})}{\|\mathbf{g}_{t}(\mathbf{x}_{t})\|}. (3) SAM then adopts the adversarial stochastic gradient \mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t}) to update \mathbf{x}_{t} per SGD fashion. A step-by-step implementation is listed in Alg. 1 , where the means to find an adversary in lines 5 and 6 is presented in a generic form in order to unify the algorithmic framework with approaches in subsequent sections. Algorithm 1 Generic form of SAM 1: Initialize: \mathbf{x}_{0},\rho 2: for t=0,\dots,T-1 do 3: Sample a minibatch {\cal B}_{t} 4: Define stochastic gradient on {\cal B}_{t} as \mathbf{g}_{t}(\cdot) 5: Find \bm{\epsilon}_{t}\in\mathbb{S}_{\rho}(\mathbf{0}) via stochastic linearization; e.g., 6: // ( 5 ) for VASSO , or ( 3 ) for SAM 7: Calculate stochastic gradient \mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t}) 8: Update model via \mathbf{x}_{t+1}=\mathbf{x}_{t}-\eta\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t}) 9: end for 10: Return: \mathbf{x}_{T} II-B The good For an insightful understanding of SAM, this subsection focuses on Alg. 1 , and establishes convergence for the solver of ( 1 ). Assumptions to this end that are common for nonconvex stochastic optimization are listed next [ 24 , 25 , 26 , 16 ] . Assumption 1 (lower bounded loss) . Function f(\mathbf{x}) is bounded from below, that is, \exists~f^{*}>-\infty such that f(\mathbf{x})\geq f^{*},\forall\mathbf{x} . Assumption 2 (smoothness) . The stochastic gradient \mathbf{g}(\mathbf{x}) is L -Lipschitz, i.e., \|\mathbf{g}(\mathbf{x})-\mathbf{g}(\mathbf{y})\|\leq L\|\mathbf{x}-\mathbf{y}\|,\forall\mathbf{x},\mathbf{y} . Assumption 3 (bounded variance) . The stochastic gradient \mathbf{g}(\mathbf{x}) is unbiased with bounded variance, that is, \mathbb{E}[\mathbf{g}(\mathbf{x})|\mathbf{x}]=\nabla f(\mathbf{x}) and \mathbb{E}[\|\mathbf{g}(\mathbf{x})-\nabla f(\mathbf{x})\|^{2}|\mathbf{x}]\leq\sigma^{2} for some finite \sigma . Since \|\bm{\epsilon}_{t}\|=\rho holds for every t , the pertinent constraint in ( 1 ) is never violated; see lines 5 and 6 in Alg. 1 . Thus, SAM convergence relates to the behavior of the objective for which a tight result is derived next. Theorem 1 (SAM convergence) . If Assumptions 1 – 3 hold, \eta_{t}\equiv\eta=\frac{\eta_{0}}{\sqrt{T}}\leq\frac{2}{3L} , and \rho=\frac{\rho_{0}}{\sqrt{T}} , then with c_{0}=1-\frac{3L\eta}{2}\in(0,1) Alg. 1 guarantees that \displaystyle\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]={\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg)~~~~\text{and}~~~~ \displaystyle\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2}\big]={\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg). Within a constant factor SAM’s convergence rate is the same as that of SGD; see Appendix D for such a factor included in big \cal O . Our result avoids the need for a bounded gradient assumption present in prior analyses [ 26 , 16 ] . A message from Theorem 1 is that any adversary satisfying \bm{\epsilon}_{t}\in\mathbb{S}_{\rho}(\mathbf{0}) ensures converge. Because the surface \mathbb{S}_{\rho}(\mathbf{0}) is already a huge space, it challenges the plausible optimality of the adversary, and raises a natural question: Is it possible to find a more powerful adversary to enhance the generalization ability? II-C The challenge: friendly adversary Adversary to a minibatch can be a friend of other minibatches. SAM’s adversary can be ‘malicious’ for a minibatch {\cal B}_{t} used in iteration t , but not necessarily for other data, because it only safeguards f_{{\cal B}_{t}}(\mathbf{x}_{t}+\bm{\epsilon}_{t})-f_{{\cal B}_{t}}(\mathbf{x}_{t})\geq 0 for a small \rho . Given another minibatch data {\cal B} , it can be shown that f_{{\cal B}}(\mathbf{x}_{t}+\bm{\epsilon}_{t})-f_{{\cal B}}(\mathbf{x}_{t})\leq 0 , whenever the stochastic gradients do not align well, meaning \langle\mathbf{g}_{t}(\mathbf{x}_{t}),\mathbf{g}_{\cal B}(\mathbf{x}_{t})\rangle\leq 0 . Note that such misalignment is common because the variance is massive in large-scale training datasets. This issue will be referred to as friendly adversary , and it implies that the adversary vector \bm{\epsilon}_{t} cannot accurately depict the global sharpness of \mathbf{x}_{t} . The ‘friendly adversary’ also has a more involved interpretation, that is, \mathbf{g}_{t}(\mathbf{x}_{t}) falls outside the column space of Hessian at convergence; see [ 14 , Definition 4.3] for further elaboration. This misalignment of high-order derivatives undermines the inductive bias of SAM, thereby worsening generalization. (a) (b) (c) Fig. 2: (a) A friendly adversary diminishes the generalization ability of SAM; (b) m -sharpness may not directly correlate with variance since noisy gradient degrades generalization; and (c) m -sharpness may not hold universally. Note that test accuracies in (a) and (b) are normalized to SGD. (a) SNR =5 ​​(b) SNR =1 ​ (c) SNR =0.1 ​ (d) SNR =0.01 (e) SNR in practice Fig. 3: (a) - (d) SAM’s adversaries are spread across the sphere; (e) SNR is in [0.01,0.1] when training a ResNet-18 on CIFAR10, where the SNR is calculated at the first iteration of every epoch. To numerically visualize the catastrophic impact of the friendly adversary, we manually introduce one by replacing line 5 of Alg. 1 as \tilde{\bm{\epsilon}}_{t}=\rho\tilde{\mathbf{g}}_{t}(\mathbf{x}_{t})/\|\tilde{\mathbf{g}}_{t}(\mathbf{x}_{t})\| , where \tilde{\mathbf{g}}_{t} denotes the gradient on \tilde{\cal B}_{t} , a randomly sampled batch of the same size as {\cal B}_{t} . This modified approach is denoted as SAM-db, and its performance for i) ResNet-18 on CIFAR10; and, ii) ResNet-34 on CIFAR100 2 2 2 https://www.cs.toronto.edu/~kriz/cifar.html can be found in Fig. 2 (a). Note that the test accuracy is normalized relative to SGD for the ease of visualization. It is evident that the friendly adversary \tilde{\bm{\epsilon}}_{t} in SAM-db almost nullifies the generalization benefits entirely. Source of a friendly adversary. The major cause behind a friendly adversary is due to the gradient variance, which equivalently translates to the lack of stability in SAM’s stochastic linearization (2b) . An illustrative three-dimensional example is shown in Fig. 3 , where we plot the adversary \bm{\epsilon}_{t} obtained from different minibatch data. The minibatch gradient is simulated by adding Gaussian noise to the true gradient. When the signal to noise ratio (SNR) is similar to a practical scenario (ResNet-18 on CIFAR10 in Fig. 3 (e)), it can be seen in Fig. 3 (c) and (d) that the adversaries almost uniformly spread over the sphere, which strongly indicates how challenging is to evaluate sharpness. Friendly adversary under the lens of Frank Wolfe. An additional evidence in support of SAM’s friendly adversary resides in its link with stochastic Frank Wolfe (SFW), which also relies heavily on stochastic linearization [ 27 ] . The stability of SFW is known to be vulnerable, and its convergence cannot be guaranteed without a sufficiently large batchsize. Appendix A provides the means to obtain friendly adversaries in SAM, and demonstrates that this is tantamount to one-step SFW with a constant batchsize. This unveils possible instability of SAM’s stochastic linearization. II-D A closer look at friendly adversaries Gradient variance is a major driver behind SAM’s friendly adversary and unstable stochastic linearization. At first glance however, this seems to conflict with the empirical notion of m -sharpness, which asserts that the benefit of SAM is more pronounced when \bm{\epsilon}_{t} is found using subsampled {\cal B}_{t} of size m , meaning larger variance. Since m -sharpness hinges heavily on the loss curvature, it is unlikely to hold universally. For example, a transformer is trained on the IWSLT-14 dataset [ 28 ] , where the test performance (BLEU) decreases with smaller m even if \rho has been tuned carefully; see Fig. 2 (c). In principle, m -sharpness is not necessarily related to sharpness or generalization, as verified by the example given in [ 13 , Sec. 3] . Moreover, m -sharpness formulation can be ill-posed for a specific choice of m ; see Appendix B for further details. Even in the regime where m -sharpness is empirically observed (as with ResNet-18 on CIFAR10 and ResNet-34 on CIFAR100), we have confirmed experimentally that m -sharpness is not a consequence of gradient variance; thus, there is contradiction with the friendly adversary pursued in this work. Observation 1. Same variance, different generalization. Let m=128 and batchsize b=128 . Recall the SAM-db experiment in Fig. 2 (a). If m -sharpness were a consequence of gradient variance, it would be reasonable to expect that SAM-db has comparable performance to SAM simply because their batchzises (hence variance) for finding adversaries are the same. Unfortunately, SAM-db exhibits degraded accuracy. We further increase the variance of \tilde{\mathbf{g}}_{t}(\mathbf{x}_{t}) by setting m=64 . The resultant algorithm is denoted as SAM-db-m/2. It does not catch up with SAM and performs even worse than SAM-db. These experiments validate that variance/stability correlates with the friendly adversary rather than m -sharpness. Observation 2. Enlarged variance degrades generalization. We explicitly increase variance when finding the adversary by adding Gaussian noise \bm{\zeta} to \mathbf{g}_{t}(\mathbf{x}_{t}) , i.e., \hat{\bm{\epsilon}}_{t}=\rho\frac{\mathbf{g}_{t}(\mathbf{x}_{t})+\bm{\zeta}}{\|\mathbf{g}_{t}(\mathbf{x}_{t})+\bm{\zeta}\|} . After tuning for the best \rho to compensate the variance of \bm{\zeta} , the test performance is plotted in Fig. 2 (b). It can be seen that generalization merits clearly decrease with larger variance on both ResNet-18 and ResNet-34. This again illustrates that the plausible benefit of m -sharpness does not stem from increased variance. While understanding m -sharpness is beyond the scope of this work, Observations 1 and 2 jointly suggest that gradient variance correlates with friendly adversaries rather than m -sharpness. II-E The metric: characterization of a friendly adversary To characterize friendly adversaries analytically, it is convenient to start with necessary notation. Let the quality of a stochastic linearization at \mathbf{x}_{t} with slope \mathbf{v} be {\cal L}_{t}(\mathbf{v}):=\max_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t})+\langle\mathbf{v},\bm{\epsilon}\rangle . For example, {\cal L}_{t}\big(\mathbf{g}_{t}(\mathbf{x}_{t})\big) is the quality of SAM. Another critical case is {\cal L}_{t}\big(\nabla f(\mathbf{x}_{t})\big) . It is shown in [ 16 ] and (2 b ) that {\cal L}_{t}\big(\nabla f(\mathbf{x}_{t})\big)\approx\max_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t}+\bm{\epsilon}) when \rho is small. Moreover, {\cal L}_{t}\big(\nabla f(\mathbf{x}_{t})\big)-f(\mathbf{x}_{t}) is also an accurate approximation of sharpness. These observations safeguard {\cal L}_{t}(\nabla f(\mathbf{x}_{t})) as the anchor when analyzing the stability of stochastic linearization. Definition 1 ( \delta -stability) . A stochastic linearization with slope \mathbf{v} is said to be \delta -stable if its quality satisfies \mathbb{E}\big[|{\cal L}_{t}(\mathbf{v})-{\cal L}_{t}(\nabla f(\mathbf{x}_{t}))|\big]\leq\delta . Letting {\cal L}_{t}\big(\nabla f(\mathbf{x}_{t})\big)-f(\mathbf{x}_{t}) denote ‘sharpness,’ Definition 1 can be decomposed as \displaystyle{\cal L}_{t}(\mathbf{v}) \displaystyle-{\cal L}_{t}(\nabla f(\mathbf{x}_{t})) (4) \displaystyle=\underbrace{\Big({\cal L}_{t}(\mathbf{v})-f(\mathbf{x}_{t})\Big)}_{\text{estimated sharpness}}-\underbrace{\Big({\cal L}_{t}(\nabla f(\mathbf{x}_{t}))-f(\mathbf{x}_{t})\Big)}_{\text{sharpness}}. The last equation suggests that \delta -stability reflects how well sharpness is estimated using slope \mathbf{v} . Hence, a larger \delta implies a more friendly adversary, where the sharpness is approximated less accurately. Next, we will develop our novel approach to ensure improved \delta -stability over SAM. III Variance Suppression This section advocates variance suppression (VASSO) for SAM as a means of dealing with the friendly adversary. We start with the intuition behind VASSO, and then establish its improved \delta -stability over SAM. We also develop implementation aspects and possible extensions. III-A Design and stability analysis A straightforward attempt towards stability is to equip SAM’s stochastic linearization with variance-reduced gradients such as SVRG and SARAH [ 29 , 30 , 31 , 32 ] . However, the requirement to compute a full gradient every few iterations is infeasible, and hardly scales for tasks such as training DNNs. VASSO overcomes this computational burden through a refined stochastic linearization. For a prescribed \theta\in(0,1) , VASSO is as follows. VASSO: \displaystyle\mathbf{d}_{t}=(1-\theta)\mathbf{d}_{t-1}+\theta\mathbf{g}_{t}(\mathbf{x}_{t}) (5a) \displaystyle\bm{\epsilon}_{t}=\argmax_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t})+\langle\mathbf{d}_{t},\bm{\epsilon}\rangle=\rho\frac{\mathbf{d}_{t}}{\|\mathbf{d}_{t}\|}. (5b) Compared with ( II-A ) of SAM, the key difference is that VASSO relies on the slope \mathbf{d}_{t} in ( 5b ) to promote a more stable stochastic linearization. Slope \mathbf{d}_{t} is an exponentially moving average (EMA) of \{\mathbf{g}_{t}(\mathbf{x}_{t})\}_{t} that smooths changes across consecutive iterations. Noticing that \bm{\epsilon}_{t} and \mathbf{d}_{t} share the same direction, the relatively smoothed vectors \{\mathbf{d}_{t}\}_{t} thus ensure stability of \{\bm{\epsilon}_{t}\}_{t} in VASSO. Moreover, as \mathbf{d}_{t} processes information of different batches of data, the global sharpness can be captured in a principled manner to alleviate the friendly adversary challenge. VASSO can be readily integrated with SAM, as summarized in Alg. 1 . For convenience, the resultant algorithm is also referred to as VASSO. To theoretically characterize the effectiveness of VASSO, our first result considers \mathbf{d}_{t} as a qualified strategy to estimate \nabla f(\mathbf{x}_{t}) , and delves into its mean-square error (MSE). Theorem 2 (Variance suppression) . Under Assumptions 1 – 3 , if i) \bm{\epsilon}_{t} is obtained by ( 5 ) with \theta\in(0,1) ; and, ii) \eta_{t} and \rho are selected as in Theorem 1 , then VASSO guarantees that the MSE of \mathbf{d}_{t} is bounded by \displaystyle\mathbb{E}\big[\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2}\big]\leq\theta\sigma^{2}+{\cal O}\bigg(\frac{(1-\theta)^{2}\sigma^{2}}{\theta^{2}\sqrt{T}}\bigg). (6) Because SAM’s gradient estimate has a looser bound on MSE (or variance), that is, \mathbb{E}[\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\|^{2}]\leq\sigma^{2} , the shrunk MSE in Theorem 2 justifies the notion of variance suppression. If we further assume that the gradient is also bounded, meaning \mathbb{E}[\|\nabla f(\mathbf{x}_{t})\|^{2}]\leq G , it is possible to further tighten the dependence on T in Theorem 2 as follows \displaystyle\mathbb{E}\big[\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2}\big]\leq\theta\sigma^{2}+{\cal O}\bigg(\frac{(1-\theta)^{2}G}{\theta^{2}T}\bigg). The proof follows directly by tightening inequality ( 12 ) with the bounded gradient assumption. Other theorems in this paper also have an improved T dependence given this extra assumption, but we do not state them explicitly to avoid repetition. Next, we quantify the claimed stability with the suppressed variance. Theorem 3 (Stabilizing adversaries with VASSO.) . Under Assumptions 1 – 3 , and the hyperparameter choices of Theorem 2 , the stochastic linearization is \rho\big[\sqrt{\theta}\sigma+{\cal O}(\frac{\sigma}{\theta T^{1/4}})\big] -stable for VASSO, compared with \rho\sigma -stability of SAM. Theorem 3 contends that VASSO alleviates the friendly adversary challenge by promoting stability. Qualitatively, VASSO is roughly \sqrt{\theta}\in(0,1) times more stable relative to SAM, since the term in big {\cal O} notation is negligible given a sufficiently large T . Theorem 3 also guides the choice of \theta – preferably small but not too small, otherwise the term in big {\cal O} is inversely amplified. Visualize stabilized adversaries. To validate our findings in Theorem 2 , we train a ResNet-18 on CIFAR10 and depict the evolution of \|\bm{\epsilon}_{t}-\bm{\epsilon}_{t-1}\| for both SAM and VASSO in Fig. 4 . Because both \bm{\epsilon}_{t} and \bm{\epsilon}_{t-1} reside on \mathbb{S}_{\rho}(\mathbf{0}) , the value of \|\bm{\epsilon}_{t}-\bm{\epsilon}_{t-1}\| is solely determined by the angle between these vectors. In essence, \|\bm{\epsilon}_{t}-\bm{\epsilon}_{t-1}\| characterizes well the stability. The results presented in Fig. 4 distinctly reveal that VASSO indeed improves the stability adversary over SAM. III-B Additional perspectives of VASSO Having dealt with stability, this subsection proceeds with other aspects of VASSO. Convergence. Summarized in the following corollary, the convergence of VASSO can be pursued as a direct consequence of Theorem 1 . The reason is that \bm{\epsilon}_{t}\in\mathbb{S}_{\rho}(\mathbf{0}) is satisfied by ( 5 ). Corollary 1 (VASSO convergence) . Under Assumptions 1 – 3 , and with \eta_{t} and \rho as in Theorem 1 , VASSO ensures for any \theta\in(0,1) that \displaystyle\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]\leq{\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg)~~~~\text{and}~~~~ \displaystyle\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2}\big]\leq{\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg). Fig. 4: The adversary of VASSO is more stable than SAM. Pronounced sharpness around optimum. Consider a near optimal region, where \|\nabla f(\mathbf{x}_{t})\|\rightarrow 0 , and suppose a big data regime, where \mathbf{g}_{t}(\mathbf{x}_{t})=\nabla f(\mathbf{x}_{t})+\bm{\zeta} for some Gaussian random vector \bm{\zeta} with covariance matrix \sigma^{2}\mathbf{I} for simplicity. (Using arguments from von Mises-Fisher statistics [ 33 ] generalization is also possible). SAM has difficulty estimating the flatness in this case, since \bm{\epsilon}_{t}\approx\rho\bm{\zeta}/\|\bm{\zeta}\| is uniformly distributed over \mathbb{S}_{\rho}(\mathbf{0}) regardless of whether the neighboring region is sharp or not. On the other hand, VASSO has \bm{\epsilon}_{t}=\rho\mathbf{d}_{t}/\|\mathbf{d}_{t}\| . Because \{\mathbf{g}_{\tau}(\mathbf{x}_{\tau})\}_{\tau} on sharper valleys tend to have larger magnitude, their EMA \mathbf{d}_{t} is helpful for distinguishing sharp valleys with flat ones. Memory efficient implementation. Although at first glance VASSO has to store both \mathbf{d}_{t} and \bm{\epsilon}_{t} , it can be implemented in a much more memory efficient manner. It is sufficient to store \mathbf{d}_{t} together with a scalar \|\mathbf{d}_{t}\| so that \bm{\epsilon}_{t} can be recovered on demand through normalization; see ( 5b ). Hence, VASSO’s memory requirements are the same as those of SAM. Extensions. VASSO has the potential to boost the performance of other SAM variants by stabilizing their stochastic linearization through variance suppression. For instance, adaptive SAM methods such as [ 34 , 17 ] are scale invarianct, while GSAM [ 16 ] minimizes a surrogate gap jointly with ( 1 ). Nevertheless, these SAM variants leverage stochastic linearization in ( II-A ). It is thus envisioned that VASSO can also alleviate the possible friendly adversary issues therein. As we shall see in Sec. V , cross-fertilizing VASSO with GSAM yields improved numerical performance. IV VASSO improves generalization for computation tradeoff Algorithm 2 Efficient VASSO (eVASSO) 1: Initialize: \mathbf{x}_{0},\rho,p , and a sequence of iid Bernoulli random variables \{R_{t}\}_{t=0}^{T-1} , where R_{t}=1 with probability p . 2: for t=0,\dots,T-1 do 3: Sample a minibatch {\cal B}_{t} 4: Define stochastic gradient on {\cal B}_{t} as \mathbf{g}_{t}(\cdot) 5: Calculate \mathbf{d}_{t}=(1-\theta)\mathbf{d}_{t-1}+\theta\mathbf{g}_{t}(\mathbf{x}_{t}) 6: if R_{t}=1 then // Calculate the second gradient 7: \bm{\epsilon}_{t}=\argmax_{\|\bm{\epsilon}\|\leq\rho}f(\mathbf{x}_{t})+\langle\mathbf{d}_{t},\bm{\epsilon}\rangle=\rho\frac{\mathbf{d}_{t}}{\|\mathbf{d}_{t}\|} 8: Calculate stochastic gradient \hat{\mathbf{g}}_{t}=\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t}) 9: else \hat{\mathbf{g}}_{t}=\mathbf{g}_{t}(\mathbf{x}_{t}) // Skip gradient computation 10: end if 11: Update model via \mathbf{x}_{t+1}=\mathbf{x}_{t}-\eta\hat{\mathbf{g}}_{t} 12: end for 13: Return: \mathbf{x}_{T} The generalization benefits of SAM come at the price of approximately doubled computation per iteration compared with SGD because of the need to compute \mathbf{g}_{t}(\mathbf{x}_{t}) and \mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t}) . While there are works trading off generalization for computation [ 19 , 20 , 21 ] , unfortunately these efforts are still under the threat of friendly adversaries, suggesting that the optimal tradeoff is elusive. In pursuit of a more favorable tradeoff that leans toward the generalization side, our idea is to leverage VASSO’s stabilized stochastic linearization in eSAM proposed originally in [ 20 ] . The resultant algorithm termed as efficient VASSO (eVASSO) is listed as Alg. 2 . It introduces a Bernoulli random variable R_{t} per iteration, where R_{t}=1 with probability p\in[0,1] . eVASSO alternates between VASSO or SGD based on the value of R_{t} to save computation. It can be seen that the number of gradient computation is (1+p) per iteration in expectation. The hyperparameter p plays a pivotal role in determining the generalization-computation tradeoff of eVASSO. A smaller p advocates more aggressive reduction of computational time, while heightening the risk of compromised generalization comparing with vanilla VASSO. However, thanks to the stabilized stochastic linearization, eVASSO still outperforms SAM for R_{t}=1 , as asserted next. Theorem 4 (Variance suppression and stability of eVASSO) . Under Assumptions 1 – 3 , if i) \bm{\epsilon}_{t} is obtained by ( 5 ) with \theta\in(0,1) ; and, ii) \eta_{t} and \rho are selected as in Theorem 1 , then eVASSO guarantees that for any p\in(0,1] , it holds that \displaystyle\mathbb{E}\big[\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2}\big]\leq\theta\sigma^{2}+{\cal O}\bigg(\frac{(1-\theta)^{2}\sigma^{2}}{\theta^{2}\sqrt{T}}\bigg). Moreover, whenever R_{t}=1 , the stochastic linearization of eVASSO is \rho\big[\sqrt{\theta}\sigma+{\cal O}(\frac{\sigma}{\theta T^{1/4}})\big] -stable. Note that Theorem 4 is the best one can achieve since there is no need for stochastic linearization when R_{t}=0 . Fig. 5: eVASSO improves generalization-computation tradeoff relative to eSAM. To visualize the generalization-computation tradeoff in eVASSO relative to eSAM, a ResNet-18 is trained on CIFAR-10 with p chosen from 0.2 to 0.8 . The test accuracy is plotted in Fig. 5 . It can be seen that eSAM saves computation at the price of compromised test accuracy relative to SAM. However, eVASSO effectively steers the tradeoff towards the desirable side – less computation (small p ) with higher accuracy. eVASSO with p=0.3 has already surpassed the performance of vanilla SAM and eSAM with p=0.7 . This means that for the same test accuracy, eVaSSO can reduce the computational overhead by 70\% and 57\% relative to SAM and eSAM, respectively. V Numerical tests To support our theoretical findings and validate how powerful variance suppression is, this section assesses generalization performance of VASSO and eVASSO on various learning tasks across vision and language domains. All experiments except those in Sec. V-B are run on NVIDIA V100 GPUs. Online code that is used is available at https://github.com/BingcongLi/VaSSO . V-A Image classification CIFAR10. Building on the selected base optimizers such as SGD, the test accuracy of VASSO is compared with SAM and two adaptive approaches, namely ASAM and FisherSAM [ 8 , 34 , 17 ] . Neural networks including VGG-11, ResNet-18, WRN-28-10 and PyramidNet-110 are trained on CIFAR10. Standard implementation including random crop, random horizontal flip, normalization and cutout [ 35 ] are leveraged for data augmentation. The first three models are trained for 200 epochs with a batchsize of 128 , and PyramidNet-110 is trained for 300 epochs using batchsize 256 . The cosine learning rate schedule is applied in all settings. The first three models use an initial learning rate of 0.05 , and PyramidNet adopts 0.1 . Weight decay is chosen as 0.001 for SAM, ASAM, FisherSAM and VASSO, but 0.0005 for SGD following [ 19 , 26 ] . We tune \rho across the values \{0.01,0.05,0.1,0.2,0.5\} for SAM; \rho=0.1 yields best results for ResNet and WRN; while \rho=0.05 and \rho=0.2 suit best for VGG and PyramidNet, respectively. ASAM and VASSO adopt the same \rho as SAM. FisherSAM uses the recommended \rho=0.1 [ 17 ] . For VASSO, we tune \theta=\{0.4,0.9\} , and report the best accuracy. We find that \theta=0.4 works best for ResNet-18 and WRN-28-10, while \theta=0.9 achieves the best accuracy in other cases. Table I shows that VASSO offers 0.2 to 0.3 accuracy improvement over SAM in all tested scenarios except for PyramidNet-110, where the improvement is about 0.1 . These results corroborate that generalizability indeed benefits from variance suppression and the induced stabilized adversary. TABLE I: Test accuracy (%) of VASSO on various neural networks trained on CIFAR10. CIFAR10 SGD SAM ASAM FisherSAM VASSO VGG-11-BN 93.20 ±0.05 93.82 ±0.05 93.47 ±0.04 93.60 ±0.09 94.10 ±0.07 ResNet-18 96.25 ±0.06 96.58 ±0.10 96.33 ±0.09 96.72 ±0.03 96.77 ±0.09 WRN-28-10 97.08 ±0.16 97.32 ±0.11 97.15 ±0.05 97.46 ±0.18 97.54 ±0.12 PyramidNet-110 97.39 ±0.09 97.85 ±0.14 97.56 ±0.11 97.84 ±0.18 97.93 ±0.08 CIFAR100. The training setups on this dataset are the same as those on CIFAR10, except that for SAM the best choice is \rho=0.2 . The numerical results are listed in Table II . It can be seen that SAM gains considerably in generalization over SGD, and this gain is further amplified by VASSO. On all tested models, VASSO improves the test accuracy of SAM by 0.2 to 0.3 . These experiments once again confirm the improved generalization of VASSO thanks to the stabilized adversary. ImageNet. Next, we investigate the performance of VASSO on larger scale experiments by training ResNet-50 and ViT-S/32 on ImageNet [ 36 ] . Implementation details are deferred to Appendix C . Note that the baseline optimizer is SGD for ResNet and AdamW for ViT [ 37 , 7 ] . VASSO is also integrated with GSAM (V+G) to demonstrate that variance suppression also benefits other SAM variants such as the one in [ 16 ] . For ResNet-50, it can be observed that vanilla VASSO outperforms other SAM variants, and offers a gain of 0.26 over SAM. V+G showcases the best performance with a gain of 0.28 on top of GSAM. VASSO and V+G also exhibit the best test accuracy on ViT-S/32, where VASSO improves SAM by 0.56 and V+G outperforms GSAM by 0.19. These numerical improvement demonstrates that stability of adversaries is indeed desirable. TABLE II: Test accuracy (%) of VASSO on various neural networks trained on CIFAR100. CIFAR100 SGD SAM ASAM FisherSAM VASSO ResNet-18 77.90 ±0.07 80.96 ±0.12 79.91 ±0.04 80.99 ±0.13 81.30 ±0.13 WRN-28-10 81.71 ±0.13 84.88 ±0.10 83.54 ±0.14 84.91 ±0.07 85.06 ±0.05 PyramidNet-110 83.50 ±0.12 85.60 ±0.11 83.72 ±0.09 85.55 ±0.14 85.85 ±0.09 TABLE III: Test accuracy (%) of VASSO on ImageNet, where V+G is short for VASSO + GSAM. ImageNet vanilla SAM ASAM GSAM VASSO V+G ResNet-50 76.62 ±0.12 77.16 ±0.14 77.10 ±0.16 77.20 ±0.13 77.42 ±0.13 77.48 ±0.04 ViT-S/32 68.12 ±0.05 68.98 ±0.08 68.74 ±0.11 69.42 ±0.18 69.54 ±0.15 69.61 ±0.11 V-B Domain generalization TABLE IV: Leave-one-out cross-validation accuracy (%) of VASSO on DomainBed. DomainBed Adam SAM GSAM VASSO PACS 85.5 ±0.2 85.8 ±0.2 85.9 ±0.1 86.0 ±0.1 VLCS 77.3 ±0.4 79.4 ±0.1 79.1 ±0.2 79.6 ±0.2 OfficeHome 66.5 ±0.3 69.6 ±0.1 69.3 ±0.0 69.8 ±0.2 TerraInc 46.1 ±1.8 43.3 ±0.7 47.0 ±0.8 47.0 ±0.3 Average 68.9 69.5 70.3 70.6 This subsection evaluates VASSO’s efficiency on domain generalization (DG) tasks. The goal of DG is to facilitate seamless transfer of learned knowledge from a “source domain” to generalize well on unseen yet related “target domains” [ 38 , 39 ] . The major challenge is the distributional shift across these domains, and recent studies have demonstrated that a flat minimum is beneficial to the desirable generalizability [ 40 ] . Numerical tests of VASSO are conducted on DomainBed, which is a well-established benchmark [ 41 ] . We focus on 4 specific datasets: PACS [ 42 ] , VLCS [ 43 ] , OfficeHome [ 44 ] , and TerraInconita [ 45 ] ; see Table IX for details. The performance is evaluated using standard leave-one-out cross-validation [ 41 ] , and this experiment is run on a NVIDIA A5000 GPU. Following [ 41 ] , a ResNet-50 imported from pytorch and pretrained on ImageNet is adopted as the backbone. We use a pretrained checkpoint on purpose – to demonstrate that VASSO can enhance the generalization even for finetuning. Adam is adopted as the base optimizer, and hyperparamters are chosen the same as in [ 41 , 46 ] . For VASSO, \theta takes values from \{0.2,0.4,0.9\} . Table IV compares VASSO with Adam, SAM, and GSAM, where the results of the last three are obtained from [ 46 ] . Detailed per-domain results can be found in Appendix C-B . It is observed that VASSO surpasses all these competitors in terms of averaged accuracy, underscoring the benefit of variance suppression in the scenario of distributional shift across diverse domains. V-C Label noise TABLE V: Test accuracy (%) of VASSO on CIFAR10 under different levels of label noise. SAM VASSO VASSO VASSO ( \theta=0.9 ) ( \theta=0.4 ) ( \theta=0.2 ) 25% label noise 96.39 ±0.12 96.36 ±0.11 96.42 ±0.12 96.48 ±0.09 50% label noise 93.93 ±0.21 94.00 ±0.24 94.63 ±0.21 94.93 ±0.16 75% label noise 75.36 ±0.42 77.40 ±0.37 80.94 ±0.40 85.02 ±0.39 TABLE VI: Performance of VASSO for training a Transformer on IWSLT-14 dataset. AdamW SAM ASAM VASSO VASSO ( \theta=0.9 ) ( \theta=0.4 ) val. ppl. 5.02 ±0.03 5.00 ±0.04 4.99 ±0.03 5.00 ±0.03 4.99 ±0.03 BLEU 34.66 ±0.06 34.75 ±0.04 34.76 ±0.04 34.81 ±0.04 34.88 ±0.03 It is known that SAM holds great potential to harness robustness to DNNs under the appearance of label noise in training data [ 8 , 47 ] . As the training loss landscape is largely perturbed by the label noise, this is a setting where the suppressed variance and stabilized adversaries are expected to improve performance. In our experiments, VASSO’s performance is evaluated when a fraction of the training labels are randomly flipped. With \theta taking \{0.9,0.4,0.2\} values, the corresponding test accuracies are listed in Table V . Our first observation is that VASSO outperforms SAM at all three levels of label noise tested. VASSO elevates generalization improvement as the percentage of noisy labels grows. For 75\% noisy labels, VASSO with \theta=0.4 outperforms SAM with an absolute improvement of 5.58 , while VASSO with \theta=0.2 markedly improves SAM by 9.66 . In all setups, \theta=0.2 leads to best performance while \theta=0.9 exhibits the worst generalization when compared with VASSO. When fixing the chosen \theta , e.g., \theta=0.2 , VASSO has larger absolute accuracy improvement over SAM under higher level of label noise. These observations are in agreement with Theorem 3 , which predicts that VASSO is suitable for settings with larger label noise due to its enhanced stability, especially when \theta is chosen small (but not too small). V-D Neural machine translation Having demonstrated the benefits of variance suppression on vision tasks, here we will test VASSO on German to English translation using a Transformer [ 28 ] trained on IWSLT-14 dataset [ 48 ] , and the fairseq implementation. AdamW is chosen as the base optimizer in SAM and VASSO because of its improved performance over SGD. The learning rate of AdamW is initialized to 5\times 10^{-4} , and then follows an inverse square root schedule. For momentum, we choose \beta_{1}=0.9 and \beta_{2}=0.98 . Label smoothing is also applied with a rate of 0.1 . Hyperparameter \rho is tuned for SAM from \{0.01,0.05,0.1,0.2\} , and \rho=0.1 performs the best. The same \rho is picked for ASAM and VASSO. The validation perplexity and test BLEU scores are listed in Table VI . It can be seen that both SAM and ASAM have better performance on validation perplexity and BLEU relative to AdamW. Although VASSO with \theta=0.9 has slightly higher validation perplexity, its BLEU score outperforms SAM and ASAM. VASSO with \theta=0.4 showcases the best generalization performance on this task, providing a 0.22 improvement on BLEU score relative to AdamW. This aligns with Theorems 2 and 3 , which suggest that a small \theta is more beneficial to the stability of adversaries. V-E Generalization-computation tradeoff As previously illustrated in Fig. 5 , eVASSO improves the generalization-computation tradeoff. This subsection offers further supporting evidence to this end. In particular, the proposed eVASSO with p=0.5 and p=0.3 is tested on ResNet-18 and WRN-28-10 using datasets CIFAR10 and CIFAR100. The test accuracy vs runtime of eVASSO, and benchmark algorithms such as SGD, SAM and eSAM can be found in Table VII . Note that for eVASSO, we tune \theta from \{0.4,0.9\} , and report the best results. As expected, the excess runtime of eVASSO and eSAM relative to SGD is roughly proportional to p . Another common observation is that a smaller p degrades generalization, demonstrating the tradeoff pattern. CIFAR10. Compared with SAM, eVASSO achieves better and comparable test accuracy on ResNet-18 and WRN-28-10, respectively, while requiring significantly reduced training time. On the other hand, eVASSO utilizes similar computational resources to reach markedly improved test accuracy over eSAM, because of the suppressed variance for finding adversaries. CIFAR100. On ResNet-18, the test accuracy of eVASSO with p=0.5 outperforms SAM, and with p=0.3 it is comparable to SAM. While on WRN-28-10, although eVASSO cannot match with SAM, it significantly outperforms eSAM and SGD. This suggests that even with minimally increased computation time (e.g., 1.3x), it is possible to improve the generalization over SGD drastically by 2.3 . TABLE VII: Test accuracy and epoch runtime of eVASSO on CIFAR-10 and CIFAR-100 datasets. The numbers in parentheses ( \cdot ) indicate the ratio of training speed relative to SGD. ResNet-18 WRN-28-10 CIFAR-10 Accuracy epoch runtime (s) Accuracy epoch runtime (s) SGD 96.25 ±0.05 14.42 (1x) 97.08 ±0.16 80.58 (1x) SAM 96.58 ±0.10 27.62 (1.92x) 97.32 ±0.11 156.92 (1.95x) eSAM ( p=0.5 ) 96.54 ±0.11 21.57 (1.49x) 97.21 ±0.08 119.06 (1.48x) eVASSO ( p=0.5 ) 96.72 ±0.14 21.94 (1.52x) 97.36 ±0.11 120.11 (1.49x) eSAM ( p=0.3 ) 96.42 ±0.08 18.34 (1.27x) 97.20 ±0.11 105.63 (1.31x) eVASSO ( p=0.3 ) 96.69 ±0.06 18.61 ((1.29x) 97.29 ±0.16 105.99 (1.32x) CIFAR-100 Accuracy epoch runtime (s) Accuracy epoch runtime (s) SGD 77.90 ±0.07 14.87 (1x) 81.71 ±0.13 81.02 (1x) SAM 80.96 ±0.12 28.37 (1.91x) 84.88 ±0.10 157.44 (1.94x) eSAM ( p=0.5 ) 81.03 ±0.17 21.77 (1.46x) 84.31 ±0.15 120.28 (1.48x) eVASSO ( p=0.5 ) 81.20 ±0.15 22.09 (1.49x) 84.52 ±0.06 121.55 (1.49x) eSAM ( p=0.3 ) 80.60 ±0.12 19.32 (1.30x) 83.65 ±0.18 105.41 (1.30x) eVASSO ( p=0.3 ) 80.84 ±0.06 19.35 ((1.30x) 84.07 ±0.08 106.61 (1.30x) V-F Additional tests (a) SGD (b) SAM (c) VASSO (d) eVASSO Fig. 6: Visualization of loss landscapes. This subsection evaluates several flatness-related metrics using a ResNet-18 trained on CIFAR10, where the hyperparameters are chosen as those in Sections V-A and V-E . TABLE VIII: Hessian spectrum of a ResNet-18. SGD SAM VASSO eVASSO \lambda_{1} 82.52 26.40 23.32 25.21 \lambda_{1}/\lambda_{5} 16.63 2.12 1.86 2.03 Hessian spectrum. We focus on the largest eigenvalue \lambda_{1} and the ratio of the largest to the fifth largest eigenvalue \lambda_{1}/\lambda_{5} . These metrics are also adopted by [ 8 , 49 ] to reflect the flatness of the solution, where smaller numbers are more preferable. Because exact calculation of the Hessian spectrum is prohibitive given the ResNet-18 size, we instead leverage Lanczos’ approximation algorithm [ 50 ] . Table VIII shows that SAM indeed converges to a much flatter solution compared with SGD, and VASSO further improves upon SAM. This confirms that the friendly adversary effect is indeed alleviated by variance suppression, which in turn boosts the generalization of ResNet18 as shown earlier in Section V-A . Moreover, the flatness measure of eVASSO with p=0.5 is slightly worse compared with VASSO. This is a consequence of the computation-generalization tradeoff that is present in eVASSO. Landscape. The loss landscapes optimized by the proposed approaches are plotted in Fig. 6 following the visualization method in [ 51 ] . It can be seen that VASSO and eVASSO ( p=0.5 ) indeed find flatter valleys relative to SAM and SGD, in agreement with their improved generalization behavior. VI Other related works This section completes the context of DNN generalizability with related works. Sharpness and generalization. Since the study of [ 10 ] , the relation between sharpness and generalization has been investigated intensively. It has been observed that sharpness is closely correlated with the ratio between learning rate and batchsize in SGD [ 52 ] . Analytical results on the generalization error using sharpness-related measures can be found in e.g., [ 53 , 54 , 55 ] . These works justify the goal of seeking a flatter valley to enhance generalizability. Aiming at a flatter minimum, approaches other than SAM have been also developed. For example, stochastic weight averaging has been advocated for DNNs [ 56 ] , while [ 57 ] has put forth an algorithm similar to SAM and has placed emphasis on robustness to adversarial training. SAM variants. Besides GSAM and ASAM that have been already mentioned, [ 58 ] pursued a SAM variant by penalizing the gradient norm on the premise that sharper valleys tend to have gradients with larger norm. In addition, [ 59 ] arrived at a similar conclusion by analyzing gradient flow. Exploiting multiple (ascent) steps to find an adversary has been studied systematically [ 60 ] . However, these works overlook the friendly adversary issue, while VASSO provides algorithmic possibilities for generalization benefits by stabilizing their adversaries. VII Concluding remarks This contribution demonstrates that stabilizing adversaries through variance suppression consolidates the generalization merits of sharpness-aware minimization. The novel framework abbreviated as VASSO, induces provable stability for SAM’s stochastic linearization. VASSO’s theoretically established merits are demonstrated with a suit of numerical experiments, and illustrate model-agnostic improvement over SAM on various vision and language tasks. Lastly, VASSO also steers the generalization-computation tradeoff of SAM towards the optimal side – improved generalization (over SGD) with significantly reduced computation (relative to SAM). Appendix A SFW vis-a-vis SAM adversary The stochastic Frank-Wolfe (SFW) algorithm outlined in Alg. 3 solves the following generally nonconvex stochastic optimization \displaystyle\max_{\mathbf{x}\in{\cal X}}h(\mathbf{x}):=\mathbb{E}_{\xi}\big[h(\mathbf{x},\xi)\big] (7) where {\cal X} is a convex and compact constraint set. Algorithm 3 SFW [ 27 ] 1: Initialize: \mathbf{x}_{0}\in{\cal X} 2: for t=0,1,\dots,T-1 do 3: draw iid samples \{\xi_{t}^{b}\}_{b=1}^{B_{t}} 4: let \hat{\mathbf{g}}_{t}=\frac{1}{B_{t}}\sum_{b=1}^{B_{t}}\nabla h(\mathbf{x}_{t},\xi_{t}^{b}) 5: \mathbf{v}_{t+1}=\argmax_{\mathbf{v}\in\cal X}\langle\hat{\mathbf{g}}_{t},\mathbf{v}\rangle 6: \mathbf{x}_{t+1}=(1-\gamma_{t})\mathbf{x}_{t}+\gamma_{t}\mathbf{v}_{t+1} 7: end for The SFW iteration is convergent so long as the batchsize B_{t}={\cal O}(T),\forall t is sufficiently large [ 27 , Theorem 2] . This is because line 5 in Alg. 3 is extremely sensitive to gradient noise. A-A The adversary of SAM By choosing h(\bm{\epsilon})=f(\mathbf{x}_{t}+\bm{\epsilon}) and {\cal X}=\mathbb{S}_{\rho}(\mathbf{0}) , it is not hard to show that 1-iteration SFW with \gamma_{0}=1 yields a solution equivalent to the stochastic linearization in SAM; cf. ( II-A ) and ( 3 ). This link implies that the SAM adversary also suffers from stability issues in the same way as SFW does. Moreover, what amplifies this issue in SAM is the adoption of a constant batchsize, which is typically small and far less than the {\cal O}(T) required for SFW convergence. Our VASSO solver is inspired by modified SFW approaches that leverage a constant batchsize to ensure convergence; see e.g., [ 61 , 62 , 63 ] . Even though, coping with SAM’s instability is still challenging in two major aspects. First, SAM uses one-step SFW, which internally breaks the nice analytical structure. Moreover, the inner maximization (i.e., the objective function of SFW) varies from iteration to iteration along with the updated \mathbf{x}_{t} . This link also suggests the potential of applying other FW approaches for the adversary such as those in [ 64 , 65 , 66 , 67 ] . We leave this direction for future research. A-B The three dimensional example in Fig. 3 Here we detail the implementation used for generating Fig. 3 . We use \nabla f(\mathbf{x})=[0.2,-0.1,0.6] , and stochastic noise \bm{\xi}=[\xi_{1},\xi_{2},\xi_{3}] , where \xi_{1} , \xi_{2} , \xi_{3} are iid Gaussian random variables with variance scaling with 0.2,1,2 , respectively. Scaling is used to vary the SNR. We generate 100 adversaries by solving \argmax_{\|\bm{\epsilon}\|\leq\rho}\langle\nabla f(\mathbf{x})+\bm{\xi},\bm{\epsilon}\rangle for each SNR value. As shown in Fig. 3 , the adversaries are unlikely to capture the sharpness information when the SNR is small, because they spread indistinguishably all over the sphere. Appendix B More on m -sharpness m -sharpness can be ill-posed. Our reason for not studying m -sharpness directly is that its formulation [ 13 , eq. (3)] may be ill-posed mathematically due to the lack of a clear definition on how the dataset {\cal S} is partitioned. Consider the following example, where the same notation as [ 13 ] is adopted for convenience. Suppose that the loss function is l_{i}(w)=a_{i}w^{2}+b_{i}w , where \{(a_{i},b_{i})\}_{i} are data points, and w is the parameter to be optimized. Let the dataset have 4 samples, (a_{1}=0,b_{1}=1) ; (a_{2}=0,b_{2}=-1) ; (a_{3}=-1,b_{3}=0) ; and, (a_{4}=1,b_{4}=0) . Consider 2-sharpness. • If the data partition is {1,2} and {3,4}, the objective of 2-sharpness, namely equation (3) in [ 13 ] , becomes \min_{w}\sum_{i=1}^{2}\max_{||\delta||<\rho}0 . • If the data partition is {1,3} and {2,4}, the objective is \min_{w}\sum_{i=1}^{2}\max_{||\delta||<\rho}f_{i}(w,\delta) , where f_{1} is the loss on partition {1,3}, that is, f_{1}(w,\delta)=-(w+\delta)^{2}+(w+\delta) ; and f_{2}(w,\delta)=(w+\delta)^{2}-(w+\delta) is the loss on partition {3,4}. The objective functions are different when the data partition varies. This makes the problem ill-posed – data partition leads to entirely different loss curvature. In practice, the data partition even varies across epochs due to the random shuffle in data loading. Appendix C Details on numerical tests C-A ImageNet ResNet50. Due to limitations of computational resources, we report the averaged results over 2 independent runs. For this dataset, we randomly resize and crop all images to a resolution of 224\times 224 , and apply random horizontal flip, as well as normalization during training. The batchsize is 128 with a cosine learning rate scheduling and with initial step size 0.05 . The momentum and weight decay of the base optimizer, here SGD, are set to 0.9 and 10^{-4} , respectively. We tune \rho from \{0.05,0.075,0.1,0.2\} , and choose \rho=0.075 for SAM. VASSO uses \theta=0.99 . VASSO and ASAM adopt the same \rho=0.075 . ViT-S/32. We follow the implementation of [ 22 ] , where we train the model for 300 epochs with a batchsize of 4096 . The baseline optimizer is chosen as AdamW with weight decay 0.3 . SAM relies on \rho=0.05 . For the implementation of GSAM and V+G, we adopt the same implementation from [ 16 ] . C-B Domain generalization Table IX includes details of the DomainBed benchmark [ 41 ] ; while Tables X , XI , XII , and XIII provide leave-one-out cross-validation results per dataset. TABLE IX: Summary of DomainBed benchmark dataset # images # classes PACS 9,991 7 VLCS 10,729 5 OfficeHome 15,588 65 TerraInc 24,788 10 TABLE X: Cross-validation accuracies (%) on PACS dataset. Test domain Adam SAM GSAM VASSO P hoto 97.2 ±0.3 97.0 ±0.4 97.5 ±0.0 95.4 ±0.2 A rt painting 84.7 ±0.4 85.6 ±2.1 86.9 ±0.1 84.2 ±0.6 C artoon 80.8 ±0.6 80.9 ±1.2 80.4 ±0.2 81.8 ±0.5 S ketch 79.3 ±1.0 79.6 ±1.6 78.7 ±0.8 82.5 ±0.4 Average 85.5 85.8 85.9 86.0 TABLE XI: Cross-validation accuracies (%) on VLCS dataset. Test domain Adam SAM GSAM VASSO V OC2007 75.2 ±1.6 79.8 ±0.1 78.5 ±0.8 78.9 ±0.7 L abelMe 64.7 ±1.2 65.0 ±1.0 64.9 ±0.2 65.9 ±0.5 C altech101 98.0 ±0.3 99.1 ±0.2 98.7 ±0.3 99.0 ±0.2 S UN09 71.4 ±1.2 73.7 ±1.0 74.3 ±0.0 74.4 ±0.9 Average 77.3 79.4 79.1 79.6 TABLE XII: Cross-validation accuracies (%) on OfficeHome dataset. Test domain Adam SAM GSAM VASSO Art 61.3 ±0.7 64.5 ±0.3 64.9 ±0.1 64.8 ±0.5 Clipart 52.4 ±0.3 56.5 ±0.2 55.2 ±0.2 57.1 ±0.4 Product 75.8 ±0.1 77.4 ±0.1 77.8 ±0.0 78.2 ±0.2 Real world 76.6 ±0.3 79.8 ±0.4 79.2 ±0.2 79.3 ±0.1 Average 66.5 69.6 69.3 69.8 TABLE XIII: Cross-validation accuracies (%) on TerraIncognita dataset. Test domain Adam SAM GSAM VASSO Location 38 42.1 ±1.4 38.4 ±2.4 39.3 ±0.2 38.5 ±0.7 Location 43 56.9 ±1.8 54.0 ±1.0 59.6 ±0.0 60.7 ±0.2 Location 46 35.7 ±3.9 34.5 ±0.8 38.2 ±0.8 37.5 ±0.8 Location 100 49.8 ±4.4 46.3 ±1.0 50.8 ±0.1 51.4 ±0.8 Average 46.1 43.3 47.0 47.0 Appendix D Missing proofs Alg. 1 can be written as \displaystyle\mathbf{x}_{t+\frac{1}{2}} \displaystyle=\mathbf{x}_{t}+\bm{\epsilon}_{t} (8a) \displaystyle\mathbf{x}_{t+1} \displaystyle=\mathbf{x}_{t}-\eta_{t}\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}}) (8b) where \|\bm{\epsilon}_{t}\|=\rho . In SAM, we have \bm{\epsilon}_{t}=\rho\frac{\mathbf{g}_{t}(\mathbf{x}_{t})}{\|\mathbf{g}_{t}(\mathbf{x}_{t})\|} , and in VASSO we have \bm{\epsilon}_{t}=\rho\frac{\mathbf{d}_{t}}{\|\mathbf{d}_{t}\|} . D-A Useful lemmas This subsection presents useful lemmas for our main results. Lemma 1 . Alg. 1 (or equivalently iteration ( 8 )) ensures that \displaystyle\eta_{t}\mathbb{E}\big[\langle\nabla f(\mathbf{x}_{t}),\nabla f(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\rangle\big] \displaystyle~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\leq\frac{L\eta_{t}^{2}}{2}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]+\frac{L\rho^{2}}{2}. Proof. To start, we have that \displaystyle~~~~~\big\langle\nabla f(\mathbf{x}_{t}),\nabla f(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\big\rangle \displaystyle=\langle\nabla f(\mathbf{x}_{t}),\nabla f(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t})+\mathbf{g}_{t}(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\rangle. Taking expectation conditioned on \mathbf{x}_{t} , we arrive at \displaystyle~~~~~\mathbb{E}\big[\big\langle\nabla f(\mathbf{x}_{t}),\nabla f(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\big\rangle|\mathbf{x}_{t}\big] \displaystyle=\mathbb{E}\big[\langle\nabla f(\mathbf{x}_{t}),\nabla f(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t})\rangle|\mathbf{x}_{t}\big] \displaystyle~~~~~~~~~~~~~~~~+\mathbb{E}\big[\langle\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\rangle|\mathbf{x}_{t}\big] \displaystyle=\mathbb{E}\big[\langle\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\rangle|\mathbf{x}_{t}\big] \displaystyle\leq\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|\cdot\|\mathbf{g}_{t}(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\||\mathbf{x}_{t}\big] \displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}L\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|\cdot\|\mathbf{x}_{t}-\mathbf{x}_{t+\frac{1}{2}}\||\mathbf{x}_{t}\big] \displaystyle\stackrel{{\scriptstyle(b)}}{{=}}L\rho\|\nabla f(\mathbf{x}_{t})\| where (a) follows from Assumption 2 ; and (b) holds because \mathbf{x}_{t}-\mathbf{x}_{t+\frac{1}{2}}=-\bm{\epsilon}_{t} , and its norm equals \rho . This inequality ensures that \displaystyle~~~~~\eta_{t}\mathbb{E}\big[\big\langle\nabla f(\mathbf{x}_{t}),\nabla f(\mathbf{x}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\big\rangle|\mathbf{x}_{t}\big] \displaystyle\leq L\rho\eta_{t}\|\nabla f(\mathbf{x}_{t})\|\leq\frac{L\eta_{t}^{2}\|\nabla f(\mathbf{x}_{t})\|^{2}}{2}+\frac{L\rho^{2}}{2} where the last inequality holds because \rho\eta_{t}\|\nabla f(\mathbf{x}_{t})\|\leq\frac{1}{2}\eta_{t}^{2}\|\nabla f(\mathbf{x}_{t})\|^{2}+\frac{1}{2}\rho^{2} . Taking expectation w.r.t. \mathbf{x}_{t} completes the proof. ∎ Lemma 2 . Alg. 1 (or equivalently iteration ( 8 )) ensures that \displaystyle\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\|^{2}\big]\leq 2L^{2}\rho^{2}+2\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]+2\sigma^{2}. Proof. The proof starts with bounding \|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\| as \displaystyle\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\|^{2} \displaystyle=\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})-\mathbf{g}_{t}(\mathbf{x}_{t})+\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2} \displaystyle\leq 2\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})-\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2}+2\|\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2} \displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}2L^{2}\|\mathbf{x}_{t}-\mathbf{x}_{t+\frac{1}{2}}\|^{2}+2\|\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2} \displaystyle\stackrel{{\scriptstyle(b)}}{{=}}2L^{2}\rho^{2}+2\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\|^{2} where (a) follows from Assumption 2 ; and (b) is because \mathbf{x}_{t}-\mathbf{x}_{t+\frac{1}{2}}=-\bm{\epsilon}_{t} , and its norm equals \rho . Taking expectation conditioned on \mathbf{x}_{t} , we have \displaystyle~~~~~\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\|^{2}|\mathbf{x}_{t}\big] \displaystyle\leq 2L^{2}\rho^{2}+2\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\|^{2}|\mathbf{x}_{t}\big] \displaystyle\leq 2L^{2}\rho^{2}+2\|\nabla f(\mathbf{x}_{t})\|^{2}+2\sigma^{2} where the last inequality is because of Assumption 3 . Taking expectation w.r.t. the randomness in \mathbf{x}_{t} completes the proof. ∎ Lemma 3 . With A_{t+1}=\alpha A_{t}+\beta for some \alpha\in(0,1) , we have \displaystyle A_{t+1}\leq\alpha^{t+1}A_{0}+\frac{\beta}{1-\alpha}. Proof. The proof can be completed by simply unrolling A_{t+1} and using the fact that 1+\alpha+\alpha^{2}+\ldots+\alpha^{t}\leq\frac{1}{1-\alpha} . ∎ D-B Proof of Theorem 1 Proof. Using Assumption 2 , we have that \displaystyle~~~~~f(\mathbf{x}_{t+1})-f(\mathbf{x}_{t}) \displaystyle\leq\langle\nabla f(\mathbf{x}_{t}),\mathbf{x}_{t+1}-\mathbf{x}_{t}\rangle+\frac{L}{2}\|\mathbf{x}_{t+1}-\mathbf{x}_{t}\|^{2} \displaystyle=-\eta_{t}\langle\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\rangle+\frac{L\eta_{t}^{2}}{2}\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\|^{2} \displaystyle=-\eta_{t}\langle\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\rangle \displaystyle~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+\frac{L\eta_{t}^{2}}{2}\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\|^{2} \displaystyle=-\eta_{t}\|\nabla f(\mathbf{x}_{t})\|^{2}-\eta_{t}\langle\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})-\nabla f(\mathbf{x}_{t})\rangle \displaystyle~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+\frac{L\eta_{t}^{2}}{2}\|\mathbf{g}_{t}(\mathbf{x}_{t+\frac{1}{2}})\|^{2}. Taking expectation, and plugging Lemmas 1 and 2 , yields \displaystyle\mathbb{E}\big[f(\mathbf{x}_{t+1})-f(\mathbf{x}_{t})\big] \displaystyle\leq-\bigg(\eta_{t}-\frac{3L\eta_{t}^{2}}{2}\bigg)\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle~~~~~~~+\frac{L\rho^{2}}{2}+L^{3}\eta_{t}^{2}\rho^{2}+L\eta_{t}^{2}\sigma^{2}. As the parameter selection ensures that \eta_{t}\equiv\eta=\frac{\eta_{0}}{\sqrt{T}}\leq\frac{2}{3L} , we can divide both sides by \eta , and rearrange terms to arrive at \displaystyle~~~~~\bigg(1-\frac{3L\eta}{2}\bigg)\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq\frac{\mathbb{E}\big[f(\mathbf{x}_{t})-f(\mathbf{x}_{t+1})\big]}{\eta}+\frac{L\rho^{2}}{2\eta}+L^{3}\eta\rho^{2}+L\eta\sigma^{2}. Summing over t , we have \displaystyle~~~~~\bigg(1-\frac{3L\eta}{2}\bigg)\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq\frac{\mathbb{E}\big[f(\mathbf{x}_{0})-f(\mathbf{x}_{T})\big]}{\eta T}+\frac{L\rho^{2}}{2\eta}+L^{3}\eta\rho^{2}+L\eta\sigma^{2} \displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\frac{f(\mathbf{x}_{0})-f^{*}}{\eta T}+\frac{L\rho^{2}}{2\eta}+L^{3}\eta\rho^{2}+L\eta\sigma^{2} \displaystyle=\frac{f(\mathbf{x}_{0})-f^{*}}{\eta_{0}\sqrt{T}}+\frac{L\rho_{0}^{2}}{2\eta_{0}\sqrt{T}}+\frac{L^{3}\eta_{0}\rho_{0}^{2}}{T^{3/2}}+\frac{L\eta_{0}\sigma^{2}}{\sqrt{T}} where (a) uses Assumption 1 , and the last equality is obtained by plugging in the values of \rho and \eta . This completes the proof of the first part. For the second part of this theorem, we have that \displaystyle~~~~~\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2}\big] \displaystyle=\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}+\bm{\epsilon}_{t})+\nabla f(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq 2\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}\|^{2}\big]+2\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}+\bm{\epsilon}_{t})-\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq 2\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}\|^{2}\big]+2L^{2}\rho^{2} \displaystyle=2\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t}\|^{2}\big]+\frac{2L^{2}\rho_{0}^{2}}{T}. Averaging over t completes the proof. Extension . Theorem 1 also holds when \bm{\epsilon}_{t}\in\mathbb{S}_{\rho}(\bm{0}) is replaced by \bm{\epsilon}_{t}\in\mathbb{B}_{\rho}(\bm{0}) . Since the derivation is similar, we will skip it here. ∎ D-C Proof of Theorem 2 Proof. To bound the MSE, we first have that \displaystyle~~~~~\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2} (9) \displaystyle=\|(1-\theta)\mathbf{d}_{t-1}+\theta\mathbf{g}_{t}(\mathbf{x}_{t})-(1-\theta)\nabla f(\mathbf{x}_{t})-\theta\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle=(1-\theta)^{2}\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t})\|^{2}+\theta^{2}\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle~~~~~~~~~~~~~~~~+2\theta(1-\theta)\langle\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\rangle. We will cope with three terms in the right hand side (rhs) of ( 9 ) separately. The second term can be bounded directly using Assumption 2 \displaystyle\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\|^{2}|\mathbf{x}_{t}\big]\leq\sigma^{2}. (10) For the third term, we have \displaystyle\mathbb{E}\big[\langle\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\rangle|\mathbf{x}_{t}\big]=0. (11) The first term is bounded through \displaystyle~~~~~\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle=\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})+\nabla f(\mathbf{x}_{t-1})-\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}(1\!+\!\lambda)\|\mathbf{d}_{t\!-\!1}\!-\!\nabla f(\mathbf{x}_{t\!-\!1})\|^{2}+\big(1\!+\!\frac{1}{\lambda}\big)\|\nabla f(\mathbf{x}_{t\!-\!1})\!-\!\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle\leq(1+\lambda)\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}+\big(1+\frac{1}{\lambda}\big)L^{2}\|\mathbf{x}_{t-1}-\mathbf{x}_{t}\|^{2} \displaystyle=(1\!+\!\lambda)\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}+\big(1\!+\!\frac{1}{\lambda}\big)\eta^{2}L^{2}\|\mathbf{g}_{t-1}(\mathbf{x}_{t-\frac{1}{2}})\|^{2} where (a) follows from Young’s inequality. Taking expectation and applying Lemma 2 , we arrive at \displaystyle~~~~\mathbb{E}\big[\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t})\|^{2}\big] (12) \displaystyle\leq(1+\lambda)\mathbb{E}\big[\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}\big] \displaystyle~~~~~+\big(1+\frac{1}{\lambda}\big)\eta^{2}L^{2}\bigg(2L^{2}\rho^{2}+2\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t-1})\|^{2}\big]+2\sigma^{2}\bigg) \displaystyle\leq(1+\lambda)\mathbb{E}\big[\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}\big]+\big(1+\frac{1}{\lambda}\big)\cdot{\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg). The last inequality uses the value of \eta=\frac{\eta_{0}}{\sqrt{T}} and \rho=\frac{\rho_{0}}{\sqrt{T}} . In particular, we have \eta^{2}\rho^{2}L^{4}={\cal O}(1/T^{2}) and \eta^{2}L^{2}\sigma^{2}={\cal O}(\sigma^{2}/T) , and \displaystyle~~~~~\eta^{2}L^{2}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]=\frac{\eta_{0}^{2}L^{2}}{T}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq\eta_{0}^{2}L^{2}\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]={\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg) where for the last equality we have also used Theorem 1 . Combining ( 9 ) with ( 12 ), ( 10 ) with ( 11 ), and choosing \lambda=\frac{\theta}{1-\theta} , we have \displaystyle~~~~~\mathbb{E}\big[\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq(1\!-\!\theta)\mathbb{E}\big[\|\mathbf{d}_{t\!-\!1}-\nabla f(\mathbf{x}_{t\!-\!1})\|^{2}\big]+\frac{(1-\theta)^{2}}{\theta}{\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg)\!+\!\theta^{2}\sigma^{2} \displaystyle\leq\theta\sigma^{2}+{\cal O}\bigg(\frac{(1\!-\!\theta)^{2}\sigma^{2}}{\theta^{2}\sqrt{T}}\bigg) where the last inequality is the result of Lemma 3 . ∎ D-D Proof of Theorem 3 Proof. We adopt a unified notation for simplicity. Let \mathbf{v}_{t}:=\mathbf{d}_{t} for VASSO, and \mathbf{v}_{t}:=\mathbf{g}_{t}(\mathbf{x}_{t}) for SAM. Then for both VASSO and SAM, we can write \displaystyle~~~~~f(\mathbf{x}_{t})+\langle\mathbf{v}_{t},\bm{\epsilon}_{t}\rangle=f(\mathbf{x}_{t})+\rho\|\mathbf{v}_{t}\| (13) \displaystyle=f(\mathbf{x}_{t})+\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\|. For convenience, let \bm{\epsilon}_{t}^{*}=\rho\nabla f(\mathbf{x}_{t})/\|\nabla f(\mathbf{x}_{t})\| . From ( 13 ), we have that \displaystyle~~~~~f(\mathbf{x}_{t})+\langle\mathbf{v}_{t},\bm{\epsilon}_{t}\rangle (14) \displaystyle=f(\mathbf{x}_{t})+\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\| \displaystyle\leq f(\mathbf{x}_{t})+\rho\|\nabla f(\mathbf{x}_{t})\|+\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\| \displaystyle=f(\mathbf{x}_{t})+\langle\nabla f(\mathbf{x}_{t}),\bm{\epsilon}_{t}^{*}\rangle+\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\|. Applying the triangle inequality \big|\|\mathbf{a}\|-\|\mathbf{b}\|\big|\leq\|\mathbf{a}-\mathbf{b}\| , we arrive at \displaystyle~~~~~f(\mathbf{x}_{t})+\langle\mathbf{v}_{t},\bm{\epsilon}_{t}\rangle (15) \displaystyle=f(\mathbf{x}_{t})+\rho\|\nabla f(\mathbf{x}_{t})-(\nabla f(\mathbf{x}_{t})-\mathbf{v}_{t})\| \displaystyle\geq f(\mathbf{x}_{t})+\rho\|\nabla f(\mathbf{x}_{t})\|-\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\| \displaystyle=f(\mathbf{x}_{t})+\langle\nabla f(\mathbf{x}_{t}),\bm{\epsilon}_{t}^{*}\rangle-\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\|. Combining ( 14 ) with ( 15 ), we have \displaystyle|{\cal L}_{t}(\mathbf{v}_{t})-{\cal L}_{t}(\nabla f(\mathbf{x}_{t}))|\leq\rho\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\| which further implies that \displaystyle\mathbb{E}\big[|{\cal L}_{t}(\mathbf{v}_{t})-{\cal L}_{t}(\nabla f(\mathbf{x}_{t}))|\big] \displaystyle\leq\rho\mathbb{E}\big[\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\|\big] \displaystyle\leq\rho\sqrt{\mathbb{E}\big[\|\mathbf{v}_{t}-\nabla f(\mathbf{x}_{t})\|^{2}\big]} where the last inequality follows from (\mathbb{E}[a])^{2}\leq\mathbb{E}[a^{2}] . This theorem can be proved by applying Assumption 3 for SAM, and Lemma 2 for VASSO. ∎ D-E Proof for Theorem 4 We start with a technical lemma needed for the main theorem. Lemma 4 . Alg. 2 ensures that \displaystyle\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2}\big]\leq 2pL^{2}\rho^{2}+(1+p)\|\nabla f(\mathbf{x}_{t})\|^{2}+(1+p)\sigma^{2}. Proof. First, consider the case where B_{t}=1 . We have that \displaystyle\|\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2} \displaystyle=\|\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t})+\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2} \displaystyle\leq 2\|\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t})-\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2}+2\|\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2} \displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}2L^{2}\|\bm{\epsilon}_{t}\|^{2}+2\|\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2} \displaystyle\stackrel{{\scriptstyle(b)}}{{=}}2L^{2}\rho^{2}+2\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\|^{2} where (a) is due to Assumption 2 ; and (b) is because \|\bm{\epsilon}_{t}\|=\rho . When B_{t}=0 , i.e., \bm{\epsilon}_{t}=\bm{0} , we have that \displaystyle\|\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2} \displaystyle=\|\mathbf{g}_{t}(\mathbf{x}_{t})\|^{2}=\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\|^{2}. Taking expectation conditioned on \mathbf{x}_{t} , we have \displaystyle~~~~~\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t}+\bm{\epsilon}_{t})\|^{2}|\mathbf{x}_{t}\big] \displaystyle\leq 2pL^{2}\rho^{2}+(1+p)\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})+\nabla f(\mathbf{x}_{t})\|^{2}|\mathbf{x}_{t}\big] \displaystyle\leq 2pL^{2}\rho^{2}+(1+p)\|\nabla f(\mathbf{x}_{t})\|^{2}+(1+p)\sigma^{2} where the last inequality is because of Assumption 3 . Taking expectation w.r.t. the randomness in \mathbf{x}_{t} completes the proof. ∎ Now we are ready to prove Theorem 4 . Proof. Similar to ( 9 ), we have that for eVASSO \displaystyle\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2} (16) \displaystyle=(1-\theta)^{2}\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t})\|^{2}+\theta^{2}\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle~~~~~~~~~~~+2\theta(1-\theta)\langle\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\rangle. Again, we deal with the three terms in the rhs ( 16 ) separately. The second term can be bounded directly using Assumption 2 \displaystyle\mathbb{E}\big[\|\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\|^{2}|\mathbf{x}_{t}\big]\leq\sigma^{2}. (17) For the third term, we have \displaystyle\mathbb{E}\big[\langle\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t}),\mathbf{g}_{t}(\mathbf{x}_{t})-\nabla f(\mathbf{x}_{t})\rangle|\mathbf{x}_{t}\big]=0. (18) The first term is bounded through \displaystyle~~~~~\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle=\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})+\nabla f(\mathbf{x}_{t-1})-\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}(1\!+\!\lambda)\|\mathbf{d}_{t\!-\!1}\!-\!\nabla f(\mathbf{x}_{t\!-\!1})\|^{2}+\big(1\!+\!\frac{1}{\lambda}\big)\|\nabla f(\mathbf{x}_{t\!-\!1})\!-\!\nabla f(\mathbf{x}_{t})\|^{2} \displaystyle\leq(1\!+\!\lambda)\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}+\big(1+\frac{1}{\lambda}\big)L^{2}\|\mathbf{x}_{t-1}-\mathbf{x}_{t}\|^{2} \displaystyle=(1\!+\!\lambda)\|\mathbf{d}_{t\!-\!1}\!-\!\nabla f(\mathbf{x}_{t\!-\!1})\|^{2}+\big(1\!+\!\frac{1}{\lambda}\big)\eta^{2}L^{2}\|\mathbf{g}_{t\!-\!1}(\mathbf{x}_{t\!-\!1}\!+\!\bm{\epsilon}_{t\!-\!1})\|^{2} where (a) follows from Young’s inequality. Taking expectation and applying Lemma 4 , we deduce that \displaystyle~~~~\mathbb{E}\big[\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t})\|^{2}\big] (19) \displaystyle\leq(1+\lambda)\mathbb{E}\big[\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}\big] \displaystyle~~~~+\big(1+\frac{1}{\lambda}\big)\eta^{2}L^{2}\bigg(2pL^{2}\rho^{2}+(1+p)\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t-1})\|^{2}\big]\bigg) \displaystyle~~~~+\big(1+\frac{1}{\lambda}\big)\eta^{2}L^{2}(1+p)\sigma^{2} \displaystyle\leq(1+\lambda)\mathbb{E}\big[\|\mathbf{d}_{t-1}-\nabla f(\mathbf{x}_{t-1})\|^{2}\big]+\big(1+\frac{1}{\lambda}\big)\cdot{\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg). The last inequality uses the values of \eta=\frac{\eta_{0}}{\sqrt{T}} and \rho=\frac{\rho_{0}}{\sqrt{T}} . In particular, we have \eta^{2}\rho^{2}L^{4}={\cal O}(1/T^{2}) and \eta^{2}L^{2}\sigma^{2}={\cal O}(\sigma^{2}/T) , and \displaystyle~~~~~\eta^{2}L^{2}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]=\frac{\eta_{0}^{2}L^{2}}{T}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq\eta_{0}^{2}L^{2}\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\big[\|\nabla f(\mathbf{x}_{t})\|^{2}\big]={\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg) where the last equation is the result of Theorem 1 . Combining ( 16 ) with ( 19 ), ( 17 ) with ( 18 ), and choosing \lambda=\frac{\theta}{1-\theta} , we have \displaystyle~~~~~\mathbb{E}\big[\|\mathbf{d}_{t}-\nabla f(\mathbf{x}_{t})\|^{2}\big] \displaystyle\leq(1\!-\!\theta)\mathbb{E}\big[\|\mathbf{d}_{t\!-\!1}-\!\nabla f(\mathbf{x}_{t\!-\!1})\|^{2}\big]+\frac{(1\!-\!\theta)^{2}}{\theta}{\cal O}\bigg(\frac{\sigma^{2}}{\sqrt{T}}\bigg)+\theta^{2}\sigma^{2} \displaystyle\leq\theta\sigma^{2}+{\cal O}\bigg(\frac{(1-\theta)^{2}\sigma^{2}}{\theta^{2}\sqrt{T}}\bigg) where the last inequality is the result of Lemma 3 . ∎