Stochastic Quasi-Gradient Methods: Variance Reduction via Jacobian Sketching

Robert M. Gower, Peter Richtárik, Francis Bach

Introduction

We consider the problem of minimizing the average of a large number of differentiable functions

where ff is μ\mu–strongly convex and LL–smooth. In solving (1), we restrict our attention to first-order methods that use a (variance-reduced) stochastic estimate of the gradient gk≈∇f(xk)g^{k}\approx\nabla f(x^{k}) to take a step towards minimizing (1) by iterating

In the context of machine learning, (1) is an abstraction of the empirical risk minimization problem; xx encodes the parameters/features of a (statistical) model, and fif_{i} is the loss of example/data point ii incurred by model xx. The goal is to find the model xx which minimizes the average loss on the nn observations.

Typically, nn is so large that algorithms which rely on scanning through all nn functions in each iteration are too costly. The need for incremental methods for the training phase of machine learning models has revived the interest in the stochastic gradient descent (SGD) method . SGD sets gk=∇fi(xk)g^{k}=\nabla f_{i}(x^{k}), where ii is an index chosen from [n]=def{1,2,…,n}[n]\overset{\text{def}}{=}\{1,2,\dots,n\} uniformly at random. SGD therefore requires only a single data sample to complete a step and make progress towards the solution. Thus SGD scales well in the number of data samples, which is important in several machine learning applications since there many be a large number of data samples. On the downside, the variance of the stochastic estimates of the gradient produced by SGD does not vanish during the iterative process, which suggests that a decreasing stepsize regime needs to be put into place if SGD is to converge. Furthermore, for SGD to work efficiently, this decreasing stepsize regime needs to be tuned for each application area, which is costly.

Stochastic variance-reduced versions of SGD offer a solution to this high variance issue, which improves the theoretical convergence rate and solves the issue with ad hoc stepsize regimes. The first variance reduced method for empirical risk minimization is the stochastic average gradient (SAG) method of Schmidt, Le Roux and Bach . The analysis of SAG is notoriously difficult, which is perhaps due to the estimator of gradient being biased. Soon afterwards, the SAG gradient estimator was modified into an unbiased one, which resulted in the SAGA method . SAGA maintains a matrix of the latest gradients computed for each datapoint ii, and uses this matrix to construct a stochastic estimate of the gradient. The analysis of SAGA is dramatically simpler than that of SAG. Another popular method is SVRG of Johnson and Zhang (see also S2GD ). SVRG enjoys the same theoretical complexity bound as SAGA, but has a much smaller memory footprint. It is based on an inner-outer loop procedure. In the outer loop, a full pass over data is performed to compute the gradient of ff at the current point. In the inner loop, this gradient is modified with the use of cheap stochastic gradients, and steps are taken in the direction of the modified gradients. A notable recent addition to the family of variance reduced methods, developed by Nguyen et al , is known as SARAH. Unlike other methods, SARAH does not use an estimator that is unbiased in the last step. Instead, it is unbiased over a long history of the method.

A fundamentally different way of designing variance reduced methods is to use coordinate descent to solve the dual. This is what the SDCA method and its various extensions do. The key advantage of this approach is that the dual often has a seperable structure in the coordinate space, which in turn means that each iteration of coordinate descent is cheap. Furthermore, SDCA is a variance-reduced method by design since the coordinates of the gradient tend to zero as one approaches the solution. One of the downsides of SDCA is that it requires calculating Fenchel duals and their derivatives. This issue was later solved by introducing approximations and mapping the dual iterates to the primal space as pointed out in . This resulted in primal variants of SDCA such as dual-free SDCA . A primal-dual variant which enables the use of arbitrary minibatch strategies was developped by Qu et al , and is known as QUARTZ.

2 Gaps in our understanding of SAGA

Despite significant research into variance-reduced stochastic gradient descent methods for solving (1), there are still big gaps in our understanding of variance reduction. For instance, the current theory supporting the SAGA algorithm is far from complete.

SAGA with uniform probabilities enjoys the iteration complexity O((n+Lmax⁡μ)log⁡1ϵ){\cal O}((n+\tfrac{L_{\max}}{\mu})\log\tfrac{1}{\epsilon}), where Lmax⁡=defmax⁡iLiL_{\max}\overset{\text{def}}{=}\max_{i}L_{i} and LiL_{i} is the smoothness constant of fif_{i}. While importance sampling versions of SAGA have proved in practice to produce a speed-up over uniform SAGA , a proof of this speed-up has been elusive. It was conjectured by Schmidt et al. that a properly designed importance sampling strategy for SAGA should lead to the rate O((n+Lˉμ)log⁡1ϵ){\cal O}((n+\tfrac{\bar{L}}{\mu})\log\tfrac{1}{\epsilon}), where Lˉ=1n∑iLi\bar{L}=\tfrac{1}{n}\sum_{i}L_{i}. However, no such result was proved. This rate is achieved by, for instance, importance sampling variants of SDCA and QUARTZ . However, the analysis only applies to a more specialized version of problem (1) (e.g., one needs an explicit strongly convex regularizer). Second, existing minibatch variants of SAGA do not enjoy the same rate as that offered by methods such as SDCA and QUARTZ. Are the above issues with SAGA unavoidable, or is it the case that our understanding of the method is far from complete? Lastly, no minibatch variant of SAGA with importance sampling is known.

One of the contributions of this paper is giving positive answers to all of the above questions.

3 Jacobian sketching: a new approach to variance reduction

Our key contribution in this paper is the introduction of a novel approach—which we call Jacobian sketching—to designing and understanding variance-reduced stochastic gradient descent methods for solving (1). We refer to our method by the name JacSketch. We shall now briefly introduce some of the key insights motivating our our approach.

The starting point of our new approach is the following trivial observation: the gradient of ff at xx can be computed from the Jacobian ∇F(x){\bf\nabla F}(x) by a simple linear transformation:

which is a stochastic gradient of ff at xx. In other words, by performing a random linear transformation of the Jacobian, we have arrived at the classical stochastic estimate of the gradient. This approach does not suffer from the first issue mentioned above as the Jacobian is not needed at all in order to compute ∇fi(x)\nabla f_{i}(x). Likewise, it does not suffer from the second issue; namely, the cost of computing the stochastic gradient is merely O(d){\cal O}(d), and we can avoid a costly pass through the data.For the purposes of this narrative it suffices to assume that stochastic gradients can be sampled at cost O(d){\cal O}(d).

This equation generalizes both (5) and (6). The left hand side contains the sketched system matrix Sk\mathbf{S}_{k} and the unknown matrix J{\bf J}, and the right hand side contains a quantity we can measure (through a random linear measurement of the Jacobian, which we assume is cheap). Of course, the true Jacobian solves (8). However, in general, and in particular when τ≪n\tau\ll n which is the regime we want to be in for practical reasons, the system (8) will have infinite J{\bf J} solutions.

In doing so, we have built a learning mechanism whose goal is to maintain good estimates of the Jacobian throughout the run of method (2). These estimates can be used to efficiently estimate the gradient by performing a linear transformation similar to (5), but with ∇F(x){\bf\nabla F}(x) replaced by the latest estimate of the Jacobian. In practice, it is important to design sketching matrices so that the Jacobian sketch ∇F(x)Sk{\bf\nabla F}(x)\mathbf{S}_{k} can be calculated efficiently.

The “sketch-and-project” strategy (1.3) for updating our Jacobian estimate is analogous to the way quasi-Newton methods update the estimate of the Hessian (or inverse Hessian) . From this perspective, our method can be viewed as a stochastic quasi-gradient method.The term “quasi-gradient methods” was popular in the 1980s , and refers to algorithms for solving certain stochastic optimization problems which rely on stochastic estimates of function values and their derivatives. In this paper we give the term a different meaning by drawing a direct link with quasi-Newton methods.

Problem (1.3) admits the explicit closed-form solution (see Lemma B.1):

is a projection matrix, and †\dagger denotes the Moore-Penrose pseudoinverse.

The key insight of our work is to propose an efficient Jacobian learning mechanism based on ideas borrowed from recent results in randomized numerical linear algebra.

Having established our update of the Jacobian estimate, we now need to use this to form an estimate of the gradient. Unfortunately, using Jk+1{\bf J}^{k+1} in place of ∇F(xk){\bf\nabla F}(x^{k}) in (5) leads to a biased gradient estimate (something we explore later in Section 2.5). To obtain an unbiased estimator of the gradient, we introduce a stochastic relaxation parameter θSk\theta_{\mathbf{S}_{k}} and use

This strategy indeed works, as we show in detail in this paper. Under appropriate conditions (on the stepsize α\alpha, properties of ff and randomness behind the sketch matrices Sk\mathbf{S}_{k} and so on), the variance of gkg^{k} diminishes to zero (e.g., see Lemma 3.10), which means that JacSketch is a variance-reduced method. We perform an analysis for smooth and strongly convex functions ff, and obtain a linear convergence result (Theorem 3.6). We summarize our complexity results in detail in Section 1.7.

4 SAGA as a special case of JacSketch

Of particular importance in this paper are minibatch sketches, which are sketches of the form Sk=ISk\mathbf{S}_{k}={\bf I}_{S_{k}}, where SkS_{k} is a random subset of [n][n], and ISk{\bf I}_{S_{k}} is a random column submatrix of the n×nn\times n identity matrix with columns indexed by SkS_{k}. For minibatch sketches, JacSketch corresponds to minibatch variants of SAGA. Indeed, in this case, and if W=Diag(w1,…,wn){\bf W}={\rm Diag}(w_{1},\dots,w_{n}), we have ΠSke=eSk{\bf\Pi}_{\mathbf{S}_{k}}e=e_{S_{k}}, where eS=∑i∈Seie_{S}=\sum_{i\in S}e_{i} (see Lemma 4.7). Therefore,

In view of (11), and since ΠSk=ISkISk⊤{\bf\Pi}_{\mathbf{S}_{k}}={\bf I}_{S_{k}}{\bf I}_{S_{k}}^{\top} (see Lemma 4.7), the Jacobian estimate gets updated as follows

Standard uniform SAGA is obtained by setting Sk={i}S_{k}=\{i\} with probability 1/n1/n for each i∈[n]i\in[n], and letting θSk≡n\theta_{\mathbf{S}_{k}}\equiv n. SAGA with arbitrary probabilities is obtained by instead choosing Sk={i}S_{k}=\{i\} with probability pi>0p_{i}>0 for each i∈[n]i\in[n], and letting θSk≡1pi\theta_{\mathbf{S}_{k}}\equiv\tfrac{1}{p_{i}}. However, virtually all minibatching and importance sampling strategies can be treated as special cases of our general approach.

The theory we develop answers the open questions raised earlier. In particular, we answer the conjecture of Schmidt et al. about the rate of SAGA with importance sampling in the affirmative. In particular, we establish the iteration complexity (n+4Lˉμ)log⁡1ϵ.(n+\frac{4\bar{L}}{\mu})\log\tfrac{1}{\epsilon}. This complexity is obtained for different importance sampling distributions than that currently proposed in the literature for SAGA. In order to achieve this, we develop a new analysis technique which makes use of a stochastic Lyapunov function (see Section 5). That is, our Lyapunov function has a random element which is independent of the randomness inherited from the iterates of the method. This is unlike any other Lyapunov function used in the analysis of stochastic methods we are aware of. Further, we prove that SAGA converges with any initial matrix J0{\bf J}^{0} in place of the matrix of gradients of functions fif_{i} at the starting point. We also show that our results give better rates for minibatch SAGA than are currently known, even for uniform minibatch strategies. We also allow for a family of completely new uniform minibatching strategies which were not considered in connection with SAGA before, and consider also SAGA with importance sampling for minibatchesFor some prior results on importance sampling for minibatches, in the context of QUARTZ, see . (based on a partition of [n][n]). Lastly, as a special case, our method recovers standard gradient descent, together with the sharp iteration complexity of 4Lμlog⁡1ϵ\frac{4L}{\mu}\log\tfrac{1}{\epsilon}.

