Non-convex Distributionally Robust Optimization: Non-asymptotic Analysis

Jikai Jin, Bohang Zhang, Haiyang Wang, Liwei Wang

Introduction

For a classical machine learning problem, the goal is typically to train a model over a training set that achieves good performance on a test set, where both the training set and the test set are drawn from the same distribution PP. While such an assumption is reasonable and simple for theoretical analysis, it is often not the case in real applications. For example, this setting may be improper when there is a gap between training and test distribution (e.g. in domain adaptation tasks) (Zhang et al., 2021), when there is severe class imbalance in the training set (Sagawa et al., 2020), when fairness in minority groups is an important consideration (Hashimoto et al., 2018), or when the deployed model is exposed to adversarial attacks (Sinha et al., 2018).

Distributionally robust optimization (DRO), as a popular approach to deal with the above situations, has attracted great interest for the machine learning research communities in recent years. In contrast to classic machine learning problems, for DRO it is desired that the trained model still has good performance under distribution shift. Specifically, DRO proposes to minimize the worst-case loss over a set of probability distributions QQ around PP. This can be formulated as the following constrained optimization problem (Rahimian and Mehrotra, 2019; Shapiro, 2017):

where dd measures the distance between two probability distributions, and the positive number ϵ\epsilon corresponds to the magnitude of the uncertainty set.

Instead of imposing a hard constrained uncertainty set, sometimes it is more preferred to use a soft penalty term, resulting in the penalized DRO problem (Sinha et al., 2018):

where λ>0\lambda>0 is the regularization coefficient.

There are many possible choices of dd. A detailed discussion of different distance measures and their properties can be found in Rahimian and Mehrotra (2019). In this paper we consider a general class of distances dd called the ψ\psi-divergence, which is a popular choice in DRO literature (Namkoong and Duchi, 2016; Shapiro, 2017). Specifically, for a non-negative convex function ψ\psi such that ψ(1)=0\psi(1)=0 and two probability distributions P,QP,Q such that QQ is absolutely continuous w.r.t. PP, the ψ\psi-divergence between QQ and PP is defined as

which satisfies dψ(Q,P)≥0d_{\psi}(Q,P)\geq 0 and dψ(Q,P)=0d_{\psi}(Q,P)=0 if Q=PQ=P a.s.

The above analysis applies to a broad class of divergence functions ψ\psi. We further discuss special cases when ψ\psi has additional properties. In particular, to handle the CVaR case (a non-differentiable loss), we propose a divergence function which is a smoothed variant of CVaR and is further Lipschitz. In this case we show that a convergence guarantee can be established using vanilla SGD, and an similar complexity bound holds.

We highlight that the algorithm and analysis in this paper are not limited to DRO setting, and are described in the context of a general class of optimization problem. Our analysis clearly demonstrates the effectiveness of gradient normalization and momentum techniques in optimizing ill-conditioned objective functions. We believe our result can shed light on why some popular optimizers, in particular Adam (Kingma and Ba, 2015), often exhibit superior performance in real applications.

Assuming that ψ∗\psi^{*} is further Lipschitz, in Section 3.4 we prove that vinilla SGD suffices to achieve the O(ϵ−4)\mathcal{O}(\epsilon^{-4}) complexity. As a special case, we propose a new divergence which is a smoothed approximation of CVaR.

We conduct experiments to verify our theoretical results. We observe that our proposed methods significantly accelerate the optimization process, and also demonstrates superior test performance.

1 Related work

Constrained DRO and Penalized DRO. There are two existing formulations of the DRO problem: the constrained DRO and the penalized DRO. The constrained DRO formulation 1 has been studied in a number of works (Namkoong and Duchi, 2016; Shapiro, 2017; Duchi and Namkoong, 2018), while other works consider the penalty-based formulation 3 (Sinha et al., 2018; Levy et al., 2020). From a Lagrangian perspective, the two formulations are equivalent; however, the dual objective of the constrained formulation is sometimes hard to solve as pointed out in (Namkoong and Duchi, 2016; Duchi and Namkoong, 2018). In this paper we focus on the penalty-based version and provide the first non-asymptotic analysis in the non-convex setting. Moreover, we do not make the assumption that the loss is bounded, as assumed in Levy et al. (2020) in the convex setting.

DRO with ψ\psi-divergence. ψ\psi-divergence is one of the most common choices in DRO literature to measure the distance between probability distributions. It encompasses a variety of popular functions such as KL-divergence, χ2\chi^{2}-divergence, and the conditional-value-at-risk (CVaR), etc. Table 1 gives detailed descriptions for these functions.

For CVaR, Namkoong and Duchi (2016) proposed a mirror-descent method which achieves O(T)\mathcal{O}(\sqrt{T}) regret. Levy et al. (2020) proposed a stochastic gradient-based method with optimal convergence rate in the convex setting. They also discussed an alternative approach based on the dual formulation which they call Dual SGM. In the non-convex setting, Soma and Yoshida (2020) proposed a smoothed approximation of CVaR and obtain an O(ϵ−6)\mathcal{O}(\epsilon^{-6}) complexity. We contribute to this line of work by proposing a different divergence with similar behavior as CVaR and an O(ϵ−4)\mathcal{O}(\epsilon^{-4}) complexity.

Preliminaries

We make the following assumptions throughout the paper:

ψ\psi is a valid divergence function, i.e. a non-negative convex function satisfying ψ(1)=0\psi(1)=0 and ψ(t)=+∞\psi(t)=+\infty for all t<0t<0. Furthermore the conjugate ψ∗\psi^{*} is MM-smooth.

We finally define the notion of ϵ\epsilon-stationary points for differentiable non-convex functions.

2 Equivalent formulation of the DRO objective

The aim of this paper is to find an ϵ\epsilon-stationary point of problem 3. However, the original formulation 3 involves a max operation over distributions which makes optimization challenging. By duality arguments we can show that the DRO objective 3 can be equivalently written as (see detailed derivations in (Levy et al., 2020, Section A.1.2))

