Communication-Efficient Distributed Optimization of Self-Concordant Empirical Loss
Yuchen Zhang, Lin Xiao
Introduction
Many optimization problems in data science (including statistics, machine learning, data mining, etc.) are formulated with a large amount of data as input. They are typically solved by iterative algorithms which need to access the whole dataset or at least part of it during each iteration. With the amount of data we collect and process growing at a fast pace, it happens more often that the dataset involved in an optimization problem cannot fit into the memory or storage of a single computer (machine). To solve such “big data” optimization problems, we need to use distributed algorithms that rely on inter-machine communication.
In this paper, we focus on distributed optimization problems generated through sample average approximation (SAA) of stochastic optimization problems. Consider the problem
Our goal is to minimize the overall empirical loss defined with all samples:
For stability and generalization purposes, we often add a regularization term to make the empirical loss function strongly convex. More specifically, we modify the definition of as
For example, when is the hinge loss, this formulation yields the support-vector machine .
Since the functions can be accessed only locally, we consider distributed algorithms that alternate between a local computation procedure at each machine, and a communication round involving simple map-reduce type of operations . Compared with local computation at each machine, the cost of inter-machine communication is much higher in terms of both speed/delay and energy consumption (e.g., ); thus it is often considered as the bottleneck for distributed computing. Our goal is to develop communication-efficient distributed algorithms, which try to use a minimal number of communication rounds to reach certain precision in minimizing .
For a concrete discussion, we make the following assumption:
where denotes the Hessian of at , and is the identity matrix.
Functions that satisfy Assumption A are often called -smooth and -strongly convex. The value is called the condition number of , which is a key quantity in characterizing the complexity of iterative algorithms. We focus on ill-conditioned cases where .
Another popular technique for distributed optimization is to use the alternating direction method of multipliers (ADMM); see, e.g., [8, Section 8]. Under the assumption that each local function is -smooth and -strongly convex, the ADMM approach can achieve linear convergence, and the best known complexity is . This turns out to be the same order as for accelerated gradient methods. In this case, ADMM can actually be considered as an accelerated primal-dual first-order method; see the discussions in [10, Section 4].
The polynomial dependence of the iteration complexity on the condition number can be unsatifactory. For machine learning applications, both the precision and the regularization parameter should decrease while the overall sample size increases, typically on the order of (e.g., ). This translates into the condition number being . In this case, the iteration complexity, and thus the number of communication rounds, scales as for both accelerated gradient methods and ADMM (with careful tuning of the penalty parameter). This suggests that the number of communication rounds grows with the total sample size.
Despite the rich literature on distributed optimization (e.g., ), most algorithms involve high communication cost. In particular, their iteration complexity have similar or worse dependency on the condition number as the methods discussed above. It can be argued that the iteration complexity cannot be improved in general for distributed first-order methods — after all, it is optimal for centralized first-order methods under the same assumption that is -smooth and -strongly convex . Thus in order to obtain better communication efficiency, we need to look into further problem structure and/or alternative optimization methods. And we need both in this paper.
First, we note that the above discussion on iteration complexity does not exploit the fact that each function is generated by, or can be considered as, SAA of a stochastic optimization problem. Since the data are i.i.d. samples from a common distribution, the local empirical loss functions will be similar to each other if the local sample size is large. Under this assumption, Zhang et al. studied a one-shot averaging scheme that approximates the minimizer of function by simply averaging the minimizers of . For a fixed condition number, the one-shot approach is communication efficient because it achieves optimal dependence on the overall sample size (in the sense of statistical lower bounds). But their conclusion doesn’t allow the regularization parameter to decrease to zero as goes to infinity (see discussions in ).
Exploiting the stochastic nature alone seems not enough to overcome ill-conditioning in the regime of first-order methods. This motivates the development of distributed second-order methods. Recently, Shamir et al. proposed a distributed approximate Newton-type (DANE) method. Their method takes advantage of the fact that, under the stochastic assumptions of SAA, the Hessians are similar to each other. For quadratic loss functions, DANE is shown to converge in \widetilde{\mathcal{O}}\bigl{(}(L/\lambda)^{2}n^{-1}\log(1/\epsilon)\bigr{)} iterations with high probability, where the notation hides additional logarithmic factors involving and . If as in machine learning applications, then the iteration complexity becomes , which scales linearly with the number of machines , not the total sample size . However, the analysis in does not guarantee that DANE has the same convergence rate on non-quadratic functions.
2 Outline of our approach
where and are the Newton step and the Newton decrement, respectively, defined as
Since is the average of , its gradient and Hessian can be written as
In order to compute in a distributed setting, the naive approach would require all the machines to send their gradients and Hessians to a master node (say machine 1). However, the task of transmitting the Hessians (which are matrices) can be prohibitive for large dimensions . A better alternative is to use the conjugate gradient (CG) method to compute as the solution to a linear system . Each iteration of the CG method requires a matrix-vector product of the form
The overall method has two levels of loops: the outer-loop of the damped Newton method, and the inner loop of the CG method for computing the inexact Newton steps. A similar approach (using a distributed truncated Newton method) was proposed in for ERM of linear predictors, and it was reported to perform very well in practice. However, the total number of CG iterations (each takes a round of communication) may still be high.
First, consider the outer loop complexity. It is well-known that Newton-type methods have asymptotic superlinear convergence. However, in classical analysis of Newton’s method (e.g., [9, Section 9.5.3]), the number of steps needed to reach the superlinear convergence zone still depends on the condition number; more specifically, it scales quadratically in . To solve this problem, we resort to the machinery of self-concordant functions . For self-concordant empirical losses, we show that the iteration complexity of the inexact damped Newton method has a much weaker dependence on the condition number.
Second, consider the inner loop complexity. The convergence rate of the CG method also depends on the condition number : it takes CG iterations to compute an -precise Newton step. Thus we arrive at the dilemma that the overall complexity of the CG-powered inexact Newton method is no better than accelerated gradient methods or ADMM. To overcome this difficulty, we exploit the stochastic nature of the problem and propose to use a preconditioned CG (PCG) method for solving the Newton system. Roughly speaking, if the local Hessians are “similar” to each other, then we can use any local Hessian as a preconditioner. Without loss of generality, let , where is an estimate of the spectral norm . Then we use CG to solve the pre-conditioned linear system
where the preconditioning (multiplication by ) can be computed locally at machine (the master node). The convergence rate of PCG depends on the condition number of the matrix , which is close to 1 if the spectral norm is small.
To exactly characterize the similarity between and , we rely on stochastic analysis in the framework of SAA or ERM. We show that with high probability, decreases as in general, and for quadratic loss. Therefore, when is large, the preconditioning is very effective and the PCG method converges to sufficient precision within a small number of iterations. The stochastic assumption is also critical for obtaining an initial point which further brings down the overall iteration complexity.
Combining the above ideas, we propose and analyze an algorithm for Distributed Self-Concordant Optimization (DiSCO, which also stands for Distributed Second-Order method, or Distributed Stochastic Convex Optimization). We show that several popular empirical loss functions in machine learning, including ridge regression, regularized logistic regression and a (new) smoothed hinge loss, are actually self-concordant. For ERM with these loss functions, Table 1 lists the number of communication rounds required by DiSCO and several other algorithms to find an -optimal solution. As the table shows, the communication cost of DiSCO weakly depends on the number of machines and on the feature dimension , and is independent of the local sample size (excluding logarithmic factors). Comparing to DANE , DiSCO not only improves the communication efficiency on quadratic loss, but also handles non-quadratic classification tasks.
The rest of this paper is organized as follows. In Section 2, we review the definition of self-concordant functions, and show that several popular empirical loss functions used in machine learning are either self-concordant or can be well approximated by self-concordant functions. In Section 3, we analyze the iteration complexity of an inexact damped Newton method for minimizing self-concordant functions. In Section 4, we show how to compute the inexact Newton step using a distributed PCG method, describe the overall DiSCO algorithm, and discuss its communication complexity. In Section 5, we present our main theoretical results based on stochastic analysis, and apply them to linear regression and classification. In Section 6, we report experiment results to illustrate the advantage of DiSCO in communication efficiency, compared with other algorithms listed in Table 1. Finally, we discuss the extension of DiSCO to distributed minimization of composite loss functions in Section 7, and conclude the paper in Section 8.
Self-concordant empirical loss
The reader may refer to the books for detailed treatment of self-concordance. In particular, the following lemma [34, Corollary 4.1.2] states that any self-concordant function can be rescaled to become standard self-concordant.
If a function is self-concordant with parameter , then is standard self-concordant (with parameter ).
In the rest of this section, we show that several popular regularized empirical loss functions for linear regression and binary classification are either self-concordant or can be well approximated by self-concordant functions.
First we consider regularized linear regression (ridge regression) with
For binary classification, we consider the following regularized empirical loss function
For logistic regression, we minimize the objective function (7) where is the logistic loss: . We can calculate the second and the third derivatives of :
Smoothed hinge loss
In classification tasks, it is sometimes more favorable to use the hinge loss than using the logistic loss. We consider a family of smoothed hinge loss functions parametrized by a positive number . The function is defined by
We plot the functions for on Figure 1. As the plot shows, is zero for , and it is a linear function with unit slope for . These two linear zones are connected by three smooth non-linear segments on the interval .
The smoothed hinge loss satisfies the condition of Lemma 2 with and . To see this, we note that the third derivative of is nonzero only when and when . On the first interval, we have
Inexact damped Newton method
The explicit account of approximation errors is essential for distributed optimization. In particular, if and the components locate on separate machines, then we can only perform Newton updates approximately with limited communication budget. Even in a centralized setting on a single machine, analysis of approximation errors can be important if the Newton system is solved by iterative algorithms such as the conjugate gradient method.
Before presenting the convergence analysis, we need to introduce two auxiliary functions
These two functions are very useful for characterizing the properties of self-concordant functions; see [34, Section 4.1.4] for a detailed account. Here, we simply note that , both are strictly increasing for , and as .
We also need to define two auxiliary vectors
The norm of the first vector, , is the exact Newton decrement. The norm of the second one is , which is computed during each iteration of Algorithm 1. Note that we do not compute or in Algorithm 1. They are introduced solely for the purpose of convergence analysis. The following Theorem is proved in Appendix A.
For any , we have .
If , then we have .
As mentioned before, when , the vector becomes the exact Newton step. In this case, we have , and it can be shown that for all and the exact damped Newton method has quadratic convergence when is small (see [34, Section 4.1.5]). With the approximation error specified in (10), we have
Appendix A shows that when is sufficiently small, the above inequality leads to the conclusion in part (a). Compared with the exact damped Newton method, the guaranteed reduction of the objective value per iteration is cut by half.
Part (b) of Theorem 1 suggests a linear rate of convergence when is small. This is slower than the quadratic convergence rate of the exact damped Newton method, due to the allowed approximation errors in computing the Newton step. Actually, superlinear convergence can be established if we set the tolerances to be small enough; see Appendix B for detailed analysis. However, when is computed through a distributed iterative algorithm (like the distributed PCG algorithm in Section 4.2), a smaller would require more local computational effort and more rounds of inter-machine communication. The choice in equation (10) is a reasonable trade-off in practice.
Using Theorem 1, we can derive the iteration complexity of Algorithm 1 for obtaining an arbitrary accuracy. We present this result as a corollary.
Here denotes the smallest nonnegative integer that is larger or equal to .
Since is strictly increasing for , part (a) of Theorem 1 implies that if , one step of Algorithm 1 decreases the value of by at least a constant . So within at most iterations, we are guaranteed that .
According to [34, Theorem 4.1.13], if , then we have
Moreover, it is easy to check that for . Therefore, using part (b) of Theorem 1, we conclude that when ,
Bounding the right-hand side of the above inequality by , we have whenever , which is the desired result.
We note that when (as long as ), we have . Thus for , it suffices to have . ∎
We discuss two stopping criteria for Algorithm 1. The first one is based on the strong convexity of , which leads to the inequality (e.g., [34, Theorem 2.1.10])
Therefore, we can use the stopping criterion , which implies . However, this choice can be too conservative in practice (see discussions in [9, Section 9.1.2]).
Another choice for the stopping criterion is based on self-concordance. Using the fact that for (see [9, Section 9.6.3]), we have
provided . Since we do not compute (the exact Newton decrement) directly in Algorithm 1, we can use as an approximation. Using the inequality (11), and noticing that , we conclude that
implies when . Since is computed at each iteration of Algorithm 1, this can serve as a good stopping criterion.
2 Scaling for non-standard self-concordant functions
Using the sequence defined in (10), the condition for computing in Step 1 is
In other words, the precision requirement in Step 1 is scaling invariant.
Step 2 of Algorithm 1 can be rewritten as
The DiSCO algorithm
In this section, we adapt the inexact damped Newton method (Algorithm 1) to a distributed system, in order to minimize
where each function can only be evaluated locally at machine (see background in Section 1). This involves two questions: (1) how to set the initial point and (2) how to compute the inexact Newton step in a distributed manner. After answering these two questions, we will present the overall DiSCO algorithm and analyze its communication complexity.
In accordance with the averaging structure in (18), we choose the initial point based on averaging. More specifically, we let
where each is the solution to a local optimization problem at machine :
Here we comment on the computational cost of solving (20) locally at each machine. Suppose each has the form in (3), then the local optimization problems in (20) become
The finite average structure of the above objective function can be effectively exploited by the stochastic average gradient (SAG) method or its new variant SAGA . Each step of these methods processes only one component function , picked uniformly at random. Suppose is -smooth, then SAG returns an -optimal solution with \mathcal{O}\bigl{(}(n+\frac{L+\rho}{\lambda+\rho})\log(1/\epsilon)\bigr{)} steps of stochastic updates. For ERM of linear predictors, we can also use the stochastic dual coordinate ascent (SDCA) method , which has the same complexity. We also mention some recent progress in accelerated stochastic coordinate gradient methods , which can be more efficient both in theory and practice.
2 Distributed computing of the inexact Newton step
In each iteration of Algorithm 1, we need to compute an inexact Newton step such that . This boils down to solving the Newton system approximately. When the objective has the averaging form (18), its Hessian and gradient are given in (6). In the setting of distributed optimization, we propose to use a preconditioned conjugate gradient (PCG) method to solve the Newton system.
To simplify notation, we use to represent and use to represent . Without loss of generality, we define a preconditioning matrix using the local Hessian at the first machine (the master node):
where is a small regularization parameter. Algorithm 2 describes our distributed PCG method for solving the preconditioned linear system
In particular, the master machine carries out the main steps of the classical PCG algorithm (e.g., [20, Section 10.3]), and all machines (including the master) compute the local gradients and Hessians and perform matrix-vector multiplications. Communication between the master and other machines are used to form the overall gradient and the matrix-vector products
We note that the overall Hessian is never formed and the master machine only stores and updates the vectors and .
As explained in Section 1.2, the motivation for preconditioning is that when is sufficiently close to , the condition number of might be close to , which is much smaller than that of itself. As a result, the PCG method may converge much faster than CG without preconditioning. The following lemma characterizes the extreme eigenvalues of based on the closeness between and .
Suppose Assumption A holds. If , then we have
Since both and are symmetric and positive definite, all eigenvalues of are positive real numbers (e.g., [21, Section 7.6]). The eigenvalues of are identical to that of . Thus, it suffices to prove inequalities (22) and (23) for the matrix . To prove inequality (22), we need to show that . This is equivalent to , which is a direct consequence of the assumption .
Similarly, the second inequality (23) is equivalent to , which is the same as . Since (by Assumption A), we have . The additional assumption implies , which complete the proof. ∎
By Assumption A, the condition number of the Hessian matrix is , which can be very large if is small. Lemma 3 establishes that the condition number of the preconditioned linear system is
provided that . When is small (comparable with ), the condition number is close to one and can be much smaller than . Based on classical convergence analysis of the CG method (e.g., ), the following lemma shows that Algorithm 2 terminates in iterations. See Appendix C for the proof.
Suppose Assumption A holds and assume that . Let
Then Algorithm 2 terminates in iterations and the output satisfies .
When the tolerance is chosen as in (10), the iteration bound is independent of , i.e.,
Under Assumption A, we always have . If we choose , then Lemma 4 implies that Algorithm 2 terminates in iterations. where the notation hides logarithmic factors. In practice, however, the matrix norm is usually much smaller than due to the stochastic nature of . Thus, we can choose to be a tight upper bound on , and expect the algorithm terminating in iterations. In Section 5, we show that if the local empirical losses are constructed with i.i.d. samples from the same distribution, then with high probability. As a consequence, the iteration complexity of Algorithm 2 is upper bounded by .
We wrap up this section by discussing the computation and communication complexities of Algorithm 2. The bulk of computation is at the master machine, especially computing the vector in Step 3, which is equivalent to minimize the quadratic function . Using and the form of in (3), this is equivalent to
This problem has the same structure as (21), and an -optimal solution can be obtained with \mathcal{O}\bigl{(}(n+\frac{L+\mu}{\lambda+\mu})\log(1/\epsilon)\bigr{)} stochastic-gradient type of steps (see discussions at the end of Section 4.1).
As for the communication complexity, we need one round of communication at the beginning of Algorithm 2 to compute . Then, each iteration takes one round of communication to compute and . Thus, the total rounds of communication is bounded by .
3 Communication efficiency of DiSCO
Putting everything together, we present the DiSCO algorithm in Algorithm 3. Here we study its communication efficiency. Recall that by one round of communication, the master machine broadcasts a message of bits to all machines, and every machine processes the aggregated message and sends a message of bits back to the master. The following proposition gives an upper bound on the number of communication rounds taken by the DiSCO algorithm.
Assume that is a standard self-concordant function and it satisfies Assumption A. Suppose the input parameter in Algorithm 3 is an upper bound on for all . Then for any , in order to find a solution satisfying , the total number of communication rounds is bounded by
Ignoring logarithmic terms and universal constants, the rounds of communication is bounded by
First we notice that the number of communication rounds in each call of Algorithm 2 is no more than , where is given in (25), and the extra 1 accounts for the communication round to form . Corollary 1 states that in order to guarantee , the total number of calls of Algorithm 2 in DiSCO is bounded by given in (12). Thus the total number of communication rounds is bounded by , where the extra one count is for computing the initial point defined in (19). ∎
It can be hard to give a good a priori estimate of that satisfies the condition in Theorem 2. In practice, we can adjust the value of adaptively while running the algorithm. Inspired by a line search procedure studied in , we propose an adaptive DiSCO method, described in Algorithm 4. The following proposition bounds the rounds of communication required by this algorithm.
Let be the number of calls to Algorithm 2 during the th iteration of Algorithm 4. We have
The total number of calls to Algorithm 2 is
From the above proof, we see that the average number of calls to Algorithm 2 at each iteration is , roughly twice as the non-adaptive Algorithm 3. Ignoring logarithmic terms and universal constants, the number of communication round used by Algorithm 4 is bounded by
In general, we can update in Algorithm 4 as follows:
4 A simple variant without PCG iterations
We consider a simple variant of DiSCO where the approximate Newton step is computed without using the PCG method described in Algorithm 2. Instead, we simply set
which is equivalent to setting in the initialization phase of Algorithm 2, or forcing it to always exit during the first PCG iteration. (The latter choice gives the same search direction but with a slightly different scaling.) In this variant, each iteration of the inexact damped Newton method requires two communication rounds: one to form and another to compute the stepsize parameter .
A distributed algorithm that is similar to this variant of DiSCO is proposed in . It does not compute ; instead it uses line search to determine the step size, which also requires extra round(s) of communication. It is shown in that this method works well in experiments, requiring less number of iterations to converge than ADMM. However, according to their theoretical analysis, its iteration complexity still depends badly on the condition number.
Here we examine the theoretical conditions under which this variant of DiSCO enjoys a low iteration complexity. Recall the two auxiliary vectors defined in Section 3:
The norm of their difference can be bounded as
From Lemma 3, we know that when , the eigenvalues of are located within the interval . Therefore, we have
This inequality has the same form as (11), which is responsible to obtain the desired low complexity result if is sufficiently small. Indeed, if as specified in (10), the same convergence rate and complexity result stated in Theorem 1 and Corollary 1 apply. Since each iteration of the damped Newton method involves only two communication rounds (to compute and respectively), we have the following corollary.
Assume that is a standard self-concordant function and it satisfies Assumption A. In the DiSCO algorithm, we compute the inexact Newton step using (28). Suppose and for all . Then for any , in order to find a solution satisfying , the total number of communication rounds is bounded by
In Corollary 2, the requirement on , which upper bounds for all , is quite strong. In particular, it requires to be a small fraction of in order to satisfy . As we will see from the stochastic analysis in the next section, the spectral bound decreases on the order of . Therefore, in the standard setting where the regularization parameter , the condition in Corollary 2 cannot be satisfied, and the convergence of this simple variant may be slow. In contrast, DiSCO with PCG iterations is much more tolerant of a relatively large , and can achieve superlinear convergence with a smaller .
Stochastic analysis
From Theorems 2 and 3 of the previous section, we see that the communication complexity of the DiSCO algorithm mainly depends on two quantities: the initial objective gap and the upper bound on the spectral norms for all . As we discussed in Section 3.2, the initial gap may grow with the number of samples due to the scaling used to make the objective function standard self-concordant. On the other hand, the upper bound may decrease as the number of samples increases based on the intuition that the local Hessians and the global Hessian become similar to each other. In this section, we show how to exploit the stochastic origin of the problem (SAA or ERM, as explained in Section 1) to mitigate the effect of objective scaling and quantify the notion of similarity between local and global Hessians. These lead to improved complexity results.
We focus on the setting of distributed optimization of regularized empirical loss. That is, our goal is to minimize , where
We assume that are i.i.d. samples from a common distribution. Our theoretical analysis relies on refined assumptions on the smoothness of the loss function . In particular, we assume that for any in the sampling space , the function has bounded first derivative in a compact set, and its second derivatives are bounded and Lipschitz continuous. We formalize these statements in the following assumption.
There are finite constants , such that for any :
for any ;
For the regularized empirical loss in (30), condition in the above assumption implies for , which in turn implies Assumption A.
Recall that the initial point is obtained as the average of the solutions to regularized local optimization problems; see equations (19) and (20). The following lemma shows that expected value of the initial gap decreases with order as the local sample size increases. The proof uses the notion and techniques of uniform stability for analyzing the generalization performance of ERM . See Appendix D for the proof.
Here the expectation is taken with respect to the randomness in generating the i.i.d. data.
Suppose Assumption B holds. For any and any , we have with probability at least ,
If are quadratic functions in , then we have in Assumption B. In this case, Lemma 6 implies . For general non-quadratic loss, Lemma 6 implies . We use this lemma to obtain an upper bound on the spectral norm of the Hessian distances , where the vectors are generated by Algorithm 1.
Suppose Assumption B holds and the sequence is generated by Algorithm 1. Let r=\Big{(}\frac{2V_{0}}{\lambda}+\frac{2G}{\lambda}\sqrt{\frac{2V_{0}}{\lambda}}\Big{)}^{1/2}. Then with probability at least , we have for all ,
Substituting (see Lemma 5) into the above inequality yields
Thus, we have for all . Applying Lemma 6 establishes the corollary. ∎
Here we remark that the dependence on of the upper bound in (34) comes from Lemma 6, where the bound needs to hold for all point in a -dimensional ball with radius . However, for the analysis of the DiSCO algorithm, we only need the matrix concentration bound to hold for a finite number of vectors , instead of for all vectors satisfying . Thus we conjecture that the bound in (34), especially its dependence on the dimension , is too conservative and very likely can be tightened.
We are now ready to present the main results of our stochastic analysis. The following theorem provides an upper bound on the expected number of communication rounds required by the DiSCO algorithm to find an -optimal solution. Here the expectation is taken with respect to the randomness in generating the i.i.d. data set .
Then for any , the total number of communication rounds required to reach is bounded by
where are or logarithmic terms:
In particular, ignoring numerical constants and logarithmic terms, we have
Suppose Algorithm 3 terminates in iterations, and let be the number of conjugate gradient steps in each call of Algorithm 2, for . For any given , we define as in (25). Let denotes the event that for all . Let be the complement of , i.e., the event that for some . In addition, let the probabilities of the events and be and respectively. By the law of total expectation, we have
When the event happens, we have where is given in (25); otherwise we have , where
is an upper bound on the number of PCG iterations in Algorithm 2 when the event happens (see the analysis in Appendix F). Since Algorithm 2 always return a such that , the outer iteration count share the same bound (12), which depends on the random variable . However, and are deterministic constants. So we have
Combining with the strong convexity of , we obtain
where the additional 1 counts compensate for removing one operator in (12).
where . With the choice of in (35) and the definition of in (36), we have
Replacing by its expression in (25) and applying Corollary 3, we obtain the desired result. ∎
According to Theorem 4, we need to set the two input parameters and in Algorithm 3 appropriately to obtain the desired communication efficiency. Using the adaptive DiSCO method given in Algorithm 4, we can avoid the explicit specification of defined in (33) and (35). This is formalized in the following theorem.
In Algorithm 4, the parameter is automatically tuned such that the number of PCG iterations in Algorithm 2 is no more than . By Corollary 3, with probability at least , we have
where is defined in (33), and and are given in (35). Therefore we can use the same arguments in the proof of Theorem 4 to show that
and and are the same as given in Theorem 4. Ignoring constants and logarithmic terms, we obtain the desired result. ∎
To handle the constraint , we need to replace the inexact damped Newton method in DiSCO with an inexact proximal Newton method, and replace the distributed PCG method for solving the Newton system with a preconditioned accelerated proximal gradient method. Further details of such an extension are given in Section 7.
The expectation bounds on the rounds of communication given in Theorems 4 and 5 are obtained by combining two consequences of averaging over a large number of i.i.d. local samples. One is the expected reduction of the initial gap (Lemma 5), which helps to mitigate the effect of objective scaling used to make standard self-concordant. The other is a high-probability bound that characterizes the similarity between the local and global Hessians (Corollary 3). If the empirical loss is standard self-concordant without scaling, then we can regard as a constant, and only need to use Corollary 3 to obtain a high-probability bound. This is demonstrated for the case of linear regression in Section 5.1.
For applications where the loss function needs to be rescaled to be standard self-concordant, the convexity parameter as well as the “constants” in Assumption B also need to be rescaled. If the scaling factor grows with , then we need to rely on Lemma 5 to balance the effects of scaling. As a result, we only obtain bounds on the expected number of communication rounds. These are demonstrated in Section 5.2 for binary classification with logistic regression and a smoothed hinge loss.
1 Application to linear regression
We consider linear regression with quadratic regularization (ridge regression). More specifically, we minimize the overall empirical loss function
Thus we can apply Theorems 4 and 5 to obtain an expectation bound on the number of communication rounds for DiSCO. For linear regression, however, we can obtain a stronger result.
Since is a quadratic function, it is self-concordant with parameter , and by definition also standard self-concordant (with parameter ). In this case, we do not need to rescale the objective function, and can regard the initial gap as a constant. As a consequence, we can directly apply Theorem 2 and Corollary 3 to obtain a high probability bound on the communication complexity, which is stronger than the expectation bounds in Theorems 4 and 5. In particular, Theorem 2 states that if
then the number of communication rounds is bounded as
Since there is no scaling, the initial gap can be considered as a constant. For example, we can simply pick and have
By Corollary 3 and the fact that for quadratic functions, the condition (42) holds with probability at least if we choose
Further using , we obtain the following corollary.
Suppose we apply DiSCO (Algorithm 3) to minimize defined in (41) with the input parameter in (43), and let be the total number of communication rounds required to find an -optimal solution. With probability at least , we have
We note that the same conclusion also holds for the adaptive DiSCO algorithm (Algorithm 4), where we do not need to specify the input parameter based on (43). For the adaptive DiSCO algorithm, the bound in (44) holds for any .
The communication complexity guaranteed by Corollary 4 is strictly better than that of distributed implementation of the accelerated gradient method and ADMM (cf. Table 1). If we choose , then Corollary 4 implies
with high probability. The DANE algorithm , under the same setting, converges in iterations with high probability (and each iteration requires two rounds of communication). Thus DiSCO enjoys a better communication efficiency.
2 Application to binary classification
For binary classification, we consider the following regularized empirical loss function
then we have and . It is easy to check that Assumption B holds with
which all containing the scaling factor . Plugging these scaled constants into Theorems 4 and 5, we have the following corollary.
For logistic regression, the number of communication rounds required by DiSCO to find an -optimal solution is bounded by
In the specific case when , Corollary 5 implies
If we ignore logarithmic terms, then the expected number of communication rounds is independent of the sample size , and only grows slowly with the number of machines .
Smoothed Hinge Loss
If we choose , then applying Theorems 4 and 5 yields the following result.
For the smoothed hinge loss defined in (8) with , the total number of communication rounds required by DiSCO to find an -optimal solution is bounded by
Thus, the smoothed hinge loss enjoys the same communication efficiency as the logistic loss.
Numerical experiments
In this section, we conduct numerical experiments to compare the DiSCO algorithm with several state-of-the-art distributed optimization algorithms: the ADMM algorithm (e.g., ), the accelerated full gradient method (AFG) [34, Section 2.2], the L-BFGS quasi-Newton method (e.g., [37, Section 7.2]), and the DANE algorithm .
The algorithms ADMM, AFG and L-BFGS are well known and each has a rich literature. In particular, using ADMM for empirical risk minimization in a distributed setting is straightforward; see [8, Section 8]. For AFG and L-BFGS, we use the simple distributed implementation discussed in Section 1.1: at each iteration , each machine computes the local gradients and sends it to the master machine to form , and the master machine executes the main steps of the algorithm to compute . The iteration complexities of these algorithms stay the same as their classical analysis for a centralized implementation, and each iteration usually involves one or two rounds of communication.
Here we briefly describe the DANE (Distributed Approximate NEwton) algorithm proposed by Shamir et al. . Each iteration of DANE takes two rounds of communication to compute from . The first round of communication is used to compute the gradient . Then each machine solves the local minimization problem
and take a second round of communication to compute . Here is a regularization parameter with a similar role as in DiSCO. For minimizing the quadratic loss in (41), the iteration complexity of DANE is . As summarized in Table 1, if the condition number grows as , then DANE is more efficient than AFG and ADMM when is large. However, the same complexity cannot be guaranteed for minimizing non-quadratic loss functions. According to the analysis in , the convergence rate of DANE on non-quadratic functions might be as slow as the ordinary full gradient descent method.
For comparison, we solve three binary classification tasks using logistic regression. The datasets are obtained from the LIBSVM datasets and summarized in Table 2. These datasets are selected to cover different relations between the sample size and the feature dimensionality : (Covtype ), (RCV1 ) and (News20 ). For each dataset, our goal is to minimize the regularized empirical loss function:
Among other methods in comparison, we manually tune the penalty parameter of ADMM and the regularization parameter for DANE to optimize their performance. For AFG, we used an adaptive line search scheme to speed up its convergence. For L-BFGS, we adopted the memory size (number of most recent iterates and gradients stored) as a general rule of thumb suggested in ,
We want to evaluate DiSCO not only on , but also in the middle of calculating , to show its progress after each round of communication. To this end, we follow equation (16) to define an intermediate solution for each iteration of the distributed PCG method (Algorithm 2):
2 Performance evaluation
It is important to note that different algorithms take different number of communication rounds per iteration. ADMM requires one round of communication per iteration. For AFG and L-BFGS, each iteration consists of at least two rounds of communications: one for finding the descent direction, and another one or more for searching the stepsize. For DANE, there are also two rounds of communications per iteration, for computing the gradient and for aggregating the local solutions. For DiSCO, each iteration in the inner loop takes one round of communication, and there is an additional round of communication at the beginning of each inner loop. Since we are interested in the communication efficiency of the algorithms, we plot their progress in reducing the objective value with respect to the number of communication rounds taken.
We plot the performance of ADMM, AFG, L-BFGS, DANE and DiSCO in Figure 2. According to the plots, DiSCO converges substantially faster than ADMM and AFG. It is also notably faster than L-BFGS and DANE. In particular, the convergence speed (and the communication efficiency) of DiSCO is more robust to the number of machines in the distributed system. For , the performance of DiSCO is somewhat comparable to that of DANE. As grows to and , the convergence of DANE becomes significantly slower, while the performance of DiSCO only degrades slightly. This coincides with the theoretical analysis: the iteration complexity of DANE is proportional to , but the iteration complexity of DiSCO is proportional to .
Since both DANE and DiSCO take a regularization parameter , we study their sensitivity to the choices of this parameter. Figure 3 shows the performance of DANE and DiSCO with the value of varying from to . We observe that the curves of DiSCO are relatively smooth and stable. In contrast, the curves of DANE exhibit sharp valley at particular values of . This suggests that DiSCO is more robust to the non-optimal choice of parameters.
Extension to distributed composite minimization
Thus far, we have studied the problem of minimizing empirical loss functions that are standard self-concordant. In this section, we sketch how to extend the DiSCO algorithm to solve distributed composite minimization problems. By composite minimization, we consider the minimization of
We modify Algorithm 1 and Algorithm 2 to minimize the composite function . To modify Algorithm 1, we update using an inexact version of the proximal-Newton method (e.g., ). More specifically, the two steps in each iteration of Algorithm 1 are replaced with:
Find a vector that is an approximate solution of
Update .
Note that for , the above proximal-Newton method reduces to Algorithm 1. Since only needs to be an inexact solution to problem (48), we need a measure to quantify the approximation error. For this purpose, we define the following gradient mapping
If is an exact minimizer of (48), then we have . In the distributed setting, we only need to find a vector such that .
It remains to devise an distributed algorithm to compute an inexact minimizer . Since the objective function in (48) is not quadratic, we can no longer employ the distributed PCG method in Algorithm 2. Instead, we propose a preconditioned accelerated proximal gradient method. In particular, we modify the algorithm on the master machine in Algorithm 2 as follows:
where is an auxiliary vector. We output once the condition is satisfied. Each update takes one round of communication to compute the vector . Then, the sub-problem (49) is locally solved by the master machine. This problem has similar structure as problems (20) and (26), and can be solved in \mathcal{O}\bigl{(}(n+\frac{L+\mu}{\lambda+\mu})\log(1/\epsilon)\bigr{)} time using the methods proposed in .
If we replace the first term on the right-hand side of equation (49) by and set , then the above algorithm is exactly the accelerated proximal gradient algorithm , which converges in iterations. By utilizing the similarity between and , and assuming for all , it can be shown that our algorithm in (49) converges in iterations, which is of the same order as the PCG algorithm.
In summary, to minimize the composite function , we replace Algorithm 1 by the inexact proximal Newton method, and replace Algorithm 2 by a distributed implementation of the above preconditioned accelerated proximal gradient method. Under the same assumptions on , we can obtain similar guarantees on the communication efficiency as stated in Theorems 4 and 5.
Conclusions
We considered distributed convex optimization problems originated from SAA or ERM, which involve large amount of i.i.d. data stored on a distributed computing system. Since the cost of inter-machine communication is very high in practice, communication efficiency is a critical measure in evaluating the performance of a distributed algorithm. For algorithms based on first-order methods, including accelerated gradient methods and ADMM, the required number of communication rounds grows with the condition number of the objective function. The condition number itself often grows with the number of samples due to weaker regularization required. This causes the total number of communication rounds to grow with the overall sample size.
In this paper, we proposed and analyzed DiSCO, a communication-efficient distributed algorithm for minimizing self-concordant empirical loss functions, and discussed its application to linear regression and classification. DiSCO is based on an inexact damped Newton method, where the inexact Newton steps are computed by a distributed preconditioned conjugate gradient method. In a standard setting for supervised learning, its required number of communication rounds does not increase with the sample size, but only grows slowly with the number of machines in the distributed system. There are three main thrusts in our approach:
Self-concordant analysis. We showed that several popular empirical loss functions used in machine learning are either self-concordant or can be well approximated by self-concordant functions. We gave complexity analysis of the inexact damped Newton method, and characterized the conditions for both linear and superlinear convergence.
Preconditioned conjugate gradient (PCG) method. We proposed a distributed implementation of the PCG method for computing the inexact Newton step. In particular, the preconditioner based on similarity between local and global Hessians is very effective in reducing the number of communication rounds, both in theory and practice.
Stochastic analysis of communication efficiency. Our main theoretical results combine two consequences of averaging over a large number of i.i.d. samples. One is the expected reduction of the initial objective value, which counters the effect of objective scaling required to make the objective function standard self-concordant. The other is a high-probability bound that characterizes the similarity between the local and global Hessians.
Our numerical experiments on real datasets confirmed the superior communication efficiency of the DiSCO algorithm. In addition, we also proposed an extension for solving distributed optimization problems with composite empirical loss functions.
Appendix A Proof of Theorem 1
First, we recall the definitions of the two auxiliary functions
which form a pair of convex conjugate functions.
We notice that Step 2 of Algorithm 1 is equivalent to
When inequality (50) holds, Nesterov [34, Theorem 4.1.8] has shown that
Using the definition of functions and , and with some algebraic operations, we obtain
By the second-order mean-value theorem, we have
Using the inequality (11), we can upper bound the second derivative as
Combining the two inequalities above, and using the relation for all , we obtain
In the last inequality above, we used the fact that for any we have , which is the result of convexity of and ; more specifically,
Substituting the above upper bound into inequality (A) yields
With inequality (52), we are ready to prove the statements of the lemma. In particular, Part (a) of the Lemma holds for any .
For part (b), we assume that . According to [34, Theorem 4.1.13], when , it holds that for every ,
Combining this sandwich inequality with inequality (52), we have
It is easy to verify that for all , and if . Applying these two inequalities to inequality (54) completes the proof.
It should be clear that other combinations of the value of and bound on are also possible. For example, for and , we have .
Appendix B Super-linear convergence of Algorithm 1
For any , we have .
If , then we have .
Part (b) suggests superlinear convergence when is small. This comes at the cost of a smaller approximation tolerance given in (55), compared with (10). Roughly speaking, when is relative large, the tolerance in (55) needs to be proportional to since . When is very small, the tolerance in (55) needs to be proportional to because as . In contrast, for linear convergence, the tolerance in (10) is proportional to .
We start with the inequality (A), and upper bound the last two terms on its right-hand side. Since , we have
Applying these two bounds to (A), we obtain
Next we bound using the approximation tolerance specified in (55),
Combining the above inequality with (56), and using with the monotonicity of , we arrive at
Part (a) of the theorem follows immediately from inequality (57).
For part (b), we assume that . Combining (53) with (57), we have
Let and consider only . Notice that and for . Thus, we conclude that for . We also notice that and for . Thus, we have for . Combining these results, we obtain
Applying this inequality to the right-hand side of (58) completes the proof. ∎
In classical analysis of inexact Newton methods , asymptotic superlinear convergence occurs with (in fact with for any ). This agrees with our analysis since when is not too small. Our result can be very conservative asymptotically because as . However, using and the associated self-concordance analysis, we are able to derive a much better global complexity result.
where denotes the smallest nonnegative integer that is larger than or equal to .
By part (a) of Theorem 6, if , then each iteration of Algorithm 1 decreases the function value at least by the constant . So within at most iterations, we are guaranteed to have .
Part (b) of Theorem 6 implies when , and hence
Note that both sides of the above inequality is negative. Therefore, after iterations (assuming ), we have
which implies . Finally using (53) and the fact that for , we obtain
Appendix C Proof of Lemma 4
It suffices to show that the algorithm terminates at iteration , because when the algorithm terminates, it outputs a vector which satisfies . Denote by the solution of the linear system . By the classical analysis on the preconditioned conjugate gradient method (e.g., ), Algorithm 2 has the convergence rate
where is the condition number of given in (24). For the left-hand side of inequality (60), we have
For the right-hand side of inequality (60), we have
Combining the above two inequalities with inequality (60), we obtain
To guarantee that , it suffices to have
where in the last inequality we used for . Comparing with the definition of , this is the desired result.
Appendix D Proof of Lemma 5
First, we prove inequality (31). Recall that and minimizes and . Since both function are -strongly convex, we have
which implies and . Then inequality (31) follows since is the average over .
Let be a set of i.i.d. samples in from the same distribution. We define a regularized empirical risk
The following lemma states that the population risk of is very close to its empirical risk. The proof is based on the notion of stability of regularized empirical risk minimization .
Suppose Assumption B holds and is a set of i.i.d. samples in . Then we have
Let . For any , we define a modified training set by replacing with another sample , which is drawn from the same distribution and is independent of . The empirical risk on is defined as
and let . Since both and are -strongly convex, we have
Summing the above two inequalities, and noticing that
By Assumption B (ii) and the facts and , we have
Combining the above Lipschitz condition with (61), we obtain
As a consequence, we have , and therefore
In the terminology of learning theory, this means that empirical minimization over the regularized loss has uniform stability with respect to the loss function ; see .
For any fixed , since is independent of , we have
Next, we consider a distributed system with machines, where each machine has a local dataset of size , for . To simplify notation, we denote the local regularized empirical loss function and its minimizer by and , respectively. We would like to bound the excessive error when applying to a different dataset . Notice that
where is the constant vector minimizing . Since and are independent, we have
where the inequality is due to Lemma 7. For the second term, we have
It remains to bound the third term . We first use the strong convexity of to obtain (e.g., [34, Theorem 2.1.10])
where denotes the gradient of at . If we index the elements of by , then
By the optimality condition of , we have for any ,
Therefore, according to (65), the gradient is the average of independent and zero-mean random vectors. Combining (64) and (65) with the definition of in (63), we have
In the equality above, we used the fact that are i.i.d. zero-mean random variables; so the variance of their sum equals the sum of their variances. The last inequality above is due to Assumption B (ii) and the fact that . Combining the upper bounds for , and , we have
where denotes the th sample at machine . Let ; then we have
We compare the value , for any , with the minimum of :
Taking expectation with respect to all the random data sets and using (66), we obtain
Finally, we bound the expected value of :
Appendix E Proof of Lemma 6
We consider an arbitrary point and the associated Hessian matrices for the functions defined in (30). We have
The components of the above sum are i.i.d. matrices which are upper bounded by . By the matrix Hoeffding’s inequality [30, Corollary 4.2], we have
Applying the union bound, we have with probability at least
As the final step, we choose and then choose to make the right-hand side of inequality (71) equal to . This yields the desired result.
Appendix F More analysis on the number of PCG iterations
Here we analyze the number of iterations of the distributed PCG method (Algorithm 2) when is misspecified, i.e., when used in is not an upper bound on . For simplicity of discussion, we assume that Assumption A holds, and . In this case, we can show (using similar arguments for proving Lemma 3):
Hence the condition number of the preconditioned linear system is
and the number of PCG iterations is bounded by (cf. Appendix C)
This gives the bound on number of PCG iterations in (36).