APOLLO: AN ADAPTIVE PARAMETER-WISE DIAG-

Abstract:
In this paper, we introduce APOLLO, a quasi-Newton method for nonconvex stochastic optimization, which dynamically incorporates the curvature of the loss function by approximating the Hessian via a diagonal matrix. Importantly, the update and storage of the diagonal approximation of Hessian is as efficient as adaptive first-order optimization methods with linear complexity for both time and memory. To handle nonconvexity, we replace the Hessian with its rectified absolute value, which is guaranteed to be positive-definite. Experiments on three tasks of vision and language show that APOLLO achieves significant improvements over other stochastic optimization methods, including SGD and variants of Adam, in terms of both convergence speed and generalization performance. The implementation of the algorithm is available at anonymous link.

heading: 1 INTRODUCTION
text: Nonconvex stochastic optimization is of core practical importance in many fields of machine learning, in particular for training deep neural networks (DNNs). First-order gradient-based optimization algorithms, conceptually attractive due to their linear efficiency on both the time and memory complexity, have led to tremendous progress and impressive successes. A number of advanced first-order algorithms have emerged over the years to pursue fast and stable convergence, among which stochastic gradient descent (SGD) (Robbins & Monro, 1951; LeCun et al., 1998), equipped with momentum (Rumelhart et al., 1985; Qian, 1999; Bottou & Bousquet, 2008), has stood out for its simplicity and effectiveness across a wide range of applications (Hinton & Salakhutdinov, 2006; Hinton et al., 2012; Graves, 2013). However, one disadvantage of SGD is that the gradients in different directions are scaled uniformly, resulting in limited convergence speed and sensitive choice of learning rate, and thus has spawned a lot of recent interests in accelerating SGD from the algorithmic and practical perspectives.
Recently, many adaptive first-order optimization methods have been proposed to achieve rapid training progress with element-wise scaled learning rates, and we can only mention a few here due to space limits. In their pioneering work, Duchi et al. (2011) proposed AdaGrad, which scales the gradient by the square root of the accumulative square gradients from the first iteration. While AdaGrad works well for sparse settings, its performance significantly degrades for dense settings, primarily due to the monotonic increase of the accumulation. Subsequently, several methods have been proposed with the intuition to limit the accumulation to a small window of past iterations, and in particular exponentially reduce the weight of earlier iterations. Notable works incorporating this method are RMSProp (Tieleman & Hinton, 2012), AdaDelta (Zeiler, 2012), and Adam (Kingma & Ba, 2015), among which Adam has become the default optimization algorithm across many deep learning applications because of its fast convergence speed and relatively consistent selections of hyper-parameters (Ruder, 2016; Zhang et al., 2020). However, it has been observed that these adaptive optimization methods may converge to bad/suspicious local optima, resulting in worse generalization ability than their non-adaptive counterparts (Wilson et al., 2017), or fail to converge due to unstable and extreme learning rates (Luo et al., 2019).
Quasi-Newton methods have been widely used in solving convex optimization problems, due to their efficient computation and fast convergence rate (Broyden, 1967; Dennis & Moré, 1977). However, the stochastic, high-dimensional and nonconvex nature of many machine learning tasks, such as
training deep neural networks, has rendered many classical quasi-Newton methods ineffective and/or inefficient (Keskar & Berahas, 2016; Wang et al., 2017; Yao et al., 2020). Indeed, in many natural language processing (NLP) and computer vision (CV) tasks (He et al., 2016; Ma & Hovy, 2016; Luo et al., 2019), SGD (with momentum) is chosen as the optimizer, benefiting from its stable and efficient training and outstanding generalization.
In this work, we develop APOLLO, a quasi-Newton method for nonconvex stochastic optimization to simultaneously tackle the aforementioned challenges of stochastic variance, nonconvexity and inefficiency. Algorithmically, APOLLO dynamically incorporates the curvature of the objective function with diagonally approximated Hessian. It only requires first-order gradients and updates the approximation of the Hessian diagonally so that it satisfies a parameter-wise version of the weak secant condition (Wolfe, 1959). To handle nonconvexity, we replace the Hessian with its rectified absolute value, the computation of which is also efficient under our diagonal approximation, yielding an efficient optimization algorithm with linear complexity for both time and memory (§3). Experimentally, through three tasks on CV and NLP with popular deep neural networks, including ResNets (He et al., 2016), LSTMs (Hochreiter & Schmidhuber, 1997) and Transformers (Vaswani et al., 2017), we demonstrate that APOLLO significantly outperforms SGD and variants of Adam, in terms of both convergence speed and generalization performance (§4).

