Stochastic Dual Coordinate Ascent Methods for Regularized Loss Minimization

Shai Shalev-Shwartz, Tong Zhang

Introduction

For example, given labels y1,,yny_{1},\ldots,y_{n} in {±1}\{\pm 1\}, the SVM problem (with linear kernels and no bias term) is obtained by setting ϕi(a)=max{0,1yia}\phi_{i}(a)=\max\{0,1-y_{i}a\}. Regularized logistic regression is obtained by setting ϕi(a)=log(1+exp(yia))\phi_{i}(a)=\log(1+\exp(-y_{i}a)). Regression problems also fall into the above. For example, ridge regression is obtained by setting ϕi(a)=(ayi)2\phi_{i}(a)=(a-y_{i})^{2}, regression with the absolute-value is obtained by setting ϕi(a)=ayi\phi_{i}(a)=|a-y_{i}|, and support vector regression is obtained by setting ϕi(a)=max{0,ayiν}\phi_{i}(a)=\max\{0,|a-y_{i}|-\nu\}, for some predefined insensitivity parameter ν>0\nu>0.

Let ww^{*} be the optimum of (1). We say that a solution ww is ϵP\epsilon_{P}-sub-optimal if P(w)P(w)ϵPP(w)-P(w^{*})\leq\epsilon_{P}. We analyze the runtime of optimization procedures as a function of the time required to find an ϵP\epsilon_{P}-sub-optimal solution.

The dual objective in (2) has a different dual variable associated with each example in the training set. At each iteration of DCA, the dual objective is optimized with respect to a single dual variable, while the rest of the dual variables are kept in tact.

then it is known that w(α)=ww(\alpha^{*})=w^{*}, where α\alpha^{*} is an optimal solution of (2). It is also known that P(w)=D(α)P(w^{*})=D(\alpha^{*}) which immediately implies that for all ww and α\alpha, we have P(w)D(α)P(w)\geq D(\alpha), and hence the duality gap defined as

can be regarded as an upper bound of the primal sub-optimality P(w(α))P(w)P(w(\alpha))-P(w^{*}).

We focus on a stochastic version of DCA, abbreviated by SDCA, in which at each round we choose which dual coordinate to optimize uniformly at random. The purpose of this paper is to develop theoretical understanding of the convergence of the duality gap for SDCA.

We analyze SDCA either for LL-Lipschitz loss functions or for (1/γ)(1/\gamma)-smooth loss functions, which are defined as follows. Throughout the paper, we will use ϕ(a)\phi^{\prime}(a) to denote a sub-gradient of a convex function ϕ()\phi(\cdot), and use ϕ(a)\partial\phi(a) to denote its sub-differential.

where ϕi\phi_{i}^{\prime} is the derivative of ϕi\phi_{i}.

Our main findings are: in order to achieve a duality gap of ϵ\epsilon,

For loss functions which are almost everywhere smooth (such as the hinge-loss), we can obtain rate better than the above rate for Lipschitz loss. See Section 5 for a precise statement.

Related Work

DCA methods are related to decomposition methods . While several experiments have shown that decomposition methods are inferior to SGD for large scale SVM , recently argued that SDCA outperform the SGD approach in some regimes. For example, this occurs when we need relatively high solution accuracy so that either SGD or SDCA has to be run for more than a few passes over the data.

However, our theoretical understanding of SDCA is not satisfying. Several authors (e.g. ) proved a linear convergence rate for solving SVM with DCA (not necessarily stochastic). The basic technique is to adapt the linear convergence of coordinate ascent that was established by . The linear convergence means that it achieves a rate of (1ν)k(1-\nu)^{k} after kk passes over the data, where ν>0\nu>0. This convergence result tells us that after an unspecified number of iterations, the algorithm converges faster to the optimal solution than SGD.

However, there are two problems with this analysis. First, the linear convergence parameter, ν\nu, may be very close to zero and the initial unspecified number of iterations might be very large. In fact, while the result of does not explicitly specify ν\nu, an examine of their proof shows that ν\nu is proportional to the smallest nonzero eigenvalue of XXX^{\top}X, where XX is the n×dn\times d data matrix with its ii-th row be the ii-th data point xix_{i}. For example if two data points xixjx_{i}\neq x_{j} becomes closer and closer, then ν0\nu\to 0. This dependency is problematic in the data laden domain, and we note that such a dependency does not occur in the analysis of SGD.

Some analyses of stochastic coordinate ascent provide solutions to the first problem mentioned above. For example, analyzed an exponentiated gradient dual coordinate ascent algorithm. The algorithm analyzed there (exponentiated gradient) is different from the standard DCA algorithm which we consider here, and the proof techniques are quite different. Consequently their results are not directly comparable to results we obtain in this paper. Nevertheless we note that for SVM, their analysis shows a convergence rate of O(n/ϵD)O(n/\epsilon_{D}) in order to achieve ϵD\epsilon_{D}-sub-optimality (on the dual) while our analysis shows a convergence of O(nloglogn+1/λϵ)O(n\log\log n+1/\lambda\epsilon) to achieve ϵ\epsilon duality gap; for logistic regression, their analysis shows a convergence rate of O((n+1/λ)log(1/ϵD))O((n+1/\lambda)\log(1/\epsilon_{D})) in order to achieve ϵD\epsilon_{D}-sub-optimality on the dual while our analysis shows a convergence of O((n+1/λ)log(1/ϵ))O((n+1/\lambda)\log(1/\epsilon)) to achieve ϵ\epsilon duality gap.

