Slow Learners are Fast

John Langford, Alexander Smola, Martin Zinkevich

Introduction

Online learning has become the paradigm of choice for tackling very large scale estimation problems. Their convergence properties are well understood and have been analyzed in a number of different frameworks such as by means of asymptotics Murata et al. (1994), game theory Hazan et al. (2007), or stochastic programming Nesterov and Vial (2000). Moreover, learning-theory guarantees show that O(1)O(1) passes over a dataset suffice to obtain optimal estimates Bottou and LeCun (2004); Bottou and Bousquet (2007). All those properties combined suggest that online algorithms are an excellent tool for addressing learning problems.

This view, however, is slightly deceptive for several reasons: current online algorithms process one instance at a time. That is, they receive the instance, make some prediction, incur a loss, and update an associated parameter. In other words, the algorithms are entirely sequential in their nature. While this is acceptable in single-core processors, it is highly undesirable given that the number of processing elements available to an algorithm is growing exponentially (e.g. modern desktop machines have up to 8 cores, graphics cards up to 1024 cores). It is therefore very wasteful if only one of these cores is actually used for estimation.

A second problem arises from the fact that network and disk I/O have not been able to keep up with the increase in processor speed. A typical network interface has a throughput of 100MB/s and disk arrays have comparable parameters. This means that current algorithms reach their limit at problems of size 1TB whenever the algorithm is I/O bound (this amounts to a training time of 3 hours), or even smaller problems whenever the model parametrization makes the algorithm CPU bound.

Finally, distributed and cloud computing are unsuitable for today’s online learning algorithms. This creates a pressing need to design algorithms which break the sequential bottleneck. We propose two variants. To our knowledge, this is the first paper which provides theoretical guarantees combined with empirical evidence for such an algorithm. Previous work, e.g. by Delalleau and Bengio (2007) proved rather inconclusive in terms of theoretical and empirical guarantees.

In a nutshell, we propose the following two variants: several processing cores perform stochastic gradient descent independently of each other while sharing a common parameter vector which is updated asynchronously. This allows us to accelerate computationally intensive problems whenever gradient computations are relatively expensive. A second variant assumes that we have linear function classes where parts of the function can be computed independently on several cores. Subsequently the results are combined and the combination is then used for a descent step.

A common feature of both algorithms is that the update occurs with some delay: in the first case other cores may have updated the parameter vector in the meantime, in the second case, other cores may have already computed parts of the function for the subsequent examples before an update.

Algorithm

We begin with an overview of three platforms which are available for parallelization of algorithms. The differ in their structural parameters, such as synchronization ability, latency, and bandwidth and consequently they are better suited to different styles of algorithms. This description is not comprehensive by any means. For instance, there exist numerous variants of communication paradigms for distributed and cloud computing ranging from fully independent Folding@Home algorithms Shirts and Pande (2000) to sophisticated pipelines like the Drayad architecture Isard et al. (2007).

The commercially available 4-16 core CPUs on servers and desktop computers fall into this category. They are general purpose processors which operate on a joint memory space where each of the processors can execute arbitrary pieces of code independently of other processors. Synchronization is easy via shared memory/interrupts/locks. The critical shared resource is memory bandwidth. This problem can be somewhat alleviated by exploiting affinity of processes to specific cores.

A second example of a shared memory architecture are graphics cards. There the number of processing elements is vastly higher (512 on high-end consumer graphics cards), although they tend to be bundled into groups of 8 cores (also referred to as multiprocessing elements), each of which can execute a given piece of code in a data-parallel fashion. An issue is that explicit synchronization between multiprocessing elements is difficult — it requires computing kernels on the processing elements to complete. This means that an explicit synchronization mechanism may be undesirable since it comes at the expense of a large performance penalty or a significant increase in latency. Implicit synchronization via shared memory is still possible. Critical resources are availability of memory: consumer grade graphics cards have in the order of 512MB high speed RAM per chip. Communication between multiple chips is nontrivial.

To increase I/O bandwidth one can combine several computers in a cluster using MPI or PVM as the underlying communications mechanism. A clear limit here is bandwidth constraints and latency for inter-computer communication. On Gigabit Ethernet the TCP/IP latency can be in the order of 100μ\mus, the equivalent of 10510^{5} clock cycles on a processor and network bandwidth tends to be a factor 100 slower than memory bandwdith. Infiniband is approximately one order of magnitude faster but it is rarely found in off-the-shelf server farms.

Computational paradigms such as MapReduce Chu et al. (2007) are well suited for the parallelization of batch-style algorithms Teo et al. (2009). In comparison to cluster configurations communication and latency are further constrained. For instance, often individual processing elements are unable to communicate directly with other elements with disk / network storage being the only mechanism of inter-process data transfer. Moreover, the latency is significantly increased, typically in the order of seconds, due to the interleaving of Map and Reduce processing stages.

