Second-Order Stochastic Optimization for Machine Learning in Linear Time
Naman Agarwal, Brian Bullins, Elad Hazan
Introduction
In recent literature stochastic first-order optimization has taken the stage as the primary workhorse for training learning models, due in large part to its affordable computational costs which are linear (in the data representation) per iteration. The main research effort devoted to improving the convergence rates of first-order methods have introduced elegant ideas and algorithms in recent years, including adaptive regularization [DHS11], variance reduction [JZ13, DBLJ14], dual coordinate ascent [SSZ13], and many more.
In contrast, second-order methods have typically been much less explored in large scale machine learning (ML) applications due to their prohibitive computational cost per iteration which requires computation of the Hessian in addition to a matrix inversion. These operations are infeasible for large scale problems in high dimensions.
In this paper we propose a family of novel second-order algorithms, LiSSA (Linear time Stochastic Second-Order Algorithm) for convex optimization that attain fast convergence rates while also allowing for an implementation with linear time per-iteration cost, matching the running time of the best known gradient-based methods. Moreover, in the setting where the number of training examples is much larger than the underlying dimension , we show that our algorithm has provably faster running time than the best known gradient-based methods.
Formally, the main optimization problem we are concerned with is the empirical risk minimization (ERM) problem:
Our focus is second-order optimization methods (Newton’s method), where in each iteration, the underlying principle is to move to the minimizer of the second-order Taylor approximation at any point. Throughout the paper, we will let . The update of Newton’s method at a point is then given by
Certain desirable properties of Newton’s method include the fact that its updates are independent of the choice of coordinate system and that the Hessian provides the necessary regularization based on the curvature at the present point. Indeed, Newton’s method can be shown to eventually achieve quadratic convergence [Nes13]. Although Newton’s method comes with good theoretical guarantees, the complexity per step grows roughly as (the former term for computing the Hessian and the latter for inversion, where is the matrix multiplication constant), making it prohibitive in practice. Our main contribution is a suite of algorithms, each of which performs an approximate Newton update based on stochastic Hessian information and is implementable in linear time. These algorithms match and improve over the performance of first-order methods in theory and give promising results as an optimization method on real world data sets. In the following we give a summary of our results. We propose two algorithms, LiSSA and LiSSA-Sample.
LiSSA: Algorithm 1 is a practical stochastic second-order algorithm based on a novel estimator of the Hessian inverse, leading to an efficient approximate Newton step (Equation 1). The estimator is based on the well known Taylor approximation of the inverse (Fact 2) and is described formally in Section 3.1. We prove the following informal theorem about LiSSA.
LiSSA returns a point such that in total time
where is the underlying condition number of the problem and is a bound on the variance of the estimator.
The precise version of the above theorem appears as Theorem 3.3. In theory, the best bound we can show for is ; however, in our experiments we observe that setting to be a small constant (often 1) is sufficient. We conjecture that can be improved to and leave this for future work. If indeed can be improved to (as is indicated by our experiments), LiSSA enjoys a convergence rate comparable to first-order methods. We provide a detailed comparison of our results with existing first-order and second-order methods in Section 1.2. Moreover, in Section 7 we present experiments on real world data sets that demonstrate that LiSSA as an optimization method performs well as compared to popular first-order methods. We also show that LiSSA runs in time proportional to input sparsity, making it an attractive method for high-dimensional sparse data.
LiSSA-Sample: This variant brings together efficient first-order algorithms with matrix sampling techniques [LMP13, CLM+15] to achieve better runtime guarantees than the state-of-the-art in convex optimization for machine learning in the regime when . Specifically, we prove the following theorem:
LiSSA-Sample returns a point such that in total time
The above result improves upon the best known running time for first-order methods achieved by acceleration when we are in the setting where . We discuss the implication of our bounds and further work in Section 1.3.
We also remark that all of our results focus on the very high accuracy regime. In general the benefits of linear convergence and second-order methods can be seen to be effective only when considerably small error is required. This is also the case for recent advances in fast first-order methods where their improvement over stochastic gradient descent becomes apparent only in the high accuracy regime. Our experiments also demonstrate that second-order methods can improve upon fast first-order methods in the regime of very high accuracy. While it is possible that this regime is less interesting for generalization, in this paper we focus on the optimization problem itself.
We further consider the special case when the function is self-concordant. Self-concordant functions are a sub-class of convex functions which have been extensively studied in convex optimization literature in the context of interior point methods [Nem04]. For self-concordant functions we propose an algorithm (Algorithm 5) which achieves linear convergence with running time guarantees independent of the condition number. We prove the formal running time guarantee as Theorem 6.2.
We believe our main contribution to be a demonstration of the fact that second-order methods are comparable to, or even better than, first-order methods in the large data regime, in both theory and practice.
LiSSA: The key idea underlying LiSSA is the use of the Taylor expansion to construct a natural estimator of the Hessian inverse. Indeed, as can be seen from the description of the estimator in Section 3.1, the estimator we construct becomes unbiased in the limit as we include additional terms in the series. We note that this is not the case with estimators that were considered in previous works such as that of [EM15], and so we therefore consider our estimator to be more natural. In the implementation of the algorithm we achieve the optimal bias/variance trade-off by truncating the series appropriately.
An important observation underlying our linear time step is that for GLM functions, has the form where is a scalar dependent on . A single step of LiSSA requires us to efficiently compute for a given vector . In this case it can be seen that the matrix-vector product reduces to a vector-vector product, giving us an time update.
LiSSA-Sample: LiSSA-Sample is based on Algorithm 2, which represents a general family of algorithms that couples the quadratic minimization view of Newton’s method with any efficient first-order method. In essence, Newton’s method allows us to reduce (up to factors) the optimization of a general convex function to solving intermediate quadratic or ridge regression problems. Such a reduction is useful in two ways.
First, as we demonstrate through our algorithm LiSSA-Sample, the quadratic nature of ridge regression problems allows us to leverage powerful sampling techniques, leading to an improvement over the running time of the best known accelerated first-order method. On a high level this improvement comes from the fact that when solving a system of linear equations in dimensions, a constant number of passes through the data is enough to reduce the system to equations. We carefully couple this principle and the computation required with accelerated first-order methods to achieve the running times for LiSSA-Sample. The result for the quadratic sub-problem (ridge regression) is stated in Theorem 5.1, and the result for convex optimization is stated in Theorem 5.2.
The second advantage of the reduction to quadratic sub-problems comes from the observation that the intermediate quadratic sub-problems can potentially be better conditioned than the function itself, allowing us a better choice of the step size in practice. We define these local notions of condition number formally in Section 2.1 and summarize the typical benefits for such algorithms in Theorem 4.1. In theory this is not a significant improvement; however, in practice we believe that this could be significant and lead to runtime improvements.While this is a difficult property to verify experimentally, we conjecture that this is a possible explanation for why LiSSA performs better than first-order methods on certain data sets and ranges of parameters.
To achieve the bound for LiSSA-Sample we extend the definition and procedure for sampling via leverage scores described by [CLM+15] to the case when the matrix is given as a sum of PSD matrices and not just rank one matrices. We reformulate and reprove the theorems proved by [CLM+15] in this context, which may be of independent interest.
2 Comparison with Related Work
In this section we aim to provide a short summary of the key ideas and results underlying optimization methods for large scale machine learning. We divide the summary into three high level principles: first-order gradient-based methods, second-order Hessian-based methods, and quasi-Newton methods. For the sake of brevity we will restrict our summary to results in the case when the objective is strongly convex, which as justified above is usually ensured by the addition of an appropriate regularizer. In such settings the main focus is often to obtain algorithms which have provably linear convergence and fast implementations.
First-Order Methods: First-order methods have dominated the space of optimization algorithms for machine learning owing largely to the fact that they can be implemented in time proportional to the underlying dimension (or sparsity). Gradient descent is known to converge linearly to the optimum with a rate of convergence that is dependent upon the condition number of the objective. In the large data regime, stochastic first-order methods, introduced and analyzed first by [RM51], have proven especially successful. Stochastic gradient descent (SGD), however, converges sub-linearly even in the strongly convex setting. A significant advancement in terms of the running time of first-order methods was achieved recently by a clever merging of stochastic gradient descent with its full version to provide variance reduction. The representative algorithms in this space are SAGA [RSB12, DBLJ14] and SVRG [JZ13, ZMJ13]. The key technical achievement of the above algorithms is to relax the running time dependence on (the number of training examples) and (the condition number) from a product to a sum. Another algorithm which achieves similar running time guarantees is based on dual coordinate ascent, known as SDCA [SSZ13].
Further improvements over SAGA, SVRG and SDCA have been obtained by applying the classical idea of acceleration emerging from the seminal work of [Nes83]. The progression of work here includes an accelerated version of SDCA [SSZ16]; APCG [LLX14]; Catalyst [LMH15], which provides a generic framework to accelerate first order algorithms; and Katyusha [AZ16], which introduces the concept of negative momentum to extend acceleration for variance reduced algorithms beyond the strongly convex setting. The key technical achievement of accelerated methods in general is to reduce the dependence on condition number from linear to a square root. We summarize these results in Table 1.
LiSSA places itself naturally into the space of fast first-order methods by having a running time dependence that is comparable to SAGA/SVRG (ref. Table 1). In LiSSA-Sample we leverage the quadratic structure of the sub-problem for which efficient sampling techniques have been developed in the literature and use accelerated first-order methods to improve the running time in the case when the underlying dimension is much smaller than the number of training examples. Indeed, to the best of our knowledge LiSSA-Sample is the theoretically fastest known algorithm under the condition . Such an improvement seems out of hand for the present first-order methods as it seems to strongly leverage the quadratic nature of the sub-problem to reduce its size. We summarize these results in Table 1.
Second-Order Methods: Second-order methods such as Newton’s method have classically been used in optimization in many different settings including development of interior point methods [Nem04] for general convex programming. The key advantage of Newton’s method is that it achieves a linear-quadratic convergence rate. However, naive implementations of Newton’s method have two significant issues, namely that the standard analysis requires the full Hessian calculation which costs , an expense not suitable for machine learning applications, and the matrix inversion typically requires time. These issues were addressed recently by the algorithm NewSamp [EM15] which tackles the first issue by subsampling and the second issue by low-rank projections. We improve upon the work of [EM15] by defining a more natural estimator for the Hessian inverse and by demonstrating that the estimator can be computed in time proportional to . We also point the reader to the works of [Mar10, BCNN11] which incorporate the idea of taking samples of the Hessian; however, these works do not provide precise running time guarantees on their proposed algorithm based on problem specific parameters. Second-order methods have also enjoyed success in the distributed setting [SSZ14].
Quasi-Newton Methods: The expensive computation of the Newton step has also been tackled via estimation of the curvature from the change in gradients. These algorithms are generally known as quasi-Newton methods stemming from the seminal BFGS algorithm [Bro70, Fle70, Gol70, Sha70]. The book of [NW06] is an excellent reference for the algorithm and its limited memory variant (L-BFGS). The more recent work in this area has focused on stochastic quasi-Newton methods which were proposed and analyzed in various settings by [SYG07, MR14, BHNS16]. These works typically achieve sub-linear convergence to the optimum. A significant advancement in this line of work was provided by [MNJ16] who propose an algorithm based on L-BFGS by incorporating ideas from variance reduction to achieve linear convergence to the optimum in the strongly convex setting. Although the algorithm achieves linear convergence, the running time of the algorithm depends poorly on the condition number (as acknowledged by the authors). Indeed, in applications that interest us, the condition number is not necessarily a constant as is typically assumed to be the case for the theoretical results in [MNJ16].
Our key observation of linear time Hessian-vector product computations for machine learning applications provides evidence that in such instances, obtaining true Hessian information is efficient enough to alleviate the need for quasi-Newton information via gradients.
3 Discussion and Subsequent Work
In this section we provide a brief survey of certain technical aspects of our bounds which have since been improved by subsequent work.
An immediate improvement in terms of (in fact suggested in the original manuscript) was achieved by [BBN16] via conjugate gradient on a sub-sampled Hessian which reduces this to . A similar improvement can also be achieved in theory through the extensions of LiSSA proposed in the paper. As we show in Section 7, the worse dependence on condition number has an effect on the running time when is quite large.Equivalently, is small. Accelerated first-order methods, such as APCG [LLX14], outperform LiSSA in this regime. To the best of our knowledge second-order stochastic methods have so far not exhibited an improvement in that regime experimentally. We believe a more practical version of LiSSA-Sample could lead to improvements in this regime, leaving this as future work.
To the best of our knowledge the factor of that appears to reduce the variance of our estimator has yet not been improved despite it being in our experiments. This is an interesting question to which partial answers have been provided in the analysis of [YLZ17].
Significant progress has been made in the space of inexact Newton methods based on matrix sketching techniques. We refer the reader to the works of [PW15, XYRK+16, Coh16, LACBL16, YLZ17] and the references therein.
We would also like to comment on the presence of a warm start parameter in our proofs of Theorems 3.3 and 5.1. In our experiments the warm start we required would be quite small (often a few steps of gradient descent would be sufficient) to make LiSSA converge. The warm start does not affect the asymptotic results proven in Theorems 3.3 and 5.1 because getting to such a warm start is independent of . However, improving this warm start, especially in the context of Theorem 5.1, is left as interesting future work.
On the complexity side, [AS16] proved lower bounds on the best running times achievable by second-order methods. In particular, they show that to get the faster rates achieved by LiSSA-Sample, it is necessary to use a non-uniform sampling based method as employed by LiSSA-Sample. We would like to remark that in theory, up to logarithmic factors, the running time of LiSSA-Sample is still the best achieved so far in the setting . Some of the techniques and motivations from this work were also generalized by the authors to provide faster rates for a large family of non-convex optimization problems [AAZB+17].
4 Organization of the Paper
The paper is organized as follows: we first present the necessary definitions, notations and conventions adopted throughout the paper in Section 2. We then describe our estimator for LiSSA, as well as state and prove the convergence guarantee for LiSSA in Section 3. After presenting a generic procedure to couple first-order methods with Newton’s method in 4, we present LiSSA-Sample and the associated fast quadratic solver in Section 5. We then present our results regarding self-concordant functions in Section 6. Finally, we present an experimental evaluation of LiSSA in Section 7.
Preliminaries
The following is a well known fact about the inverse of a matrix s.t. and :
For an -strongly convex and -smooth function , the condition number of the function is defined as , or when the function is clear from the context. Note that by definition this corresponds to the following notion:
We define a slightly relaxed notion of condition number where the moves out of the fraction above. We refer to this notion as a local condition number as compared to the global condition number defined above:
It follows that . The above notions are defined for any general function , but in the case of functions of the form , a further distinction is made with respect to the component functions. We refer to such definitions of the condition number by . In such cases one typically assumes the each component is bounded by . The running times of algorithms like SVRG depend on the following notion of condition number:
Similarly, we define a notion of local condition number for , namely
and it again follows that .
For our (admittedly pessimistic) bounds on the variance we also need a per-component strong convexity bound . We can now define
Assumptions: In light of the previous definitions, we make the following assumptions about the given function to make the analysis easier. We first assume that the regularization term has been divided equally and included in . We further assume that each .The scaling is without loss of generality, even when looking at additive errors, as this gets picked up in the log-term due to the linear convergence. We also assume that is -strongly convex and -smooth, is the associated local condition number and has a Lipschitz constant bounded by .
We now collect key concepts and pre-existing results that we use for our analysis in the rest of the paper.
Matrix Concentration: The following lemma is a standard concentration of measure result for sums of independent matrices.The theorem in the reference states the inequality for the more nuanced bounded variance case. We only state the simpler bounded spectral norm case which suffices for our purposes. An excellent reference for this material is by [Tro12].
Consider a finite sequence of independent, random, Hermitian matrices with dimension . Assume that
Define . Then we have for all ,
Accelerated SVRG: The following theorem was proved by [LMH15].
Given a function with condition number , the accelerated version of SVRG via Catalyst [LMH15] finds an -approximate minimum with probability in time
Sherman-Morrison Formula: The following is a well-known expression for writing the inverse of rank one perturbations of matrices:
LiSSA: Linear (time) Stochastic Second-Order Algorithm
In this section, we provide an overview of LiSSA (Algorithm 1) along with its main convergence results.
Based on a recursive reformulation of the Taylor expansion (Equation 2), we may describe an unbiased estimator of the Hessian. For a matrix , define as the first terms in the Taylor expansion, i.e.,
One can also define and analyze a simpler (non-recursive) estimator based on directly sampling terms from the series in Equation (2). Theoretically, one can get similar guarantees for the estimator; however, empirically our proposed estimator exhibited better performance.
2 Algorithm
Our algorithm runs in two phases: in the first phase it runs any efficient first-order method FO for steps to shrink the function value to the regime where we can then show linear convergence for our algorithm. It then takes approximate Newton steps based on the estimator from Definition 3.1 in place of the true Hessian inverse. We use two parameters, and , to define the Newton step. represents the number of unbiased estimators of the Hessian inverse we average to get better concentration for our estimator, while represents the depth to which we capture the Taylor expansion. In the algorithm, we compute the average Newton step directly, which can be computed in linear time as observed earlier, instead of estimating the Hessian inverse.
3 Main Theorem
In this section we present our main theorem which analyzes the convergence properties of LiSSA. Define to be the total time required by a first-order algorithm to achieve accuracy .
Consider Algorithm 1, and set the parameters as follows: , , The following guarantee holds for every with probability ,
As an immediate corollary, we obtain the following:
For a GLM function , Algorithm 1 returns a point such that with probability at least ,
We now prove our main theorem about the convergence of LiSSA (Theorem 3.3).
Note that since we use a first-order algorithm to get a solution of accuracy at least , we have that
where .
Substituting the values of and , combining Equation (3) and Lemma 3.5, and noting that , we have that at the start of the Newton phase the following inequality holds:
It can be shown via induction that the above property holds for all , which concludes the proof. ∎
Define . Note that . Following an analysis similar to that of [Nes13], we have that
Following from the previous equations, we have that
We now analyze the above two terms and separately:
The second inequality follows from the Lipschitz bound on the Hessian. The second term can be bounded as follows:
The previous claim follows from Lemma 3.6 which shows a concentration bound on the sampled estimator and by noting that due to our assumption on the function, we have that for all , and hence .
Putting the above two bounds together and using the triangle inequality, we have that
First note the following statement which is a straightforward implication of our construction of the estimator:
We also know from Equation (2) that for matrices such that and ,
Since we have scaled the function such that , it follows that
Also note that since , it follows that . Observing the second term in the above equation,
We can now apply Theorem 2.1, which gives the following:
Setting gives us that the probability above is bounded by . Now putting together the bounds and Equation (4) we get the required result. ∎
4 Leveraging Sparsity
A key property of real-world data sets is that although the input is a high dimensional vector, the number of non-zero entries is typically very low. The following theorem shows that LiSSA can be implemented in a way to leverage the underlying sparsity of the data. Our key observation is that for GLM functions, the rank one Hessian-vector product can be performed in time where is the sparsity of the input .
For GLM functions Algorithm 1 returns a point such that with probability at least
We will prove the following theorem, from which Theorem 3.7 will immediately follow.
Consider Algorithm 1, let be of the form described above, and let be such that the number of non zero entries in is bounded by . Then each step of the algorithm can be implemented in time .
LiSSA: Extensions
In this section we first describe a family of algorithms which generically couple first-order methods as sub-routines with second-order methods. In particular, we formally describe the algorithm LiSSA-Quad (Algorithm 2) and provide its runtime guarantee (Theorem 4.1). The key idea underlying this algorithm is that Newton’s method essentially reduces a convex optimization problem to solving intermediate quadratic sub-problems given by the second-order Taylor approximation at a point, i.e., the sub-problem given by
where . The above ideas provide an alternative implementation of our estimator for used in LiSSA. Consider running gradient descent on the above quadratic , and let be the step in this process. By definition we have that
It can be seen that the above expression corresponds exactly to the steps taken in LiSSA (Algorithm 2, line 8), the difference being that we use a sample of the Hessian instead of the true Hessian. Therefore LiSSA can also be interpreted as doing a partial stochastic gradient descent on the quadratic . It is partial because we have a precise estimate of gradient of the function and a stochastic estimate for the Hessian. We note that this is essential for the linear convergence guarantees we show for LiSSA.
The above interpretation indicates the possibility of using any first-order linearly convergent scheme for approximating the minimizer of the quadratic . In particular, consider any algorithm that, given a convex quadratic function and an error value , produces a point such that
with probability at least , where . Let the total time taken by the algorithm to produce the point be . For our applications we require to be linearly convergent, i.e. is proportional to with probability at least .
Given such an algorithm , LiSSA-Quad, as described in Algorithm 2, generically implements the above idea, modifying LiSSA by replacing the inner loop with the given algorithm . The following is a meta-theorem about the convergence properties of LiSSA-Quad.
Given the function which is -strongly convex, let be the minimizer of the function and be defined as in Algorithm 2. Suppose the algorithm satisfies condition (5) with probability under the appropriate setting of parameters . Set the parameters in the algorithm as follows: , , , where is the final error guarantee one wishes to achieve. Then we have that after steps, with probability at least ,
In particular, LiSSA-Quad(ALG) produces a point such that
in total time with probability at least for .
Note that for GLM functions, the at any point can be computed in time linear in . In particular, a full gradient of can be computed in time and a stochastic gradient (corresponding to a stochastic estimate of the Hessian) in time . Therefore, a natural choice for the algorithm in the above are first-order algorithms which are linearly convergent, for example SVRG, SDCA, and Acc-SDCA. Choosing a first-order algorithm FO gives us a family of algorithms LiSSA-Quad(FO), each with running time comparable to the running time of the underlying FO, up to logarithmic factors. The following corollary summarizes the typical running time guarantees for LiSSA-Quad(FO) when FO is Acc-SVRG.
Given a GLM function , if is replaced by Acc-SVRG [LMH15], then under a suitable setting of parameters, LiSSA-Quad produces a point such that
We run the algorithm to achieve accuracy on each of the intermediate quadratic functions , and we set which implies via a union bound that for all ,
Assume that for all , (otherwise the theorem is trivially true). Using the analysis of Newton’s method as before, we get that for all ,
where the second inequality follows from the analysis in the proof of Theorem 3.3 and Equation (6). We know that from the initial run of the first-order algorithm . Applying the above inductively and using the value of prescribed by the theorem statement, we get that . ∎
Runtime Improvement through Fast Quadratic Solvers
The previous section establishes the reduction from general convex optimization to quadratic functions. In this section we show how we can leverage the fact that for quadratic functions the running time for accelerated first-order methods can be improved in the regime when . In particular, we show the following theorem.
is the condition number of an sized sample of A and is formally defined in Equation (11). We can now use Algorithm 4 to compute an approximate Newton step by setting and . We therefore propose LiSSA-Sample to be a variant of LiSSA-Quad where Algorithm 4 is used as the subroutine ALG and any first-order algorithm can be used in the initial phase. The following theorem bounding the running time of LiSSA-Sample follows immediately from Theorem 4.1 and Theorem 5.1.
Given a GLM function , let . LiSSA-Sample produces a point such that
with probability at least in total time
In this section we provide a short overview of Algorithm 4. To simplify the discussion, lets consider the case when we have to compute for a matrix given as where the column of is . The computation can be recast as minimization of a convex quadratic function and can be solved up to accuracy in total time as can be seen from Theorem 2.2 Algorithm 4 improves upon the running time bound in the case when . In the following we provide a high level outline of the procedure which is formally described as Algorithm 4.
Given we will compute a low complexity constant spectral approximation of . Specifically and . This is achieved by techniques developed in matrix sampling/sketching literature, especially those of [CLM+15]. The procedure requires solving a constant number of sized linear systems, which we do via Accelerated SVRG.
We use as a preconditioner and compute by minimizing the quadratic . Note that this quadratic is well conditioned and can be minimized using gradient descent. In order to compute the gradient of the quadratic which is given by , we again use Accelerated SVRG to solve a linear system in B.
Finally, we compute using Accelerated SVRG to solve a linear system in B.
In the rest of the section we formally describe the procedure outlined and provide the necessary definitions. One key nuance we must take into account is the fact that based on our assumption we have included the regularization term into the component functions. Due to this, the Hessian does not necessarily look like a sum of rank one matrices. Of course, one can decompose the identity matrix that appears due to the regularizer as a sum of rank one matrices. However, note that the procedure above requires that each of the sub-samples must have good condition number too in order to solve linear systems on them with Accelerated SVRG. Therefore, the sub-samples generated must look like sub-samples formed from the Hessians of component functions. For this purpose we extend the procedure and the definition for leverage scores described by [CLM+15] to the case when the matrix is given as a sum of PSD matrices and not just rank one matrices. We reformulate and reprove the basic theorems proved by [CLM+15] in this context. To maintain computational efficiency of the procedure, we then make use of the fact that each of the PSD matrices actually is a rank one matrix plus the Identity matrix. We now provide the necessary preliminaries for the description of the algorithm and its analysis.
2 Preliminaries for Fast Quadratic Solver
For all the definitions and preliminaries below assume we are given a PSD matrix where are also PSD matrices. Let be the standard matrix dot product. Given two matrices and we say is a -spectral approximation of if .
If is a -spectral approximation of , then .
When the sample is unweighted, i.e., , we will simply denote the above as . We can now define to be
The following lemma is a generalization of the leverage score sampling lemma (Lemma 4, [CLM+15]). The proof is very similar to the original proof by [CLM+15] and is included in the Appendix for completeness.
Given an error parameter , let be a vector of leverage score overestimates, i.e., , for all . Let be a sampling rate parameter and let c be a fixed positive constant. For each matrix , we define a sampling probability . Let be a random sample of indices drawn from by sampling each index with probability . Define the weight vector to be the vector such that . By definition of weighted samples we have that
where is a Bernoulli random variable with probability .
If we set , is formed by at most entries in the above sum, and is a spectral approximation for with probability at least .
The following theorem is an analogue of the key theorem regarding uniform sampling (Theorem 1, [CLM+15]). The proof is identical to the original proof and is also included in the appendix for completeness.
Given any as defined above, let be formed by uniformly sampling matrices without repetition. Define
Suppose we are given any where each is of the form . Let be formed by uniformly sampling matrices without repetition. Define
Then for all , and
In the other case a similar inequality can be shown by noting via the Sherman-Morrison formula that
This proves Equation (12). A direct application of Theorem 5.7 now finishes the proof. ∎
3 Algorithms
In the following we formally state the two sub-procedures: Algorithm 4, which solves the required system, and Algorithm 3, which is the sampling routine for reducing the size of the system.
We prove the following theorem regarding the above algorithm REPEATED HALVING (Algorithm 3).
We first provide the proof of Theorem 5.1 using Theorem 5.9 and then provide the proof for Theorem 5.9. For the purpose of clarity of discourse we hide the terms that appear due to the probabilistic part of the lemmas. We can take a union bound to bound the total probability of failure, and those terms show up in the log factor.
We will first prove correctness which follows from noting that . Therefore we have that
Running Time Analysis: We now prove that the algorithm can be implemented efficiently. We first note the following two simple facts: since is a -approximation of , ; furthermore, the quadratic is -strongly convex and -smooth. Next, we consider the running time of implementing step 5. For this purpose we will perform gradient descent over the quadratic . Note that the gradient of is given by
Define . Using the standard analysis of gradient descent, we show that the following holds true for :
This follows directly from the gradient descent analysis which we outline below. To make the analysis easier, we define a true gradient descent series:
where and are the strong convexity and smoothness parameters of . Therefore, we have that
The running time of the above sub-procedure is bounded by the time to multiply a vector with , which takes time, and the time required to compute , which involves solving a linear system in at each step. Finally, in step 6 we once again compute the solution of a linear system in . Combining these we get that the total running time is
The correctness of the algorithm is immediate from Theorems 5.8 and 5.6. The key challenge in the proof lies in proving that there is an efficient way to implement the algorithm, which we describe next.
Runtime Analysis: To analyze the running time of the algorithm we consider the running time of the computation required in step 7 of the algorithm. We will show that there exists an efficient algorithm to compute numbers such that
We also know that is an sized weighted sub-sample of , and so it is of the form
Consider the following procedure for the computation of :
For each compute . This takes a total time of .
Here, is the running time of solving a linear system in with error . Therefore, substituting , the total running time of the above algorithm is
It is now easy from the definitions of and to see that
Setting , it follows from the definitions that
Now setting satisfies the required inequality for . This implies that when sampling from , we will have a -approximation, and the number of matrices will be bounded by .
Putting the above arguments together we get that the total running time of the procedure is bounded by
Condition Number Independent Algorithms
In this section we state our main result regarding self-concordant functions and provide the proof. The following is the definition of a self-concordant function:
Our main theorem regarding self-concordant functions is as follows:
Let , let , and let be a constant depending on . Set , , where is a constant depending on , and . Then, after steps, the following linear convergence guarantee holds between two full gradient steps for Algorithm 5:
Moreover, the time complexity of each full gradient step is , where is a constant depending on (independent of the condition number).
To describe the algorithm we first present the requisite definitions regarding self-concordant functions.
An excellent reference for this material is the lecture notes on this subject by [Nem04].
A key object in the analysis of self-concordant functions is the notion of a Dikin ellipsoid, which is the unit ball around a point in the norm given by the Hessian at the point. We will refer to this norm as the local norm around a point and denote it as . Formally, we have:
The Dikin ellipsoid of radius centered at a point is defined as
One of the key properties of self-concordant functions is that inside the Dikin ellipsoid, the function is well conditioned with respect to the local norm at the center, and furthermore, the function is smooth. The following lemmas makes these notions formal, and the proofs of these lemmas can be found in the lecture notes of [Nem04].
For all such that we have that
For all such that we have that
Another key quantity which is used both as a potential function as well as a dampening for the step size in the analysis of Newton’s method in general is the Newton decrement which is defined as . The following lemma quantifies how behaves as a potential by showing that once it drops below 1, it ensures that the minimum of the function lies in the current Dikin ellipsoid. This is the property which we use crucially in our analysis.
2 Condition Number Independent Algorithms
In this section we describe an efficient linearly convergent method (Algorithm 5) for optimization of self-concordant functions for which the running time is independent of the condition number. We have not tried to optimize the complexity of the algorithms in terms of as our main focus is to make it condition number independent.
The key idea here is the ellipsoidal view of Newton’s method, whereby we show that after making a constant number of full Newton steps, one can identify an ellipsoid and a norm such that the function is well conditioned with respect to the norm in the ellipsoid. This is depicted in Figure 1.
At this point one can run any desired first-order algorithm. In particular, we choose SVRG and prove its fast convergence. Algorithm 6 (described in the appendix) states the modified SVRG routine for general norms used in Algorithm 5.
We now state and prove the following theorem regarding the convergence of Algorithm 5.
It follows from Lemma 6.8 that at , the minimizer is contained in the Dikin ellipsoid of radius , where is a constant depending on . This fact, coupled with Lemma 6.7, shows that the function satisfies the following property with respect to :
Using the above fact along with Lemma 6.9, and substituting for the parameters, concludes the proof. ∎
We describe the Algorithm N-SVRG (Algorithm 6 in the appendix). Since the algorithm and the following lemmas are minor variations of their original versions, we include the proofs of the following lemmas in the appendix for completeness.
Let be a self-concordant function over , let , and consider . Let be the Dikin ellipsoid of radius , and let and . Then, for all s.t. ,
Let be a self-concordant function over , let , let , and consider following the damped Newton step as described in Algorithm 5 with initial point . Then, the number of steps of the algorithm before the minimizer of is contained in the Dikin ellipsoid of radius of the current iterate, i.e. , is at most , where is a constant depending on .
Let be a convex function. Suppose there exists a convex set and a positive semidefinite matrix such that for all , . Then the following holds between two full gradient steps of Algorithm 6:
Experiments
In this section we describe our experiments and choice of parameters in detail. Table 2 provides details regarding the data sets chosen for the experiments. To make sure our functions are scaled such that the norm of the Hessian is bounded, we scale the above data set points to unit norm.
2 Comparison with Standard Algorithms
In Figures 2 and 4 we present comparisons between the efficiency of our algorithm with different standard and popular algorithms. In both cases we plot . We obtained the optimum value for each case by running our algorithm for a long enough time until it converged to the point of machine precision.
Epoch Comparison: In Figure 2, we compare LiSSA with SVRG and SAGA in terms of the accuracy achieved versus the number of passes over the data. To compute the number of passes in SVRG and SAGA, we make sure that the inner stochastic gradient iteration in both the algorithms counts as exactly one pass. This is done because although it accesses gradients at two different points, one of them can be stored from before in both cases. The outer full gradient in SVRG counts as one complete pass over the data. We set the number of inner iterations of SVRG to for the case when , and we parameter tune the number of inner iterations when . The stepsizes for all of the algorithms are parameter tuned by an exhaustive search over the parameters.
Time Comparison: For the comparison with respect to time (Figure 4), we consider the following algorithms: AdaGrad [DHS11], BFGS [Bro70, Fle70, Gol70, Sha70], gradient descent, SGD, SVRG [JZ13] and SAGA [DBLJ14]. The is plotted as a function of the time elapsed from the start of the run for each algorithm. We next describe our choice of parameters for the algorithms. For AdaGrad we used the faster diagonal scaling version proposed by [DHS11]. We implemented the basic version of BFGS with backtracking line search. In each experiment for gradient descent, we find a reasonable step size using parameter tuning. For stochastic gradient descent, we use the variable step size which is usually the prescribed step size, and we hand tune the parameter . The parameters for SVRG and SAGA were chosen in the same way as before.
Choice of Parameters for LiSSA: To pick the parameters for our algorithm, we observe that it exhibits smooth behavior even in the case of , so this is used for the experiments. However, we observe that increasing has a positive effect on the convergence of the algorithm up to a certain point, as a higher leads to a larger per-iteration cost. This behavior is consistent with the theoretical analysis. We summarize the comparison between the per-iteration convergence and the value of in Figure 5. As the theory predicts to be of the order , for our experiments we determine an estimate for and set to around . This value is typically equal to in our experiments. We observe that setting in this way resulted in the experimental results displayed in Figure 2.
Comparison with Second-Order Methods: Here we present details about the comparison between LiSSA, NewSamp [EM15], and standard Newton’s method, as displayed in Figure 3. We perform this experiment on the MNIST data set and show the convergence properties of all three algorithms over time as well as over iterations. We could not replicate the results of NewSamp on all of our data sets as it sometimes seems to diverge in our experiments. For logistic regression on the MNIST data set, we could get it to converge by setting the value of to be slightly higher. We observe as is predicted by the theory that when compared in terms of the number of iterations, NewSamp and LiSSA perform similarly, while Newton’s method performs the best as it attains a quadratic convergence rate. This can be seen in Figure 3. However, when we consider the performance in terms of time for these algorithms, we see that LiSSA has a significant advantage.
Comparison with Accelerated First-Order Methods: Here we present experimental results comparing LiSSA with a popular accelerated first-order method, APCG [LLX14], as seen in Figure 6. We ran the experiment on the RealSIM data set with three settings of , to account for the high condition number setting. We observe a trend that can be expected from the runtime guarantees of the algorithms. When is not too low, LiSSA performs better than APCG, but as gets very low we see that APCG performs significantly better than LiSSA. This is not surprising when considering that the running time of APCG grows proportional to , whereas for LiSSA the running time can at best be proportional to . We note that for accelerated first-order methods to be useful, one needs the condition number to be quite large which is not often the case for applications. Nevertheless, we believe that an algorithm with running time guarantees similar to LiSSA-Sample can get significant gains in these settings, and we leave this exploration as future work.
Acknowledgements
The authors would like to thank Zeyuan Allen-Zhu, Dan Garber, Haipeng Luo and David McAllester for several illuminating discussions and suggestions. We would especially like to thank Aaron Sidford and Yin Tat Lee for discussions regarding the matrix sampling approach.
References
Appendix A Remaining Proofs
Here we provide proofs for the remaining lemmas.
The proof is almost identical to the proof of Lemma 4 by [CLM+15]. As in there we will use the following lemma on matrix concentration, which appears as Lemma 11 in the work of [CLM+15].
Let be independent random positive semidefinite matrices of size . Let and let . If , then
For every matrix choose with probability and otherwise. Therefore we need to bound . Note that . We will now show that
which will finish the proof by a direct application of Lemma A.1. First we will show that
We need to show that . By noting that the are PSD we have that if then . We can now consider . Therefore, we need to show that
This is true because the maximum eigenvalue of is bounded by its (due to positive semidefiniteness), which is equal to by definition. Therefore when , i.e., , the facts immediately provide
When the above does not hold, but we can essentially replace with variables each equal to , each being sampled with probability 1. This does not change but proves concentration. Now a direct application of Lemma A.1 finishes the proof. Also note that a standard Chernoff bound proves the required bound on the sample size. ∎
A.2 Proof of Lemma 5.7
A.3 Proof of Ellipsoidal Cover Lemma
Let be the Newton decrement at . By Lemma 6.6, we know that if , then
Consider a single iteration of the algorithm at time . If , then we may conclude that . Therefore, it is only when that may not be contained within . Since our update is of the form
where the first inequality follows from Lemma 6.5. It now follows that
steps, we can guarantee that we have arrived at such that . ∎
A.4 Proof of SVRG Lemma
The proof follows the original proof of SVRG [JZ13] with a few modifications to take the general norm into account. For any , consider
We know that since . Therefore,
The second inequality follows from smoothness of , where we note that is as smooth as . Summing the above inequality over and setting to be the minimum of so that , we get
The above inequalities follow by noting the following three facts:
Now note that conditioned on , we have that , and so
The second inequality uses the strong convexity property. Therefore, we have that