heading: 2 BACKGROUNDS
text: In this section, we set up the notations on nonconvex stochastic optimization, briefly review the (quasi-) Newton methods, and discuss the problems of applying quasi-Newton methods to nonconvex stochastic optimization that we attempt to study in the rest of the paper.

heading: 2.1 NONCONVEX STOCHASTIC OPTIMIZATION
text: In this paper, we consider the following nonconvex stochastic optimization problem: min θ∈Rd f(θ) = E[l(θ; Γ)] (1) where l : Rd ×Rn → R is a continuously differentiable (and possible nonconvex) function, θ ∈ Rd denotes the parameter to be optimized, Γ ∈ Rn denotes a random variable with distribution function P, and E[·] denotes the expectation w.r.t Γ. Intuitively, Γ incorporates noises in f , leading to a stochastic objective function. A special case of (1) that arises frequently in machine learning is the empirical risk minimization problem:
min θ∈Rd
f(θ) = 1
N N∑ i=1 li(θ) (2)
where li : Rd → R is the loss function corresponding to the i-th data, and N is the number of data samples that is assumed to be extremely large. Objective functions may also have other sources of noise than data subsampling, such as dropout (Srivastava et al., 2014) in deep neural networks.
Decoupled Parameters. In this work, we consider a setting of decoupled parameters: θ = {θ(l), l = 1, . . . , L}. Intuitively, under this setting the parameter θ is decoupled into a sequence of parameters serving different functionalities. For example, in neural network training the parameters of a neural network can be naturally decoupled into the parameters of different layers or modules.

heading: 2.2 NEWTON AND QUASI-NEWTON METHODS
text: Newton’s method usually employs the following updates to solve (1): θt+1 = θt −H−1t gt (3) where gt = ∇f(θt) is the gradient at θt and Ht = ∇2f(θt) is the Hessian matrix. The convergence rate of Newton’s method is quadratic under standard assumptions (Nocedal & Wright, 2006). However, major challenges with this method are i) the expensive computation of the inverse Hessian at every iteration and the corresponding quadratic memory complexity; and ii) the limitation to convex functions (nonconvexity results in negative curvature of Ht and misleads the update directions).
A standard alternative to Newton’s method is a class of quasi-Newton methods, which have been widely used in solving convex deterministic optimization problem:
θt+1 = θt − ηtB−1t gt (4)
where ηt is the stepsize (a.k.a learning rate), Bt is an approximation to the Hessian matrix ∇2f(θt) at θt, which is updated based on the well-known secant equation:
Bt+1 = argmin B
‖B −Bt‖
s.t. Bt+1st = yt (secant equation) (5)
where st = θt+1−θt and yt = gt+1−gt. Bt+1 is, in the sense of some matrix norm, the closest toBt among all symmetric matrices that satisfy the secant equation. Each choice of the matrix norm results in a different update formula, such as DFP (Davidon, 1991; Fletcher, 1987) and BFGS (Broyden, 1970; Fletcher, 1970; Goldfarb, 1970; Shanno, 1970). The popularity of this method is due to the fact that only the gradient of the objective function is required at each iteration. Since no second derivatives (Hessian) are required, quasi-Newton methods are sometimes more efficient than Newton’s method, especially when the computation of Hessian is expensive. To further reduce memory cost, one seminal work is the limited memory BFGS (L-BFGS) (Liu & Nocedal, 1989; Byrd et al., 1995) that achieves desirable linear computational and memory complexity by approximating the Hessian as a series of sum of first order information from previous iterations.

heading: 2.3 PROBLEMS OF QUASI-NEWTON METHODS
text: Despite their impressive successes on convex deterministic optimization, quasi-Newton methods suffer from their own problems in more challenging scenarios. In this section, we mainly discuss three problems preventing quasi-Newton methods from being applied to the scenario of largescale nonconvex stochastic optimization. Due to these problems, no quasi-Newton methods (to our best knowledge) designed for nonconvex optimization consistently outperform adaptive firstorder algorithms w.r.t convergence speed and generalization performance. The main goal of this work is to algorithmically design and experimentally demonstrate a novel quasi-Newton method, in hope of improving the convergence speed and generalization performance of nonconvex stochastic optimization eventually.
Stochastic Variance. One challenge of quasi-Newton methods on nonconvex stochastic optimization (1) is the variance introduced by the stochastic nature of the problem. At each iteration, only the stochastic gradient gt is available, which is an unbiased estimation of the gradient∇f(θt) and may lead to an erroneous approximation of Hessian (Byrd et al., 2011).
Nonconvexity. Another key challenge in designing such quasi-Newton methods lies in the difficulty of preserving the positive-definiteness of Bt in (5), due to the nonconvexity of the objective function. What is worse is that performing line search is infeasible in the stochastic setting, due to the presence of noise in the stochastic gradients (Wang et al., 2017).
Computational and Memory Efficiency. Even though quasi-Newton methods are more efficient than Newton’s method, the time and memory complexities are still relatively large compared with adaptive first-order methods. For instance, L-BFGS requires to store first-order information from m previous iterations with commonly m ≥ 5, which is still too expensive for deep neural networks containing millions of parameters. Moreover, adapting quasi-Newton methods to nonconvex stochastic optimization probably introduces additional computation, further slowing down these methods.

