Towards Optimal One Pass Large Scale Learning with Averaged Stochastic Gradient Descent

Wei Xu

Introduction

For prediction problems, we want to find a function fθ(x)f_{\theta}(x) with parameter θ\theta to predict the value of the outcome variable yy given an observed vector xx. Typically, the problem is formulated as an optimization problem:

where tt is the number of data points, θt∗\theta_{t}^{*} is the parameter that minimize the empirical cost, (xi,yi)(x_{i},y_{i}) are the ithi^{th} training example, L(s,y)L(s,y) is a loss function which gives small value if ss is a good prediction for yy, and R(θ)R(\theta) is a regularization function for θ\theta which typically gives small value for small θ\theta. Some commonly used LL are: max⁡(0,1−ys)\max(0,1-ys) for support vector machine (SVM), 12(max⁡(0,1−ys))2\frac{1}{2}(\max(0,1-ys))^{2} for L2 SVM, and 12(y−s)2\frac{1}{2}(y-s)^{2} for linear regression. Some commonly used regularization functions are: L2 regularization λ2∥θ∥2\frac{\lambda}{2}\|\theta\|^{2}, and L1 regularization λ∥θ∥1\lambda\|\theta\|_{1}.

For large scale machine learning problems, we need to deal with optimization problems with millions or even billions of training samples. The classical optimization techniques such as interior point methods or conjugate gradient descent have to go through all data points to just evaluate the objective once. Not to say that they need to go through the whole data set many times in order to find the best θ\theta.

On the other hand, stochastic gradient descent (SGD) has been shown to have great promise for large scale learning (Zhang, 2004; Hazan et al., 2006; Shalev-Shwartz et al., 2007; Bottou and Bousquet, 2008; Shalev-Shwartz and Tewari, 2009; Langford et al., 2009). Let d=(x,y)d=(x,y) be one data sample, l(θ,d)=L(fθ(x),y)+R(θ)l(\theta,d)=L(f_{\theta}(x),y)+R(\theta) be the cost of θ\theta for dd, g(θ,ξ)=∂l(θ,d)∂θg(\theta,\xi)=\frac{\partial l(\theta,d)}{\partial\theta} be the gradient function, and Dt=(d1,⋯ ,dt)D_{t}=(d_{1},\cdots,d_{t}) be all the training samples at ttht^{th} step. The SGD method updates θ\theta according to its stochastic gradient:

where γt\gamma_{t} is learning rate at the ttht^{th} step. γt\gamma_{t} can be either a scalar or a matrix. Let the expected loss of θ\theta over test data be E(θ)=Ed(l(θ,d))\mathcal{E}(\theta)=E_{d}(l(\theta,d)), the optimal parameter be θ∗=arg⁡min⁡θE(θ)\theta^{*}=\arg\min_{\theta}\mathcal{E}(\theta), and the Hessian be H=∂2E(θ)∂θ∂θT∣θ=θ∗H=\left.\frac{\partial^{2}\mathcal{E}(\theta)}{\partial\theta\partial\theta^{T}}\right|_{\theta=\theta^{*}}. Note that θt\theta_{t} and θt∗\theta_{t}^{*} are random variables depending on DtD_{t}. Hence both E(θt)\mathcal{E}(\theta_{t}) and E(θt∗)\mathcal{E}(\theta_{t}^{*}) are random variables depending on DtD_{t}. If γt\gamma_{t} is a scalar, the best asymptotic convergence for the expected excess loss EDt(E(θt))−E(θ∗)E_{D_{t}}(\mathcal{E}(\theta_{t}))-\mathcal{E}(\theta^{*}) is O(t−1)O(t^{-1}), which is obtained by using γt=γ0(1+γ0λ0t)−1\gamma_{t}=\gamma_{0}(1+\gamma_{0}\lambda_{0}t)^{-1}, where λ0\lambda_{0} is the smallest eigenvalue of HH and γ0\gamma_{0} is some constant. The asymptotic convergence rate of SGD can be potentially benefit from using second order information (Bottou and Bousquet, 2008; Schraudolph et al., 2007; Amari et al., 2000). The optimal asymptotic convergence rate is achieved by using matrix valued learning rate γt=1tH−1\gamma_{t}=\frac{1}{t}H^{-1}. If this optimal matrix step size is used, then asymptotically second order SGD is as good as explicitly optimizing the empirical loss. More precisely, this means that both tEDt(E(θt)−E(θ∗))tE_{D_{t}}(\mathcal{E}(\theta_{t})-\mathcal{E}(\theta^{*})) and tEDt(E(θt∗)−E(θ∗))tE_{D_{t}}(\mathcal{E}(\theta_{t}^{*})-\mathcal{E}(\theta^{*})) converge to a same positive constant.