In addition, , and later have analyzed randomized versions of coordinate descent for unconstrained and constrained minimization of smooth convex functions. [3, Theorem 4] applied these results to the dual SVM formulation. However, the resulting convergence rate is O(n/ϵD)O(n/\epsilon_{D}) which is, as mentioned before, inferior to the results we obtain here. Furthermore, neither of these analyses can be applied to logistic regression due to their reliance on the smoothness of the dual objective function which is not satisfied for the dual formulation of logistic regression. We shall also point out again that all of these bounds are for the dual sub-optimality, while as mentioned before, we are interested in the primal sub-optimality.

In this paper we derive new bounds on the duality gap (hence, they also imply bounds on the primal sub-optimality) of SDCA. These bounds are superior to earlier results, and our analysis only holds for randomized (stochastic) dual coordinate ascent. As we will see from our experiments, randomization is important in practice. In fact, the practical convergence behavior of (non-stochastic) cyclic dual coordinate ascent (even with a random ordering of the data) can be slower than our theoretical bounds for SDCA, and thus cyclic DCA is inferior to SDCA. In this regard, we note that some of the earlier analysis such as can be applied both to stochastic and to cyclic dual coordinate ascent methods with similar results. This means that their analysis, which can be no better than the behavior of cyclic dual coordinate ascent, is inferior to our analysis.

Recently, derived a stochastic coordinate ascent for structural SVM based on the Frank-Wolfe algorithm. Specifying one variant of their algorithm to binary classification with the hinge loss, yields the SDCA algorithm for the hinge-loss. The rate of convergence derived for their algorithm is the same as the rate we derive for SDCA with a Lipschitz loss function.

The following table summarizes our results in comparison to previous analyses. Note that for SDCA with Lipschitz loss, we observe a faster practical convergence rate, which is explained with our refined analysis in Section 5.

Basic Results

The generic algorithm we analyze is described below. In the pseudo-code, the parameter TT indicates the number of iterations while the parameter T0T_{0} can be chosen to be a number between 11 to TT. Based on our analysis, a good choice of T0T_{0} is to be T/2T/2. In practice, however, the parameters TT and T0T_{0} are not required as one can evaluate the duality gap and terminate when it is sufficiently small.

Procedure SDCA(α(0))(\alpha^{(0)}) Let w(0)=w(α(0))w^{(0)}=w(\alpha^{(0)}) Iterate: for t=1,2,,Tt=1,2,\dots,T: Randomly pick ii Find Δαi\Delta\alpha_{i} to maximize ϕi((αi(t1)+Δαi))λn2w(t1)+(λn)1Δαixi2-\phi_{i}^{*}(-(\alpha_{i}^{(t-1)}+\Delta\alpha_{i}))-\frac{\lambda n}{2}\|w^{(t-1)}+(\lambda n)^{-1}\Delta\alpha_{i}x_{i}\|^{2}. α(t)α(t1)+Δαiei\alpha^{(t)}\leftarrow\alpha^{(t-1)}+\Delta\alpha_{i}e_{i} w(t)w(t1)+(λn)1Δαixiw^{(t)}\leftarrow w^{(t-1)}+(\lambda n)^{-1}\Delta\alpha_{i}x_{i} Output (Averaging option): Let αˉ=1TT0i=T0+1Tα(t1)\bar{\alpha}=\frac{1}{T-T_{0}}\sum_{i=T_{0}+1}^{T}\alpha^{(t-1)} Let wˉ=w(αˉ)=1TT0i=T0+1Tw(t1)\bar{w}=w(\bar{\alpha})=\frac{1}{T-T_{0}}\sum_{i=T_{0}+1}^{T}w^{(t-1)} return wˉ\bar{w} Output (Random option): Let αˉ=α(t)\bar{\alpha}=\alpha^{(t)} and wˉ=w(t)\bar{w}=w^{(t)} for some random tT0+1,,Tt\in T_{0}+1,\ldots,T return wˉ\bar{w}

We analyze the algorithm based on different assumptions on the loss functions. To simplify the statements of our theorems, we always assume the following:

If we choose the average version, we may simply take T=2T0T=2T_{0}. Moreover, we note that Theorem 1 holds for both averaging or for choosing ww at random from {T0+1,,T}\{T_{0}+1,\ldots,T\}. This means that calculating the duality gap at few random points would lead to the same type of guarantee with high probability. This approach has the advantage over averaging, since it is easier to implement the stopping condition (we simply check the duality gap at some random stopping points. This is in contrast to averaging in which we need to know T,T0T,T_{0} in advance).

The above theorem applies to the hinge-loss function, ϕi(u)=max{0,1yia}\phi_{i}(u)=\max\{0,1-y_{i}a\}. However, for the hinge-loss, the constant 44 in the first inequality can be replaced by 11 (this is because the domain of the dual variables is positive, hence the constant 44 in Lemma 4 can be replaced by 11). We therefore obtain the bound:

If we choose T=2T0T=2T_{0}, and assume that T0n+1/(λγ)T_{0}\geq n+1/(\lambda\gamma), then the second part of Theorem 2 implies a requirement of

which is slightly weaker than the first part of Theorem 2 when ϵP\epsilon_{P} is relatively large.

Using SGD at the first epoch

We first introduce convenient notation. Let PtP_{t} denote the primal objective for the first tt examples in the training set,

Note that Pn(w)P_{n}(w) is the primal objective given in (1) and that Dn(α)D_{n}(\alpha) is the dual objective given in (2).

The following algorithm is a modification of SGD. The idea is to greedily decrease the dual sub-optimality for problem Dt()D_{t}(\cdot) at each step tt. This is different from DCA which works with Dn()D_{n}(\cdot) at each step tt.

Procedure Modified-SGD Initialize: w(0)=0w^{(0)}=0 Iterate: for t=1,2,,nt=1,2,\dots,n: Find αt\alpha_{t} to maximize ϕt(αt)λt2w(t1)+(λt)1αtxt2-\phi_{t}^{*}(-\alpha_{t})-\frac{\lambda t}{2}\|w^{(t-1)}+(\lambda t)^{-1}\alpha_{t}x_{t}\|^{2}. Let w(t)=1λti=1tαixiw^{(t)}=\frac{1}{\lambda t}\sum_{i=1}^{t}\alpha_{i}x_{i} return α\alpha

We have the following result for the convergence of dual objective:

Assume that ϕi\phi_{i} is LL-Lipschitz for all ii. In addition, assume that (ϕi,xi)(\phi_{i},x_{i}) are iid samples from the same distribution for all i=1,,ni=1,\ldots,n. At the end of Procedure Modified-SGD, we have

Here the expectation is with respect to the random sampling of {(ϕi,xi):i=1,,n}\{(\phi_{i},x_{i}):i=1,\ldots,n\}.

When λ\lambda is relatively large, the convergence rate in Theorem 3 for modified-SGD is better than what we can prove for SDCA. This is because Modified-SGD employs a larger step size at each step tt for Dt(α)D_{t}(\alpha) than the corresponding step size in SDCA for D(α)D(\alpha). However, the proof requires us to assume that (ϕi,xi)(\phi_{i},x_{i}) are randomly drawn from a certain distribution, while this extra randomness assumption is not needed for the convergence of SDCA.

Procedure SDCA with SGD Initialization Stage 1: call Procedure Modified-SGD and obtain α\alpha Stage 2: call Procedure SDCA with parameter α(0)=α\alpha^{(0)}=\alpha

For Lipschitz loss, ideally we would like to have a computational complexity of O(n+L2/(λϵP))O(n+L^{2}/(\lambda\epsilon_{P})). Theorem 4 shows that SDCA with SGD at first epoch can achieve no worst than O(nlog(logn)+L2/(λϵP))O(n\log(\log n)+L^{2}/(\lambda\epsilon_{P})), which is very close to the ideal bound. The result is better than that of vanilla SDCA in Theorem 1 when λ\lambda is relatively large, which shows a complexity of O(nlog(n)+L2/(λϵP))O(n\log(n)+L^{2}/(\lambda\epsilon_{P})). The difference is caused by small step-sizes in the vanilla SDCA, and its negative effect can be observed in practice. That is, the vanilla SDCA tends to have a slower convergence rate than SGD in the first few iterations when λ\lambda is relatively large.

Similar to Remark 2, for the hinge-loss, the constant 44 in Theorem 4 can be reduced to 1, and the constant 2020 can be reduced to 55.

Refined Analysis for Almost Smooth Loss

Our analysis shows that for smooth loss, SDCA converges faster than SGD (linear versus sub-linear convergence). For non-smooth loss, the analysis does not show any advantage of SDCA over SGD. This does not explain the practical observation that SDCA converges faster than SGD asymptotically even for SVM. This section tries to refine the analysis for Lipschitz loss and shows potential advantage of SDCA over SGD asymptotically. Note that the refined analysis of this section relies on quantities that depend on the underlying data distribution, and thus the results are more complicated than those presented earlier. Although precise interpretations of these results will be complex, we will discuss them qualitatively after the theorem statements, and use them to explain the advantage of SDCA over SGD for non-smooth losses.

Although we note that for SVM, Luo and Tseng’s analysis shows linear convergence of the form (1ν)k(1-\nu)^{k} for dual sub-optimality after kk passes over the data, as we mentioned, ν\nu is proportional to the smallest nonzero eigenvalue of the data Gram matrix XXX^{\top}X, and hence can be arbitrarily bad when two data points xixjx_{i}\neq x_{j} becomes very close to each other. Our analysis uses a completely different argument that avoids this dependency on the data Gram matrix.