Of the above three platform types we will only consider the first two since latency plays a critical role in the analysis of the class of algorithms we propose. While we do not exclude the possibility of devising parallel online algorithms suited to grid computing, we believe that the family of algorithm proposed in this paper is unsuitable and a significantly different synchronization paradigm would need to be explored.

2 Delayed Stochastic Gradient Descent

At the outset we make no special assumptions on the order or form of the functions fif_{i}. In particular, an adversary may choose to order or generate them in response to our previous choices of xx. In other cases, the functions fif_{i} may be drawn from some distribution (e.g. whenever we deal with induced losses). It is our goal to find a sequence of xix_{i} such that the cumulative loss ∑ifi(xi)\sum_{i}f_{i}(x_{i}) is minimized. With some abuse of notation we identify the average empirical and expected loss both by f∗f^{*}. This is possible, simply by redefining p(f)p(f) to be the uniform distribution over FF. Denote by

the average risk. We assume that x∗x^{*} exists (convexity does not guarantee a bounded minimizer) and that it satisfies ∥x∗∥≤R\left\|x^{*}\right\|\leq R (this is always achievable, simply by intersecting X\mathcal{X} with the unit-ball of radius RR). We propose the following algorithm:

3 Templates

Assume that we have nn processors which can process data independently of each other, e.g. in a multicore platform, a graphics card, or a cluster of workstations. Moreover, assume that computing the gradient of ft(x)f_{t}(x) is at least nn times as expensiveMore fine-grained variants are possible where we write only parts of the parameter vector xx at a time, thereby requiring locks on only parts of xx by an updating processor. We omit details of such modifications as they are entirely technical and do not add to the key idea of the paper. as it is to update xx (read, add, write). This occurs, for instance, in the case of conditional random fields Ratliff et al. (2007); Vishwanathan et al. (2006), in planning Ratliff et al. (2006), and in ranking Weimer et al. (2008).

The rationale for delayed updates can be seen in the following setting: assume that we have nn cores performing stochastic gradient descent on different instances ftf_{t} while sharing one common parameter vector xx. If we allow each core in a round-robin fashion to update xx one at a time then there will be a delay of τ=n−1\tau=n-1 between when we see ftf_{t} and when we get to update xt+τx_{t+\tau}. The delay arises since updates by different cores cannot happen simultaneously. This setting is preferable whenever computation of ftf_{t} itself is time consuming.

Note that there is no need for explicit thread-level synchronization between individual cores. All we need is a read / write-locking mechanism for xx or alternatively, atomic updates on the parameter vector.There exists some limited support for this in the Intel Threading Building Blocks library for the x86 architecture. This is important since thread synchronization on GPUs is rudimentary at best. Keeping the state synchronized by a shared memory architecture is key.

On a multi-computer cluster we can use a similar mechanism simply by having one server act as a state-keeper which retains an up-to-date copy of xx while the loss-gradient computation clients can retrieve at any time a copy of xx and send gradient update messages to the state keeper. Note that this is only feasible whenever the message size does not exceed 1n\frac{1}{n} of the bandwidth of the state-keeper. This suggests an alternative variant of the algorithm which is considerably less demanding in terms of bandwidth constraints.

Pipelined Optimization

The key impediment in the previous template is that it required significant amounts of bandwidth solely for the purpose of synchronizing the state vector. This can be addressed by parallelizing computing the function value fi(x)f_{i}(x) explicitly rather than attempting to compute several instances of fi(x)f_{i}(x) simultaneously. Such situations occur, e.g. when fi(x)=g(⟨ϕ(zi),x⟩)f_{i}(x)=g(\left\langle\phi(z_{i}),x\right\rangle) for high-dimensional ϕ(zi)\phi(z_{i}). If we decompose the data ziz_{i} (or its features) over nn nodes we can compute partial function values and also all partial updates locally. The only communication that is required is to combine partial values and to compute the gradient with respect to ⟨ϕ(zi),x⟩\left\langle\phi(z_{i}),x\right\rangle.

This causes delay since the second stage is processing results of the first stage while the latter has already moved on to processing ft+1f_{t+1} or further. While the architecture is quite different, the effects are identical: the parameter vector xx is updated with some delay τ\tau. Note that here τ\tau can be much smaller than the number of processors and mainly depends on the latency of the communication channel. Also note that in this configuration the memory access for xx is entirely local.

Randomization

Order of observations matters for delayed updates: imagine that an adversary, aware of the delay τ\tau bundles each of the τ\tau most similar instances ftf_{t} together. In this case we will incur a loss that can be τ\tau times as large as in the non-delayed case and require a learning rate which is τ\tau times smaller. The reason being that only after seeing τ\tau instances of ftf_{t} will we be able to respond to the data. Such highly correlated settings do occur in practice: for instance, e-mails or search keywords have significant temporal correlation (holidays, political events, time of day) and cannot be treated as iid data.