Since HH is unknown in advance, methods for adaptively estimating HH is proposed (Bottou and LeCun, 2005; Amari et al., 2000). However, for high dimensional data sets, maintaining a full matrix HH is too computationally expensive. Hence various methods for approximating HH have been proposed (LeCun et al., 1998; Schraudolph et al., 2007; Roux et al., 2008; Bordes et al., 2009). However, with the approximated HH, the optimal convergence cannot be guaranteed. It is worth to point out that most of the existing analysis for second order SGD is asymptotic, namely, that they do not tell how much data is needed for the algorithm to reach their asymptotic region.

In order to accelerate the convergence speed of SGD, averaged stochastic gradient (ASGD) was proposed in Polyak and Juditsky (1992). For ASGD, the running average θˉt=1t∑j=1tθj\bar{\theta}_{t}=\frac{1}{t}\sum_{j=1}^{t}\theta_{j} of the parameters obtained by SGD is used as the estimator for θ∗\theta^{*}. Polyak and Juditsky (1992) showed a very nice result that θˉt\bar{\theta}_{t} converges to θ∗\theta^{*} as good as full second order SGD, which means that if there are enough training samples, ASGD can obtain the parameter as good as the empirical optimal parameter θt∗\theta_{t}^{*} in just one pass of data. And another advantage of ASGD is that, unlike second order SGD, ASGD is extremely easy to implement. Zhang (2004); Nemirovski et al. (2009) gave some nice non-asymptotic analysis for ASGD with a fixed learning rate. However, the convergence bounds obtained by Zhang (2004); Nemirovski et al. (2009) are far less appealing than that of Polyak and Juditsky (1992).

Despite its nice properties, ASGD receives little attention in recent research for online large scale learning. The reason for the lack of interest in ASGD might be that its potential good convergence has not been realized by researchers in real applications. Our analysis shows the cause of this may due to the fact the ASGD needs a prohibitively large amount of data to reach asymptotics if learning rate is chosen arbitrarily.

A typical choice for the learning rate γt\gamma_{t} is to make it decease as fast as Θ(t−c)\Theta(t^{-c}) for some constant cc. In this paper, we assume a particular form of learning rate schedule which satisfies this condition,

where γ0\gamma_{0}, aa and cc are some constants. Based on this form of learning rate schedule, we provide non-asymptotic analysis of ASGD. Our analysis shows that γ0\gamma_{0} and aa should to be properly set according to the curvature of the expected cost function. cc should be a problem independent constant. With our recipe for setting the learning rate, we show that ASGD outperforms SGD if the data size is large enough for SGD to reach its asymptotic region.

To demonstrate the effectiveness of ASGD with the proposed learning rate schedule, we apply ASGD for training linear classification and regression models. We compare ASGD with other prominent large scale SVM solvers on several benchmark tasks. Our experimental results show the clear advantage of ASGD.