The main intuition behind our analysis is that many non-smooth loss functions are nearly smooth everywhere. For example, the hinge loss max(0,1uyi)\max(0,1-uy_{i}) is smooth at any point uu such that uyiuy_{i} is not close to 11. Since a smooth loss has a strongly convex dual (and the strong convexity of the dual is directly used in our proof to obtain fast rate for smooth loss), the refined analysis in this section relies on the following refined dual strong convexity condition that holds for nearly everywhere smooth loss functions.

For each ii, we define γi()0\gamma_{i}(\cdot)\geq 0 so that for all dual variables aa and bb, and uϕi(b)u\in\partial\phi_{i}^{*}(-b), we have

For the SVM loss, we have ϕi(u)=max(0,1uyi)\phi_{i}(u)=\max(0,1-uy_{i}), and ϕi(a)=ayi\phi^{*}_{i}(-a)=-ay_{i}, with ayiay_{i}\in and yi{±1}y_{i}\in\{\pm 1\}. It follows that

Therefore we may take γi(u)=uyi1\gamma_{i}(u)=|uy_{i}-1|.

For the absolute deviation loss, we have ϕi(u)=uyi\phi_{i}(u)=|u-y_{i}|, and ϕ(a)=ayi\phi^{*}(-a)=-ay_{i} with aa\in. It follows that γi(u)=uyi\gamma_{i}(u)=|u-y_{i}|.

Under the assumption of (4). Let γi=γi(wxi)\gamma_{i}=\gamma_{i}(w^{*\top}x_{i}), we have the following dual strong convexity inequality:

For SVM, we can take γi=wxiyi1\gamma_{i}=|w^{*\top}x_{i}y_{i}-1|, and for the absolute deviation loss, we may take γi=wxiyi\gamma_{i}=|w^{*\top}x_{i}-y_{i}|. Although some of γi\gamma_{i} can be close to zero, in practice, most γi\gamma_{i} will be away from zero, which means D(α)D(\alpha) is strongly convex at nearly all points. Under this assumption, we may establish a convergence result for the dual sub-optimality.

where ss\in satisfies ϵD8L2(s/λn)N(s/λn)/n\epsilon_{D}\geq 8L^{2}(s/\lambda n)N(s/\lambda n)/n.

if N(s/λn)/nN(s/\lambda n)/n is small, then Theorem 5 is superior to Theorem 1 for the convergence of the dual objective function. We consider three scenarios. The first scenario is when s=1s=1. If N(1/λn)/nN(1/\lambda n)/n is small, and ϵD8L2(1/λn)N(1/λn)/n\epsilon_{D}\geq 8L^{2}(1/\lambda n)N(1/\lambda n)/n, then the convergence is linear. The second scenario is when there exists s0s_{0} so that N(s0/λn)=0N(s_{0}/\lambda n)=0 (for SVM, it means that λnwxiyi1s0\lambda n|w^{*\top}x_{i}y_{i}-1|\geq s_{0} for all ii), and since ϵD8L2(s0/λn)N(s0/λn)/n\epsilon_{D}\geq 8L^{2}(s_{0}/\lambda n)N(s_{0}/\lambda n)/n, we again have a linear convergence of (2n/s0)log(2/ϵD)(2n/s_{0})\log(2/\epsilon_{D}). In the third scenario, we assume that N(s/λn)/n=O[(s/λn)ν]N(s/\lambda n)/n=O[(s/\lambda n)^{\nu}] for some ν>0\nu>0, we can take ϵD=O((s/λn)1+ν)\epsilon_{D}=O((s/\lambda n)^{1+\nu}) and obtain

The log(1/ϵD)\log(1/\epsilon_{D}) factor can be removed in this case with a slightly more complex analysis. This result is again superior to Theorem 1 for dual convergence.

The following result shows fast convergence of duality gap using Theorem 5.

This means that the convergence rate for duality gap in Theorem 6 is linear as implied by the linear convergence of ϵD\epsilon_{D} in Theorem 5.

Examples

We will specify the SDCA algorithms for a few common loss functions. For simplicity, we only specify the algorithms without SGD initialization. In practice, instead of complete randomization, we may also run in epochs, and each epoch employs a random permutation of the data. We call this variant SDCA-Perm.

Procedure SDCA-Perm(α(0))(\alpha^{(0)}) Let w(0)=w(α(0))w^{(0)}=w(\alpha^{(0)}) Let t=0t=0 Iterate: for epoch k=1,2,k=1,2,\ldots Let {i1,,in}\{i_{1},\ldots,i_{n}\} be a random permutation of {1,,n}\{1,\ldots,n\} Iterate: for j=1,2,,nj=1,2,\ldots,n: tt+1t\leftarrow t+1 i=iji=i_{j} Find Δαi\Delta\alpha_{i} to increase dual (*) α(t)α(t1)+Δαiei\alpha^{(t)}\leftarrow\alpha^{(t-1)}+\Delta\alpha_{i}e_{i} w(t)w(t1)+(λn)1Δαixiw^{(t)}\leftarrow w^{(t-1)}+(\lambda n)^{-1}\Delta\alpha_{i}x_{i} Output (Averaging option): Let αˉ=1TT0i=T0+1Tα(t1)\bar{\alpha}=\frac{1}{T-T_{0}}\sum_{i=T_{0}+1}^{T}\alpha^{(t-1)} Let wˉ=w(αˉ)=1TT0i=T0+1Tw(t1)\bar{w}=w(\bar{\alpha})=\frac{1}{T-T_{0}}\sum_{i=T_{0}+1}^{T}w^{(t-1)} return wˉ\bar{w} Output (Random option): Let αˉ=α(t)\bar{\alpha}=\alpha^{(t)} and wˉ=w(t)\bar{w}=w^{(t)} for some random tT0+1,,Tt\in T_{0}+1,\ldots,T return wˉ\bar{w}