heading: 3 ADAPTIVE PARAMETER-WISE DIAGONAL QUASI-NEWTON
text: With the end goal of designing an efficient quasi-Newton method to solve the problem in (1) in mind, we first propose to approximate the Hessian with a diagonal matrix, whose elements are determined by the variational approach subject to the parameter-wise weak secant equation (§3.1). Then, we explain our stepsize bias correction technique to reduce the stochastic variance in §3.2. To handle nonconvexity, we directly use the rectified absolute value of the diagonally approximated Hessian as the preconditioning of the gradient (§3.3). The initialization technique of APOLLO allows us to eliminate one hyper-parameter (§3.4). At last, we provide a theoretical analysis of APOLLO’s convergence in both convex optimization and nonconvex stochastic optimization (§3.5). The pseudo-code is shown in Algorithm 1.

heading: 3.1 QUASI-NEWTON METHODS WITH DIAGONAL HESSIAN APPROXIMATION
text: As discussed in Bordes et al. (2009), designing an efficient stochastic quasi-Newton algorithm involves a careful trade-off between the sparsity of the approximation matrix Bt and the quality of
its approximation of the Hessian Ht, and diagonal approximation is a reasonable choice (Becker et al., 1988; Zhu et al., 1999). If B is chosen to be a diagonal matrix satisfying (5), one can obtain a formula similar to the SGD-QN algorithm (Bordes et al., 2009).
An alternative of the secant equation in the updating formula (5), as first introduced by Nazareth (1995), is the weak secant equation (Dennis & Wolkowicz, 1993):
Bt+1 = argmin B
‖B −Bt‖
s.t. sTt Bt+1st = s T t yt (weak secant equation)
(6)
The motivation of using the weak secant condition in diagonal quasi-Newton method is straightforward: the standard mean-value theorem might not necessarily hold for vector-valued functions expressed in the secant equation, Bt+1st = yt ≈ ∇2f(θt)st. Thus, we do not know whether there exists a vector θ̃ ∈ Rd such that yt = ∇2f(θ̃)st (Dennis & Moré, 1977). On the other hand, the Taylor theorem ensures that there exists such θ̃ that sTt yt = s T t ∇2f(θ̃)st, leading to the reasonable assumption of the weak secant condition (6).
Based on the variational technique (Zhu et al., 1999), the solution of (6) with Frobenius norm is:
Λ , Bt+1 −Bt = sTt yt − sTt Btst ‖st‖44 Diag(s2t ) (7)
where s2t is the element-wise square vector of st, Diag(s 2 t ) is the diagonal matrix with diagonal elements from vector s2t , and ‖ · ‖4 is the 4-norm of a vector.
Parameter-Wise Weak Secant Condition. However, in optimization problems with highdimensional parameter space, such as training deep neural networks with millions of parameters, the weak secant condition might be too flexible to produce a good Hessian approximation. In the setting of decoupled parameters (§2.1), we propose a parameter-wise version of the weak secant equation to achieve a trade-off between the secant and weak secant conditions: for each parameter θ(l) ∈ θ, we update B corresponding to θ(l) by solving (6) individually. Remarkably, the secant condition restricts B with an equation of a d-dimensional vector, while the weak secant condition relaxes it with a 1-dimensional scalar. The parameter-wise weak secant condition expresses the restriction as a l-dimension vector (1 < l < d), resulting in a reasonable trade-off. The updating formula is the same as (7) for each parameter-wise B.