In the rest of the paper, for matrices XX and YY, X≤YX\leq Y means Y−XY-X is positive semi-definite, ∥x∥A\|x\|_{A} is defined as xTAx\sqrt{x^{T}Ax}. We will assume γt=γ0(1+aγ0t)−c\gamma_{t}=\gamma_{0}(1+a\gamma_{0}t)^{-c} for some constant γ0>0\gamma_{0}>0, a>0a>0 and 0≤c≤10\leq c\leq 1 in all the theorems and lemmas. Through out this paper we denote Δt=θt−θ∗\Delta_{t}=\theta_{t}-\theta^{*} and Δˉt=θˉt−θ∗\bar{\Delta}_{t}=\bar{\theta}_{t}-\theta^{*}. To help the reader focus on the main idea, we put most proofs to the Appendix.

The paper is organized as follows: Section 2 establish some results on stochastic linear equation; Section 3 extends the result to ASGD for quadratic loss functions; Section 4 works on general non-quadratic loss functions; Section 5 discusses some implementation issues; Section 6 shows experimental results; Section 7 concludes the paper; and Appendix includes all the proofs.

Stochastic Linear Equation

To motivate the problem, we first take a close look at the SGD update (2). Let gˉ(θ)=E(g(θ,d))\bar{g}(\theta)=E(g(\theta,d)) and the first order Taylor expansion of gˉ(θ)\bar{g}(\theta) around θ∗\theta^{*} be Aθ−bA\theta-b, where A=∂gˉ(θ)∂θ∣θ=θ∗A=\left.\frac{\partial\bar{g}(\theta)}{\partial\theta}\right|_{\theta=\theta^{*}} and b=Aθ∗−gˉ(θ∗)=Aθ∗b=A\theta^{*}-\bar{g}(\theta^{*})=A\theta^{*}. Then g(θt−1,d)g(\theta_{t-1},d) can be decomposed as:

where ξt(1)=g(θ∗,dt)\xi_{t}^{(1)}=g(\theta^{*},d_{t}), ξt(2)=g(θt−1,dt)−g(θ∗,dt)−gˉ(θt−1)\xi_{t}^{(2)}=g(\theta_{t-1},d_{t})-g(\theta^{*},d_{t})-\bar{g}(\theta_{t-1}) and ξt(3)=gˉ(θt−1)−Aθt−1+b\xi_{t}^{(3)}=\bar{g}(\theta_{t-1})-A\theta_{t-1}+b. So the SGD update (2) can be re-written as

It is easy to see that ξt(1)\xi_{t}^{(1)} is martingale with respect to dtd_{t}, i.e., E(ξt(1)∣d1,⋯ ,dt−1)=0E(\xi_{t}^{(1)}|d_{1},\cdots,d_{t-1})=0, and has identical distribution for different tt. ξt(2)\xi_{t}^{(2)} is also martingale with respect to dtd_{t}. However, as we will see in later section, its magnitude depends on θt−1−θ∗\theta_{t-1}-\theta^{*}. If g(θ,d)g(\theta,d) is smooth, we have ξt(2)=O(∥θt−1−θ∗∥)\xi_{t}^{(2)}=O(\|\theta_{t-1}-\theta^{*}\|). For smooth gˉ(θ)\bar{g}(\theta), we have ξt(3)=o(∥θt−1−θ∗∥)\xi_{t}^{(3)}=o(\|\theta_{t-1}-\theta^{*}\|). Both ξt(2)\xi_{t}^{(2)} and ξt(3)\xi_{t}^{(3)} are asymptotically negligible if suitable conditions are met. We also note that ξt(3)=0\xi_{t}^{(3)}=0 for quadratic l(θ,ξ)l(\theta,\xi).

By the above analysis, we first consider the following simple stochastic approximation procedure which ignores ξt(2)\xi_{t}^{(2)} and ξt(3)\xi_{t}^{(3)}:

where AA is a positive definite matrix with the smallest eigenvalue λ0\lambda_{0} and the largest eigenvalue λ1\lambda_{1}, ξt\xi_{t} is martingale difference process, i.e., E(ξt∣ξ1,⋯ ,ξt−1)=0E(\xi_{t}|\xi_{1},\cdots,\xi_{t-1})=0, the variance of ξt\xi_{t} is E(ξtξtT)=SE(\xi_{t}\xi_{t}^{T})=S. We will see that this algorithm can be used to find the root θ∗\theta^{*} of equation Aθ=bA\theta=b