Under the Assumption 2.4, Ψ(x)\Psi(x) is differentiable, and ∇Ψ(x)=∇xL(x,η)\nabla\Psi(x)=\nabla_{x}\mathcal{L}(x,\eta) for any η∈arg⁡min⁡η′L(x,η′)\eta\in\arg\min_{\eta^{\prime}}\mathcal{L}(x,{\eta^{\prime}}).

Note that the η\eta in Lemma 2.6 may not be unique but the values of ∇xL(x,η)\nabla_{x}\mathcal{L}(x,\eta) are all equal. Since Ψ(x)\Psi(x) is differentiable, the ϵ\epsilon-stationary points are well-defined. We now prove that the problem of finding an ϵ\epsilon-stationary point of Ψ(x)\Psi(x) is equivalent to finding an ϵ\epsilon-stationary point of a rescaled version of L(x,η)\mathcal{L}(x,\eta).

Under the Assumption 2.4, if for some (x,η)(x,\eta) the following holds: ∥∇xL(x,η)∥+G∣∇ηL(x,η)∣≤ϵ\|\nabla_{x}\mathcal{L}(x,\eta)\|+G|\nabla_{\eta}\mathcal{L}(x,\eta)|\leq\epsilon, then xx is an ϵ\epsilon-stationary point of Ψ(x)\Psi(x). Furthermore, define a rescaled function

then ∥∇L^(x,η)∥≤ϵ/2\|\nabla\widehat{\mathcal{L}}(x,\eta)\|\leq\epsilon/\sqrt{2} implies that xx is an ϵ\epsilon-stationary point of Ψ(x)\Psi(x).

The proof of Lemma 2.6 and Theorem 2.7 can be found in Appendix A. From the above theorem it suffices to find an ϵ\epsilon-stationary point of L^(x,η)\widehat{\mathcal{L}}(x,\eta) such that ∥∇L^(x,η)∥≤ϵ\|\nabla\widehat{\mathcal{L}}(x,\eta)\|\leq\epsilon (ignoring numerical constant 2\sqrt{2}). As a result, we will mainly work with L^\widehat{\mathcal{L}} in subsequent analysis. The property of the objective function 5 heavily depends on ψ∗\psi^{*}. We list some popular choices of ψ\psi together with the corresponding ψ∗\psi^{*} in Table 1. They serve as motivating examples of our subsequent analysis.

Analysis of general non-convex DRO

Now consider the DRO where ψ\psi is chosen as the commonly used χ2\chi^{2}-divergence. Fix λ=1\lambda=1 and η=0\eta=0. Based on the expression of ψ∗(t)\psi^{*}(t) in Table 1, the DRO objective function 5 thus takes the form L^(x,0;ξ)=14[x2(1+ξx2+1)2+2]2−1\widehat{\mathcal{L}}(x,0;\xi)=\frac{1}{4}\left[x^{2}\left(1+\frac{\xi}{x^{2}+1}\right)^{2}+2\right]^{2}-1, which is a quartic-like function. It follows that

L^(x,0;ξ)=Θ(x4)\widehat{\mathcal{L}}(x,0;\xi)=\Theta(x^{4}) for large xx and therefore L^(x,0;ξ)\widehat{\mathcal{L}}(x,0;\xi) is not globally smooth;

∇xL^(x,0;ξ)=x3+2xξ+2x+O(1)\nabla_{x}\widehat{\mathcal{L}}(x,0;\xi)=x^{3}+2x\xi+2x+\mathcal{O}(1) for large xx and the stochastic gradient variance Var⁡[∇xL^(x,0;ξ)]=Θ(x2)\operatorname{Var}[\nabla_{x}\widehat{\mathcal{L}}(x,0;\xi)]=\Theta(x^{2}) which is unbounded globally.

2 Main results

In this section, we present the main theoretical result of this paper. All proofs can be founded in Appendix C. We make the following assumption on the noise of the stochastic loss:

We now provide formal statements of the key properties mentioned above, which show that both the gradient variance and the local smoothness can be controlled in terms of the gradient norm.

Under Assumptions 2.4 and 3.2, the gradient estimators of (5) satisfies the following property:

Under Assumption 2.4, for any pair of parameters (x,η)(x,\eta) and (x′,η′)(x^{\prime},\eta^{\prime}), we have the following property for the gradient of L^\widehat{\mathcal{L}}:

Note that 7 reduces to the standard notion of smoothness if the term LG∥∇L^(x,η)∥\frac{L}{G}\|\nabla\widehat{\mathcal{L}}(x,\eta)\| is absent. Thus the inequality 7 can be seen as a generalized smoothness condition. Zhang et al. (2020b) for the first time proposed such generalized smoothness for twice-differentiable functions in a different form, and Zhang et al. (2020a) further gave a comprehensive analysis of algorithms for optimizing generalized smooth functions. However, all these works make strong assumptions on the gradient noise and can not be applied in our setting.

Instead, we propose to use the mini-batch normalized SGD with momentum algorithm for non-convex DRO, shown in Algorithm 1. The algorithm has been theoretically analysed in (Cutkosky and Mehta, 2020) for optimizing standard smooth non-convex functions. Compared with Cutkosky and Mehta (2020), we use mini-batches in each iteration in order to ensure convergence in our setting.

The following main theorem establishes convergence guarantee of Algorithm 1. We further provide a sketch of proof in Section 3.3, where we can gain insights on how normalization and momentum techniques help tackle the difficulties shown in Lemmas 3.3 and 3.4.

Suppose that FF satisfies the following conditions:

(Generalized smoothness) ∥∇F(w1)−∇F(w2)∥≤(K0+K1∥∇F(w1)∥)∥w1−w2∥\|\nabla F(w_{1})-\nabla F(w_{2})\|\leq(K_{0}+K_{1}\|\nabla F(w_{1})\|)\|w_{1}-w_{2}\| holds for any w1,w2w_{1},w_{2};