A simple strategy can be used to alleviate this problem: decorrelate observations by random permutations of the instances. The price we pay for this modification is a delay in updating the model parameters (there need not be any delay in the prediction itself) since obviously the range of decorrelation needs to exceed τ\tau considerably.

Lipschitz Continuous Losses

We begin with a simple game theoretic analysis that only requires ftf_{t} to be convex and where the subdifferentials are bounded ∥∇ft(x)∥≤L\left\|\nabla f_{t}(x)\right\|\leq L by some L>0L>0. Denote by x∗x^{*} the minimizer of f∗(x)f^{*}(x). It is our goal to bound the regret RR associated with a sequence X={x1,…,xT}X=\left\{x_{1},\ldots,x_{T}\right\} of parameters

Such bounds can then be converted into bounds on the expected loss. See e.g. (Shalev-Shwartz et al., 2007) for an example of a randomized conversion. Since all ftf_{t} are convex we can upper bound R[X]R[X] via

Next define a potential function measuring the distance between xtx_{t} and x∗x^{*}. In the more general analysis this will become a Bregman divergence. We define D(x∥x′):=12∥x−x′∥2D(x\|x^{\prime}):=\frac{1}{2}\left\|x-x^{\prime}\right\|^{2}. To prove regret bounds we need the following auxiliary lemma which bounds the instantaneous risk at a given time:

The divergence function allows us to decompose our progress via

We can now expand the inner product between delayed parameters ⟨xt−xt−τ,gt−τ⟩\left\langle x_{t}-x_{t-\tau},g_{t-\tau}\right\rangle in terms of differences between gradients. Here we need to distinguish the initialization: for τ≤t<2τ\tau\leq t<2\tau we only obtain differences between t−τt-\tau gradients, since the optimization protocol initializes xt=x1x_{t}=x_{1} for all t≤τt\leq\tau. This yields

Plugging the above into (9), dividing both sides by ηt\eta_{t} and moving ⟨xt−τ−x∗,gt−τ⟩\left\langle x_{t-\tau}-x^{*},g_{t-\tau}\right\rangle to the LHS completes the proof.

To show that the inequality holds note that distances between vectors can only decrease if we project onto convex sets. The argument follows that of Zinkevich (2003). ∎

Note that the decomposition (5) is very similar to standard regret decomposition bounds, such as (Zinkevich, 2003). The key difference is that we now have an additional term characterizing the correlation between successive gradients which needs to be bounded. In the worst case all we can do is bound ⟨gt−τ−j,gt−τ⟩≤L2\left\langle g_{t-\tau-j},g_{t-\tau}\right\rangle\leq L^{2}, whenever the gradients are highly correlated, which leads to the following theorem:

Suppose all the cost functions are Lipschitz continuous with a constant LL and max⁡x,x′∈XD(x∥x′)≤F2\max_{x,x^{\prime}\in X}D(x\|x^{\prime})\leq F^{2}. Given ηt=σt−τ\eta_{t}=\frac{\sigma}{\sqrt{t-\tau}} for some constant σ>0\sigma>0, the regret of the delayed update algorithm is bounded by

and consequently for σ2=F22τL2\sigma^{2}=\frac{F^{2}}{2\tau L^{2}} and T≥τ2T\geq\tau^{2} we obtain the bound

Before we prove the claim, we briefly state a few useful identities concerning sums.

Summing over (5) and using Lemma 1 yields the inequality

By the Lipschitz property of gradients and the definition of ηt\eta_{t} we can bound the first summand of the above risk inequality via

Next we tackle the terms dependent on DD. By the assumption on the diameter, D(x∗∥xt)≤F2D(x^{*}\|x_{t})\leq F^{2} for all xtx_{t}. This yields

Here the second to last equality follows from the fact that we have a telescoping sum. Note that we can discard the contribution of −D(x∗∥xT+τ+1)ηT+τ-\frac{D(x^{*}\|x_{T+\tau+1})}{\eta_{T+\tau}} since it is always negative, hence the bound can only become tighter.

Finally, we address the contribution of the inner products between gradients. By the Lipschitz property of the gradients we know that ⟨gt−τ−j,gt−τ⟩≤L2\left\langle g_{t-\tau-j},g_{t-\tau}\right\rangle\leq L^{2}. Moreover, ηt\eta_{t} is monotonically decreasing, hence we can bound the correlation term in Lemma 1 via

Substituting the bounds for all three terms into the gradient bound yields

Plugging in σ=FL2τ\sigma=\frac{F}{L\sqrt{2\tau}} changes the RHS to