Hinge loss is used in SVM. We have ϕi(u)=max{0,1yiu}\phi_{i}(u)=\max\{0,1-y_{i}u\} and ϕi(a)=ayi\phi_{i}^{*}(-a)=-ay_{i} with ayiay_{i}\in. Absolute deviation loss is used in quantile regression. We have ϕi(u)=uyi\phi_{i}(u)=|u-y_{i}| and ϕi(a)=ayi\phi_{i}^{*}(-a)=-ay_{i} with aa\in.

For the hinge loss, step (*) in Procedure SDCA-Perm has a closed form solution as

For absolute deviation loss, step (*) in Procedure SDCA-Perm has a closed form solution as

Both hinge loss and absolute deviation loss are 11-Lipschitz. Therefore, we expect a convergence behavior of no worse than

without SGD initialization based on Theorem 1. The refined analysis in Section 5 suggests a rate that can be significantly better, and this is confirmed with our empirical experiments.

Smooth loss

Squared loss is used in ridge regression. We have ϕi(u)=(uyi)2\phi_{i}(u)=(u-y_{i})^{2}, and ϕi(a)=ayi+a2/4\phi_{i}^{*}(-a)=-ay_{i}+a^{2}/4. Log loss is used in logistic regression. We have ϕi(u)=log(1+exp(yiu))\phi_{i}(u)=\log(1+\exp(-y_{i}u)), and ϕi(a)=ayilog(ayi)+(1ayi)log(1ayi)\phi_{i}^{*}(-a)=ay_{i}\log(ay_{i})+(1-ay_{i})\log(1-ay_{i}) with ayiay_{i}\in.

For squared loss, step (*) in Procedure SDCA-Perm has a closed form solution as

For log loss, step (*) in Procedure SDCA-Perm does not have a closed form solution. However, one may start with the approximate solution,

and further use several steps of Newton’s update to get a more accurate solution.

Finally, we present a smooth variant of the hinge-loss, as defined below. Recall that the hinge loss function (for positive labels) is ϕ(u)=max{0,1u}\phi(u)=\max\{0,1-u\} and we have ϕ(a)=a\phi^{*}(-a)=-a with aa\in. Consider adding to ϕ\phi^{*} the term γ2a2\frac{\gamma}{2}a^{2} which yields the γ\gamma-strongly convex function

Then, its conjugate, which is defined below, is (1/γ)(1/\gamma)-smooth. We refer to it as the smoothed hinge-loss (for positive labels):

For the smoothed hinge loss, step (*) in Procedure SDCA-Perm has a closed form solution as

Both log loss and squared loss are 11-smooth. The smoothed-hinge loss is 1/γ1/\gamma smooth. Therefore we expect a convergence behavior of no worse than

This is confirmed in our empirical experiments.

Proofs

We denote by ϕi(a)\partial\phi_{i}(a) the set of sub-gradients of ϕi\phi_{i} at aa. We use the notation ϕi(a)\phi_{i}^{\prime}(a) to denote some sub-gradient of ϕi\phi_{i} at aa. For convenience, we list the following simple facts about primal and dual formulations, which will used in the proofs. For each ii, we have

The proof of our basic results stated in Theorem 2 and Theorem 1 relies on the fact that for SDCA, it is possible to lower bound the expected increase in dual objective by the duality gap. This key observation is stated in Lemma 1. Note that the duality gap can be further lower bounded using dual suboptimality. Therefore Lemma 1 implies a recursion for dual suboptimality which can be solved to obtain the convergence of dual objective. We can then apply Lemma 1 again, and the convergence of dual objective implies an upper bound of the duality gap, which leads to the basic theorems. The more refined results in Section 4 and Section 5 use similar strategies but with Lemma 1 replaced by its variants.

The key lemma, which estimates the expected increase in dual objective in terms of the duality gap, can be stated as follows.

Assume that ϕi\phi^{*}_{i} is γ\gamma-strongly-convex (where γ\gamma can be zero). Then, for any iteration tt and any ss\in we have

and ui(t1)ϕi(xiw(t1))-u^{(t-1)}_{i}\in\partial\phi_{i}(x_{i}^{\top}w^{(t-1)}).

Proof Since only the ii’th element of α\alpha is updated, the improvement in the dual objective can be written as

By the definition of the update we have for all ss\in that

Combining this with (8) and rearranging terms we obtain that

where we used uϕ(wx)-u\in\partial\phi(w^{\top}x) which yields ϕ(u)=uwxϕ(wx)\phi^{*}(-u)=-uw^{\top}x-\phi(w^{\top}x). Therefore

Therefore, if we take expectation of (10) w.r.t. the choice of ii we obtain that