Our general approach also enables a novel reduced memory variant of SAGA as a special case. Let Sk=eSk\mathbf{S}_{k}=e_{S_{k}}, and choose W=I.{\bf W}={\bf I}. Since ΠSke=eSk{\bf\Pi}_{\mathbf{S}_{k}}e=e_{S_{k}}, the formula for gkg^{k} is the same as in the case of SAGA, and is given by (16). What is notably different about this sketch (compared to ISk{\bf I}_{S_{k}}) is that, since ΠISk=1∣Sk∣eSkeSk⊤,{\bf\Pi}_{{\bf I}_{S_{k}}}=\frac{1}{|S_{k}|}e_{S_{k}}e_{S_{k}}^{\top}, the update of the Jacobian estimate (39) is given by

Thus, the same update is applied to all the columns of Jk{\bf J}^{k} that belong to SkS_{k}. Equivalently, this update can be written as

In particular, if SkS_{k} only ever picks sets which correspond to a partition of [n][n], and we initialize J0{\bf J}^{0} so that all the columns belonging to the same partition are the same, then they will be the same within in each partition for all kk. In such a case, we do not need to maintain all the identical copies. Instead, we can update and use a condensed/compressed version of the Jacobian, with one column per partition set only, to reduce the total memory usage. This method, with non-uniform probabilities, is analyzed in our framework in Section 5.6.

5 Sketch and project

It has long been known, and was explored in detail by Needell, Srebro and Ward , that the randomized Kaczmarz method is a specific instantiation of SGD, applied to a suitable least-squares type function. In the context of sketch and project methods with arbitrary sketching matrices Sk\mathbf{S}_{k}, this was explored by Richtárik and Takáč , who also demonstrated that the sketch and project method, and hence also our Jacobian learning iteration (1.3), can be interpreted as stochastic gradient descent applied to a suitable stochastic optimization problem. Therefore, and quite surprisingly:

In our Jacobian sketching framework, variance reduction is obtained by applying SGD to the problem of learning the Jacobian. So, our method uses SGD in two different ways: as a method for performing the step toward minimizing the loss (this is standard), and as a method for learning the Jacobian which is then used to lower the variance of the search direction (this is our new insight).

As a follow up to , Gower and Richtárik further extended their analysis in to arbitrary consistent linear systems (i.e., beyond systems with a single solution, such as (7)). Therein they show that the sketch and project method converges linearly to the projection of the starting iterate onto the solution space of the system, and also uncover a dual interpretation of the method as stochastic dual subspace ascent. Related ideas were later used to design stochastic algorithms for inverting matrices and computing the pseudoinverse of a rectangular matrix . For a compendium of some of the above papers on sketch and project, see also .

An accelerated (in the sense of Nesterov) sketch and project method was proposed and analyzed in . However, the analysis was restricted to a weak type of convergence. This was remedied by Tu et al. for positive definite systems and a special class of sketchings, by Richtárik and Takáč for general linear systems and general sketchings, and further extended to Euclidean setting and applied to matrix inversion and quasi-Newton updates by Gower et al. . A sketch and project method with the heavy ball momentum was studied in .

6 Controlled stochastic reformulation

Loosely motivated by , we shall explore an alternative narrative to the sketch-and-project motivation described above. In particular, the development of JacSketch can instead be motivated through the lens of controlled stochastic reformulations of (1).

Let us now very briefly outline the main idea. First, we will use the distribution D{\cal D} from which the sketching matrices are drawn to define a stochastic optimization reformulation of problem (1). That is, we write ff as an expectation over some carefully constructed functions fS(x)f_{\mathbf{S}}(x) instead, where the expectation is taken over S∼D\mathbf{S}\sim{\cal D}. We then add a “smart” zero function, also of the form of an expectation of some functions over D{\cal D}, to this reformulation. However, this zero perturbation depends on Jk{\bf J}^{k}. While this does not change the objective function, it affects the stochastic gradients in a positive way: it reduces their variance. We then apply an SGD step to this perturbed (or “controlled”) reformulation, followed by an update of the Jacobian (through sketch and project). This is iterated until convergence, and results in JacSketch. This alternative narrative is provided in Section 2.

7 Summary of complexity results

All convergence results obtained in this paper are summarized in Table 1.

Theorem 3.6 is our most general result, allowing for any(unbiased) sketch S\mathbf{S} (see (15)), and any weight matrix W≻0{\bf W}\succ 0. The resulting iteration complexity given by this theorem is

and is also presented in the first row of Table 1. This result depends on two expected smoothness constants L1{\cal L}_{1} (measuring the expected smoothness of the stochastic gradient of our stochastic reformulation; see Assumption 3.1) and L2{\cal L}_{2} (measuring the expected smoothness of the Jacobian; see Assumption 3.2). The complexity also depends on the stochastic condition number κ\kappa (see (48)) and the sketch residual ρ\rho (see (37) and (55)). We devote considerable effort to give simple formulas for these constants under some specialized settings (for special combinations of sketches S\mathbf{S} and weight matrices W{\bf W}). In fact, the entire Section 4 is devoted to this. In particular, all rows of Table 1 where the last column mentions Theorem 3.6 arise as special cases of the general iteration complexity in the first row.

Gradient descent. As a starting point, in row 3 we highlight that one can recover gradient descent as a special case of JacSketch with the choice S=I\mathbf{S}={\bf I} (with probability 1) and W=I{\bf W}={\bf I}. We get the rate 4Lμlog⁡1ϵ\tfrac{4L}{\mu}\log\tfrac{1}{\epsilon}, which is tight.

SAGA with uniform sampling. Let us now focus on a slightly more interesting special case: row 5. We see that SAGA with uniform probabilities appears as a special case, and enjoys the rate (n+4Lmax⁡μ)log⁡1ϵ(n+\tfrac{4L_{\max}}{\mu})\log\tfrac{1}{\epsilon}, recovering an existing result.

SAGA with importance sampling. Unfortunately, the generality of Theorem 3.6 comes at a cost: we are not able to obtain an importance sampling version of SAGA as a special case which would have a better iteration complexity than uniform SAGA. This will be remedied by our second complexity theorem, which we shall discuss later below.

Minibatch SAGA. Rows 9-13 correspond to minibatch versions of SAGA. In particular, row 9 contains a general statement (albeit still a special case of the statement in row 1), covering virtually all minibatch strategies. Rows 10-13 specialize this result to two particular minibatch sketches (i.e., S=IS\mathbf{S}={\bf I}_{S}), each with two choices of W{\bf W}. The first sketch corresponds to samplings SS which choose from among all subsets of [n][n] uniformly at random. This sampling is known in the literature as τ\tau-nice sampling . The second sketch corresponds to SS being a τ\tau–partition sampling. This sampling picks uniformly at random subsets of [n][n] which form a partition of [n][n], and are all of cardinality τ\tau. Notice that the complexities in rows 10 and 11 are comparable (each can be slightly better than the other, depending on the values of the smoothness constants {Li}\{L_{i}\}). On the other hand, in the case of τ\tau–partition, the choice W=Diag(Li){\bf W}={\rm Diag}(L_{i}) is better than W=I{\bf W}={\bf I}: the complexity in row 13 is better than that in row 12. This is because max⁡C∈supp(S)1τ∑i∈CLi≤Lmax⁡.\max_{C\in{\rm supp}(S)}\frac{1}{\tau}\sum_{i\in C}L_{i}\leq L_{\max}.

Optimal minibatch size for SAGA. Our analysis for mini-batch SAGA also gives the first iteration complexities that interpolate between the (n+4Lmax⁡μ)log⁡1ϵ(n+\frac{4L_{\max}}{\mu})\log\tfrac{1}{\epsilon} complexity of SAGA and the 4Lμlog⁡1ϵ\frac{4L}{\mu}\log\tfrac{1}{\epsilon} complexity of gradient descent, as τ\tau increases from 11 to nn. Indeed, consider the complexity in rows 10, 11 and 13 for τ=1\tau=1 and τ=n.\tau=n. Our iteration complexity of mini-batch SAGA is the first result that is precise enough to inform an optimal mini-batch size (see Section 6.2). In contrast, the previous best complexity result for mini-batch SAGA interpolates between (n+4Lmax⁡μ)log⁡1ϵ(n+\frac{4L_{\max}}{\mu})\log\tfrac{1}{\epsilon} and 4Lmax⁡μlog⁡1ϵ\frac{4L_{\max}}{\mu}\log\tfrac{1}{\epsilon} as τ\tau increases from 11 to nn, and thus is not precise enough as to inform the best minibatch size. We make a more detailed comparison between our results and in Section 4.7.

Specialized theorem.

We now move to the second main complexity result of our paper: Theorem 5.2. The general complexity statement is listed in row 2 of Table 1:

Gradient descent. As a starting point, we point out that just like Theorem 3.6, Theorem 5.2 also recovers the correct complexity of gradient descent as a special case (this is when S=[n]S=[n] with probability 1); this can be seen in row 4. Indeed, in this case we have S=[n]S=[n] with probability 1 (hence, p[n]=1p_{[n]}=1), supp(S)={[n]}{\rm supp}(S)=\{[n]\}, τ=n\tau=n and L[n]=LL_{[n]}=L. Hence, (19) specializes to 4Lμlog⁡1ϵ\frac{4L}{\mu}\log\frac{1}{\epsilon}.

SAGA with importance sampling. The first remarkable special case of (19) is summarized in row 8, and corresponds to SAGA with importance sampling. The complexity obtained, (n+4Lˉμ)log⁡1ϵ(n+\tfrac{4\bar{L}}{\mu})\log\tfrac{1}{\epsilon}, answers a conjecture of Schmidt et al. in the affirmative. In this case, the support of SS are the singletons {1}\{1\}, {2},…,{n}\{2\},\dots,\{n\}, p{i}=pip_{\{i\}}=p_{i} for all ii, τ=1\tau=1 and L{i}=LiL_{\{i\}}=L_{i}. Optimizing the complexity bound over the probabilities p1,…,pnp_{1},\dots,p_{n}, we obtain the importance sampling pi=μn+4τLi∑jμn+4τLj.p_{i}=\frac{\mu n+4\tau L_{i}}{\sum_{j}\mu n+4\tau L_{j}}.

Minibatch SAGA with importance sampling. In row 14 we state the complexity for a minibatch SAGA method with importance sampling. This is the first result for this method in the literature. Note that by comparing rows 13 and 14, we can conclude that the complexity of minibatch SAGA with importance sampling is better than for minibatch SAGA with uniform probabilities. Indeed, this is becauseWe prove inequality (20) in the appendix; see Lemma A.1.

8 Outline of the paper