heading: 3.2 STEPSIZE BIAS CORRECTION
text: To mitigate the stochastic variance problem in stochastic quasi-Newton methods, APOLLO utilizes stepsize bias correction on the stochastic gradients at each step t. We know that the optimal stepsize ηt equals to 1 w.r.t the quadratic approximation underlying Newton’s method, if the Hessian approximation Bt and the stochastic gradient gt are close to the exact Hessian Ht and gradient ∇f(θt), respectively. Inspired by this, we correct the stepsize bias in the stochastic gradient gt by replacing it with a corrected gradient g′t = ηtgt. Together with the corresponding corrected y′t = g ′ t+1 − g′t = ηtyt, we correct the updating term Λ of Bt in (7) by replacing yt with y′t:
Λ′ = sTt y ′ t − sTt Btst ‖st‖44 Diag(s2t ) = − dTt yt + d T t Btdt ‖dt‖44 Diag(d2t ) (8)
where dt = −st/ηt = B−1t gt is the corrected update direction. Note that after applying the step bias correction, the update formula of Bt in (8) is independent with the stepsize ηt, eliminating the stepsize bias. Technically, the stepsize bias correction is designed to reduce the stochastic variance, rather than entirely discarding the stepsize. The APOLLO algorithm (Algorithm 1) still incorporates the stepsize at every iteration to enforce convergence.
Based on previous studies, incorporating exponential moving averages (EMVs) for the stochastic gradients significantly reduces the variance (Kingma & Ba, 2015). We follow these works and apply EMV to gt, together with the initialization bias correction:
mt+1 = β(1− βt) 1− βt+1 mt + 1− β 1− βt+1 gt+1 (9)
where 0 < β < 1 is the decay rate of EMV and yt in (8) is written as mt+1 −mt. Note that we do not apply moving average methods to the approximated Hessian, though the diagonal matrix is easier to be explicitly formed to average than full matrices. Investigating the moving average of the diagonal Bt might be an interesting direction of future work.
Algorithm 1: APOLLO, our proposed algorithm for nonconvex stochastic optimization. All operations on vectors are element-wise. Good default settings are β = 0.9 and = 1e−4. Initial: m0, d0, B0 ← 0, 0, 0 // Initialize m0, d0, B0 to zero while t ∈ {0, . . . , T} do
for θ ∈ {θ1, . . . , θL} do gt+1 ← ∇ft(θt) // Calculate gradient at step t mt+1 ← β(1−β t) 1−βt+1 mt + 1−β 1−βt+1 gt+1 // Update bias-corrected moving
average
α← d T t (mt+1−mt)+d T t Btdt
(‖dt‖4+ )4 // Calculate coefficient of B update
Bt+1 ← Bt − α ·Diag(d2t ) // Update diagonal Hessian Dt+1 ← rectify(Bt+1, 0.01) // Handle nonconvexity dt+1 ← D−1t+1mt+1 // Calculate update direction θt+1 ← θt − ηt+1dt+1 // Update parameters
end end

heading: 3.3 RECTIFIED ABSOLUTE VALUE OF HESSIAN FOR NONCONVEXITY
text: To guarantee convergence, quasi-Newton methods require the approximated Hessian matrix Bt to be positive definite at each step. The common strategy in previous studies is to solve the updating formula in (5) by restricting the candidate matrix B to be symmetric positive definite. It is known that the BFGS update preserves the positive-definiteness of Bt+1 as long as the curvature condition sTt yt > 0 holds, which can be guaranteed for strongly convex problem. For nonconvex problem, the curvature condition can be satisfied by performing a line search, which is, however, expensive or even infeasible in stochastic setting, because the exact function values and gradient information are unavailable. Wang et al. (2017) proposed the stochastic damped L-BFGS (SdLBFGS) method that implicitly generates a positive definite matrix without line search. However, it usually requires large history size (m ≥ 100) to guarantee convergence, which is infeasible for large-scale optimization. To handle nonconvexity, we adopt a different strategy that does not require the solution of Bt in (5) to be positive definite. Intuitively, we search for Bt that is a good approximation of the real Hessian, which is not necessarily positive definite in nonconvex problem. When we use Bt as preconditioning to calculate the update direction, we use its absolute value: |Bt| = √ BTt Bt, where √ · is the positive definite square root of a matrix. The motivation of absolute value is straight-forward: for dimensions with large absolute values of curvature, the objective function could be very sharp and we would prefer to take relatively smaller steps than those flatter dimensions. Since APOLLO formulate Bt as a diagonal matrix, the cost of computing |Bt| is marginal.
Rectified Absolute Value of Bt For nonconvex objective functions, there exist inflection points whose curvatures are zero. To prevent the steps from becoming arbitrarily large, we rectify the absolute value of Bt with a convexity hyper-parameter σ:
Dt = rectify(Bt, σ) = max(|Bt|, σ) (10) where the rectify(·, σ) function is similar to the rectified linear unit (ReLU) (Nair & Hinton, 2010) with threshold set to σ. The update direction in (8) is then dt = D−1t mt.
AdaHessian (Yao et al., 2020) used an idea similar to the absolute values ofBt to handle nonconvexity, where the root mean square averaging is applied to compute the Hessian diagonal. Different from APOLLO, AdaHessian requires second-order information to compute the Hessian matvec oracle and approximate the Hessian diagonal using Hutchinson’s method, which is significantly more costly.