Using the fact that τ≥1\tau\geq 1 (otherwise our analysis is vacuous) and T≥τ2T\geq\tau^{2} (it is reasonable to assume that we have at least O(τ)O(\tau) data per processor) yields the claim. ∎

In other words the algorithm converges at rate O(τT)O(\sqrt{\tau T}). This is similar to what we would expect in the worst case: an adversary may reorder instances such as to maximally slow down progress. In this case a parallel algorithm is no faster than a sequential code. This result may appear overly pessimistic in practice but the following example shows that such worst-case scaling behavior is to be expected:

Assume that an optimal online algorithm with regard to a convex game achieves regret R[m]R[m] after seeing mm instances. Then any algorithm which may only use information that is at least τ\tau instances old has a worst case regret bound of τR[m/τ]\tau R[m/\tau].

The useful consequence of Theorem 2 is that we are guaranteed to converge at all even if we encounter delay (the latter is not trivial — after all, we could end up with an oscillating parameter vector for overly aggressive learning rates). While such extreme cases hardly occur in practice, we need to make stronger assumptions in terms of correlation of ftf_{t} and the degree of smoothness in ftf_{t} to obtain tighter bounds.

We conclude this section by studying a particularly convenient case: the setting when the functions fif_{i} are strongly convex with parameter λ>0\lambda>0 satisfying

Here we can get rid of the D(x∗∥x1)D(x^{*}\|x_{1}) dependency in the loss bound.

Suppose that the functions fif_{i} are strongly convex with parameter λ>0\lambda>0. Moreover, choose the learning rate ηt=1λ(t−τ)\eta_{t}=\frac{1}{\lambda(t-\tau)} for t>τt>\tau and ηt=0\eta_{t}=0 for t≤τt\leq\tau. Then under the assumptions of Theorem 2 we have the following bound:

The proof largely follows that of Bartlett et al. (2008). The key difference is that now we need to take the additional contribution of the gradient correlations into account. Using (20) we have

By construction, ηt\eta_{t} (when t≥τ+1t\geq\tau+1) is monotonically increasing, hence we have ηt≤ηmax⁡(t−τ,τ+1)\eta_{t}\leq\eta_{\max(t-\tau,\tau+1)}, so we can:

As before, we pay a linear price in the delay τ\tau.

Decorrelating Gradients

To improve our bounds beyond the most pessimistic case we need to assume that the adversary is not acting in the most hostile fashion possible. In the following we study the opposite case — namely that the adversary is drawing the functions fif_{i} iid from an arbitrary (but fixed) distribution. The key reason for this requirement is that we need to control the value of ⟨gt,gt′⟩\left\langle g_{t},g_{t^{\prime}}\right\rangle for adjacent gradients.