We present an alternative narrative motivating the development of JacSketch in Section 2. This narrative is based on a novel technical tool which we call controlled stochastic optimization reformulations of problem (1). We then develop a general convergence theory of JacSketch in Section 3. This theory admits practically any sketches S\mathbf{S} (including minibatch sketches mentioned in the introduction) and weight matrices W{\bf W}. The main result in this section is Theorem 3.6. In Section 4 we specialize the general results to minibatch sketches. Here we also compute the various constants appearing in the general complexity result for JacSketch for specific classes of minibatch samplings. In Section 5 we develop an alternative theory for JacSketch, one based on a novel stochastic Lyapunov function. The main result in this section is Theorem 5.2. Computational experiments are included in Section 6.

9 Notation

We will introduce notation when and as needed. If the reader would like to recall any notation, for ease of reference we have a notation glossary in Section D. As a general rule, all matrices are written in upper-case bold letters. By log⁡t\log t we refer to the natural logarithm of tt.

Controlled Stochastic Reformulations

In this section we provide an alternative narrative behind the development of JacSketch; one through the lens of what we call controlled stochastic reformulations. These reformulations are a novel technical tool enabling us to view JacSketch from a novel perspective.

It will be useful to formalize the condition mentioned in Section 1.3 which leads to gkg^{k} being an unbiased estimator of the gradient.

Let W≻0{\bf W}\succ 0 be a weighting matrix and let D{\bf D} be the distribution from which the sketch matrices S\mathbf{S} are drawn. There exists a random variable θS\theta_{\mathbf{S}} such that

When this assumption is satisfied, we say that (S,θS,W)(\mathbf{S},\theta_{\mathbf{S}},{\bf W}) constitutes an “unbiased sketch”, and we call θS\theta_{\mathbf{S}} the bias-correcting random variable. When the triple is obvious from the context, sometimes we shall simply say that S\mathbf{S} is an unbiased sketch.

The first key insight of this section is that besides producing unbiased estimators of the gradient, unbiased sketches produce unbiased estimators of the loss function as well. Indeed, by simply observing that f(x)=1n<F(x),e>f(x)=\frac{1}{n}\left<F(x),e\right>, we get

In other words, we can rewrite the finite-sum optimization problem (1) as an equivalent stochastic optimization problem where the randomness comes from D{\cal D} rather than from the representation-specific uniform distribution over the nn loss functions:

The stochastic optimization problem (22) is a stochastic reformulation of the original problem (1). Further, the stochastic gradient of this reformulation is given by

With these simple observations, our options at designing stochastic gradient-type algorithms for (1) have suddenly broadened dramatically. Indeed, we can now solve the problem, at least in principle, by applying SGD to any stochastic reformulation:

But now we have a parameter to play with, namely, the distribution of S\mathbf{S}. The choice of this parameter will influence both the iteration complexity of the resulting method as well as the cost of each iteration. We now give a few examples of possible choices of D{\cal D} to illustrate this.

Let S\mathbf{S} be equal to I{\bf I} (or any other n×nn\times n invertible matrix) with probability 1 and let W≻0{\bf W}\succ 0 be chosen arbitrarily. Then θS≡1\theta_{\mathbf{S}}\equiv 1 is bias-correcting since

With this setup, the SGD method (24) becomes gradient descent:

Let Sk={ik}S_{k}=\{i_{k}\} be picked at iteration kk. Then the SGD method (24) becomes SGD with non-uniform sampling:

Note that with this setup, and when pi=1/np_{i}=1/n for all ii, the stochastic reformulation is identical to the original finite-sum problem. This is the case because fei(x)=fi(x)f_{e_{i}}(x)=f_{i}(x).

Let S=eS=∑i∈Sei\mathbf{S}=e_{S}=\sum_{i\in S}e_{i}, where S=C⊆[n]S=C\subseteq[n] with probability pCp_{C}. Let W=I{\bf W}={\bf I}. Assume that the cardinality of the set {C⊆[n]  :  C∈supp(S),  i∈C}\{C\subseteq[n]\;:\;C\in{\rm supp}(S),\;i\in C\} does not depend on ii (and is equal to c1>0c_{1}>0). Then θeS=1/(c1pS)\theta_{e_{S}}=1/(c_{1}p_{S}) is bias-correcting since

Note that ΠeSe=eS{\bf\Pi}_{e_{S}}e=e_{S}. Assume that set SkS_{k} is picked in iteration kk.Then the SGD method (24) becomes minibatch SGD with non-uniform sampling:

Finally, note that gradient descent (25) is a special case of (27) if we set p[n]=1p_{[n]}=1 and pC=0p_{C}=0 for all other subsets CC of [n][n]. Likewise, SGD with non-uniform probabilities (26) is a special case of (27) if we set p{i}=pi>0p_{\{i\}}=p_{i}>0 for all ii and pC=0p_{C}=0 for all other subsets CC of [n][n].

2 The controlled stochastic reformulation

Though SGD applied to the stochastic reformulation can generate several known algorithms in special cases, there is no reason to believe that the gradient estimates gkg^{k} will have diminishing variance (excluding the extreme case such as gradient descent). Here we handle this issue using control variates, a commonly used tool to reduce variance in Monte Carlo methods .

Given a random function zS(x)z_{\mathbf{S}}(x), we introduce the controlled stochastic reformulation:

is an unbiased estimator of the gradient ∇f(x)\nabla f(x), we can apply SGD to the controlled stochastic reformulation instead, which leads to the method

Reformulation (22) and method (24) is recovered as a special case with the choice zS(x)≡0z_{\mathbf{S}}(x)\equiv 0. However, we now have the extra freedom to choose zS(x)z_{\mathbf{S}}(x) so as to control the variance of this stochastic gradient. In particular, if ∇zS(x)\nabla z_{\mathbf{S}}(x) and ∇fS(x)\nabla f_{\mathbf{S}}(x) are sufficiently correlated, then (29) will have a smaller variance than ∇fS(x).\nabla f_{\mathbf{S}}(x). For this reason, we choose a linear model for zS(x)z_{\mathbf{S}}(x) that mimicks the stochastic function fS(x).f_{\mathbf{S}}(x).

We collect this observation that (32) is unbiased in the following lemma for future reference.

If S\mathbf{S} is an unbiased sketch (see Definition 2.1), then

Now it remains to choose the matrix J{\bf J}, which we do by minimizing the variance of our gradient estimate.

3 The Jacobian estimate, variance reduction and the sketch residual

and we have used the weighted Frobenius norm with weight matrix B{\bf B} (see (10)).

For most distributions D{\cal D} of interest, the matrix B{\bf B} is positive definiteExcluding such trivial cases as when S\mathbf{S} is an invertible matrix and θS=1\theta_{\mathbf{S}}=1 with probability one, in which case B=0{\bf B}=0. Letting vS=def(I−θSΠS)ev_{\mathbf{S}}\overset{\text{def}}{=}({\bf I}-\theta_{\mathbf{S}}{\bf\Pi}_{\mathbf{S}})e, we can bound the largest eigenvalue of matrix B{\bf B} via Jensen’s inequality as follows:

Combined with (34), we get the the following bound on the variance of ∇fS,J\nabla f_{\mathbf{S},{\bf J}}:

Let us now return to the identity (34) and its role in choosing J{\bf J}. Minimizing the variance in a single step is overly ambitious, since it requires setting J=∇F(x){\bf J}={\bf\nabla F}(x), which is costly. So instead, we propose to minimize (34) iteratively. But first, to make (34) more manageable, we upper-bound it using a norm defined by the weight matrix W{\bf W} as follows

is the largest eigenvalue of W1/2BW1/2{\bf W}^{1/2}{\bf B}{\bf W}^{1/2}. We refer to the constant ρ\rho as the sketch residual, and it is a key constant affecting the convergence rate of JacSketch as captured by Theorem 3.6. The sketch residual ρ\rho represents how much information is “lost” on average due to sketching and due to how well W−1{\bf W}^{-1} approximates B{\bf B}. We develop formulae and estimates of the sketch residual for several specific sketches of interest in Section 4.5.

Consider the setup from Example 2.2 (gradient descent). That is, let S\mathbf{S} be invertible with probability one and let θS=1\theta_{\mathbf{S}}=1 be the bias-reducing variable. Then ΠSe=e{\bf\Pi}_{\mathbf{S}}e=e and hence B=0{\bf B}=0, which means that ρ=0\rho=0.

We have switched from the B{\bf B} norm to a user-controlled W−1{\bf W}^{-1} norm because minimizing under the B{\bf B} norm will prove to be impractical because B{\bf B} is a dense matrix for most all practical sketches. With this norm change we now have the option to set W{\bf W} as a sparse matrix (e.g., the identity, or a diagonal matrix), as we explain in Remark 2.8 further down. However, the theory we develop allows for any symmetric positive definite matrix W{\bf W}.

We can now minimize (36) iteratively by only using a single sketch of the true Jacobian at each iteration. Suppose we have a current estimate Jk{\bf J}^{k} of the true Jacobian and a sketch of the true Jacobian ∇F(xk)Sk{\bf\nabla F}(x^{k})\mathbf{S}_{k}. With this we can calculate an improved Jacobian estimate using a projection step

the solution of which, as it turns out, depends on ∇F(xk){\bf\nabla F}(x^{k}) through its sketch ∇F(xk)Sk{\bf\nabla F}(x^{k})\mathbf{S}_{k} only. That is, we choose the next Jacobian estimate Jk+1{\bf J}^{k+1} as close as possible to the true Jacobian ∇F(xk){\bf\nabla F}(x^{k}) while restricted to a matrix subspace that passes through Jk{\bf J}^{k}. Thus in light of (36), the variance is decreasing. The explicit solution to (38) is given by

See Lemma B.1 in the appendix for the proof. Note that, as alluded to before, Jk+1{\bf J}^{k+1} depends on ∇F(xk){\bf\nabla F}(x^{k}) through its sketch only. Note that (39) updates the Jacobian estimate by re-using the sketch ∇F(xk)Sk{\bf\nabla F}(x^{k})\mathbf{S}_{k} which we also use when calculating the stochastic gradient (32).

Note that (39) gives the same formula for Jk+1{\bf J}^{k+1} as (11) which we obtained by solving (1.3); i.e., by projecting Jk{\bf J}^{k} onto the solution set of (8). This is not a coincidence. In fact, the optimization problems (1.3) and (38) are mutually dual. This is formally stated in Lemma B.1 which can be found in the appendix. In the context of solving linear systems, this was observed in . Therein, (1.3) is called the sketch-and-project method, whereas (38) is called the constrain-and-approximate problem. In this sense, the Jacobian sketching narrative we followed in Section 1.3 is dual to the Jacobian sketching narrative we are pursuing here.

Loosely speaking, the denser the weighting matrix W{\bf W}, the higher the computational cost for updating the Jacobian using (39). Indeed, the sparsity pattern of W{\bf W} controls how many elements of the previous Jacobian estimate Jk{\bf J}^{k} need to be updated. This can be seen by re-arranging (39) as

4 JacSketch Algorithm

Combining formula (32) for the stochastic gradient of the controlled stochastic reformulation with formula (39) for the update of the Jacobian estimate, we arrive at our JacSketch algorithm (Algorithm 1).

From the point of view of the controlled stochastic reformulation, JacSketch can also be written in the form of Algorithm 2.

5 A window into biased estimates and SAG