If γ0λ1≤1\gamma_{0}\lambda_{1}\leq 1 and (2c−1)a<λ0(2c-1)a<\lambda_{0}, then the estimator θˉt\bar{\theta}_{t} in (6) satisfies:

The immediate conclusion from Theorem 1 is the asymptotic convergence bound of θˉt\bar{\theta}_{t}.

The above bound is consistent with Theorem 1 in Polyak and Juditsky (1992) and is the best possible asymptotic convergence rate that can be achieved by any algorithms (Fabian, 1973). However, we are more interested in the non-asymptotic behavior of θˉt\bar{\theta}_{t}.

If we choose a=λ0a=\lambda_{0}, it takes t=O((λ0γ0)−1)t=O((\lambda_{0}\gamma_{0})^{-1}) samples for θˉt\bar{\theta}_{t} in (6) to reach the asymptotic region. And at this point, θˉt\bar{\theta}_{t} begins to become better than θt\theta_{t}.

Proof Let t=Kλ0γ0t=\frac{K}{\lambda_{0}\gamma_{0}}, we have

On the other hand, the best possible convergence for θt\theta_{t} is obtained with a=λ0a=\lambda_{0} and c=1c=1:

It takes t=Ω((aλ0)c1−c(λ0γ0)−1)t=\Omega\left(\left(\frac{a}{\lambda_{0}}\right)^{\frac{c}{1-c}}(\lambda_{0}\gamma_{0})^{-1}\right) samples for θˉt\bar{\theta}_{t} in (6) to reach the asymptotic region.

By Corollary 4, we should limit aa in order to have fast convergence. For the linear problem (5), we should always use a=0a=0. If we use some arbitrary value such as 1 for aa, although θˉt\bar{\theta}_{t} still has asymptotic optimal convergence according to Polyak and Juditsky (1992), but it needs much more samples to reach the asymptotic region in situations where λ0\lambda_{0} is very small. For the general SGD update (4), we need to trade-off against the convergence of ξ(2)\xi^{(2)} and ξ(3)\xi^{(3)}. Hence aa should not be 0. In general, aa should be a constant factor times of λ0\lambda_{0}.

Regression Problem

In this section, we will analyze the convergence for regression problems. As we noted in section 2, the SGD update can be decomposed as (4), where ξt(3)=0\xi_{t}^{(3)}=0 for quadratic loss of linear regression. As in the proof of Theorem 1, Δˉt\bar{\Delta}_{t} can be written as:

We already have a bound for ∥I(0)∥A\|I^{(0)}\|_{A} and ∥I(1)∥A\|I^{(1)}\|_{A} in Theorem 1. Now we work on I(2)I^{(2)}. We will make two assumptions:

(9) is related to the continuity of g(θ,d)g(\theta,d) and the distribution of yy. (10) is related to the convergence of standard SGD. A bound similar to (10) can be found in section 3.1 of Hazan et al. (2006). Using these assumptions, we can bound E∥I(2)∥A2E\|I^{(2)}\|_{A}^{2}:

With the above lemma, we can obtain the following asymptotic convergence result:

For quadratic loss, with assumption (9) (10), θˉt\bar{\theta}_{t} satisfies

The corollary follows by applying (16), (17) and Lemma 5. The best convergence rate is obtained when c=2/3c=2/3. Now we take a close look at the constant factor c1c_{1} in assumption (9) to have a better understanding of the non-asymptotic behavior of tE∥I(2)∥A2tE\|I^{(2)}\|_{A}^{2}.

For ridge regression l(θ,d)=12(θTx−y)2l(\theta,d)=\frac{1}{2}(\theta^{T}x-y)^{2}, if ∥x∥≤M\|x\|\leq M, then