The flavor of the bounds we use will be in terms of the expected regret rather than an actual regret. Conversions from expected to realized regret are standard. See e.g. (Nesterov and Vial, 2000, Lemma 2) for an example of this technique. For this purpose we need to take expectations of sums of copies of (5) in Lemma 1. Note that this is feasible since expectations are linear and whenever products between more than one term occur, they can be seen as products which are conditionally independent given past parameters, such as ⟨gt,gt′⟩\left\langle g_{t},g_{t^{\prime}}\right\rangle for ∣t−t′∣≤τ|t-t^{\prime}|\leq\tau (in this case no information about gtg_{t} can be used to infer gt′g_{t^{\prime}} or vice versa, given that we already know all the history up to time min⁡(t,t′)−1\min(t,t^{\prime})-1. Our informal argument can be formalized by using martingale techniques. We omit the latter in favor of a much more streamlined discussion. Since the argument is rather repetitive (we will prove a number of different bounds) we will not discuss issues with conditional expectations any further.

A key quantity in our analysis are bounds on the correlation between subsequent instances. In some cases we will only be able to obtain bounds on the expected regret rather than the actual regret. For the reasons pointed out in Lemma 3 this is an in-principle limitation of the setting.

Our first strategy is to assume that ftf_{t} arises from a scalar function of a linear function class. This leads to bounds which, while still bearing a linear penalty in τ\tau, make do with considerably improved constants. The second strategy makes stringent smoothness assumptions on ftf_{t}, namely it assumes that the gradients themselves are Lipschitz continuous. This will lead to guarantees for which the delay becomes increasingly irrelevant as the algorithm progresses.

Many functions ft(x)f_{t}(x) depend on xx only via an inner product. They can be expressed as

Now assume that ∣∂⟨zt,x⟩l(yt,⟨zt,x⟩)∣≤Λ\left|\partial_{\left\langle z_{t},x\right\rangle}l(y_{t},\left\langle z_{t},x\right\rangle)\right|\leq\Lambda for all xx and all tt. This holds, e.g. in the case of logistic regression, the soft-margin hinge loss, novelty detection. In all three cases we have Λ=1\Lambda=1. Robust loss functions such as Huber’s regression score Huber (1981) also satisfy (22), although with a different constant (the latter depends on the level of robustness). For such problems it is possible to bound the correlation between subsequent gradients via the following lemma:

Denote by (y,z),(y′,z′)∼Pr⁡(y,z)(y,z),(y^{\prime},z^{\prime})\sim\Pr(y,z) random variables which are drawn independently of x,x′∈Xx,x^{\prime}\in\mathcal{X}. In this case

Here we defined α\alpha to be the scaling factor which quantifies by how much gradients are correlated.

By construction we may bound the inner product for linear function classes using the Lipschitz constant Λ\Lambda. This yields the upper bound

Here the first term follows from Lipschitz continuity and the inequality is a consequence of the quadratic function being convex. ∎

Given ηt=σt−τ\eta_{t}=\frac{\sigma}{\sqrt{t-\tau}} and the conditions of Lemma 5 the regret of the delayed update algorithm is bounded by

and consequently for σ2=F22ταL2\sigma^{2}=\frac{F^{2}}{2\tau\alpha L^{2}} (assuming that τα≥1\tau\alpha\geq 1) and T≥τ2T\geq\tau^{2} we obtain the bound

The proof is identical to that of Theorem 2, except that the terms linear and quadratic in τ\tau are rescaled by a factor of α\alpha. Substituting the new value for σ\sigma and exploiting ατ≥1\alpha\tau\geq 1 proves the claim. ∎

2 Bounds for smooth gradients

The key to improving the rate rather than the constant with regard to which the bounds depend on τ\tau is to impose further smoothness constraints on ftf_{t}. The rationale is quite simple: we want to ensure that small changes in xx do not lead to large changes in the gradient. This is precisely what we need in order to show that a small delay (which amounts to small changes in xx) will not impact the update that is carried out to a significant amount. More specifically we assume that the gradient of ff is a Lipschitz-continuous function. That is,

Such a constraint effectively rules out piecewise linear loss functions, such as the hinge loss, structured estimation, or the novelty detection loss. Nonetheless, since this discontinuity only occurs on a set of measure delayed stochastic gradient descent still works very well on them in practice. We need an auxiliary lemma which allows us to control the magnitude of the gradient as a function of the distance from optimality:

Assume that ff is convex and moreover that ∂xf(x)\partial_{x}f(x) is Lipschitz continuous with constant HH. Finally, denote by x∗x^{*} the minimizer of ff. In this case

The proof decomposes into two parts: we first show that the problem can be reduced to a one-dimensional setting and secondly we show that the claim holds in the one-dimensional case.

Part 1: For a given function ff with minimizer x∗x^{*} and for an arbitrary starting point xx we can simply follow the opposite of the gradient field −∂xf(x)-\partial_{x}f(x) starting at xx to arrive at x∗x^{*}.This is simply gradient descent and related to the Picard-Lindelöf theorem. Without loss of generality we define x∗x^{*} to be the particular minimizer of ff that is reached by the going in the opposite direction of the gradient flow, whenever there is ambiguity in the choice. The parametrized curve corresponding to the gradient flow is still monotonically decreasing, its directed gradient equals −∥∂xf(x)∥-\left\|\partial_{x}f(x)\right\| along the curve, and moreover, distances between points on the curve are bounded from above by the length of the path between them. Hence, (27) holds for the now one-dimensional restriction of ff. Note that the derivative along the path is strictly negative until the end, what one would expect as one heads to a minimum.

Note that by construction, the gradient is strictly negative from 0 (inclusive) to x∗x^{*} (exclusive), hence the upper bound of zero. Define t∗=−f′(0)/Ht^{*}=-f^{\prime}(0)/H, such that f′(0)+Ht∗=0f^{\prime}(0)+Ht^{*}=0. Clearly t∗∈[0,x∗]t^{*}\in[0,x^{*}] since t∗>x∗t^{*}>x^{*} would imply that f′(x∗)<0f^{\prime}(x^{*})<0 and x∗x^{*} is not the minimizer. Integrating the lower bound on f′(t)f^{\prime}(t) yields

Multiplying both sides by −2H-2H (and switching the inequality) proves the claim. Note that we did not require in the second part of the proof that ff is convex or monotonic. This information was only used in part 1 to generate the gradient flow. ∎

This inequality will become useful to show that as we are approaching optimality, the expected gradient ∂xf∗(x)\partial_{x}f^{*}(x) also needs to vanish. Since gtg_{t} is assumed to change smoothly with xx this implies that in expectation gtg_{t} will vanish for x→x∗x\to x^{*} at a controlled rate. We now state our main result:

In addition to the conditions of Theorem 2 assume that the functions fif_{i} are i.i.d., H≥L4FτH\geq\frac{L}{4F\sqrt{\tau}} and that HH also upper-bounds the change in the gradients as in Lemma 7. Moreover, assume that we choose a learning rate ηt=σt−τ\eta_{t}=\frac{\sigma}{\sqrt{t-\tau}} with σ=FL\sigma=\frac{F}{L}. In this case the risk is bounded by

Our proof is quite similar to that of Theorem 2. The key differences are that we may now bound the expected change between subsequent gradients in terms of the optimality gap itself. In particular:

Moving the minimum inside the expectation makes it so that we can decide which point after we know what function is drawn, as opposed to before, which makes the problem easier and the expected cost lower. Note that ∑t=1Tft\sum_{t=1}^{T}f_{t}, because it is a sum of random functions with mean f∗f^{*}, is itself a random function with mean Tf∗Tf^{*}. So the same reasoning applies:

We can extract from the proof of Theorem 2 that:

Consider the gradient correlation of (18) for t>τt>\tau

We know that ∥xt−xt′∥≤L∑j=tt′−1ηj\left\|x_{t}-x_{t^{\prime}}\right\|\leq L\sum_{j=t}^{t^{\prime}-1}\eta_{j} since each gradient is bounded by LL. By the smoothness constraint on the gradients this implies that ∥∂x(fi(xt)−fi(xt′))∥≤LH∑j=tt′−1ηj\left\|\partial_{x}\left(f_{i}(x_{t})-f_{i}(x_{t^{\prime}})\right)\right\|\leq LH\sum_{j=t}^{t^{\prime}-1}\eta_{j}. This means that as ηt→0\eta_{t}\to 0 the error induced by the delayed update become a second order effect as the algorithm converges. In summary, we may bound CtC_{t} as follows:

Taking expectations of the upper bound is feasible, since all ft−τ−jf_{t-\tau-j} and ft−τf_{t-\tau} are independent of each other and of their argument xt−τx_{t-\tau}. This yields the upper bound

The second inequality is obtained by appealing to Lemma 7 and by using the fact that the learning rate is monotonically decreasing.

What this means is that once the stepsize of the learning rate is small enough, second order effects become essentially negligible. The overall reduction in the amount by which the bound on the expected regret f∗(xt)−f∗(x∗)f^{*}(x_{t})-f^{*}(x^{*}) is reduced is given by τHηt−τ\tau H\eta_{t-\tau}. If we wish to limit this reduction to 14\frac{1}{4} this implies for a learning rate of ηt=σ/t−τ\eta_{t}=\sigma/\sqrt{t-\tau} that we should use (39) only for t≥t0:=3τ+64σ2τ2H2≤112σ2τ2H2t\geq t_{0}:=3\tau+64\sigma^{2}\tau^{2}H^{2}\leq 112\sigma^{2}\tau^{2}H^{2} (the latter bounds holds by assumption on HH). We now bound the part of the risk where the effects of the delay are sufficiently small. In analogy to (15) we obtain

All but the last term can be bounded in the same way as in Theorem 2. The sum over the gradient norms can be bounded from above by σL2T\sigma L^{2}\sqrt{T} as in (16). Likewise, the sum over the divergences can be bounded by F2σT\frac{F^{2}}{\sigma}\sqrt{T} as in (17). Lastly, since 2Hτηt−τ≤142H\tau\eta_{t-\tau}\leq\frac{1}{4} when t≥t0t\geq t_{0} and f∗(xt−τ)−f∗(x∗)≥0f^{*}(x_{t-\tau})-f^{*}(x^{*})\geq 0, the sum over the gradient correlations is bounded as follows

For bounding the sum over ηt2\eta_{t}^{2} we used a conversion of the sum to an integral and the fact that t0>τ+1t_{0}>\tau+1. This first term equals the expected regret over the time period [t0,T+τ][t_{0},T+\tau]. Hence, multiplying the overall regret bound by 1/(1−1/4)=4/31/(1-1/4)=4/3 and combining the sum over [t0,T][t_{0},T] with Theorem 2 (which covers the segment [τ,t0][\tau,t_{0}]) yields the following guarantee:

Plugging in σ=F/L\sigma=F/L and t0≤112F2τ2H2/L2t_{0}\leq 112F^{2}\tau^{2}H^{2}/L^{2}, using the fact that τ≥1\tau\geq 1, and collecting terms yields

Dividing by 34\frac{3}{4} proves the claim. ∎

Note that the convergence bound which is O(τ2log⁡T+T)O(\tau^{2}\log T+\sqrt{T}) is governed by two different regimes. Initially, a delay of τ\tau can be quite harmful since subsequent gradients are highly correlated. At a later stage when optimization becomes increasingly an averaging process a delay of τ\tau in the updates proves to be essentially harmless. The key difference to bounds of Theorem 2 is that now the rate of convergence has improved dramatically and is essentially as good as in sequential online learning. Note that HH does not influence the asymptotic convergence properties but it significantly affects the initial convergence properties.

This is exactly what one would expect: initially while we are far away from the solution x∗x^{*} parallelism does not help much in providing us with guidance to move towards x∗x^{*}. However, after a number of steps online learning effectively becomes an averaging process for variance reduction around x∗x^{*} since the stepsize is sufficiently small. In this case averaging becomes the dominant force, hence parallelization does not degrade convergence further. Such a setting is desirable — after all, we want to have good convergence for extremely large amounts of data.

3 Bounds for smooth gradients with strong convexity

The analysis is a combination of the proof techniques described in Theorem 8 in combination with Theorem 4.

Under the assumptions of Theorem 4, in particular, assuming that all functions fif_{i} are i.i.d and strongly convex with constant λ\lambda and corresponding learning rate ηt=1λ(t−τ)\eta_{t}=\frac{1}{\lambda(t-\tau)} and provided that the loss satisfies (27) for some constant HH we have the following bound on the expected regret:

As before, we bound the expected correlation between gradients via

Here the second inequality follows from the fact that the learning rate is decreasing and by the fact that ∑n=1∞1n2=π26\sum_{n=1}^{\infty}\frac{1}{n^{2}}=\frac{\pi^{2}}{6}. This allows us to combine both a bound governing the behavior until t0t_{0} and a tightened-up bound once gradient changes are small. We obtain

By choosing t0=3τ+(Hτ/λ)t_{0}=3\tau+(H\tau/\lambda) we see that the factor on the LHS is bounded by 0.90.9. This also simplifies expressions on last term of the RHS and it yields the inequality

As before, this improves the rate of the bound. Instead of a dependency of the form O(τlog⁡T)O(\tau\log T) we now have the dependency O(τ2+log⁡T)O(\tau^{2}+\log T). This is particularly desirable for large TT. We are now within a small factor of what a fully sequential algorithm can achieve. In fact, we could make the constant arbitrary small for large enough TT.

Bregman Divergence Analysis

Moreover, a convex function ff is strongly σ\sigma-convex with respect to ϕ\phi whenever the following inequality holds for all x,x′∈Bx,x^{\prime}\in\mathcal{B}:

Finally, for a convex function ff denote by f∗f^{*} the Fenchel-Legendre dual of ff. It is given by f∗(y)=sup⁡x⟨x,y⟩−f(x)f^{*}(y)=\sup_{x}\left\langle x,y\right\rangle-f(x). We are now able to define the implicit update version of Algorithm 1.

It is easy to check that Algorithm 1 is a special case of Algorithm 2. For ϕ(x)=12∥x∥2\phi(x)=\frac{1}{2}\left\|x\right\|^{2} we have that ϕ∗=ϕ\phi^{*}=\phi and ∇ϕ(x)=x\nabla\phi(x)=x. If ϕ\phi is the unnormalized logarithm we obtain delayed exponential gradient descent. We state the following lemma without proof, since it is virtually identical to that of Shalev-Shwartz and Singer (2007):

Assume that ϕ\phi is 1-strongly convex with respect to the norm associated with B\mathcal{B}. Then for any x∗∈Bx^{*}\in\mathcal{B}, and in particular the loss minimizer, the following holds

Assume that the implicit updates associated with ϕ\phi are Lipschitz, that is

for some Φ>0\Phi>0. Then the delayed update algorithm has a regret bound of the form

and consequently for σ2=F22τΦL2\sigma^{2}=\frac{F^{2}}{2\tau\Phi L^{2}} (assuming that τΦ≥1\tau\Phi\geq 1) and T≥τ2T\geq\tau^{2} we obtain the bound

To apply the regret bounds we need to replace ⟨xt−x∗,gt−τ⟩\left\langle x_{t}-x^{*},g_{t-\tau}\right\rangle in (49) by a term which uses xt−τx_{t-\tau} instead of xtx_{t}. This can be achieved by telescoping via

The key difference to before is that now the difference between subsequent weight vectors does not constitute the gradient anymore. To obtain the same type of bounds that yielded Theorem 2 we exploit continuity in the forward and reverse transform via (50). This yields ⟨xt−x∗,gt−τ⟩≥⟨xt−τ−x∗,gt−τ⟩−τηt−τΦL2\left\langle x_{t}-x^{*},g_{t-\tau}\right\rangle\geq\left\langle x_{t-\tau}-x^{*},g_{t-\tau}\right\rangle-\tau\eta_{t-\tau}\Phi L^{2}. Plugging this bound into a sum over TT terms and using the argument as in Theorem 2 proves the claim. ∎

Obtaining bounds that are as tight as Theorem 8 is subject of further work. We anticipate, however, that this may not be quite as easy, in particular whenever functions can change significantly after just seeing a small number of examples, as is the case for exponentiated gradient descent. Here a delay can be considerably more harmful than in the simple stochastic gradient descent scenario.

Experiments

In our experiments we focused on pipelined optimization. In particular, we used two different training sets that were based on e-mails: the TREC dataset Cormack (2007), consisting of 75,419 e-mail messages, and a proprietary (significantly harder) dataset of which we took 100,000 e-mails. These e-mails were tokenized by whitespace. The problem there is one of binary classification, that is we are interested in minimizing

Here yt∈{±1}y_{t}\in\left\{\pm 1\right\} denote the labels of the binary classification problem, and ll is the smoothed quadratic soft-margin loss of Langford et al. (2007). We used two feature representations: a linear one which amounted to a simple bag of words representation, and a quadratic one which amounted to generating a bag of word pairs (consecutive or not).

To deal with high-dimensional feature spaces we used hashing Weinberger et al. (2009). In particular, for the TREC dataset we used 2182^{18} feature bins and for the proprietary dataset we used 2242^{24} bins. Note that hashing comes with performance guarantees which state that the canonical distortion due to hashing is sufficiently small for the dimensionality we picked.

We tried to address the following issues in our simulation:

The obvious question is a systematic one: how much of a convergence penalty do we incur in practice due to delay. This experiment checks the goodness of our bounds. We checked convergence for a system where the delay is given by τ∈{0,10,100,1000}\tau\in\{0,10,100,1000\}.

Secondly, we checked on an actual parallel implementation whether the algorithm scales well. Unlike the previous check includes issues such as memory contention, thread synchronization, and general feasibility of a delayed updating architecture.

The code was written in Java, although several of the fundamentals were based upon VW Langford et al. (2007), that is, hashing and the choice of loss function. We added regularization using lazy updates of the parameter vector (i.e. we rescale the updates and occasionally rescale the parameter). This is akin to Leon Bottou’s SGD code. For robustness, we used ηt=1t\eta_{t}=\frac{1}{\sqrt{t}}.

All timed experiments were run on a single, 8 core machine with 32 GB of memory. In general, at least 6 of the cores were free at any given time. In order to achieve advantages of parallelization, we divide the feature space {1…n}\{1\ldots n\} into roughly equal pieces, and assign a slave thread to each piece. Each slave is given both the weights for its pieces, as well as the corresponding pieces of the examples. The master is given the label of each example. We compute the dot product separately on each piece, and then send these results to a master. The master adds the pieces together, calculates the update, and then sends that back to the slaves. Then, the slaves update their weight vectors in proportion to the magnitude of the central classifier. What makes this work quickly is that there are multiple examples in flight through this dataflow simultaneously. Note that between the time when a dot product is calculated for an example and when the results have been transcribed, the weight vector has been updated with several other earlier examples and the dot products have been calculated from several later examples. As a safeguard we limited the maximum delay to 100 examples. In this case the compute slave would simply wait for the pipeline to clear.

The first experiment that we ran was a simulation where we artificially added a delay between the update and the product (Figure 2a). We ran this experiment using linear features, and observed that the performance did not noticeably degrade with a delay of 10 examples, did not significantly degrade with a delay of 100, but with a delay of 1000, the performance became much worse.

The second experiment that we ran was with a proprietary dataset (Figure 2b). In this case, the delays hurt less; we conjecture that this was because the information gained from each example was smaller. In fact, even a delay of 1000 does not result in particularly bad performance.

Encouraged by these results, we tried to parallelize these exact experiments (results not shown). This turned out to be impossible: a serial implementation alone handled over 150,000 examples/second. However, when you consider more complex problems, such as with a quadratic representation, then a single example takes slightly above one millisecond. In this domain, we found that parallelization dramatically improved performance (Figure 2c). In this case, we loaded a small number of examples that could fit into memory,ideally, one could design code optimized for quadratic representations, and never explicitly generate the whole example and showed that the parallelization improved speed dramatically.

Summary and Discussion

Trying the type of delayed updates presented here is a natural approach to the problem: however, intuitively, having a delay of τ\tau is like having a learning rate that is τ\tau times larger. In this paper, we have shown theoretically how independence between examples can make the actual effect much smaller.

The experimental results showed three important aspects: first of all, small simulated delayed updates do not hurt much, and in harder problems they hurt less; secondly, in practice it is hard to speed up “easy” problems with a small amount of computation, such as e-mails with linear features; finally, when examples are larger or harder, the speedups can be quite dramatic.

References