We will now take a small detour from the main flow of the paper to develop an alternative viewpoint of Algorithm 1 and also make a bridge to biased methods such as SAG .

suggests that g^k=1nJk+1e\hat{g}^{k}=\frac{1}{n}{\bf J}^{k+1}e, where Jk+1≈∇F(xk){\bf J}^{k+1}\approx{\bf\nabla F}(x^{k}) would give a good estimate of the gradient. To decrease the variance of g^k\hat{g}^{k}, we can also use the same update of the Jacobian estimate (39) since

The issue with using 1nJk+1e\frac{1}{n}{\bf J}^{k+1}e as an estimator of the gradient is that it decreases the variance too aggressively, neglecting the bias. However, this can be fixed by trading off variance for bias. One way to do this is to introduce the random variable θS\theta_{\mathbf{S}} as a stochastic relaxation parameter

If θS\theta_{\mathbf{S}} is bias correcting, we recover the unbiased SAGA estimator (13). By allowing θS\theta_{\mathbf{S}} to be closer to one, however, we will get more bias and lower variance. We leave this strategy of building biased estimators for future work. It is conceivable that SAG could be analyzed using reasonably small modifications of the tools developed in this paper. Doing this would be important due to at least four reasons: i) SAG was the first variance-reduced method for problem (1), ii) the existing analysis of SAG is not satisfying, iii) one may be able to obtain a better rate, iv) one may be able to develop and analyze novel variants of SAG.

Convergence Analysis for General Sketches

In this section we establish a convergence theorem (Theorem 3.6) which applies to general sketching matrices S\mathbf{S} (that is, arbitrary distributions D{\cal D} from which they are sampled). By design, we keep the setting in this section general, and only deal with specific instantiations and special cases in Section 4.

We first formulate two expected smoothness assumptions tying together ff, its Jacobian ∇F(x){\bf\nabla F}(x) and the distribution D{\cal D} from which we pick sketch matrices S\mathbf{S}. These assumptions, and the associated expected smoothness constants, play a key role in the convergence result.

Our first assumption concerns the expected smoothness of the stochastic gradients ∇fS\nabla f_{\mathbf{S}} of the stochastic reformulation (22).A similar relation to (43) holds for the stochastic optimization reformulation of linear systems studied by Richtárik and Takáč . Therein, this relation holds as an identity with L1=1{\cal L}_{1}=1 (see Lemma 3.3 in ). However, the function fSf_{\mathbf{S}} considered there is entirely different and, moreover, f(x∗)=0f(x^{*})=0 and ∇fS(x∗)=0\nabla f_{\mathbf{S}}(x^{*})=0 for all S\mathbf{S}.

There is a constant L1>0{\cal L}_{1}>0 such that

It is easy to see from (23) and (32) that

Our second expected smoothness assumption concerns the Jacobian of FF.

There is a constant L2>0{\cal L}_{2}>0 such that

where the norm is the weighted Frobenius norm defined in (10).

Therefore, (45) can be equivalently written in the form

which suggests that the above condition indeed measures the variation/smoothness of the Jacobian under a specific weighted Frobenius norm. To the best of our knowledge, the above expected smoothness conditions are new, and have not been considered in the literature before.

2 Stochastic condition number

By the stochastic condition number associated with W{\bf W} and D{\cal D} we mean the constant defined by

In the next lemma we show that 0≤κ≤10\leq\kappa\leq 1 for all distributions D{\cal D} for which the expectation (48) exists.

For all distributions D,\mathcal{D}, we have the bounds 0≤κ≤1.0\leq\kappa\leq 1.

In our convergence theorem we will assume that κ>0\kappa>0. This can be achieved by choosing a suitable distribution D{\cal D} and it holds trivially for all the examples we develop. The condition κ>0\kappa>0 essentially says that the distribution is sufficiently rich. This condition number was first proposed in in the context of randomized algorithms for solving linear systems. We refer the reader to that work for details on sufficient assumptions about D{\cal D} guaranteeing κ>0\kappa>0. Below we give an example.

Let W≻0{\bf W}\succ 0, and let D{\cal D} be given by setting S=ei\mathbf{S}=e_{i} with probability pi>0p_{i}>0. Then

3 Convergence theorem

Our main convergence result, which we shall present shortly, holds for μ\mu-strongly convex functions. However, it turns out we can establish the result for a somewhat larger family of functions. This family is described next.

We are now ready to present the main result of this section.

Let W≻0{\bf W}\succ 0. Let ff satisfy Assumption 3.5. Let Assumption 2.1 be satisfied (i.e, S\mathbf{S} is an unbiased sketch and θS\theta_{\mathbf{S}} is the associated bias-correcting random variable). Let the expected smoothness assumptions be satisfied: Assumption 3.1 and Assumption 3.2. Assume that κ>0\kappa>0. Let the sketch residual be defined as in (37), i.e,

If we choose α\alpha to be equal to the upper bound in (53), then

Recall that the iteration complexity expression from (55) is listed in row 1 of Table 1.

The Lyapunov function we use is simply the sum of the squared distance between xkx^{k} to the optimal x∗x^{*} and the distance of our Jacobian estimate Jk{\bf J}^{k} to the optimal Jacobian ∇F(x∗).{\bf\nabla F}(x^{*}). Hence, the theorem says that both the iterates {xk}\{x^{k}\} and the Jacobian estimates {Jk}\{{\bf J}^{k}\} converge.

4 Projection lemmas and the stochastic condition number κ𝜅\kappa

In this section we collect some basic results on projections. Recall from (12) that ΠS=S(S⊤WS)†S⊤W{\bf\Pi}_{\mathbf{S}}=\mathbf{S}(\mathbf{S}^{\top}{\bf W}\mathbf{S})^{\dagger}\mathbf{S}^{\top}{\bf W} and from (46) that HS=S(S⊤WS)†S⊤{\bf H}_{\mathbf{S}}=\mathbf{S}(\mathbf{S}^{\top}{\bf W}\mathbf{S})^{\dagger}\mathbf{S}^{\top}.

Proof: Using the pseudoinverse property A†AA†=A†{\bf A}^{\dagger}{\bf A}{\bf A}^{\dagger}={\bf A}^{\dagger} we have that

and as a consequence (56) holds. Moreover,

Finally, taking expectation over (58) and (59) gives (57). ∎

By taking expectations in D{\cal D}, we get

where in the last step we used the estimate

5 Key lemmas

We first establish two lemmas. The first lemma provides an upper bound on the quality of new Jacobian estimate in terms of the quality of the current estimate and function suboptimality. If the second term on the right hand side was not there, the lemma would be postulating a contraction on the quality of the Jacobian estimate.

Let Assumption 3.2 be satisfied. Then iterates of Algorithm 1 satisfy

Proof: Subtracting ∇F(x∗){\bf\nabla F}(x^{*}) from both sides of (39) gives

Taking norms on both sides, then expectation with respect to Sk\mathbf{S}_{k} and then using Lemma 3.8, we get

We now bound the second moment of gkg^{k}. The lemma implies that as xkx^{k} approaches x∗x^{*} and Jk{\bf J}^{k} approaches ∇F(x∗){\bf\nabla F}(x^{*}), the variance of gkg^{k} approaches zero. This is a key property of JacSketch which elevates it into the ranks of variance-reduced methods.

Let S\mathbf{S} be an unbiased sketch. Let Assumption 3.1 be satisfied (i.e., assume that inequality (43) holds for some L1>0{\cal L}_{1}>0). Then the second moment of the estimated gradient is bounded by

Proof: Adding and subtracting θSkn∇F(x∗)ΠSke\tfrac{\theta_{\mathbf{S}_{k}}}{n}{\bf\nabla F}(x^{*}){\bf\Pi}_{\mathbf{S}_{k}}e in (13) gives

Taking norms on both sides and using the bound ∥a+b∥22≤2∥a∥22+2∥b∥22\|a+b\|_{2}^{2}\leq 2\|a\|_{2}^{2}+2\|b\|_{2}^{2} gives

In view of Assumption 3.1 (combine (43) and (44)), we have

If we now let v=W1/2(θSkΠSk−I)ev={\bf W}^{1/2}(\theta_{\mathbf{S}_{k}}{\bf\Pi}_{\mathbf{S}_{k}}-{\bf I})e and M=(Jk−∇F(x∗))W−1/2{\bf M}=({\bf J}^{k}-{\bf\nabla F}(x^{*})){\bf W}^{-1/2}, then we can continue:

where in the last step we have used the assumption that θSk\theta_{\mathbf{S}_{k}} is bias-correcting:

It now only remains to substitute (66) and (67) into (65) to arrive at (64). ∎

6 Proof of Theorem 3.6

With the help of the above lemmas, we now proceed to the proof of the theorem. In view of the strong convexity assumption (50), we have

By using the relationship xk+1=xk−αgkx^{k+1}=x^{k}-\alpha g^{k}, the fact that gkg^{k} is an unbiased estimate of the gradient ∇f(xk)\nabla f(x^{k}), and using one-point strong convexity (69), we get

Next, applying Lemma 3.10 leads to the estimate

We now choose α\alpha so that I≤0\text{I}\leq 0 and II≤1−αμ\text{II}\leq 1-\alpha\mu, which can be written as

Minibatch Sketches

In this section we focus on special cases of Algorithm 1 where one computes ∇fi(xk)\nabla f_{i}(x^{k}) for i∈Ski\in S^{k}, where SkS^{k} is a random subset (mini-batch) of [n][n] chosen in each iteration according to some fixed probability law. As we have seen in the introduction, this is achieved by choosing Sk=ISk\mathbf{S}_{k}={\bf I}_{S_{k}}.

where ∑C⊆[n]pC=1\sum_{C\subseteq[n]}p_{C}=1 and pC≥0p_{C}\geq 0 for all CC.

We refer the reader to for a background reading on samplings and their properties.

The support of a sampling SS is the set of subsets of [n][n] which are chosen by SS with positive probability: supp(S)=def{C  :  pC>0}{\rm supp}(S)\overset{\text{def}}{=}\{C\;:\;p_{C}>0\}. We say that SS has uniform support if

for all i,j∈[n]i,j\in[n]. In such a case we say that the support is c1c_{1}–uniform.

To illustrate the above concepts, we now list a few examples with n=4n=4.

The sampling defined by setting p{1,2}=p{3,4}=0.5p_{\{1,2\}}=p_{\{3,4\}}=0.5 is non-vacuous, proper, 22–uniform (pi=0.5p_{i}=0.5 for all ii and ∣S∣=2|S|=2 with probability 1), and has 11–uniform support. If we change the probabilities to p{1,2}=0.4p_{\{1,2\}}=0.4 and p{3,4}=0.6p_{\{3,4\}}=0.6, the sampling is no longer uniform (since p1=0.4≠0.6=p3p_{1}=0.4\neq 0.6=p_{3}), but it still has 11–uniform support, is proper and non-vacuous. Hence, a sampling with uniform support need not be uniform. On the other hand, a uniform sampling need not have uniform support. As an example, consider sampling SS defined via p{1}=0.4p_{\{1\}}=0.4, p{2,3}=p{3,4}=p{2,4}=0.2p_{\{2,3\}}=p_{\{3,4\}}=p_{\{2,4\}}=0.2. It is uniform (since pi=0.4p_{i}=0.4 for all ii). However, while element 11 appears in a single set of its support, elements 2,32,3 and 44 each appear in two sets. So, this sampling does not have uniform support.