Multiplying both sides by s/ns/n concludes the proof of the lemma.

For all α\alpha, D(α)P(w)P(0)1D(\alpha)\leq P(w^{*})\leq P(0)\leq 1. In addition, D(0)0D(0)\geq 0.

Proof The first inequality is by weak duality, the second is by the optimality of ww^{*}, and the third by the assumption that ϕi(0)1\phi_{i}(0)\leq 1. For the last inequality we use ϕi(0)=maxz(0ϕi(z))=minzϕi(z)0-\phi^{*}_{i}(0)=-\max_{z}(0-\phi_{i}(z))=\min_{z}\phi_{i}(z)\geq 0, which yields D(0)0D(0)\geq 0.

Equipped with the above lemmas we are ready to prove Theorem 2.

Proof [Proof of Theorem 2] The assumption that ϕi\phi_{i} is (1/γ)(1/\gamma)-smooth implies that ϕi\phi_{i}^{*} is γ\gamma-strongly-convex. We will apply Lemma 1 with s=λnγ1+λnγs=\frac{\lambda n\gamma}{1+\lambda n\gamma}\in. Recall that xi1\|x_{i}\|\leq 1. Therefore, the choice of ss implies that xi2γ(1s)λns0\|x_{i}\|^{2}-\frac{\gamma(1-s)\lambda n}{s}\leq 0, and hence G(t)0G^{(t)}\leq 0 for all tt. This yields,

But since ϵD(t1):=D(α)D(α(t1))P(w(t1))D(α(t1))\epsilon_{D}^{(t-1)}:=D(\alpha^{*})-D(\alpha^{(t-1)})\leq P(w^{(t-1)})-D(\alpha^{(t-1)}) and D(α(t))D(α(t1))=ϵD(t1)ϵD(t)D(\alpha^{(t)})-D(\alpha^{(t-1)})=\epsilon_{D}^{(t-1)}-\epsilon_{D}^{(t)}, we obtain that

This would be smaller than ϵD\epsilon_{D} if

So, requiring ϵD(t)snϵP\epsilon_{D}^{(t)}\leq\frac{s}{n}\epsilon_{P} we obtain a duality gap of at most ϵP\epsilon_{P}. This means that we should require

which proves the first part of Theorem 2.

Next, we sum (12) over t=T0,,T1t=T_{0},\ldots,T-1 to obtain

Now, if we choose wˉ,αˉ\bar{w},\bar{\alpha} to be either the average vectors or a randomly chosen vector over t{T0+1,,T}t\in\{T_{0}+1,\ldots,T\}, then the above implies

This implies the second part of Theorem 2, and concludes the proof.

2 Proof of Theorem 1

Next, we turn to the case of Lipschitz loss function. We rely on the following lemma.

Proof Fix some α>L\alpha>L. By definition of the conjugate we have

A direct corollary of the above lemma is:

Suppose that for all ii, ϕi\phi_{i} is LL-Lipschitz. Let G(t)G^{(t)} be as defined in Lemma 1 (with γ=0\gamma=0). Then, G(t)4L2G^{(t)}\leq 4\,L^{2}.

Proof Using Lemma 3 we know that αi(t1)L|\alpha^{(t-1)}_{i}|\leq L, and in addition by the relation of Lipschitz and sub-gradients we have ui(t1)L|u^{(t-1)}_{i}|\leq L. Thus, (ui(t1)αi(t1))24L2(u^{(t-1)}_{i}-\alpha^{(t-1)}_{i})^{2}\leq 4L^{2}, and the proof follows.

Proof [Proof of Theorem 1] Let G=maxtG(t)G=\max_{t}G^{(t)} and note that by Lemma 4 we have G4L2G\leq 4L^{2}. Lemma 1, with γ=0\gamma=0, tells us that

for all tt0=max(0,nlog(2λnϵD(0)/G))t\geq t_{0}=\max(0,\lceil n\log(2\lambda n\epsilon_{D}^{(0)}/G)\rceil). Indeed, let us choose s=1s=1, then at t=t0t=t_{0}, we have

This implies that (14) holds at t=t0t=t_{0}. For t>t0t>t_{0} we use an inductive argument. Suppose the claim holds for t1t-1, therefore

This provides a bound on the dual sub-optimality. We next turn to bound the duality gap. Summing (13) over t=T0+1,,Tt=T_{0}+1,\ldots,T and rearranging terms we obtain that

Now, if we choose wˉ,αˉ\bar{w},\bar{\alpha} to be either the average vectors or a randomly chosen vector over t{T0+1,,T}t\in\{T_{0}+1,\ldots,T\}, then the above implies

If Tn+T0T\geq n+T_{0} and T0t0T_{0}\geq t_{0}, we can set s=n/(TT0)s=n/(T-T_{0}) and combining with (14) we obtain

We conclude the proof by noticing that ϵD(0)1\epsilon_{D}^{(0)}\leq 1 using Lemma 2, which implies that t0max(0,nlog(2λn/G))t_{0}\leq\max(0,\lceil n\log(2\lambda n/G)\rceil).

3 Proof of Theorem 3