Substituting Lemmas 3.4 and 3.3 into Theorem 3.5 immediately yields the final result:

Suppose the DRO problem 3 satisfies Assumptions 2.4 and 3.2. Using Algorithm 1 with a constant batch size, the gradient complexity for finding an ϵ\epsilon-stationary point of Ψ(x)\Psi(x) is

Corollary 3.6 shows that Algorithm 1 finds an ϵ\epsilon-stationary point with complexity O(ϵ−4)\mathcal{O}(\epsilon^{-4}), which is the same as standard smooth non-convex optimization. Also note that the bound in Theorem 3.5 does not depend on K1K_{1} and Γ\Gamma as long as ϵ\epsilon is sufficiently small. In other words, Algorithm 1 is well-adapted to the non-smoothness and unbounded noise in our setting. We also point out that although the batch size is chosen propositional to Γ2\Gamma^{2}, the required number of iterations TT is inversely propositional to Γ2\Gamma^{2}, therefore the total number of stochastic gradient computations remains the same.

Finally, note that Theorem 3.5 is stated in a general form and is not limited to DRO setting. It greatly extends the results in Zhang et al. (2020a, b) by relaxing their noise assumptions, and demonstrates the effectiveness of combining adaptive gradients with momentum for optimizing ill-conditioned objective functions. More importantly, our algorithm is to some extent similar to currently widely used optimizers in practice, e.g. Adam. We believe our result can shed light on why these optimizers often show superior performance in real applications.

3 Proof sketch of Theorem 3.5

Below we present our proof sketch, in which the motivation of using Algorithm 1 will be clear. Similar to standard analysis in non-convex optimization, we first derive a descent inequality for functions satisfying the generalized smoothness:

(Descent inequality) Let F(x)F(x) be a function satisfying the generalized smoothness condition in Theorem 3.5. Then for any point xx and direction zz the following holds:

The above lemma suggests that the algorithm should take a small step size when ∥∇F(x)∥\left\|\nabla F(x)\right\| is large in order to decrease FF. This is the main motivation of considering a normalized update. Indeed, after some careful calculation we can prove the following result:

Consider the algorithm that starts at w0w_{0} and makes updates wt+1=wt−γmt+1∥mt+1∥w_{t+1}=w_{t}-\gamma\frac{m_{t+1}}{\left\|m_{t+1}\right\|} where {mt}\{m_{t}\} is an arbitrary sequence of points. Define δt:=mt+1−∇F(wt)\delta_{t}:=m_{t+1}-\nabla F(w_{t}) be the estimation error. If γ=O(1/K1)\gamma=O(1/K_{1}), then

which is γ∥∇F(wt)∥−2γ∥δt∥−O(γ2)\gamma\|\nabla F(w_{t})\|-2\gamma\|\delta_{t}\|-\mathcal{O}(\gamma^{2}) for small γ\gamma. Therefore the objective function F(w)F(w) decreases if ∥δt∥<1/2⋅∥∇F(wt)∥\|\delta_{t}\|<1/2\cdot\|\nabla F(w_{t})\|, i.e. a small estimation error. However, δt\delta_{t} is related to the stochastic gradient noise which can be very large due to Lemma 3.3. This motivates us to the use the momentum technique for the choice of {mt}\{m_{t}\} to reduce the noise. Formally, let β\beta be the momentum factor and define δt^=∇^F(wt)−∇F(wt)\hat{\delta_{t}}=\hat{\nabla}F(w_{t})-\nabla F(w_{t}), then using the recursive equation of momentum mtm_{t} in Algorithm 1 we can show that

Finally, for a suitable choice of γ\gamma we can obtain the minimum gradient complexity bound on TT.

4 Dealing with the CVaR case

Previous analysis applies to any divergence function ψ\psi as long as ψ∗\psi^{*} is smooth. This includes some popular choices such as the χ2\chi^{2}-divergence, but not the CVaR. In the case of CVaR, ψ∗\psi^{*} is not differentiable as shown in Table 1, which is undesirable from an optimization viewpoint. In this section we introduce a smoothed version of CVaR. The conjugate function of the smoothed CVaR is also smooth, so that the results in Section 3.2 can be directly applied in this setting.

For standard CVaR at level α\alpha, ψα(t)\psi_{\alpha}(t) takes zero when t∈[0,1/α)t\in[0,1/\alpha) and takes infinity otherwise. Instead, we consider the following smoothed version of CVaR:

It is easy to see that ψαsmo\psi_{\alpha}^{\text{smo}} is a valid divergence. The corresponding conjugate function is

The following propositions demonstrate that ψαsmo\psi_{\alpha}^{\text{smo}} is indeed a smoothed approximation of CVaR.

Fix 0<α<10<\alpha<1. When λ→0+\lambda\rightarrow 0^{+}, the solution of the DRO problem 5 for smoothed CVaR tends to the solution for the standard CVaR. Note that the solution of the standard CVaR does not depend on λ\lambda.

ψαsmo,∗(t)\psi^{\text{smo},*}_{\alpha}(t) is 1α\frac{1}{\alpha}-Lipschitz and 14α\frac{1}{4\alpha}-smooth.

Based on Proposition 3.10, we can then use Corollary 3.6 to obtain the gradient complexity (taking M=1/4αM=1/4\alpha).

Note that ψαsmo,∗(t)\psi^{\text{smo},*}_{\alpha}(t) is not only smooth but also Lipschitz. In this setting, we can in fact obtain a stronger result than the general one provided in Corollary 3.6. Specifically, the gradient noise and smoothness of the objective function L^(x,η,ξ)\widehat{\mathcal{L}}(x,\eta,\xi) can be bounded, as shown in the following lemma:

Suppose Assumption 2.4 holds. For smoothed CVaR, the DRO objective 5 satisfies

Moreover, L^(x,η)\widehat{\mathcal{L}}(x,\eta) is KK-smooth with K=Lα+G22λαK=\frac{L}{\alpha}+\frac{G^{2}}{2\lambda\alpha}.

Equipped with the above lemma, we can obtain the following guarantee for smoothed CVaR, which shows that vanilla SGD suffices for convergence.

Suppose that ψ=ψαsmo\psi=\psi_{\alpha}^{\text{smo}} and Assumption 2.4 holds. If we run SGD with properly selected hyper-parameters on the loss L^(x,η)\widehat{\mathcal{L}}(x,\eta), then the gradient complexity of finding an ϵ\epsilon-stationary point of Ψ(x)\Psi(x) is O(α−3λ−1G2(G2+λL)Δϵ−4)\mathcal{O}\left(\alpha^{-3}\lambda^{-1}G^{2}(G^{2}+\lambda L)\Delta\epsilon^{-4}\right), where Δ=L(x0,η0)−inf⁡xΨ(x)\Delta=\mathcal{L}(x_{0},\eta_{0})-\inf_{x}\Psi(x).

The above theorem shows a similar convergence rate compared with Corollary 3.6 in terms of ϵ\epsilon and GG, and the dependency on λ\lambda is even better. Therefore the Lipschitz property of ψ∗\psi^{*} is very useful, in that it is now possible to use a simpler algorithm while achieving a similar (or even better) bound.

Experiments

Tasks. We consider two tasks: the classification task and the regression task. While classification is more common in machine learning, here we may also highlight the regression task, since recent studies show that DRO may be more suitable for non-classification problems in which the metric of interest is continuous as opposed to the 0-1 loss (Hu et al., 2018; Levy et al., 2020).

Datasets. We choose the AFAD-Full dataset for regression and CIFAR-10 dataset for classification. AFAD-Full (Niu et al., 2016) is a regression task to predict the age of human from the facial information, which contains more than 160K facial images and the corresponding age labels ranging from 15 to 75. Note that AFAD-Full is an imbalanced dataset where the ages of two thirds of the whole dataset are between 18 and 30. Following the experimental setting in (Chang et al., 2011; Chen et al., 2013; Niu et al., 2016), we split the whole dataset into a training set comprised of 80% data and a test set comprised of the remaining 20% data. CIFAR-10 dataset is a classification task consisting of 10 classes with 5000 images for each class. To demonstrate the effectiveness of our method in DRO setting, we adopt the setting in Chou et al. (2020) to construct an imbalanced CIFAR-10 by randomly sampling each category at different ratio. See Appendix for more details.

Model. For all experiments in this paper, we use the standard ResNet-18 model in (He et al., 2016). The output has 10 logits for CIFAR-10 classification task, and has a single logit for regression.

Training details. We choose the penalty coefficient λ=0.1\lambda=0.1 and the CVaR coefficient α=0.02\alpha=0.02 in all experiments. For each algorithm, we tune the learning rate hyper-parameter from a grid search and pick the one that achieves the fastest optimization speed. The momentum factor is taken to 0.9 in all experiments, and the mini-batch size is chosen to be 128. We train the model for 100 epochs on CIFAR-10 dataset and 200 epochs on AFAD-Full dataset. Other training details can be found in Appendix E.

2 Experimental results

Results are demonstrated in Figure 1. For each figure, we plot the value of the DRO objective Ψ(x)\Psi(x) through the training process. Here we calculate Ψ(x)=min⁡ηL(x,η)\Psi(x)=\min_{\eta}\mathcal{L}(x,\eta) at each epoch based on a convex optimization on η\eta until convergence (rather than using L(x,η){\mathcal{L}}(x,\eta) with the current parameter η\eta directly).

Experimental result for χ2\chi^{2} penalized DRO. Figure 1(a) and Figure 1(b) plot the training curve of the DRO objective using different algorithms. It can be seen that in both regression and classification, vanilla SGD converges slowly, and using normalized momentum algorithm significantly improves the convergence speed. For example, in regression task SGD does not converge after 100 epochs while normalized momentum algorithm converges just after 25 epochs. These results highly consist with our theoretical findings, which shows that due to the non-smoothness of the DRO loss, vanilla SGD may not be able to optimize the loss well; In contrast, normalized momentum utilizes the relationship between local smoothness and gradient magnitude, and achieves better performance.

Experimental result for smoothed CVaR. Figure 1(c) and Figure 1(d) plot the training curves for different training losses: CVaR and smoothed CVaR. Note that the evaluation metrics (yy-axis) in these figures are all chosen to be CVaR, even when the training objective is smoothed CVaR. In this way we can make a fair comparison of optimization speed based on these training curves. Firstly, it can be seen that the optimization of CVaR is very hard due to the non-smoothness, and the training curves have lots of spikes. In contrast, the optimization of smoothed CVaR is much easier for both tasks, and the final loss is significantly lower. Such experimental results show the benefit of our proposed smoothed CVaR for optimization.

Test performance. We also measure the test performance of trained models to see whether a better optimizer can also improve test accuracy. Due to space limitation, in the main text we provide results of χ2\chi^{2} penalized DRO problem for classification using unbalanced CIFAR-10 dataset, which is listed in Table 2. Other results can be found in Appendix E. It can be seen that the model trained using normalized SGD with momentum achieves higher test accuracy on all class, and especially, the worst-performing class. Since the experiments in this paper is mainly designed to compare algorithms rather than to achieve best performance, better performance is likely to be reached if adjusting the hyper-parameters (e.g. λ\lambda, the number of epochs, and the learning rate schedule).

Discussion

Conclusion. In this paper we provide non-asymptotic analysis of first-order algorithms for the DRO problem with unbounded and non-convex loss. Specifically, we write the original DRO problem as a non-smooth non-convex optimization problem, and we propose an efficient normalization-based algorithm to solve it. The general result of Theorem 3.5 might be of independent value and is not limited to DRO setting. We hope that this work can also bring inspiration to the study of other non-smooth non-convex optimization problems.