A uniform sampling need not be τ\tau–uniform for any τ\tau. For example, the sampling defined by setting p{1,2,3,4}=0.5p_{\{1,2,3,4\}}=0.5, p{1,2}=0.25p_{\{1,2\}}=0.25 and p{3,4}=0.25p_{\{3,4\}}=0.25 is uniform (since pi=0.75p_{i}=0.75 for all ii), but as it assigns positive probabilities to sets of at least two different cardinalities, it is not τ\tau–uniform for any τ\tau.

Further, the sampling defined by setting p{1,2}=1/6p_{\{1,2\}}=1/6, p{1,3}=1/6p_{\{1,3\}}=1/6, p{1,4}=1/6p_{\{1,4\}}=1/6, p{2,3}=1/6p_{\{2,3\}}=1/6, p{2,4}=1/6p_{\{2,4\}}=1/6, p{3,4}=1/6p_{\{3,4\}}=1/6 is non-vacuous, 22–uniform (pi=1/2p_{i}=1/2 for all ii and ∣S∣=2|S|=2 with probability 1), and has 33–uniform support. The sampling defined by setting p{1,2}=1/3p_{\{1,2\}}=1/3, p{2,3}=1/3p_{\{2,3\}}=1/3, p{3,1}=1/3p_{\{3,1\}}=1/3 is non-vacuous, proper, 22–uniform (pi=2/3p_{i}=2/3 for all ii and ∣S∣=2|S|=2 with probability 1) and has 22–uniform support.

Note that a sampling with uniform support is necessarily proper as long as c1>0c_{1}>0. However, it need not be non-vacuous. For instance, the sampling SS defined by setting p∅=1p_{\emptyset}=1 has –uniform support and is vacuous. From now on, we only consider samplings with the following properties.

SS is non-vacuous and has c1c_{1}–uniform support with c1≥1c_{1}\geq 1.

Note that if SS is a non-vacuous sampling with 11–uniform support, then its support is necessary a partition of [n][n]. We shall pay specific attention to such samplings in Section 5 as for them we can develop a stronger analysis than that provided by Theorem 3.6.

2 Minibatch sketches and projections

In the next result we describe some basic properties of the projection matrix ΠS=S(S⊤WS)†S⊤W{\bf\Pi}_{\mathbf{S}}=\mathbf{S}(\mathbf{S}^{\top}{\bf W}\mathbf{S})^{\dagger}\mathbf{S}^{\top}{\bf W} associated with a minibatch sketch S\mathbf{S}.

ΠS=ISIS⊤{\bf\Pi}_{\mathbf{S}}={\bf I}_{S}{\bf I}_{S}^{\top}. This is a diagonal matrix with the iith diagonal element equal to 1 if i∈Si\in S, and if i∉Si\notin S.

ΠSe=eS=def∑i∈Sei.{\bf\Pi}_{\mathbf{S}}e=e_{S}\overset{\text{def}}{=}\sum_{i\in S}e_{i}.

The stochastic condition number defined in (48) is given by κ=min⁡ipi\kappa=\min_{i}p_{i}

Let SS satisfy Assumption 4.6. Then the random variable

This follows by noting that IS⊤WIS{\bf I}_{S}^{\top}{\bf W}{\bf I}_{S} is the ∣S∣×∣S∣|S|\times|S| diagonal matrix with diagonal entries corresponding to wiw_{i} for i∈Si\in S, which in turn can be used to show that (IS⊤WIS)−1IS⊤W=IS⊤({\bf I}_{S}^{\top}{\bf W}{\bf I}_{S})^{-1}{\bf I}_{S}^{\top}{\bf W}={\bf I}_{S}^{\top}.

This follows from (i) by taking expectations of the diagonal elements of ΠS{\bf\Pi}_{\mathbf{S}}.

where the last equation follows from the assumption that the support of SS is c1c_{1}–uniform. ∎

The following simple observation will be useful in the computation of the constant L1{\cal L}_{1}. The proof is straightforward and involves a double counting argument.

Let SS be a sampling satisfying Assumption 4.6. Moreover, assume that SS is τ\tau–uniform. Then ∣supp(S)∣c1=nτ\frac{|{\rm supp}(S)|}{c_{1}}=\frac{n}{\tau}. Consequently, κ=p1=p2=⋯=pn=τn=c1∣supp(S)∣\kappa=p_{1}=p_{2}=\dots=p_{n}=\frac{\tau}{n}=\frac{c_{1}}{|{\rm supp}(S)|}, where κ\kappa is the stochastic condition number associated with the minibatch sketch S=IS\mathbf{S}={\bf I}_{S}.

3 JacSketch for minibatch sampling = minibatch SAGA

As we have mentioned in Section 1.4 already, JacSketch admits a particularly simple form for minibatch sketches, and corresponds to known and new variants of SAGA. Assume that SS satisfies Assumption 4.6 and let W=Diag(w1,…,wn){\bf W}={\rm Diag}(w_{1},\dots,w_{n}). In view of Lemma 4.7(vi), this means that the random variable θS=1c1pS\theta_{\mathbf{S}}=\frac{1}{c_{1}p_{S}} is bias-correcting, and due to Lemma 4.7(ii), we have ΠSke=eSk=∑i∈Skei{\bf\Pi}_{\mathbf{S}_{k}}e=e_{S_{k}}=\sum_{i\in S_{k}}e_{i}. Therefore,

By Lemma 4.7(i), ΠSk=ISkISk⊤{\bf\Pi}_{\mathbf{S}_{k}}={\bf I}_{S_{k}}{\bf I}_{S_{k}}^{\top}. In view of (11), the Jacobian estimate gets updated as follows

The resulting minibatch SAGA method is formalized as Algorithm 3.

Below we specialize the formula for gkg^{k} to a few interesting special cases.

Standard uniform SAGA is obtained by setting Sk={i}S_{k}=\{i\} with probability 1/n1/n for each i∈[n]i\in[n]. Since the support of this sampling is 11–uniform, we set c1=1c_{1}=1. This leads to the gradient estimate

However, we can use non-uniform probabilities instead. Let Sk={i}S_{k}=\{i\} with probability pi>0p_{i}>0 for each i∈[n]i\in[n]. Since the support of this sampling is 1–uniform, we have c1=1c_{1}=1. So, the gradient estimate has the form

Let C1,…,CqC_{1},\dots,C_{q} be nonempty subsets of forming a partition [n][n]. Let Sk=CjS_{k}=C_{j} with probability pCj>0p_{C_{j}}>0. The support of this sampling is 11–uniform, and hence we can choose c1=1c_{1}=1. This leads to the gradient estimate

Let SkS_{k} be chosen uniformly at random from all subsets of [n][n] of cardinality τ≥2\tau\geq 2. That is, Sk\mathbf{S}_{k} is the τ\tau-nice sampling, and the probabilities are equal to pSk=1/(nτ)p_{S_{k}}=1/{n\choose\tau}. This sampling has c1c_{1}–uniform support with c1=(n−1τ−1)=τn(nτ)c_{1}={n-1\choose\tau-1}=\frac{\tau}{n}{n\choose\tau}. Thus, nc1pSk=τnc_{1}p_{S_{k}}=\tau, and we have

Consider the same situation as in Example 4.12, but with τ=n\tau=n. That is, we choose Sk=[n]S_{k}=[n] with probability 11, and c1=1c_{1}=1. Then

Here we compute the expected smoothness constants L1{\cal L}_{1} and L2{\cal L}_{2} in the case of S\mathbf{S} being a minibatch sketch S=IS\mathbf{S}={\bf I}_{S}, and assuming that ff is convex and smooth. We first formalize the notion of smoothness we will use.

The above assumption is somewhat non-standard. Note that, however, if we instead assume that each fif_{i} is convex and LiL_{i}-smooth, then the above assumption holds for LC=1∣C∣∑i∈CLiL_{C}=\frac{1}{|C|}\sum_{i\in C}L_{i}. In some cases, however, we may have better estimates of the constants LCL_{C} than those provided by the averages of the LiL_{i} values. The value of these constants will have a direct influence on L1{\cal L}_{1} and L2{\cal L}_{2}, which is why we work with this more refined assumption instead.

where in the last step we used the fact that ∑i=1n∇fi(x∗)=n∇f(x∗)=0.\sum_{i=1}^{n}\nabla f_{i}(x^{*})=n\nabla f(x^{*})=0. ∎

where Li=L{i}L_{i}=L_{\{i\}}. If moreover, SS is τ\tau-uniform, thenNote that c1=∣{C∈supp(S)  :  1∈C}∣c_{1}=|\{C\in{\rm supp}(S)\;:\;1\in C\}|, and hence L1{\cal L}_{1} has the form of a maximum over averages.

where in this last inequality we have used convexity of fif_{i} for i∈[n]i\in[n]. Since

the formula for L1{\cal L}_{1} now follows by comparing (86) to (43). In order to establish the formula for L2{\cal L}_{2}, we estimate

The specialized formulas (85) for τ\tau–uniform sampling follow as special cases of the general formulas (84) by applying Lemma 4.8. ∎

In the next result we establish some inequalities relating the quantities LL, Lmax⁡L_{\max}, LCL_{C} and Lmax⁡G.L^{{\cal G}}_{\max}. In particular, the results says that for a certain family of samplings SS (the same for which we have defined the quantity Lmax⁡GL^{{\cal G}}_{\max} in (85)), the expected smoothed constant Lmax⁡GL^{{\cal G}}_{\max} is lower-bounded by the average of LCL_{C} over C∈G=supp(S)C\in{\cal G}={\rm supp}(S), and upper-bounded by Lmax⁡L_{\max}.

Let SS be a τ\tau–uniform sampling (τ≥1\tau\geq 1) with c1c_{1}–uniform support (c1≥1c_{1}\geq 1). Let G=supp(S){\cal G}={\rm supp}(S). Then

The last inequality holds without the need to assume τ\tau–uniformity.

Proof: Using the fact that SS has c1c_{1}–uniform support, and utilizing a double-counting argument, we observe that ∑C∈G∣C∣fC(x)=c1∑i=1nfi(x)\sum_{C\in{\cal G}}|C|f_{C}(x)=c_{1}\sum_{i=1}^{n}f_{i}(x). Multiplying both sides by 1nc1\frac{1}{nc_{1}}, and since ∣C∣=τ|C|=\tau for all C∈GC\in{\cal G}, we get τ∣G∣c1n1∣G∣∑C∈GfC(x)=1n∑i=1nfi(x)=f(x).\frac{\tau|{\cal G}|}{c_{1}n}\frac{1}{|{\cal G}|}\sum_{C\in{\cal G}}f_{C}(x)=\frac{1}{n}\sum_{i=1}^{n}f_{i}(x)=f(x). To obtain (88), it now only remains to use the identity

which was shown in Lemma 4.8. The first inequality in (89) follows from (88) using standard arguments (identical to those that lead to the inequality L≤LˉL\leq\bar{L}).