heading: 3.4 INITIALIZATION
text: The rectified Dt in (10) introduces one more hyper-parameter σ, limiting the application of APOLLO in practice. In this section, we show that the zero initialization approach in APOLLO, which initializes the moving average of gradientm0, the parameter update direction d0 and the diagonal approximation of Hessian B0 as (vector of) zeros, leads to coupled stepsize η and convexity σ, allowing us to eliminate one hyper-parameter of η or σ.
Coupled Stepsize η and Convexity σ. With the zero initialization ofm0, d0 andB0, the following theorem illustrates the relation between η and σ (details in Appendix A): Theorem 1. Given zero initialization of m0, d0, and B0 and a fixed parameter intialization θ0. Suppose that we have two sets of hyper-parameters η, σ and η′, σ′ with the same ratio: ησ = η′
σ′ . Then the convergence trajectories of these two sets of hyper-parameters are exactly the same:
θt = θ ′ t, ∀t ∈ {1, . . . , T}. (11)
where θt and θ′t are the parameters of (η, σ) and (η ′, σ′) at iteration t, respectively.
From Theorem 1, we observe that η and σ are coupled with each other and in practice we only need to tune one of them, leaving the other fixed. Therefore, in our experiments (§4), we fix σ = 0.01 and tune η on different problems1.
Learning Rate Warmup for APOLLO As discussed in Kingma & Ba (2015), zero initialization leads to estimations biased towards zero in the initial iterations. For the moving average mt, this bias can be corrected by dividing the bias-correction term (9). For dt and Bt, however, we cannot derive such bias correction terms. Fortunately, a simple linear warmup heuristic of η at the beginning iterations achieves remarkably stable training.

heading: 3.5 CONVERGENCE ANALYSIS
text: Similar to previous work (Reddi et al., 2018; Chen et al., 2019; Zhuang et al., 2020), we omit the initialization bias correction step, i.e. we use mt = βtmt−1 + (1− βt)gt, 0 < βt < 1, ∀t ∈ [T ]. We first analyze the convergence of APOLLO in convex optimization using the online learning framework (Zinkevich, 2003) for a sequence of convex cost functions f1(θ), f2(θ), . . . , fT (θ). Theorem 2. (Convergence in convex optimization) Let {θt} be the sequence from APOLLO. Suppose ηt =
η√ t , 0 < βt ≤ β ≤ 1 ‖gt‖2 ≤ G, ‖Dt−1‖1ηt−1 ≤ ‖Dt‖1 ηt , ‖θt − θt′‖2 ≤ D, ∀t, t′ ∈ [T ]. For θt generated with the APOLLO algorithm, we have the following bound on the regret:
RT ≤ √ TD2‖DT ‖1 2η(1− β) + ηG2 1− β (2 √ T − 1) + D 2 2(1− β) T∑ t=1 β2t ηt
(12)
The following result falls as an immediate corollary of the above result. Corollary 2.1. Suppose βt = βλt−1, 0 < λ < 1 in Theorem 2, we have
RT ≤ √ TD2‖DT ‖1 2η(1− β) + ηG2 1− β (2 √ T − 1) + D 2β2 2η(1− β)(1− λ2)2 (13)
Theorem 2 implies the regret of APOLLO is upper bounded by O( √ T ). The conditions for Corollary 2.1, as in Reddi et al. (2018), can be relaxed to βt = β/t and still ensures a regret of O( √ T ).
For nonconvex case, we analyze the convergence rate of APOLLO with the similar derivations of that in Chen et al. (2019), since APOLLO belongs to the family of generalized Adam-type methods: Theorem 3. (Convergence in nonconvex stochastic optimization) Under the assumptions: • f is lower bounded and differentiable; ‖∇f(θ)−∇f(θ′)‖2 ≤ L‖θ− θ′‖2, ‖Dt‖∞ < L,∀t, θ, θ′. • Both the true and stochastic gradient are bounded, i.e. ‖∇f(θt)‖2 ≤ H, ‖gt‖2 ≤ H, ∀t. • Unbiased and independent noise in gt, i.e. gt = ∇f(θt) + ζt, E[ζt] = 0, and ζi ⊥ ζj , ∀i 6= j. Assume ηt = η√t , βt ≤ β ≤ 1 in non-increasing, Dt−1,j ηt−1 ≤ Dt,jηt , ∀t ∈ [T ], j ∈ [d], then:
min t∈[T ]
E [ ‖∇f(θt)‖22 ] ≤ L√
T (C1η
2H2(1 + log T ) + C2dη + C3dη 2 + C4) (14)
where C1, C2, C3 are constants independent of d and T , C4 is a constant independent of T , the expectation is taken w.r.t all the randomness corresponding to {gt}. Theorem 3 implies the convergence rate for APOLLO in the non-convex case is O(log T/ √ T ), which is similar to Adam-type optimizer (Reddi et al., 2018; Chen et al., 2019). In addition, unlike Theorem 3.1 in Chen et al. (2019), Theorem 3 does not specify the bound of each update ‖ηtmt/Dt‖2. This is because that, with conditions ηt ≤ η, ‖gt‖2 ≤ H and Dt ≥ 1, it is straight-forward to derive the bound of ‖ηtmt/Dt‖2 ≤ ηH = G.
1We changed σ from 1 to 0.01 to make η in a suitable range. See Appendix E.4 for details.