Limitations. Despite the theoretical grounds and promising experimental justifications, there are some interesting questions that remain unexplored. Firstly, it may be possible to obtain better complexities on problem-dependent parameters, e.g. GG and λ\lambda. Secondly, while this paper mainly considers smooth ψ∗\psi^{*}, in some cases ψ∗\psi^{*} may be non-smooth (e.g. for KL-divergence) or even not continuous. In future we hope to discover approaches that can deal with more general classes of ψ\psi-divergence. Finally, we are looking forward to seeing more applications of DRO in real-world problems.

Acknowledgement

This work was supported by Key-Area Research and Development Program of Guangdong Province (No. 2019B121204008), National Key R&D Program of China (2018YFB1402600), BJNSF (L172037) and Beijing Academy of Artificial Intelligence. Project 2020BD006 supported by PKU-Baidu Fund. Jikai Jin is partially supported by the elite undergraduate training program of School of Mathematical Sciences in Peking University.

References

Appendix A Equivalent formulation of the DRO objective

We first assume Ψ(x)\Psi(x) is non-smooth and non-convex. To measure the convergence of non-smooth non-convex optimization, we define the notion called the generalized gradient [Clarke, 1990, Chapter 2].

and the generalized gradient at xx is the set

Interested readers may refer to the book [Clarke, 1990] for an in-depth exploration of this concept. Importantly, ∂f(x)\partial f(x) is a non-empty closed convex set; ∂f(x)\partial f(x) degenerates to a single point {∇f(x)}\{\nabla f(x)\} if ff is smooth, and ∂f(x)\partial f(x) is equivalent to the sub-gradient if ff is convex. If xx is a local minima (or maxima) for f(x)f(x), then 0∈∂f(x)0\in\partial f(x). The following proposition gives the relationship between generalized gradient and (conventional) gradient.

([Clarke, 1990, Section 2.2]) If function ff is differentiable at xx, then ff is local Lipschitz near xx and ∂f(x)={∇f(x)}\partial f(x)=\{\nabla f(x)\}. Conversely, if ff is local Lipschitz near xx and ∂f(x)\partial f(x) reduces to a singleton point {g}\{g\}, then ff is differentiable at xx and ∇f(x)=g\nabla f(x)=g.

A.2 Proof of Lemma 2.6

We first present a basic lemma which provides a rule to calculate generalized gradients of the pointwise maxima of a function family.

where T(x)={t∈T:F(x)=f(x,t)}T(x)=\left\{t\in T:F(x)=f(x,t)\right\}, ∂xf(x,t)\partial_{x}f(x,t) is the partial generalized gradient and Conv⁡\operatorname{Conv} denotes a convex hull of a point set.

Assume Assumption 2.4 holds. Fix a point x0∈Xx_{0}\in\mathcal{X}. Denote η0∈argmin⁡ηL(x0,η)\eta_{0}\in\operatorname{argmin}_{\eta}\mathcal{L}(x_{0},\eta) be an arbitrary minima. Then for any point x∈Br(x0)x\in\mathcal{B}_{r}(x_{0}) near x0,x_{0}, there exists ηx∈argmin⁡ηL(x,η)\eta_{x}\in\operatorname{argmin}_{\eta}\mathcal{L}(x,\eta), such that ∣η0−ηx∣≤Gr|\eta_{0}-\eta_{x}|\leq Gr.

Using the condition that ψ∗\psi^{*} is convex and differentiable, we have ηx∈argmin⁡ηL(x,η)\eta_{x}\in\operatorname{argmin}_{\eta}\mathcal{L}(x,\eta) if and only if ∇ηL(x,η)=0\nabla_{\eta}\mathcal{L}(x,\eta)=0. Namely,

Since ∇ηL(x,η)\nabla_{\eta}\mathcal{L}(x,\eta) is continuous in η\eta, there must exists an ηx∈[η0−Gr,η0+Gr]\eta_{x}\in[\eta_{0}-Gr,\eta_{0}+Gr], such that

Therefore ηx∈argmin⁡ηL(x,η)\eta_{x}\in\operatorname{argmin}_{\eta}\mathcal{L}(x,\eta). □\square

For any point x0x_{0}, we can use Lemma A.4 by substituting X=Br(x0)\mathcal{X}=\mathcal{B}_{r}(x_{0}) and T=[η0−Gr,η0+Gr]\mathcal{T}=[\eta_{0}-Gr,\eta_{0}+Gr]. The procedure is as follows:

We finally prove below (Lemma A.6) that {∇xL(x,η):η∈argmin⁡ηL(x,η)}\{\nabla_{x}\mathcal{L}(x,\eta):\eta\in\operatorname{argmin}_{\eta}\mathcal{L}(x,\eta)\} is a singleton set. Then Proposition A.3 indicates that Ψ(x)\Psi(x) is differentiable, and the generalized gradient reduces to gradient such that ∇Ψ(x)=∇xL(x,η)\nabla\Psi(x)=\nabla_{x}\mathcal{L}(x,\eta) for any η∈argmin⁡ηL(x,η)\eta\in\operatorname{argmin}_{\eta}\mathcal{L}(x,\eta). Thus we complete the proof of Lemma 2.6.

Assume Assumption 2.4 holds. For any η1,η2∈argmin⁡ηL(x,η)\eta_{1},\eta_{2}\in\operatorname{argmin}_{\eta}\mathcal{L}(x,\eta), we have ∇xL(x,η1)=∇xL(x,η2)\nabla_{x}\mathcal{L}(x,\eta_{1})=\nabla_{x}\mathcal{L}(x,\eta_{2}).

Denote X(x,η)X(x,\eta), Y(x)Y(x) be two random functions defined by