Let us now establish the second inequality in (89). Define LiG=def1c1∑C∈G  :  i∈CLCL^{{\cal G}}_{i}\overset{\text{def}}{=}\frac{1}{c_{1}}\sum_{C\in{\cal G}\;:\;i\in C}L_{C}. Again using a double-counting argument we observe that τ∑C∈GLC=c1∑i=1nLiG.\tau\sum_{C\in{\cal G}}L_{C}=c_{1}\sum_{i=1}^{n}L^{{\cal G}}_{i}. Multiplying both sides of this equality by ∣G∣c1n\frac{|{\cal G}|}{c_{1}n} and using identity (90), we get 1∣G∣∑C∈GLC=1n∑i=1nLiG≤max⁡iLiG=Lmax⁡G.\frac{1}{|{\cal G}|}\sum_{C\in{\cal G}}L_{C}=\frac{1}{n}\sum_{i=1}^{n}L^{{\cal G}}_{i}\leq\max_{i}L^{{\cal G}}_{i}=L^{{\cal G}}_{\max}. We will now establish the last inequality by proving that LiG≤Lmax⁡L^{{\cal G}}_{i}\leq L_{\max} for any ii:

Note that we did not need to assume τ\tau–uniformity to prove that Lmax⁡G≤Lmax⁡L^{{\cal G}}_{\max}\leq L_{\max}. ∎

5 Estimating the sketch residual ρ𝜌\rho

In this section we compute the sketch residual ρ\rho for several classes of samplings SS. Let G=supp(S){\cal G}={\rm supp}(S). We will assume throughout this section that SS is non-vacuous, has c1c_{1}–uniform support (with c1≥1c_{1}\geq 1), and is τ\tau–uniform.

Further, we assume that W=Diag(w1,…,wn){\bf W}={\rm Diag}(w_{1},\dots,w_{n}), and that the bias-correcting random variable θS\theta_{\mathbf{S}} is chosen as θS=1c1pS=∣G∣c1\theta_{\mathbf{S}}=\tfrac{1}{c_{1}p_{S}}=\tfrac{|{\cal G}|}{c_{1}} (see (75) and Lemma 4.8). In view of the above, since ΠICe=eC{\bf\Pi}_{{\bf I}_{C}}e=e_{C}, the sketch residual is given by

where the last equality follows by permuting the multiplication of matrices within the λmax⁡.\lambda_{\max}.

In the following text we calculate upper bounds for ρ\rho for τ\tau–partition and τ\tau–nice samplings. Note that Theorem 3.6 still holds if we use an upper bound of ρ\rho in place of ρ\rho.

If SS is the τ\tau–partition sampling, then

Proof: Using Lemma 4.8, and since c1=1c_{1}=1, we get ∣G∣c12=nτ\frac{|{\cal G}|}{c_{1}^{2}}=\frac{n}{\tau}. Consequently,

where wC=∑i∈Cwieiw_{C}=\sum_{i\in C}w_{i}e_{i} and we used that −W1/2ee⊤W1/2-{\bf W}^{1/2}ee^{\top}{\bf W}^{1/2} is negative semidefinite. When W=I{\bf W}={\bf I}, the above bound is tight. By Gershgorin’s theorem, every eigenvalue λ\lambda of the matrix is bounded by at least one of the inequalities λ≤∑i∈Cwi\lambda\leq\sum_{i\in C}w_{i} for C∈GC\in{\cal G}. Consequently, from (93) we have that ρ≤nτmax⁡C∈G∑i∈Cwi.\rho\leq\frac{n}{\tau}\max_{C\in{\cal G}}\sum_{i\in C}w_{i}. ∎

Next we give an useful upper bound on ρ\rho for a large family of uniform samplings (for proof, see Appendix C).

Let G{\cal G} be a collection of subsets of [n][n] with the property that the number of sets C∈GC\in{\cal G} containing distinct elements i,j∈[n]i,j\in[n] is the same for all i,ji,j. In particular, define

Now define a sampling SS by setting S=C∈GS=C\in{\cal G} with probability 1∣G∣\frac{1}{|{\cal G}|}. Moreover, assume that the support of SS is c1c_{1}–uniform. Consider the minibatch sketch S=IS\mathbf{S}={\bf I}_{S}.

If W=Diag(w1,…,wn){\bf W}={\rm Diag}(w_{1},\ldots,w_{n}), then

Note that as long as τ≥2\tau\geq 2, the τ\tau–nice sampling SS satisfies the assumptions of the above theorem. Indeed, G{\cal G} is the support of SS consisting of all subsets of [n][n] of size τ\tau, ∣G∣=(nτ)|{\cal G}|={n\choose\tau}, c1=(n−1τ−1)c_{1}={n-1\choose\tau-1}, and c2=(n−2τ−2)c_{2}={n-2\choose\tau-2}. As a result, bound (95) simplifies to

6 Calculating the iteration complexity for special cases

In this section we consider minibatch SAGA (Algorithm 3) and calculate its iteration complexity in special cases using Theorem 3.6 by pulling together the formulas for L1,L2,κ{\cal L}_{1},{\cal L}_{2},\kappa and ρ\rho established in previous sections. In particular, assume SS is τ\tau–uniform and has c1c_{1}–uniform support with c1≥1c_{1}\geq 1. In this case, formula (85) for L1,L2{\cal L}_{1},{\cal L}_{2} from Lemma 4.16 applies and we have L1=Lmax⁡G{\cal L}_{1}=L^{{\cal G}}_{\max} and L2=τmax⁡i{Liwi}{\cal L}_{2}=\tau\max_{i}\left\{\frac{L_{i}}{w_{i}}\right\}.

Moreover, by Lemma 4.8, κ=τn\kappa=\tfrac{\tau}{n}. By Theorem 3.6, if we use the stepsize

then the iteration complexity is given by

Complexity (100) is listed in line 9 of Table 1. The complexities in lines 3, 5 and 10–13 arise as special cases of (100) for specific choices of SS:

In line 3 we have gradient descent. This arises for the choice W=I{\bf W}={\bf I} and S=[n]S=[n] with probability 1. In this case, τ=n\tau=n, Lmax⁡G=LL^{{\cal G}}_{\max}=L and ρ=0\rho=0. So, (100) simplifies to

In line 5 we have uniform SAGA. We choose W=I{\bf W}={\bf I} and S={i}S=\{i\} with probability 1/n1/n. We have τ=1\tau=1 and Lmax⁡G=Lmax⁡L^{{\cal G}}_{\max}=L_{\max}. In view of Theorem 4.18, ρ≤n\rho\leq n. So, (100) simplifies to

In line 10 we choose W=I{\bf W}={\bf I} and SS is the τ\tau-nice sampling. In this case, Theorem 4.19 says that ρ=nτn−τn−1\rho=\frac{n}{\tau}\frac{n-\tau}{n-1} (see (98)). Therefore, (100) reduces to

In line 11 we choose W=Diag(Li){\bf W}={\rm Diag}(L_{i}) and SS is the τ\tau-nice sampling. Theorem 4.19 says that ρ≤n−ττ(n−2n−1Lmax⁡+nn−1Lˉ)\rho\leq\tfrac{n-\tau}{\tau}\left(\tfrac{n-2}{n-1}L_{\max}+\tfrac{n}{n-1}\bar{L}\right) (see (97)). Therefore, (100) reduces to

To simplify the above expression, one may further use the bound n−2n−1Lmax⁡+nn−1Lˉ≤Lmax⁡+Lˉ\tfrac{n-2}{n-1}L_{\max}+\tfrac{n}{n-1}\bar{L}\leq L_{\max}+\bar{L}. In Table 1 we have listed the complexity in this simplified form. Whether (103) or (104) is better depends on the constants {Li}\{L_{i}\}. Indeed, when there exists ii such that Li≫LjL_{i}\gg L_{j}, for j≠ij\neq i then

thus (104) is smaller than (103). On the other extreme, when Li=LjL_{i}=L_{j} for all i,ji,j, then

so long as n≥1n\geq 1. In this case (104) is larger than (103).

In line 12 of Table 1 we let W=I{\bf W}={\bf I} and SS is the τ\tau-partition sampling. In view of Theorem 4.18, ρ≤nττ=n\rho\leq\tfrac{n}{\tau}\tau=n and hence (100) reduces to

In line 13 of Table 1 we let W=Diag(Li){\bf W}={\rm Diag}(L_{i}) and SS is the τ\tau-partition sampling. In view of Theorem 4.18, ρ≤nτmax⁡C∈G∑i∈CLi\rho\leq\frac{n}{\tau}\max_{C\in{\cal G}}\sum_{i\in C}L_{i} and hence (100) reduces to

Note that the bound in (106) is better than (105) because max⁡C∈G∑i∈CLi≤τLmax⁡.\max_{C\in{\cal G}}\sum_{i\in C}L_{i}\leq\tau L_{\max}.

7 Comparison with previous mini-batch SAGA convergence results

Recently in , a method that includes a mini-batch variant of SAGA was proposed. This work is the most closely related to our minibatch SAGA, and was developed independently from ours. The methods described in can be cast in our framework. In the language of our paper, in the authors update the Jacobian estimate according to (77), where SkS_{k} is sampled according to a uniform probability with pi=τ/n,p_{i}=\tau/n, for all i=1,…,n.i=1,\ldots,n. What do differently is that instead of introducing the bias-corecting random variable θS\theta_{\mathbf{S}} to maintain an unbiased gradient estimate, the gradient estimate is updated using the standard SAGA update (78) and this sampling process is done independently of how SkS_{k} is sampled for the Jacobian update. Thus at every iteration a gradient ∇fi(xk)\nabla f_{i}(x^{k}) is sampled to compute (78), but is then discarded and not used to update the Jacobian update so as to maintain the independence between Jk{\bf J}^{k} and gk.g^{k}. By introducing the bias-correcting random variable θS\theta_{\mathbf{S}} in our method we avoid the data-hungry strategy used in .

The analysis provided in shows that, by choosing the stepsize appropriately, the expectation of a Lyapunov function similar to (52) is less than ϵ>0\epsilon>0 after

iterations, where K=def4Lmax⁡μK\overset{\text{def}}{=}\frac{4L_{\max}}{\mu}. When τ=1\tau=1 this gives an iteration complexity of O(n+K)log⁡1ϵ,O(n+K)\log\frac{1}{\epsilon}, which is essentially the same complexity as the standard SAGA method. The main issue with this complexity is that it decreases only very modestly as τ\tau increases. In particular, on the extreme end when τ=n\tau=n, since K≥4K\geq 4, we can approximate (1+K)2≈1+K2(1+K)^{2}\approx 1+K^{2} and the resulting complexity (107) becomes

Yet we know that τ=n\tau=n corresponds to gradient descent, and thus the iteration complexity should be O(Lμlog⁡(1/ϵ)),O(\tfrac{L}{\mu}\log(1/\epsilon)), which is what we recover in the analysis of all our mini-batch variants. In Figures 3(a), 3(b) and 3(c) in the experiments in Section 6 we illustrate how (107) descreases very modestly as τ\tau increases.

A Refined Analysis with a Stochastic Lyapunov Function

In this section we perform a refined analysis of JacSketch applied with a minibatch sketch S=IS\mathbf{S}={\bf I}_{S} for a special class of samplings SS which pick uniformly at random from a partition of [n][n] into sets of size τ\tau. This is only possible when nn is a multiple of τ\tau.

In the terminology introduced in Section 4.1, a τ\tau–partition sampling is non-vacuous, proper and τ\tau–uniform. Its support is a partition of [n][n], and is 11–uniform. It satisfies Assumption 4.6.