Assuming ∥x∥=M\|x\|=M, Lemma 12 in the Appendix shows that ∥Δt∥2\|\Delta_{t}\|^{2} will diverge if learning rate is greater than 2M\frac{2}{M}. So γ0≤2M\gamma_{0}\leq\frac{2}{M} and c1≤Mλ0c_{1}\leq\frac{M}{\lambda_{0}}. Plugging these bounds for c1c_{1} and γ0\gamma_{0} into Lemma 5, we have the following for t=Kλ0γ0t=\frac{K}{\lambda_{0}\gamma_{0}},

Note that the best possible SGD error bound is ∥Δ0∥A2(1+K)2+c3γ01+K\frac{\|\Delta_{0}\|_{A}^{2}}{(1+K)^{2}}+\frac{c_{3}\gamma_{0}}{1+K} with a=λ0a=\lambda_{0} and c=1c=1. We see that E∥I(2)∥A2E\|I^{(2)}\|_{A}^{2} is negligible compared to the error of SGD if t>O((λ0γ0)−1)t>O((\lambda_{0}\gamma_{0})^{-1}). Together with the analysis in Section 2, we conclude that ASGD begins to outperform SGD after t>O((λ0γ0)−1)t>O((\lambda_{0}\gamma_{0})^{-1}). The conclusion we draw in this section applies not only to the case of yy with constant norm. Similar conclusion can be drawn if yy is normally distributed or if each dimension of yy is independently distributed, and/or if L2 regularization is used.

Based on above analysis, for linear regression problems, we propose to use the following values for (3) to calculate the learning rate: γ0=1/M\gamma_{0}=1/M, a=λ0a=\lambda_{0}, c=2/3c=2/3. We will see that in the next section for general non-quadratic loss, optimal cc is different since we need to further consider the convergence of ξt(3)\xi_{t}^{(3)}.

Non-quadratic loss

For non-quadratic loss, we need to analyze the contribution of ξ(3)\xi^{(3)} to the error. We need the following two additional assumptions:

Similar to (9), (12) is related to the continuity of g(θ,d)g(\theta,d) and the distribution of xx and yy. Similar to (10), (13) is related to the convergence of standard SGD. We note that the asymptotic normality of θt\theta_{t} (Fabian, 1968) suggests that assumption (13) is reasonable.

With Assumption (9) (10) (12) and (13) , we have

where γ1t=∑s=1tγs\gamma_{1}^{t}=\sum_{s=1}^{t}\gamma_{s}.

For non-quadratic loss, with assumption (9) (10) (12) and (13), if c>12c>\frac{1}{2}, then θˉt\bar{\theta}_{t} satisfies

The corollary follows by applying (16), (17), Lemma 5 and Lemma 8. The best convergence rate is obtained when c=3/4c=3/4, which is different from that for quadratic loss.

Implementation

In this section, we discuss how we implement ASGD for linear models fθ(x)=θTxf_{\theta}(x)=\theta^{T}x with L2 regularization. The running average can be recursively updated by θˉt=(1−1t)θˉt−1+1tθt\bar{\theta}_{t}=(1-\frac{1}{t})\bar{\theta}_{t-1}+\frac{1}{t}\theta_{t}, which is very easy to implement. However, for sparse data sets, this can be very costly compared to SGD since θt\theta_{t} is typically a dense vector. Consider the following average procedure:

where λ\lambda is the L2 regularization coefficient, gt=∂L(θt−1Txt,yt)∂θt1=Ls(θt−1Txt,yt)xtg_{t}=\frac{\partial L(\theta_{t-1}^{T}x_{t},y_{t})}{\partial\theta_{t_{1}}}=L_{s}(\theta_{t-1}^{T}x_{t},y_{t})x_{t}, and ηt\eta_{t} is the rate of averaging. Hence gtg_{t} is sparse when xtx_{t} is sparse. We want to take the advantage of the sparsity of xtx_{t} for updating θt\theta_{t} and θˉt\bar{\theta}_{t}. Let