which depend on the random variable ξ\xi. Rewrite the gradient of L(x,η)\mathcal{L}(x,\eta) as follows:

Note that (ψ∗)′(\psi^{*})^{\prime} is monotonically increasing (due to the convexity of ψ∗\psi^{*}), thus X(x,η)X(x,\eta) is monotonically decreasing in η\eta. It follows that

A.3 Proof of Theorem 2.7

Now, suppose that we have obtained a pair (x,η)(x,\eta) s.t. ∥∇xL(x,η)∥+G∣∇ηL(x,η)∣≤ϵ\left\|\nabla_{x}\mathcal{L}(x,\eta)\right\|+G\left|\nabla_{\eta}\mathcal{L}(x,\eta)\right|\leq\epsilon. Let xx be fixed and η∗∈arg⁡min⁡ηL(x,η)\eta^{*}\in\mathop{\arg\min}_{\eta}\mathcal{L}(x,\eta). Then we have

where we use the fact that (ψ∗)′(\psi^{*})^{\prime} is monotone increasing (due to the comvexity of ψ∗\psi^{*}. Hence, using Lemma 2.6 we obtain

Now suppose that ∥∇L^(x,η)∥≤ϵ/2\|\nabla\widehat{\mathcal{L}}(x,\eta)\|\leq\epsilon/\sqrt{2}. Then

Using (a+b)2≤2(a2+b2)(a+b)^{2}\leq 2(a^{2}+b^{2}) we obtain

Appendix B The Stochastic Projected Gradient Descent algorithm for DRO with bounded loss

In this section we use a simple projected gradient method to minimize the DRO objective (5) and analyze its convergence rate under the assumption that the loss is bounded. Since this section is not so related to the main result in our paper, we mainly provide the gradient complexity bound in terms of ϵ\epsilon for finding an ϵ\epsilon-stationary point without delving into problem-dependent parameters.

It turns out that we can restrict the feasible region to X×[U,V]\mathcal{X}\times\left[{U},{V}\right] where [U,V]\left[{U},{V}\right] is a finite interval.

Under the Assumptions 2.4 and B.1, the DRO problem is equivalent to

where U=−λCψGU=-\frac{\lambda C_{\psi}}{G} and V=B−λCψGV=\frac{B-\lambda C_{\psi}}{G} are real numbers and CψC_{\psi} is a constant depending only on ψ\psi.

Note that (ψ∗)′(\psi^{*})^{\prime} is a function satisfying the following properties:

(ψ∗)′(\psi^{*})^{\prime} is monotonically increasing;

0≤lim⁡s→−∞(ψ∗)′(s)≤10\leq\lim\limits_{s\to-\infty}(\psi^{*})^{\prime}(s)\leq 1. This is because lim⁡s→−∞ψ∗(s)s=lim⁡s→−∞inf⁡t≥0t−ψ(t)s=min⁡{t:ψ(t)<+∞}∈\lim\limits_{s\to-\infty}\frac{\psi^{*}(s)}{s}=\lim\limits_{s\to-\infty}\inf_{t\geq 0}t-\frac{\psi(t)}{s}=\min\{t:\psi(t)<+\infty\}\in since ψ(1)=0\psi(1)=0;

lim⁡s→+∞(ψ∗)′(s)≥1\lim\limits_{s\to+\infty}(\psi^{*})^{\prime}(s)\geq 1 (possibly be +∞+\infty). This is because ψ∗(s)s=sup⁡t≥0t−ψ(t)s≥1\frac{\psi^{*}(s)}{s}=\sup_{t\geq 0}t-\frac{\psi(t)}{s}\geq 1 for s>0s>0 since ψ(1)=0\psi(1)=0.

Therefore there exists a constant CψC_{\psi} depending only on ψ\psi such that (ψ∗)′(Cψ)=1(\psi^{*})^{\prime}(C_{\psi})=1.

For any x∈Xx\in\mathcal{X}, the optimal η∗\eta^{*} satisfies the following equation:

We now show there exists an optimal η∗\eta^{*} such that Gη∗∈[−λCψ,B−λCψ]G\eta^{*}\in[-\lambda C_{\psi},B-\lambda C_{\psi}]. In fact, we have

Suppose Assumption 2.4 holds. Under Proposition B.2, L\mathcal{L} is KK smooth on X×[U,V]\mathcal{X}\times[U,V], where KK only depends on ψ,λ,M,B,G\psi,\lambda,M,B,G and LL.

Therefore L\mathcal{L} is smooth. □\square

Suppose Assumption 2.4 holds. Under Proposition B.2, the stochastic gradients are unbiased estimates of the true gradients ∇xL\nabla_{x}\mathcal{L} and ∇ηL\nabla_{\eta}\mathcal{L} and are uniformly bounded over X×[U,V]\mathcal{X}\times{[U,V]}, by a constant Λ\Lambda which only depends on ψ,λ,M,B,G\psi,\lambda,M,B,G and LL.

Following [Ghadimi et al., 2016, Reddi et al., 2016], in constrained optimization we typically consider a generalized gradient defined as

[Ghadimi et al., 2016, Corollary 3], combined with Proposition B.4 implies that if γ=1/2L\gamma=1/2L,

For any ϵ>0\epsilon>0, we choose T=2KΔϵ−2T=2K\Delta\epsilon^{-2} and S=12Λ2ϵ−2S=12\Lambda^{2}\epsilon^{-2}, then 24 implies that

Thus the sample complexity of Algorithm 1 for finding ϵ\epsilon-stationary point is upper bounded by 24KΛ2Δϵ−424K\Lambda^{2}\Delta\epsilon^{-4}. In this case, with pobability ≥0.5\geq 0.5 the gradient norm is upper bounded by 2ϵ2\epsilon, the conclusion follows. □\square

as the interval constraint for η\eta. Using parameters specified in Theorem B.5, Algorithm 2 arrives at (x,η)(x,\eta) with ∥∇Ψ(x)∥≤ϵ\left\|\nabla\Psi(x)\right\|\leq\epsilon with probability ≥0.5\geq 0.5.

However, η+≤η\eta^{+}\leq\eta, therefore it can only be that η+=η=η0\eta^{+}=\eta=\eta_{0}. Therefore we still have

Appendix C Proofs in Section 3.2

In this section we present the proof of main results in Section 3.2. For convenience we restate the results before proving them.

Under Assumptions 2.4 and 3.2, the gradient estimators of (5) satisfies the following property:

For a random vector XX, define the sum of its element-wise variance as

Then it is easy to check that, for i.i.d. random vectors X1,X2X_{1},X_{2} we have

We first bound the variance of the stochastic gradient ∇xL^(x,η;ξ)\nabla_{x}\widehat{\mathcal{L}}(x,\eta;\xi). Indeed we have

Here in 33 we use that fact that (a+b)2≤2(a2+b2)(a+b)^{2}\leq 2(a^{2}+b^{2}) for any a,ba,b; in 34 we use Assumption 2.4. Now we deal with the first term. Using 2(a−1)2+2≥a22(a-1)^{2}+2\geq a^{2} for any aa, we have

Under Assumption 2.4, for any pair of parameters (x,η)(x,\eta) and (x′,η′)(x^{\prime},\eta^{\prime}), we have the following property for the gradient of L^\widehat{\mathcal{L}}:

First write ∇L^(x,η)\nabla\widehat{\mathcal{L}}(x,\eta) as

We then split ∇L(x,η)−∇L(x′,η′)\nabla\mathcal{L}(x,\eta)-\nabla\mathcal{L}(x^{\prime},\eta^{\prime}) into two terms A+BA+B, where

where we use (ψ∗)′(s)≥0(\psi^{*})^{\prime}(s)\geq 0 for all ss. BB can be bounded as follows:

Combining the above inequalities, we obtain

C.2 Proof of Theorem 3.5

We formalize the generalized smoothness property into a definition.

We now present a descent inequality for (K0,K1)(K_{0},K_{1})-smooth functions which will be used in subsequent analysis.

(Descent Inequality) Let FF be (K0,K1)(K_{0},K_{1})-smooth, then for any point xx and direction zz the following holds:

C.2.2 Properties of the normalized update

Let μ≥0\mu\geq 0 be a real constant. For any vectors uu and vv,

Now we can characterize the behavior of normalization-based algorithms in terms of function value descent.

Consider the algorithm that starts at w0w_{0} and makes updates wt+1=wt−γmt+1∥mt+1∥w_{t+1}=w_{t}-\gamma\frac{m_{t+1}}{\left\|m_{t+1}\right\|} where {mt}\{m_{t}\} is an arbitrary sequence of points. Define δt:=mt+1−∇F(wt)\delta_{t}:=m_{t+1}-\nabla F(w_{t}) be the estimation error. Then

Since ∥wt+1−wt∥=γ\|w_{t+1}-w_{t}\|=\gamma, by Lemma C.4 we have

where in the second inequality we use Lemma C.5. □\square

C.2.3 A general convergence result

Instead of directly focusing on the specific problem of DRO, we first provide convergence guarantee for Algorithm 2 under general smoothness and noise assumptions.

Suppose that FF is (K0,K1)(K_{0},K_{1})-smooth and the stochastic gradient estimator ∇F(w,ξ)\nabla F(w,\xi) is unbiased and satisfies

Define the estimation errors δt:=mt+1−∇F(wt)\delta_{t}:=m_{t+1}-\nabla F(w_{t}). Denote H(a,b):=∇F(a)−∇F(b)H(a,b):=\nabla F(a)-\nabla F(b). We can upper bound H(a,b)H(a,b) using the definition of (K0,K1)(K_{0},K_{1})-smoothness:

Using the definition of momentum mtm_{t} and H(a,b)H(a,b), we can get a recursive formula on δt\delta_{t}:

Using triangle inequality and plugging in the estimate 46, we have

Taking a telescope summation of 48 we obtain

Now we take expectation of ∥∑τ=0tβτδ^t−τ∥\left\|\sum_{\tau=0}^{t}\beta^{\tau}\hat{\delta}_{t-\tau}\right\| over all the randomness. We will prove a core lemma ( Lemma C.9) later which shows

If we choose γ=18(min⁡(K1−1,K0−1ϵ)(1−β)\gamma=\frac{1}{8}(\min(K_{1}^{-1},K_{0}^{-1}\epsilon)(1-\beta), and S=64Γ2S=64\Gamma^{2}, then

Set 1−β=min⁡(4Λ−2Γ2ϵ2,1)1-\beta=\min(4\Lambda^{-2}\Gamma^{2}\epsilon^{2},1) and m0=∥∇F(w0)∥m_{0}=\|\nabla F(w_{0})\|, then

If ϵ≤min⁡(K0K1,Λ2Γ)\epsilon\leq\mathcal{\min}\left(\frac{K_{0}}{K_{1}},\frac{\Lambda}{2\Gamma}\right), then the gradient complexity is 512Λ2ΔK0ϵ−4512\Lambda^{2}\Delta K_{0}\epsilon^{-4}. □\square

Suppose the DRO problem 3 satisfies Assumptions 2.4 and 3.2. Using Algorithm 1 with a constant batch size 4096, the gradient complexity for finding an ϵ\epsilon-stationary point of Ψ(x)\Psi(x) is

Lemmas 3.3 and 3.4 imply that the conditions in Theorem 3.5 for L^(x,η)\widehat{\mathcal{L}}(x,\eta) are satisfied with K0=L+2G2λ−1M,Γ2=64,Λ2=11G2M2λ−2σ2+8G2K_{0}=L+2G^{2}\lambda^{-1}M,\Gamma^{2}=64,\Lambda^{2}=11G^{2}M^{2}\lambda^{-2}\sigma^{2}+8G^{2}. The main result immediately follows from Theorems 3.5 and 2.7. □\square

We now return to prove the core lemma that is used in 50.

Let δ^t=∇^F(wt)−∇F(wt)\hat{\delta}_{t}=\hat{\nabla}F(w_{t})-\nabla F(w_{t}) be the stochastic noise. Then

We prove the following result: for each i∈{0,1,⋯ ,t+1}i\in\{0,1,\cdots,t+1\}, the following inequality holds:

It is easy to see that Lemma C.9 follows by setting i=t+1i=t+1 in 53.

We prove 53 by induction. When i=0i=0, 53 holds obviously. Now suppose 53 holds for ii, and we want to prove that 53 holds for i+1i+1.

Appendix D Proofs in Section 3.4

In this section we prove the main result of Section 3.4 for smoothed CVaR. Recall the expressions

The following proposition shows that ψαsmo,∗\psi^{\text{smo},*}_{\alpha} is Lipschitz-continuous and smooth.

ψαsmo,∗(t)\psi^{\text{smo},*}_{\alpha}(t) is 1α\frac{1}{\alpha}-Lipschitz and 14α\frac{1}{4\alpha}-smooth.

where we use α(1−α)≤14\alpha(1-\alpha)\leq\frac{1}{4}. Hence the conclusion follows. □\square

Fix 0<α<10<\alpha<1. When λ→0\lambda\rightarrow 0, the solution of the DRO problem 5 for smoothed CVaR tends to the solution for the standard CVaR.

For the standard CVaR, the DRO problem can be written as

which is irrelevant to λ\lambda. For smoothed CVaR, the DRO problem can be written as

Suppose Assumption 2.4 holds. For smoothed CVaR, the DRO objective 5 satisfies

Moreover, L^(x,η)\widehat{\mathcal{L}}(x,\eta) is KK-smooth with K=Lα+G22λαK=\frac{L}{\alpha}+\frac{G^{2}}{2\lambda\alpha}.

since ψ∗\psi^{*} is non-decreasing and 1α\frac{1}{\alpha}-Lipschitz continuous.

We also have ∥∇ηL^(x,η;ξ)∥≤α−1G\left\|\nabla_{\eta}\widehat{\mathcal{L}}(x,\eta;\xi)\right\|\leq\alpha^{-1}G. Therefore ∥∇L^(x,η)∥2≤2α−2G2\left\|\nabla\widehat{\mathcal{L}}(x,\eta)\right\|^{2}\leq 2\alpha^{-2}G^{2}.

Now we turn to the smoothness of L\mathcal{L}. For any (x,η)(x,\eta) and (x′,η′)(x^{\prime},\eta^{\prime}) we decouple ∇L^(x,η)−∇L^(x′,η′)\nabla\widehat{\mathcal{L}}(x,\eta)-\nabla\widehat{\mathcal{L}}(x^{\prime},\eta^{\prime}) into A+BA+B using the same approach as in 40. Now different from 41, AA can be bounded by

using the Lipschitz property of ψ∗\psi^{*}. The bound for BB is the same as 42:

Hence L\mathcal{L} is KK-smooth as desired. □\square

Suppose that ψ=ψαsmo\psi=\psi_{\alpha}^{\text{smo}} and Assumption 2.4 holds. If we run SGD with properly selected hyper-parameters on the loss L^(x,η)\widehat{\mathcal{L}}(x,\eta), then the gradient complexity of finding an ϵ\epsilon-stationary point of Ψ(x)\Psi(x) is O(α−3λ−1G2(G2+λL)Δϵ−4)\mathcal{O}\left(\alpha^{-3}\lambda^{-1}G^{2}(G^{2}+\lambda L)\Delta\epsilon^{-4}\right), where Δ=L(x0,η0)−inf⁡xΨ(x)\Delta=\mathcal{L}(x_{0},\eta_{0})-\inf_{x}\Psi(x).

It is well-known [Ghadimi and Lan, 2013] that the complexity of SGD for finding an ϵ\epsilon-stationary point is O(ΔKσ2ϵ−4)\mathcal{O}(\Delta K\sigma^{2}\epsilon^{-4}) if the objective function is KK-smooth and σ2\sigma^{2} is an upper bound of the variance of stochastic gradients. Now the proof can be completed by using Lemma D.3. □\square

Appendix E Experiment

Imbalanced CIFAR-10. To demonstrate the effectiveness of our method in DRO-classification setting, we construction an imbalanced classification dataset. The original version of CIFAR-10 contains 50,000 training images and 10,000 validation images of size 32×\times32 with 10. To create their imbalanced version, we reduce the number of training examples per class and keep the validation set unchanged. We consider the type of random imbalance and use ρi\rho_{i} to denote the sample ratio of iith class between the imbalanced and original dataset. ρ={0.804,0.543,0.997,0.593,0.390,0.285,0.959,0.806,0.967,0.660}\rho=\{0.804,0.543,0.997,0.593,0.390,0.285,0.959,0.806,0.967,0.660\}

E.2 Implementation details

For every training task we jointly tune the parameters learning rate for baseline and our method by grid search and pick the one that achieves the fastest optimization. By default we set momentum = 0.9 for all experiments and ϵ=0.1\epsilon=0.1 for normalized SGD. We use batch size n = 128 throughout.

Hyper-parameter for χ2\chi^{2} penalized DRO. In regression setting, we use SGD with lr=0.0002 as our baseline algorithm and set lr=0.005 for normalized SGD. In classification setting, we set lr=0.005 and 0.01 for baseline and our method, respectively.

Hyper-parameter for smoothed CVaR. In smooth CVaR, we also divide experiment into two part, regression and classification task. We train CVaR with lr = (0.00005, 0.00005) and smoothed CVaR with lr = (0.001, 0.0001) in regression and classification setting.