Restricting our attention to τ\tau–partition samplings will allow us to perform a more in-depth analysis of JacSketch using a stochastic Lyapunov function. Unlike Theorem 3.6, and as explained in Section 1.7, our main result in this section (Theorem 5.2) is capable of obtaining the conjectured rate O((n+Lˉμ)log⁡1ϵ)O((n+\tfrac{\bar{L}}{\mu})\log\tfrac{1}{\epsilon}) for SAGA with importance sampling.

One of the key reasons why we restrict our attention to τ\tau-partition samplings is the fact that

for C1,C2∈GC_{1},C_{2}\in{\cal G}. Recall from Lemma 4.7 that if W=I{\bf W}={\bf I}, then ΠIC=ICIC⊤{\bf\Pi}_{{\bf I}_{C}}={\bf I}_{C}{\bf I}_{C}^{\top}. Consequently, for C1,C2∈GC_{1},C_{2}\in{\cal G} we have

This orthogonality property will be fundamental for controlling the convergence of the gradient estimate in Lemma 5.3.

Recall from (32) that the stochastic gradient of the controlled stochastic reformulation (28) of the original finite-sum problem (1) is given by

provided that we use the minibatch sketch S=IS\mathbf{S}={\bf I}_{S} and bias-correcting variable θS=θIS=1/pS\theta_{\mathbf{S}}=\theta_{{\bf I}_{S}}=1/p_{S} given by Lemma 4.7(vi). This object will appear in our Lyapunov function, evaluated at x=x∗x=x^{*} and J=Jk{\bf J}={\bf J}^{k}. We are now ready to present the main result of this section.

S\mathbf{S} be a minibatch sketch (i.e., S=IS\mathbf{S}={\bf I}_{S})We can alternatively set S=eS\mathbf{S}=e_{S} and the same results will hold. , where SS is a τ\tau–partition sampling with support G=supp(S){\cal G}={\rm supp}(S),

fC=def1∣C∣∑i∈Cfif_{C}\overset{\text{def}}{=}\tfrac{1}{|C|}\sum_{i\in C}f_{i} be LCL_{C}–smooth and μ\mu–strongly convex (for μ>0\mu>0) for all C∈GC\in{\cal G},

W=I{\bf W}={\bf I}, θS=1pS\theta_{\mathbf{S}}=\frac{1}{p_{S}},

{xk,Jk}\{x^{k},{\bf J}^{k}\} be the iterates produced by JacSketch.

Consider the stochastic Lyapunov function

where σS=n4τLS\sigma_{S}=\frac{n}{4\tau L_{S}} is a stochastic Lyapunov constant. If we use a stepsize that satisfies

This means that if we choose the stepsize equal to the upper bound (112), then

2 Gradient estimate contraction

Here we will show that our gradient estimate contracts in the following sense.

Let SS be the τ\tau–partition sampling, and σ(S)=defσS≥0\sigma(S)\overset{\text{def}}{=}\sigma_{S}\geq 0 be any non-negative random variable. Then

Proof: For simplicity, in this proof we let ∇Fk=∇F(xk){\bf\nabla F}^{k}={\bf\nabla F}(x^{k}) and ∇F∗=∇F(x∗){\bf\nabla F}^{*}={\bf\nabla F}(x^{*}). Rearranging (110), we have

First, it follows from (109) that expression III is zero. We now multiply expressions I and II by σS\sigma_{S} and bound certain conditional expectations of these terms. Since SS and SkS_{k} are independent samplings, we have

Taking conditional expectation over expression II yields

where in the last equation we used the identity

which in turn is a specialization of (44) to the minibatch sketch S=IS\mathbf{S}={\bf I}_{S} and the specific choice of the bias-correcting variable θS=1/pS\theta_{\mathbf{S}}=1/p_{S}. It remains to take expectation of (118) and (119), apply the tower property, and combine this with (117). ∎

In the next lemma we bound the second moment of our gradient estimate gkg^{k}.

The second moment of the gradient estimate is bounded by

Proof: Adding and subtracting 1npSk∇F(x∗)ΠISke\tfrac{1}{np_{S_{k}}}{\bf\nabla F}(x^{*}){\bf\Pi}_{{\bf I}_{S_{k}}}e from (110) gives

Taking norm squared on both sides, and using the bound ∥a+b∥22≤2∥a∥22+2∥b∥22\|a+b\|_{2}^{2}\leq 2\|a\|_{2}^{2}+2\|b\|_{2}^{2} gives

Taking expectation of the AA term, we get

Recalling the setting of Theorem 5.2, we assume that each fCf_{C} is μ\mu–strongly convex and LCL_{C}–smooth:

for all C∈GC\in{\cal G}. It is known (see Section 2.1 in ) that the above conditions imply the following inequality:

Under the assumptions of Theorem 5.2 (in particular, assumptions on ff and SS), we have

Proof: Applying (123) to the function fIS,Jf_{{\bf I}_{S},{\bf J}} gives

Taking expectation over both sides over SS, noting that pS=τnp_{S}=\frac{\tau}{n}, and recalling that ∇fIS,J(x)\nabla f_{{\bf I}_{S},{\bf J}}(x) is an unbiased estimator of ∇f(x)\nabla f(x), we get the result. ∎

5 Proof of Theorem 5.2

Next, we determine a bound on α\alpha so that III ≤0\leq 0. Choosing

guarantees that III ≤0\leq 0, and thus the last term in term in (126) can be safely dropped. Next, to build a recurrence and conclude the convergence proof, we bound the stepsize α\alpha so that II ≤\leq I; that is,

Since σS=n4τLS\sigma_{S}=\frac{n}{4\tau L_{S}}, in view of (127) and (128) the combined bound on α\alpha is

Hence, we have established the recursion (113).

6 Calculating the iteration complexity in special cases

In this section we consider the special case of JacSketch analyzed via Theorem 5.2—minibatch SAGA with τ\tau–partition sampling—and look at further special cases by varying the minibatch size τ\tau and probabilities. Our aim is to justify the complexities appearing in Table 1. In view of Theorem 5.2 the iteration complexity is given by

where G=supp(S){\cal G}={\rm supp}(S). Complexity (129) is listed in line 2 of Table 1. The complexities in lines 4, 6, 8 and 14 arise as special cases of (129) for specific choices of τ\tau and probabilities pCp_{C}.

In line 4 we have gradient descent. This is obtained by choosing G={[n]}{\cal G}=\{[n]\} (whence p[n]=1p_{[n]}=1, τ=n\tau=n and L[n]=LL_{[n]}=L), which is why (129) simplifies to

In line 6 we consider uniform SAGA. That is, we choose τ=1\tau=1 and pi=1/np_{i}=1/n for all ii. We have G={{1},{2},…,{n}}{\cal G}=\{\{1\},\{2\},\dots,\{n\}\} and L{i}=LiL_{\{i\}}=L_{i}. Therefore, (129) simplifies to

This is essentially the sameWith the difference being that in the iteration complexity is 2(n+Lmax⁡/μ)log⁡(1ϵ),2\left(n+\left.L_{\max}\right/\mu\right)\log\left(\frac{1}{\epsilon}\right), thus a small constant change. complexity result given in .

In line 8 we consider SAGA with importance sampling. This is the same setup as above, except we choose

which is the optimal choice minimizing the complexity bound in p1,…,pnp_{1},\dots,p_{n}. With these optimal probabilities, the stepsize bound becomes α≤1nμ+4Lˉ,\alpha\leq\frac{1}{n\mu+4\bar{L}}, and by choosing the maximum allowed stepsize the resulting iteration complexity is

Now consider the probabilities pi=Li∑j=1nLjp_{i}=\frac{L_{i}}{\sum_{j=1}^{n}L_{j}} suggested in . Using our bound, these lead to the complexity

Comparing this with (133), we see that this non-uniform sampling offers a significant speed up over uniform sampling if nμ≤Lmin⁡.n\mu\leq L_{\min}. However, our rate (133) is always better than both (131) and (134). The rate we establish was conjectured to hold for a “properly” designed SAGA method in ; and we resolve this conjecture.

Finally, in line 14 of Table 1 we optimize over probabilities pCp_{C} directly; that is we extend the importance sampling described above to any τ\tau. Minimizing the complexity bound over the probabilities, and noting that ∣G∣=nτ|{\cal G}|=\frac{n}{\tau}, this leads to the rate

This iteration complexity also applies to the reduced memory variant of SAGA (18). This is because Theorem 5.2 also holds for sketches S=eS\mathbf{S}=e_{S} where SS is a τ\tau–partition sampling. To see this, note that our analysis in this section relies on the orthogonality property (109) which also holds for S=eS\mathbf{S}=e_{S} since (for W=I{\bf W}={\bf I}) we have:

Lemmas 5.3, 5.4 and 5.5 depend on the sketch through ∇fS,J(x∗)\nabla f_{\mathbf{S},{\bf J}}(x^{*}) only, which in turn depends on the sketch through ΠSe{\bf\Pi}_{\mathbf{S}}e, and it is easy to see that if either S=IS\mathbf{S}={\bf I}_{S} or S=eS\mathbf{S}=e_{S}, we have ΠSe=eS.{\bf\Pi}_{\mathbf{S}}e=e_{S}.

Experiments

We perform several experiments to validate the theory, and also test the practical relavance of non-uniform SAGA (79) with the optimized probability distribution (132). All of our code for these experiments was written in Julia and can be found on github in https://github.com/gowerrobert/StochOpt.jl.

In our experiments we test either ridge regression

First we compare non-uniform SAGA using the new optimized importance probabilities (132) against using the probabilities pi=Li/L‾p_{i}=\left.L_{i}\right/\overline{L} as suggested in . When nμn\mu is significantly smaller than LiL_{i} for all ii then the two sampling are very similar. But when nμn\mu is relatively large, then the optimized probabilities (132) can be much closer to a uniform distribution as compared to using pi=Li/L‾p_{i}=\left.L_{i}\right/\overline{L}. We illustrate this by solving a ridge regression problem (136), using generated data such that

where the elements of A{\bf A} and xx are sampled from the standard Gaussian distribution N(0,1){\cal N}(0,1), and the elements of ϵ\epsilon are sampled from N(0,10−3){\cal N}(0,10^{-3}). s It is not hard to see that the smoothness constants {Li}\{L_{i}\} are given by Li=∥ai∥22+λL_{i}=\left\|a_{i}\right\|_{2}^{2}+\lambda for i∈[n]i\in[n]. We scale the columns of A{\bf A} so that ∥a1∥22=1\left\|a_{1}\right\|_{2}^{2}=1 and ∥ai∥22=1n2,\left\|a_{i}\right\|_{2}^{2}=\frac{1}{n^{2}}, for i=2,…,n,i=2,\ldots,n, and set the regularization parameter λ=1n2.\lambda=\frac{1}{n^{2}}. Consequently, Lmax⁡=1+1n2L_{\max}=1+\frac{1}{n^{2}}, Li=2n2L_{i}=\frac{2}{n^{2}} for i=1,…,ni=1,\ldots,n, L‾=(n+1)2−1n3\overline{L}=\frac{(n+1)^{2}-1}{n^{3}} and μ=1nλmin⁡(AA⊤)+1n2\mu=\tfrac{1}{n}\lambda_{\min}({\bf A}{\bf A}^{\top})+\frac{1}{n^{2}}. In this case the iteration complexity of non-uniform SAGA with the optimal probabilities (133) is given by

The complexity (134) which results from using the probabilities pi=Li/L‾p_{i}=\left.L_{i}\right/\overline{L} is given by