After some manipulation, we get the following:

Now define τt=∑i=1tηiβiαi\tau_{t}=\sum_{i=1}^{t}\frac{\eta_{i}\beta_{i}}{\alpha_{i}} and u^t=u^t−1+τt−1αtγtgt\hat{u}_{t}=\hat{u}_{t-1}+\tau_{t-1}\alpha_{t}\gamma_{t}g_{t} with u^0=uˉ0\hat{u}_{0}=\bar{u}_{0}, we get

Hence we obtain the following efficient algorithm for updating θˉt\bar{\theta}_{t}:

At any step of the algorithm, θˉt\bar{\theta}_{t} can be obtained by θˉt=uˉtβt=τtut+u^tβt\bar{\theta}_{t}=\frac{\bar{u}_{t}}{\beta_{t}}=\frac{\tau_{t}u_{t}+\hat{u}_{t}}{\beta_{t}}. Note that in Algorithm 1, none of the operations involves two dense vectors. Thus the number of operations per sample is O(Z)O(Z), where ZZ is the number of non-zero elements in xx.

Experiments

In this section, we provide 3 sets of experiments. The first experiment illustrate the importance of learning rate scheduling for ASGD. The second experiment illustrates the asymptotic optimal convergence of ASGD. In the third set of experiments, we apply ASGD on many public benchmark data sets and compare it with several state of the art algorithms.

Our first experiment is used to show how different learning rate schedule affects the convergence of ASGD using a synthetic problem. The exemplar optimization problem is min⁡θEx((θ−x)TA(θ−x))\min_{\theta}E_{x}((\theta-x)^{T}A(\theta-x)), where AA is a symmetric 100x100 matrix with eigenvalues [1,1,1,0.02⋯0.02][1,1,1,0.02\cdots 0.02] and xx follows normal distribution with zero mean and unit covariance. It can be shown that the optimal θ\theta is θ∗=0\theta^{*}=0. Figure 1 shows the excess risk E(θt)−E(θ∗)\mathcal{E}(\theta_{t})-\mathcal{E}(\theta^{*}) of the solution vs. number of training samples tt. We note that in this particular example the excess risk is simply θtTAθt\theta_{t}^{T}A\theta_{t}. For the good example of ASGD (ASGD in the figure), we use our proposed learning rate schedule γt=(1+0.02t)−2/3\gamma_{t}=(1+0.02t)^{-2/3} according to Section 3. For a bad example of ASGD (ASGD_BAD in the figure), we use γt=(1+t)−1/2\gamma_{t}=(1+t)^{-1/2}, which looks simple and also has optimal asymptotic convergence according to Corollary 2. Figure 1 also shows the performance of standard SGD using learning rate schedule γt=(1+0.02t)−1\gamma_{t}=(1+0.02t)^{-1} and batch method θt=1t∑j=1txt\theta_{t}=\frac{1}{t}\sum_{j=1}^{t}x_{t}. We see that both ASGD and ASGD_BAD eventually outperforms SGD and come close to the batch method. However, it takes only a few thousands example for ASGD to get to the asymptotic region, while it takes hundreds of thousands of examples for ASGD_BAD. This huge difference illustrates the significant role of learning rate scheduling for ASGD.

2 Asymptotic optimal convergence

3 Experiments on benchmark data sets