We assume that (ϕt,xt)(\phi_{t},x_{t}) are randomly drawn from a distribution DD, and define the population optimizer

By definition, we have P(w)P(wD)P(w^{*})\leq P(w^{*}_{D}) for any specific realization of {(ϕt,xt):t=1,,n}\{(\phi_{t},x_{t}):t=1,\ldots,n\}. Therefore

where the expectation is with respect to the choice of examples, and note that both P()P(\cdot) and ww^{*} are sample dependent.

After each step tt, we let α(t)=[α1,,αt]\alpha^{(t)}=[\alpha_{1},\ldots,\alpha_{t}], and let uϕt+1(xt+1w(t))-u\in\partial\phi_{t+1}(x_{t+1}^{\top}w^{(t)}). We have, for all tt,

The inequality above can be obtained by noticing that the choice of αt+1(t+1)-\alpha^{(t+1)}_{t+1} maximizes the dual objective. In the derivation of the equalities we have used basic algebra as well as the equation ϕt+1(u)xt+1w(t)u=ϕt+1(xt+1w(t))-\phi_{t+1}^{*}(-u)-x_{t+1}^{\top}w^{(t)}\,u=\phi_{t+1}(x_{t+1}^{\top}w^{(t)}) which follows from uϕt+1(xt+1w(t))-u\in\partial\phi_{t+1}(x_{t+1}^{\top}w^{(t)}). Next we note that λw(t)uxt+12L\|\lambda w^{(t)}-ux_{t+1}\|\leq 2L (where we used the triangle inequality, the definition of w(t)w^{(t)}, and Lemma 3). Therefore,

Taking expectation with respect to the choice of the examples, and note that the (t+1)(t+1)’th example does not depend on w(t)w^{(t)} we obtain that

Using Lemma 2 we know that Dt(α(t))0D_{t}(\alpha^{(t)})\geq 0 for all tt. Therefore, by summing the above over tt we obtain that

4 Proof of Theorem 4

5 Proof of Proposition 1

Consider any feasible dual variable α\alpha and the corresponding w=w(α)w=w(\alpha). Since

Since wxiϕi(αi)w^{*\top}x_{i}\in\partial\phi^{*}_{i}(-\alpha_{i}^{*}), we have

By combining the previous two displayed inequalities, we obtain the first desired bound.

Next, we let u=wxiu=w^{*\top}x_{i}, v=wxiv=w^{\top}x_{i}. Since aiϕi(v)-a_{i}\in\partial\phi_{i}(v) and αiϕi(u)-\alpha_{i}^{*}\in\partial\phi_{i}(u), it follows that uϕi(αi)u\in\partial\phi_{i}^{*}(-\alpha_{i}^{*}) and vϕi(ai)v\in\partial\phi_{i}^{*}(-a_{i}). Therefore

6 Proof of Theorem 5

The following lemma is very similar to Lemma 1 with nearly identical proof, but it focuses only on the convergence of dual objective function using (5).

Assume that (5) is valid. Then for any iteration tt and any ss\in we have

Proof Since only the ii’th element of α\alpha is updated, the improvement in the dual objective can be written as

By the definition of the update we have for all ss\in that

We can now apply the Jensen’s inequality to obtain

By summing over i=1,,ni=1,\ldots,n, we obtain

where the equality follows from i=1n(αiαi(t1))xi=λn(ww(t1))\sum_{i=1}^{n}(\alpha^{*}_{i}-\alpha^{(t-1)}_{i})x_{i}=\lambda n(w^{*}-w^{(t-1)}). By rearranging the terms on the right hand side using (ww(t1))w(t1)=w2/2w(t1)2/2ww(t1)2/2(w^{*}-w^{(t-1)})^{\top}w^{(t-1)}=\|w^{*}\|^{2}/2-\|w^{(t-1)}\|^{2}/2-\|w^{*}-w^{(t-1)}\|^{2}/2, we obtain

Suppose that for all ii, ϕi\phi_{i} is LL-Lipschitz. Let G(t)G_{*}^{(t)} be as defined in Lemma 5. Then

Proof Similarly to the proof of Lemma 4, we know that (αiαi(t1))24L2(\alpha^{*}_{i}-\alpha^{(t-1)}_{i})^{2}\leq 4L^{2}. Moreover, xi21\|x_{i}\|^{2}\leq 1, and xi2γiλns0\|x_{i}\|^{2}-\frac{\gamma_{i}\lambda n}{s}\leq 0 when γis/(λn)\gamma_{i}\geq s/(\lambda n). Therefore there are no more than N(s/(λn))N(s/(\lambda n)) data points ii such that xi2γiλns\|x_{i}\|^{2}-\frac{\gamma_{i}\lambda n}{s} is positive. The desired result follows from these facts.

we have ϵD(t)ϵD\epsilon_{D}^{(t)}\leq\epsilon_{D}.

7 Proof of Theorem 6

where ui(t1)ϕi(xiw(t))-u^{(t-1)}_{i}\in\partial\phi_{i}(x_{i}^{\top}w^{(t)}). It follows that given any γ>0\gamma>0, we have

where Lemma 4 is used for the last inequality. Since γ\gamma is arbitrary and ϵD(t)ϵD\epsilon_{D}^{(t)}\leq\epsilon_{D}, it follows that