heading: 4 EXPERIMENTS
text: To evaluate APOLLO, we conduct experiments on four benchmark datasets across three tasks of CV and NLP that are commonly used to evaluate optimization algorithms: CIFAR-10 (Krizhevsky & Hinton, 2009) and ImageNet (Deng et al., 2009) for image classification; One Billion Words (Chelba et al., 2013) for language modeling; and WMT 2014 English-German for neural machine translation. The five baseline methods we compare with are SGD with momentum (Bottou & Bousquet, 2008), Adam (Kingma & Ba, 2015), Rectified Adam (RAdam) (Liu et al., 2020), AdaBelief (Zhuang et al., 2020), and AdaHessian (Yao et al., 2020). Following Loshchilov & Hutter (2019), we decouple weight decays in Adam, RAdam, AdaBelief and AdaHessian in all the experiments2. For each experiment, we report the average over 5 runs. More detailed descriptions, results and analysis of the conducted experiments are provided in Appendix E.
4.1 IMAGE CLASSIFICATION
We begin our experiments with an evaluation of the convergence and generalization performance on image classification. We use ResNet-1103 for CIFAR-10 and standard ResNeXt-50 (Xie et al., 2017) for ImageNet, respectively. The results on CIFAR-10 and ImageNet are presented in Figure 1 and Table 1, together with the five baselines. For each optimizer, we use two scheduling strategies of learning rate decay: i) milestone that decays the learning rate at the end of some predefined epochs; and ii) cosine annealing schedule proposed in Loshchilov & Hutter
(2017). All the optimization methods are comprehensively tuned, especially for the learning rate and the rate of weight decay. It is because that the strength of weight decay regularization is co-related with the learning rate, even though the decoupled weight decay technique (Loshchilov & Hutter, 2019) has been applied. The tuning information and the model details are provided in the Appendix E.1.
From Figure 1 and Table 1, we see that APOLLO outperforms the four first-order methods (SGD, Adam, RAdam and AdaBelief) on both the convergence speed and classification accuracy, demonstrating its effectiveness on training the ResNet architectures based on convolutional neural networks (CNNs) (LeCun et al., 1989). Comparing with AdaHessian, APOLLO obtains better test accuracy with similar convergence speed. Note that AdaHessian requires second-order information and is significantly more costly (detailed comparison of time and memory costs in Appendix F.3). Thus, we omit AdaHessian from the following experiments in the rest of this paper.
2For AdaBelief, we also tried standard L2 regularization. But the accuracies are consistently worse than the models with decoupled weight decay.
3ResNet-110 is a modified (small) version of ResNet-18 to adapt the image size 32× 32 in CIFAR-10.
Robustness to Learning Rate Change. Besides performance improvements, we also investigate the robustness of different optimization methods to the change of learning rate. For each optimizer, we use the learning rate in the previous experiment (Table 1) as the base, i.e. 0.1 for SGD, 0.001 for Adam and RAdam, and 0.01 for APOLLO. Then, we explore different learning rates that are α times of the base learning rate, with α ∈ {0.2, 1.0, 2.0, 10.0}. As mentioned above, we observed that the strength of weight decay regularization is co-related with the learning rate, even for Adam and RAdam with decoupled weight decay (Loshchilov & Hutter, 2019). To eliminate the impact of weight decay, we adjust the weight decay rates according to the factor α. Experimental results with ResNet-110 on CIFAR-10 are summarized in Figure 2. After correcting the impact of weight decay, all the optimization methods, except SGD with α = 10.0, achieve consistent model performance, while APOLLO slightly improves the robustness of model training over the three baseline methods.