In the third set of experiments, we compare ASGD with several other algorithms for training large scale linear models: online limited-memory BFGS (oLBFGS) of Schraudolph et al. (2007), stochastic gradient descent (SGD2) of Bottou (2007), dual coordinate descent (LIBLINEAR) of Fan et al. (2008), Pegasos of Shalev-Shwartz et al. (2007) and SGDQN of Bordes et al. (2009). We performed extensive evaluation of ASGD on many data sets. Due to space limit, we only show detailed results on four tasks in this paper. COVTYPE is the detection of class 2 among 7 forest cover types (Blackard et al). All dimensions are normalized between 0 and 1. DELTA is a synthetic data set from the PASCAL Large Scale Challenge (Sonnenburg et al., 2008). We use the default data preprocessing provided by the challenge organizers. RCV1 is the classification of documents belonging to class CCAT in RCV1 text data set (Lewis et al., 2004). We use the same preprocessing as provided in Bottou (2007). MNIST9 is the classification of digit 9 against all other digits in MNIST digit image data set (LeCun et al., 1998). For this task, we generate our own image feature vectors for recognition. The experiments for these four tasks use squared hinge loss L(s,y)=12(max⁡(0,1−ys))2L(s,y)=\frac{1}{2}(\max(0,1-ys))^{2} with L2L2 regularization R(θ)=λ2∥θ∥22R(\theta)=\frac{\lambda}{2}\|\theta\|_{2}^{2}. Since λ0\lambda_{0} is unknown, we use the regularization coefficient λ\lambda as λ0\lambda_{0}, which is a lower bound for true λ0\lambda_{0}. Table 1 summarizes the data sets, where MM is the max⁡∥x∥2\max\|x\|^{2} calculated from 1000 samples, t0t_{0} is the point where average begins (See Section 5). Figure 3 shows the test error rate (left), elapsed time (middle) and test cost (right) at different points within first two passes of training data.

We also include more experimental results on data sets from Pascal Large Scale Challenge. However, to save space, we only show figures for test error rate. All experiments use the default data preprocessing provided by the challenge organizers. Table 2 summarize the data sets. Figure 4 and Figure 5 shows result for L2 SVM, logistic regression and SVM. LIBLINEAR is not included in the figures for logistic regression because the dual coordinate descent method used by LIBLINEAR cannot solve logistic regression. Although the theory of ASGD only applies to smooth cost functions, we also include the results of SVM to satisfy the possible curiosity of some readers.

As we can see from the figures, ASGD clearly outperforms all other 5 algorithms in terms accuracy in most of the data sets. In fact, for most of the data sets, ASGD reaches good performance with only one pass of data, while many other algorithms still perform poorly at that point. The only exception is the beta data set, where all methods performs equally bad because the two classes in this data set are not linearly separable. Moreover, the performance of the other 5 methods tend to be more volatile, while performance of ASGD is more robust due to average. In terms of time spent on one pass of data, ASGD is similar to the other methods except oLBFGS, which means that ASGD needs less time to reach similar test performance compared to the other methods. Another interesting point is that although the current theory of ASGD is based on the assumption that cost function is smooth, as shown in the figures, ASGD also works pretty well with non-smooth loss such as hinge loss.

Conclusion

ASGD is relatively easy to implement compared to other algorithms. And as demonstrated on both synthetic and real data sets, with our proposed learning rate schedule, ASGD performs better than other more complicated algorithms for large scale learning problems. In this paper, we only apply ASGD to linear models with convex loss, which has unique local optimum. It would be more interesting to see how ASGD can be applied to more complicated models such as conditional random fields (CRF) or models with multiple local optimums such as neural networks.

The author would like to thank Leon Bottou for the insightful discussions, Antoine Bordes for providing source code of SGDQN, SGD2 and oLBFGS, and Yi Zhang for the suggestions to improve the exposition of this paper.

References

A Proofs

Let κ=1−max⁡(0,2c−1)aλ0\kappa=1-\max(0,2c-1)\frac{a}{\lambda_{0}}. If γ0λ1≤1\gamma_{0}\lambda_{1}\leq 1, then

Proof For 0<c≤0.50<c\leq 0.5, let f(x)=(xc−(x−1)c)xcf(x)=(x^{c}-(x-1)^{c})x^{c}, where x=k+1aγ0x=k+\frac{1}{a\gamma_{0}}. We only need to show f′(x)≤0f^{\prime}(x)\leq 0