Now plug into Lemma 1, we obtain for all tT0+1t\geq T_{0}+1:

By taking s=n/T0s=n/T_{0}, and summing over t=T0+1,,2T0=Tt=T_{0}+1,\ldots,2T_{0}=T, we obtain

Experimental Results

In this section we demonstrate the tightness of our theory. All our experiments are performed with the smooth variant of the hinge-loss defined in (7), where the value of γ\gamma is taken from the set {0,0.01,0.1,1}\{0,0.01,0.1,1\}. Note that for γ=0\gamma=0 we obtain the vanilla non-smooth hinge-loss.

In the experiments, we use ϵD\epsilon_{D} to denote the dual sub-optimality, and ϵP\epsilon_{P} to denote the primal sub-optimality (note that this is different than the notation in our analysis which uses ϵP\epsilon_{P} to denote the duality gap). It follows that ϵD+ϵP\epsilon_{D}+\epsilon_{P} is the duality gap.

The experiments were performed on three large datasets with very different feature counts and sparsity, which were kindly provided by Thorsten Joachims. The astro-ph dataset classifies abstracts of papers from the physics ArXiv according to whether they belong in the astro-physics section; CCAT is a classification task taken from the Reuters RCV1 collection; and cov1 is class 1 of the covertype dataset of Blackard, Jock & Dean. The following table provides details of the dataset characteristics.

2 Linear convergence for Smooth Hinge-loss

Our first experiments are with ϕγ\phi_{\gamma} where we set γ=1\gamma=1. The goal of the experiment is to show that the convergence is indeed linear. We ran the SDCA algorithm for solving the regularized loss minimization problem with different values of regularization parameter λ\lambda. Figure 1 shows the results. Note that a logarithmic scale is used for the vertical axis. Therefore, a straight line corresponds to linear convergence. We indeed observe linear convergence for the duality gap.

3 Convergence for non-smooth Hinge-loss

Next we experiment with the original hinge loss, which is 11-Lipschitz but is not smooth. We again ran the SDCA algorithm for solving the regularized loss minimization problem with different values of regularization parameter λ\lambda. Figure 2 shows the results. As expected, the overall convergence rate is slower than the case of a smoothed hinge-loss. However, it is also apparent that for large values of λ\lambda a linear convergence is still exhibited, as expected according to our refined analysis. The bounds plotted are based on Theorem 1, which are slower than what we observe, as expected from the refined analysis in Section 5.

4 Effect of smoothness parameter

We next show the effect of the smoothness parameter. Figure 3 shows the effect of the smoothness parameter on the rate of convergence. As can be seen, the convergence becomes faster as the loss function becomes smoother. However, the difference is more dominant when λ\lambda decreases.

Figure 4 shows the effect of the smoothness parameter on the zero-one test error. It is noticeable that even though the non-smooth hinge-loss is considered a tighter approximation of the zero-one error, in most cases, the smoothed hinge-loss actually provides a lower test error than the non-smooth hinge-loss. In any case, it is apparent that the smooth hinge-loss decreases the zero-one test error faster than the non-smooth hinge-loss.

5 Cyclic vs. Stochastic vs. Random Permutation

In Figure 5 we compare choosing dual variables at random with repetitions (as done in SDCA) vs. choosing dual variables using a random permutation at each epoch (as done in SDCA-Perm) vs. choosing dual variables in a fixed cyclic order (that was chosen once at random). As can be seen, a cyclic order does not lead to linear convergence and yields actual convergence rate much slower than the other methods and even worse than our bound. As mentioned before, some of the earlier analyses such as can be applied both to stochastic and to cyclic dual coordinate ascent methods with similar results. This means that their analysis, which can be no better than the behavior of cyclic dual coordinate ascent, is inferior to our analysis. Finally, we also observe that SDCA-Perm is sometimes faster than SDCA.

6 Comparison to SGD

We next compare SDCA to Stochastic Gradient Descent (SGD). In particular, we implemented SGD with the update rule w(t+1)=(11/t)w(t)1λtϕi(w(t)xi)xiw^{(t+1)}=(1-1/t)w^{(t)}-\tfrac{1}{\lambda t}\phi^{\prime}_{i}(w^{(t)\,\top}x_{i})x_{i}, where ii is chosen uniformly at random and ϕi\phi^{\prime}_{i} denotes a sub-gradient of ϕi\phi_{i}. One clear advantage of SDCA is the availability of a clear stopping condition (by calculating the duality gap). In Figure 6 and Figure 7 we present the primal sub-optimality of SDCA, SDCA-Perm, and SGD. As can be seen, SDCA converges faster than SGD in most regimes. SGD can be better if both λ\lambda is high and one performs a very small number of epochs. This is in line with our theory of Section 4. However, SDCA quickly catches up.

In Figure 8 we compare the zero-one test error of SDCA, when working with the smooth hinge-loss (γ=1\gamma=1) to the zero-one test error of SGD, when working with the non-smooth hinge-loss. As can be seen, SDCA with the smooth hinge-loss achieves the smallest zero-one test error faster than SGD.

References