Now we consider the regime where n→∞,n\rightarrow\infty, in which case μ→O(1n2)\mu\rightarrow{\cal O}(\frac{1}{n^{2}}) and consequently (139)→O(n)log⁡1ϵ\rightarrow{\cal O}(n)\log\frac{1}{\epsilon} and in contrast (140) →O(n2)log⁡1ϵ.\rightarrow{\cal O}(n^{2})\log\frac{1}{\epsilon}.

Thus the iteration complexity (140) will grow quadratically while (139) grows linearly in nn. We illustrate this in Figures 1(a), 1(b) and 1(c) where we set n=10n=10, n=100n=100 and n=1000n=1000, respectively. In all figures we see that SAGA-opt (SAGA with optimized probabilities) is the fastest method. On the other hand SAGA-Li (SAGA with pi=Li/L‾p_{i}=L_{i}/\overline{L}) stalls in Figure 1(b) and 1(c) when nn is larger, performing even worst as compared to the standard SAGA method with uniform probabilities (SAGA-uni).

These experiments, together with our theoretical results, leads us to the following observation regarding data pre-processing and data scaling

A standard good practice for pre-processing in classification or regression problems is to scale the data so that the standard deviation of each feature equals one. Which in our setting is equivalent to scaling the rows of AA⊤{\bf A}{\bf A}^{\top} so that ∥Ai:∥22=1\left\|{\bf A}_{i:}\right\|_{2}^{2}=1 for i=1,…,d.i=1,\ldots,d. In contrast, the iteration complexity of SAGA indicates that one should scale the columns of AA⊤{\bf A}{\bf A}^{\top} so that ∥A:j∥22=∥aj∥22=1\left\|{\bf A}_{:j}\right\|_{2}^{2}=\left\|a_{j}\right\|_{2}^{2}=1 for j=1,…,n.j=1,\ldots,n. Fortunately, both the columns and rows of AA⊤{\bf A}{\bf A}^{\top} can be simultaneously scaled using the Sinkhorn algorithm to solve the matrix scaling problem AA⊤e=e{\bf A}{\bf A}^{\top}e=e and A⊤Ae=e.{\bf A}^{\top}{\bf A}e=e.

2 Optimal mini-batch size

Our analysis of the mini-batch SAGA is precise enough as to inform an optimal mini-batch size. For instance, consider τ\tau–nice sampling and the resulting iteration complexity (104). Theorem 4.16 suggests that for any τ∈[n]\tau\in[n], the terms within the maximum in (104) are bounded by

Moreover, the upper and lower bounds are realized for τ=1\tau=1 and τ=n\tau=n, respectively. Consequently, for τ\tau small, we have Lmax⁡G≥C(τ)L^{{\cal G}}_{\max}\geq C(\tau). On the other hand, for τ\tau large we have Lmax⁡G≤C(τ).L^{{\cal G}}_{\max}\leq C(\tau). Furthermore, C(τ)C(\tau) decreases super-linearly in τ\tau while Lmax⁡GL^{{\cal G}}_{\max} tends to decrease more modestly. Consequently, the point where Lmax⁡GL^{{\cal G}}_{\max} overtakes C(τ)C(\tau) is often the best for the overall complexity of the method. To better appreciate these observations, we plot the evolution of the iteration complexity (104), the total complexity and the iteration complexity as predicted by Hofmann et al. (see (107)) as τ\tau increases in Figures 3(a), 3(b) and 3(c) for three different linear least squares problems. Since each step of mini-batch SAGA computes τ\tau stochastic gradients, s the total complexity is τ\tau times the iteration complexity. In each figure we can see that our iteration complexity initially decreases super-linearly, then at some point the complexity is dominated by Lmax⁡GL^{{\cal G}}_{\max} and the iteration complexity decreases sublinearly. Up to this point we can observe an improvement in overall total complexity. This is in contrast to the iteration complexity given by Hofmann et al. that shows practically no improvement as τ\tau increases.

Though our analysis predicts only modest improvements in total complexity, and suggests that τ=2\tau=2 or τ=3\tau=3 is optimal, we must bear in mind that this corresponds to 10%10\% and 20%20\% of the data for these small dimensional problems. We conjecture that for larger problems, this improvement in total complexity will also be larger.

To use these insights in practice, we need to be able to efficiently determine the τ\tau which corresponds to the point at which the convergence regimes switches from being dominated by C(τ)C(\tau) to being dominated by Lmax⁡GL^{{\cal G}}_{\max}. This surmounts to choosing τ\tau so that

Estimating Lmax⁡L_{\max} and μ\mu is often possible, but the cost of computing Lmax⁡GL^{{\cal G}}_{\max} has a combinatorial dependency on nn and τ.\tau. Thus to have a practical way of choosing τ\tau, we first need to bound Lmax⁡GL^{{\cal G}}_{\max}. This can be done for losses with linear classifiers using concentration bounds. We leave this for future work.

3 Comparative experiments

We now compare the performance of SAGA-opt to several known methods such as SVRG , grad (gradient descent with fixed stepsizes) and AMprev (an improved version of SVRG that uses second order information) . For the stepsize of SAGA-opt and SAG-opt, we found the stepsize α≤1nμ+4Lˉ\alpha\leq\frac{1}{n\mu+4\bar{L}} given by theory to be a bit too conservative. Instead do we away with the 44 and used α=1nμ+Lˉ\alpha=\frac{1}{n\mu+\bar{L}} instead. For the remaining methods we used a grid search over Lmax⁡×2mL_{\max}\times 2^{m} for m=21,19,17,…,−10,−11.m=21,19,17,\ldots,-10,-11.

To illustrate how biased gradient estimates can perform well in practice (despite lack of proper theoretical understanding of these methods), we also test SAG-opt: a method that uses the same Jacobian updates as SAGA-opt, but instead uses the biased gradient estimate gk=1nJk+1eg^{k}=\frac{1}{n}{\bf J}^{k+1}e. See Section 2.5 for more details on biased gradient estimates.

In Figures 3(a), 3(b) and 3(c) we compare the methods on three logistic regression problems (137) based on three different data sets taken from LIBSVM . In all these problems the two methods with optimized non-uniform sampling SAG-opt and SAGA-opt were faster in terms of both epochs and time. The next best method was AM-prev, followed by SVRG and grad. It is interesting to see how well SAG-opt performs in practice, despite having biased gradient estimates. This is why we believe it is important to advance the analyse of biased gradient estimates as future work.

Conclusion

We now provide a brief summary of some of the key contributions of this paper and a few selected pointers to possible future research directions.

We developed and analyzed JacSketch—a novel family of variance reduced methods based on Jacobian sketching—and provided a link between variance reduction for empirical risk minimization and recent results from the field of randomized numerical linear algebra on sketch-and-project type methods for solving linear systems. In particular, it turns out that variance reduction is obtained by taking an SGD step on a stochastic optimization problem whose solution is the unknown Jacobian. As a consequence of our analysis, we resolved the conjecture of in the affirmative by proving a properly designed importance sampling for SAGA leading to the iteration complexity of O(n+Lˉμ)log⁡(1ϵ){\cal O}(n+\tfrac{\bar{L}}{\mu})\log\left(\frac{1}{\epsilon}\right). For this purpose we developed a new proof technique using a stochastic Lyapunov function. Our complexity result for uniform mini-batch SAGA perfectly interpolates between the best known convergence rates of SAGA and gradient descent, and is sufficiently precise as to inform the choice of the batch size that minimizes the over all complexity of the method. Additionally we design and analyse a reduced memory variant of SAGA as a special case.

2 Future work

For future work we see many possible avenues including the following.

One may wish to explore combinations of a weight matrix and different sketches to design new efficient methods further improving iteration complexity. For this the weighting matrix will have to be highly structured (e.g., block diagonal or very sparse) so that the Jacobian update (39) can be computed efficiently.

Bias-variance trade-off.

One can try to explore the bias-variance trade-off as opposed to merely focus on the extremes only: SAG (minimum variance) and SAGA (no bias). There is also no empirical evidence that unbiased estimators outperform the biased ones.

Johnson-Lindenstrauss sketches.

One can design completely new methods using different sparse sketches, such as the fast Johnson-Lindenstrauss transform or the Achlioptas transform . The resulting method can then be analyzed through Theorem 3.6. But first these sketches need to be adapted to ensure we get an efficient method. In particular, computing ∇F(x)S{\bf\nabla F}(x)\mathbf{S} is only efficient if S\mathbf{S} is row sparse, i.e., most of the rows of S\mathbf{S} contain zeros only.

References

Appendix A Proof of Inequality (20)

Let SS be a sampling whose support G=supp(S){\cal G}={\rm supp}(S) is a partition of [n][n]. Moreover, assume all sets of this partition have cardinality τ\tau. Then

Proof: By assumption, ∣G∣=nτ|{\cal G}|=\tfrac{n}{\tau}. The first inequality follows from ∑C∈GLC≤∑C∈G1τ∑i∈CLi=1τ∑i=1nLi=nτLˉ.\sum_{C\in{\cal G}}L_{C}\leq\sum_{C\in{\cal G}}\frac{1}{\tau}\sum_{i\in C}L_{i}=\frac{1}{\tau}\sum_{i=1}^{n}L_{i}=\frac{n}{\tau}\bar{L}. On the other hand,

Appendix B Duality of Sketch-and-Project and Constrain-and-Approximate

and the constrain-and-approximate problem

Proof: Let Z=(J−Jk)W−1/2{\bf Z}=({\bf J}-{\bf J}^{k}){\bf W}^{-1/2} so that (143) becomes

It follows from one of the properties of pseudoinverseThe least norm solution to AX=B{\bf A}{\bf X}={\bf B} is given by X=A†B{\bf X}={\bf A}^{\dagger}{\bf B}. that the least norm solution of the above is given by Z=(∇F−Jk)S(W1/2S)†.{\bf Z}=({\bf\nabla F}-{\bf J}^{k})\mathbf{S}({\bf W}^{1/2}\mathbf{S})^{\dagger}. Substituting Z=(J−Jk)W−1/2{\bf Z}=({\bf J}-{\bf J}^{k}){\bf W}^{-1/2}, multiplying on the right by W1/2{\bf W}^{1/2} gives

Now it remains to use another pseudoinverse property: A†=(A⊤A)†A⊤{\bf A}^{\dagger}=({\bf A}^{\top}{\bf A})^{\dagger}{\bf A}^{\top}. We use it in (147) with A=W1/2S{\bf A}={\bf W}^{1/2}\mathbf{S}, which gives (145). Next we show using duality that (144) is equivalent to (143). Consider the Lagrangian of (143), namely

Adding and subtracting to the right hand side 12∥Jk−∇F∥W−12\frac{1}{2}\left\|{\bf J}^{k}-{\bf\nabla F}\right\|_{{\bf W}^{-1}}^{2} and completing the square gives

Keeping in mind the constraint (149), maximizing the above over Y{\bf Y} gives (144). ∎

Appendix C Proof of Theorem 4.19

where ωj=e2πi jn\omega_{j}=e^{\frac{2\pi{i\mkern 1.0mu}j}{n}} are the nn-th roots of unity and i {i\mkern 1.0mu} is the imaginary number. From (151) we see that there are only two distinct eigenvalues. Namely, for j=0j=0 we have

The other eigenvalue is given by any j≠0j\neq 0 since

Appendix D Notation Glossary