heading: 4.2 LANGUAGE MODELING
text: To evaluate APOLLO on Recurrent Neural Networks (RNNs) that are applied in a wide range of NLP tasks (Graves, 2013), we conduct experiments on the One Billion Words dataset (Chelba et al., 2013), using a two-layer LSTM network for language modeling (details in Appendix E.2).
Figure 3 and Table 2 illustrate the perplexity (PPL) of training and test for APOLLO and four baseline methods, including SGD, Adam, RAdam and AdaBelief. As shown in Figure 3, although APOLLO is slower than Adam-type methods in the first few updates, its convergence is much faster after that. On generalization performance, APOLLO achieves significant improvements (more than 4.0 PPL points on test data) over Adam and RAdam. In addition, APOLLO also outperforms AdaBelief, which obtains the lowest PPL among the three Adam-type optimization methods4. This demonstrates the effectiveness of APOLLO on training LSTM-based neural architectures.
Training Stability. From the middle plot of Figure 3 we see that the training losses of Adam and RAdam may suddenly increase. This occurred in all the runs of experiments using Adam and RAdam, and we selected these successfully converged — the loss went back to normal after some updates, and discarded those that failed to converge — the model crashed due to loss numerical overflow. The models optimized with APOLLO never suffered from this issue, demonstrating its stability.
4We found that AdaBelief is very sensitive to the value of . The result in Table 2 is obtained using = 1e−12. With other values, e.g. 1e−8 or 1e−16, the PPL points of AdaBelief are even higher than Adam and RAdam. See Appendix E.2 for the details of hyper-parameter tuning.
4.3 NEURAL MACHINE TRANSLATION
Table 3: Test BLEU.
Method BLEU
SGD 26.59±0.07 Adam 27.84±0.12 RAdam 28.15±0.15 AdaBelief 28.14±0.11 APOLLO 28.34±0.10 To evaluate APOLLO on Attention-based Transformer architecture (Vaswani et al., 2017), we train the Transformer-base model on the WMT2014 English-German (EN-DE) dataset (around 4.5M sentence pairs). We use the same data preprocessing steps as in Ma et al. (2019) (details in Appendix E.3). We compare APOLLO with the same four baseline methods in the experiments of language modeling. For each experiment, we report the mean and standard variance over 5 runs. From Table 3, the first interesting observation is that SGD performs much worse than Adam-type methods (which is opposite to its behaviour for ResNet- and LSTM-based neural architectures). Similar observations about SGD were reported in (Yao et al., 2020; Zhang et al., 2020). Despite this, APOLLO obtains improvements over all the baseline methods for NMT with transformers.