where we used the fact xc≤(x−1)c+c(x−1)c−1x^{c}\leq(x-1)^{c}+c(x-1)^{c-1} for 0≤c≤10\leq c\leq 1.

For c>0.5c>0.5, let f(x)=log⁡((xc−(x−1)c)xc)f(x)=\log((x^{c}-(x-1)^{c})x^{c}), where x=k+1aγ0x=k+\frac{1}{a\gamma_{0}}. We only need to show

By mean value theorem, there exists some y:x≤y≤x+1y:x\leq y\leq x+1 s.t. f(x+1)−f(x)=f′(y)f(x+1)-f(x)=f^{\prime}(y). Hence

The following is a key lemma which is used several times in this paper.

If γ0λ1≤1\gamma_{0}\lambda_{1}\leq 1 and (2c−1)a<λ0(2c-1)a<\lambda_{0}, then we have the following bound for Xˉjt\bar{X}_{j}^{t}.

where c0c_{0} is the same as in Theorem 1.

Proof It is easy to verify the following relation by induction on tt,

Now we calculate the difference between Xˉjt\bar{X}_{j}^{t} and ∑i=jtγiXji−1\sum_{i=j}^{t}\gamma_{i}X_{j}^{i-1}.

It is clear that from the first line of above equation that Xˉjt−∑i=jtγiXji−1>0\bar{X}_{j}^{t}-\sum_{i=j}^{t}\gamma_{i}X_{j}^{i-1}>0. Hence we obtain the first inequality of the lemma. We have

Define YjkY_{j}^{k} as Yjk=∏i=jk(I−κγiA)Y_{j}^{k}=\prod_{i=j}^{k}(I-\kappa\gamma_{i}A). Since 0<κ≤10<\kappa\leq 1, we have (Xjk)κ≤Yjk(X_{j}^{k})^{\kappa}\leq Y_{j}^{k}. Hence

Now plugging (14) into above inequality, we obtain the claim of the lemma. With Lemma 11, we can now prove Theorem 1.

where Xˉjt\bar{X}_{j}^{t} is defined in Lemma 11. Hence

And we have E((I(0))TAI(1))=0E((I^{(0)})^{T}AI^{(1)})=0 since E(ξj)=0E(\xi_{j})=0.

Proof (Lemma 7) Let Σx=E(xxT)\Sigma_{x}=E(xx^{T}). We have the following:

For linear regression problem l(θ,x,y)=12(θTx−y)2l(\theta,x,y)=\frac{1}{2}(\theta^{T}x-y)^{2}, assuming all ∥x∥2\|x\|^{2} are MM, then (2) will diverge if learning rate is greater than 2M\frac{2}{M}.

Proof Let XitX_{i}^{t} be defined as in Lemma 11. We obtain the following from (2),

Let At=xtxtTA_{t}=x_{t}x_{t}^{T}, bt=xtytb_{t}=x_{t}y_{t}, A=E(At)A=E(A_{t}), b=E(bt)b=E(b_{t}). Taking expectation with respect to xt,ytx_{t},y_{t}, noticing that Aθ∗=bA\theta^{*}=b, we get

where S=E((Atθ∗−bt)(Atθ∗−bt)T)S=E((A_{t}\theta^{*}-b_{t})(A_{t}\theta^{*}-b_{t})^{T}), u=E(AtAtθ∗−Atbt)u=E(A_{t}A_{t}\theta^{*}-A_{t}b_{t}). Hence

If γt>=2M+δ>2M\gamma_{t}>=\frac{2}{M}+\delta>\frac{2}{M}, then

Noticing that X1t−1→0X_{1}^{t-1}\rightarrow 0 as t→∞t\rightarrow\infty, we conclude that E(∥Δt∥2)E(\|\Delta_{t}\|^{2}) is diverging if γt≥2M\gamma_{t}\geq\frac{2}{M}.

Proof (Lemma 8) Let γit=∑j=itγj\gamma_{i}^{t}=\sum_{j=i}^{t}\gamma_{j},