heading: 5 RELATED WORK
text: Stochastic Quasi-Newton Methods. In the literature of (nonconvex) stochastic quasi-Newton methods, several algorithms have been developed recently for large-scale machine learning problems: oLBFGS (Schraudolph et al., 2007; Mokhtari & Ribeiro, 2015), RES (Mokhtari & Ribeiro, 2014), SFO (Sohl-Dickstein et al., 2014), SQN (Byrd et al., 2016), SdLBFGS (Wang et al., 2017), and AdaQN (Keskar & Berahas, 2016), among which only SdLBFGS and AdaQN are designed to solve nonconvex optimization problems. The SdLBFGS algorithm carefully controls the quality of modified BFGS updates to preserve the positive-definiteness of Bt in (5) without line search. AdaQN shares a similar idea but is specifically designed for RNNs by refining the initial L-BFGS scaling, step acceptance control and choice of curvature information matrix, and adopting the SQN framework (Byrd et al., 2016). Different from these two methods, APOLLO does not require Bt in (5) to be positive definite, but replacing it with its rectified absolute value to handle nonconvexity. Moreover, both SdLBFGS and AdaQN use the updating formula similar to L-BFGS and require even larger history size (commonly ≥ 100) to guarantee convergence, preventing them from being applied to large-scale optimization. For comprehensive comparison of SdLBFGS with Apollo, we conducted experiments with small toy CNN models (details in Appendix G).
Adaptive First-Order Methods. From the diagonal approximation of Hessian, APOLLO is also related to those diagonally-scaled first-order algorithms, such as AdaGrad (Duchi et al., 2011), RMSProp (Tieleman & Hinton, 2012), AdaDelta (Zeiler, 2012), and Adam (Kingma & Ba, 2015). Subsequently, a number of techniques have emerged to theoretically justify and algorithmically improve Adam, including AMSGrad (Reddi et al., 2018), AdaBound (Luo et al., 2019), RAdam (Liu et al., 2020) and AdaBelief (Zhuang et al., 2020). The main difference is that the diagonal preconditioning in APOLLO is directly derived from the quasi-Newton updating formula (6). In terms of memory efficiency, Anil et al. (2019) and Chen et al. (2020) further reduces the memory cost of adaptive methods, and Agarwal et al. (2019) proposed efficient full-matrix adaptive regularization.
Stochastic Second-Order Hessian-Free Methods. Stochastic Second-Order Hessian-Free methods (Martens, 2010; Martens & Sutskever, 2011) implicitly solve quadratic models using matrix-vector products. Dauphin et al. (2014) argued the existence of saddle points and proposed a method to rapidly escape them. K-FAC (Martens & Grosse, 2015) computes a second-order step by constructing an invertible approximation of the Fisher information matrix in an online fashion. Shampoo (Gupta et al., 2018) approximates the Fisher information matrix using low-rank decomposition. Recently, Yao et al. (2020) proposed AdaHessian, which approximates the Hessian diagonal using Hutchinson’s method. These second-order methods differ from APOLLO mainly in the request of second-order information of the objective function at each iteration.

heading: 6 CONCLUSION AND EXTENSIONS
text: We have introduced APOLLO, a simple and computationally efficient quasi-Newton algorithm for nonconvex stochastic optimization. This method is aimed towards large-scale optimization problems in the sense of large datasets and/or high-dimensional parameter spaces such as machine learning with deep neural networks. Experimental results on three CV and NLP tasks demonstrate the effectiveness of APOLLO, in terms of both convergence speed and generalization performance. In Appendix C, we briefly outline a few extensions to APOLLO that we want to explore in future work.

Review summaries:
The paper proposes a Quasi-Newton inspired optimization algorithm for Stochastic Optimization named APOLLO. It adjusts a previously known update formula to better suit Deep Learning by using 1) a layer-wise diagonal approximation to the Hessian, 2) an exponential average of gradients to address the noise. Overall the algorithm shows promising results on the assigned experiments.

This paper presents the optimization method Apollo, a quasi-Newton method that relies on a parameter-wise version of the weak secant condition to allow for a diagonal approximation of the Hessian. Additionally, the issue of a potentially non-PSD approximation is addressed by replacing the approximation with a rectified absolute value. While the combination of techniques is interesting, my main hesitation comes from the limited discussion concerning other quasi-Newton methods for the same problem setting.

The paper developed a new quasi-Newton algorithm for stochastic non-convex optimization. In contrast to existing works, it uses a (rectified/capped) diagonal matrix to approximate the Hessian, and incorporated techniques to reduce the stochastic variance. It shows first-order convergence guarantee of the algorithm and provided empirical evaluation on 2 CV and 2 NLP datasets.

The paper presents a diagonal quasi-Newton method, by approximating the Hessian with a diagonal matrix. The paper proves a regret bound for the method in the convex case, and shows that in the non-convex setting the expected norm of the gradients goes to 0. The paper then provides experimental results on two image datasets, a small translation task and a small language modeling task.  

This work proposes a quasi-Newton method APOLLO for nonconvex stochastic optimization. Based on a parameter-wise weak secant condition, a diagonal approximation of the Hessian is constructed, and rectified absolute value is adopted on the approximation. A step-size bias correction technique is used to mitigate stochastic gradient variance. Theoretical convergence analysis is provided under a convex online setting and a nonconvex stochastic setting. Experiments on CV and NLP tasks demonstrate the effectiveness and stability of the proposed method.

This paper presents a first-order quasi-Newton method, named APOLLO, for solving stochastic nonconvex finite sum problems with a large number of data points. Each iteration of the method consists of computing a sparse and positive definite (diagonal) approximation of the objective function's Hessian, followed a quasi-Newton step. A regret bound is established for the convex setting and a complexity bound is established for the nonconvex setting, based on prior results on Adam-type optimizers. Finally, a comprehensive set of numerical experiments on three common tasks in vision and language is presented to show the superiority of the proposed method.