arXiv reader

Accelerating Stochastic Recursive and Semi-stochastic Gradient Methods with Adaptive Barzilai-Borwein Step Sizes

Jiangshan Wang, Yiming Yang and Zheng Peng

arXiv
2307.13930v2 · PDF · 23 October 2023
Categories
math.OC
Licence
CC BY SA 4.0 The site shows the text.

Abstract

The mini-batch versions of StochAstic Recursive grAdient algoritHm and Semi-Stochastic Gradient Descent method, employed the random Barzilai-Borwein step sizes (shorted as MB-SARAH-RBB and mS2GD-RBB), have surged into prominence through timely step size sequence. Inspired by modern adaptors and variance reduction techniques, we propose two new variant rules in the paper, referred to as RHBB and RHBB+, thereby leading to four algorithms MB-SARAH-RHBB, MB-SARAH-RHBB+, mS2GD-RHBB and mS2GD-RHBB+ respectively. RHBB+ is an enhanced version that additionally incorporates the importance sampling technique. They are aggressive in updates, robust in performance and self-adaptive along iterative periods. We analyze the flexible convergence structures and the corresponding complexity bounds in strongly convex cases. Comprehensive tuning guidance is theoretically provided for reference in practical implementations. Experiments show that the proposed methods consistently outperform the original and various state-of-the-art methods on frequently tested data sets. In particular, tests on the RHBB+ verify the efficacy of applying the importance sampling technique to the step size level. Numerous explorations display the promising scalability of our iterative adaptors.

Items 13

Assumption

Assumption 2a (Strong convexity I)

3Q7T

P(w) is \mu-strongly convex, i.e., there exists \mu>0 such that, for all w, w^{\prime} \in \text{dom}(P)

(\nabla P(w)-\nabla P(w^{\prime}))^T(w-w^{\prime}) \geq \mu\|w-w^{\prime}\|^2.
Assumption

Assumption 2b (Strong convexity II)

0I6F

Each component f_i is \mu-strongly convex, i.e., there exists \mu>0 for each f_i such that for all w, w^{\prime} \in \text{dom}(f_i)

(\nabla f_i(w)-\nabla f_i(w^{\prime}))^T(w-w^{\prime}) \geq \mu\|w-w^{\prime}\|^2.
Remark

Remark

1Q77

At beginning of each epoch s, the constant step sizes \eta_0^s and \tilde{\eta}_0^s are used in the first deterministic step of full pass. Our RHBB or RHBB+ are placed in following stochastic stages to match stochastic recursive or semi-stochastic estimators and create smooth paths for the convergence. Distribution Q can be tailored to the needs of particular data sets.

Assumption

Assumption 3 (Uniform boundness)

CT0V

The iterative adaptor h(\cdot) is continuous over the bounded closed domain, monotone decreasing with respect to the epoch count s and the inner count k, i.e., there exist constants \hat{\alpha}, \tilde{\alpha} such that

1<\tilde{\alpha}<\alpha^{h(\sigma_1s+\sigma_2k)}<\hat{\alpha}.
Lemma

Lemma 1

OI81

Suppose that Assumption 1, 2a and 3 hold. The subsets S, S_1, S_2 are selected uniformly at random of size b, b_1, b_2 respectively. Then, for any s\geq1 in MB-SARAH-RHBB, we have

\begin{aligned} & \sum_{k=0}^m \mathbb{E}\left[\left\|\nabla P\left(w_k^s\right)\right\|^2\right] \leq \frac{2 \mu \overline{b} L}{\hat{\alpha} \gamma L+(1-\tilde{\alpha})\gamma\mu} \mathbb{E}\left[P\left(w_0^s\right)-P\left(w_*\right)\right] \\ & +\sum_{k=0}^m \mathbb{E}\left[\left\|\nabla P\left(w_k^s\right)-v_k^s\right\|^2\right]-\left(1-\frac{\hat{\alpha} \gamma L^2+(1-\tilde{\alpha}) \gamma L \mu}{\mu \overline{b} L}\right) \sum_{k=0}^m \mathbb{E}\left[\left\|v_k^s\right\|^2\right]. \end{aligned}

Furthermore, if Assumption 2b holds, and the subsets S_1 and S_2 are sampled according to the probability distribution Q of size b_1 and b_2. For any s\geq1 in MB-SARAH-RHBB+, we have

\begin{aligned} & \sum_{k=0}^m \mathbb{E}\left[\left\|\nabla P\left(w_k^s\right)\right\|^2\right] \leq \frac{2 \mu_q \overline{b} L_q}{\hat{\alpha} \gamma L_q+(1-\tilde{\alpha})\gamma\mu_q} \mathbb{E}\left[P\left(w_0^s\right)-P\left(w_*\right)\right] \\ & +\sum_{k=0}^m \mathbb{E}\left[\left\|\nabla P\left(w_k^s\right)-v_k^s\right\|^2\right] - \left(1-\frac{\hat{\alpha} \gamma L L_q+(1-\tilde{\alpha}) \gamma L \mu_q}{\mu_q \overline{b} L_q}\right) \sum_{k=0}^m \mathbb{E}\left[\left\|v_k^s\right\|^2\right]. \end{aligned}
Uses Assumption 3 · Used by Proof
Proof of Lemma 1

Deferred to the Appendix A.

Next, we prove that the deviation (expected distance) of the full gradient to the recursive estimates is upper bounded within the s-th epoch (inner loop).

Lemma.

Suppose that Assumption 1, 2a hold. The subsets S, S_1, S_2 are selected uniformly at random of size b, b_1, b_2, respectively. Within the s-th epoch of MB-SARAH-RHBB, for any 1\leq k \leq m, we have

\mathbb{E}\left[\left\|\nabla P\left(w_k^s\right)-v_k^s\right\|^2\right] \leq \frac{n-b}{b\left(n-1\right)}\left(\frac{\hat{\alpha}\gamma L^2+\left(1-\tilde{\alpha}\right)\gamma\mu L}{\overline{b} \mu L}\right)^2\sum_{j=1}^k \mathbb{E}\left[\left\|v_{j-1}^s\right\|^2\right].

If Assumption 2b holds further and the subsets S_1, S_2 are sampled according to the probability distribution Q. Within the s-th epoch of MB-SARAH-RHBB+, for any 1\leq k \leq m, we then have

\mathbb{E}\left[\left\|\nabla P\left(w_k^s\right)-v_k^s\right\|^2\right] \leq \frac{L_r^2\left(n-b\right)}{b\left(n-1\right)}\left(\frac{\hat{\alpha}\gamma L_q + (1-\tilde{\alpha})\gamma \mu_q }{\overline{b} \mu_q }\right)^2\sum_{j=1}^k \mathbb{E}\left[\left\|v_{j-1}^s\right\|^2\right].
Proof

Proof

26OO

Deferred to the Appendix B.

By employing Lemma 1 and Lemma Proof, we are adequate to provide the theoretical analysis of inner loops in Theorem Proof.

Theorem.

Suppose that Assumption 1, 2a hold. Pick the subsets S, S_1, S_2 \subset \{1, \ldots, n\} of size b, b_1, b_2 uniformly at random. Parameters b, \gamma are chosen under a simple and suitable condition (This condition will be specified as (?) in Appendix C.). Within the s-th epoch of MB-SARAH-RHBB, for any finite m>1, we have

\mathbb{E}\left[\left\|\nabla P\left(w_m^s\right)\right\|^2\right] \leq \frac{2 \overline{b} \mu L}{\gamma(m+1)(\hat{\alpha} L+(1-\tilde{\alpha})\mu)}\left[P\left(w_0^s\right)-P\left(w_*\right)\right].

If Assumption 2b holds further and the subsets S_1, S_2 are sampled according to the probability distribution Q. Parameters b, \gamma are chosen under another simple and suitable condition (The condition will be specified as (?) in Appendix C.). Within the s-th epoch of MB-SARAH-RHBB+, for any finite m>1, we thus have

\mathbb{E}\left[\left\|\nabla P\left(w_m^s\right)\right\|^2\right] \leq \frac{2 \overline{b} \mu_q L_q}{\gamma(m+1)(\hat{\alpha} L_q+(1-\tilde{\alpha})\mu_q)}\left[P\left(w_0^s\right)-P\left(w_*\right)\right].
Uses Lemma 1
Proof

Proof

BPD2

Deferred to the Appendix C.

Theorem Proof shows sublinear convergence rates of the inner loops, i.e., the inner \{\left\|\nabla P\left(w_k^s\right)\right\|^2\} converges sublinearly in expectation with increasing m. Indeed, we’re sufficient to fix s=1 to dispose of the outer epoch, Algorithm ? degenerates to MB-SARAH-IN-RHBB/RHBB+ (see [nguyen2] for reference). To obtain an \varepsilon-accurate solution in MB-SARAH-IN-RHBB, the number of iterations, m, is put up so that \mathbb{E}\left[\|\nabla P(w_m)\|^2\right] \leq \varepsilon, which suggests that

\frac{2 \overline{b} \mu L}{\gamma\left(m+1\right)\left(\hat{\alpha} L+\left(1-\tilde{\alpha}\right)\mu\right)}\left[P\left(w_0\right)-P\left(w_*\right)\right] \leq \varepsilon.

Assume that P\left(w_0\right)-P\left(w_*\right)=\sigma, (?) implies m_{RH} = \lceil \frac{2\overline{b}\mu \sigma\kappa}{\varepsilon \gamma\left(\hat{\alpha} \kappa+1-\tilde{\alpha}\right)}-1\rceil. Compare with m_{R} = \lceil \frac{2\overline{b}\mu \sigma}{\varepsilon \gamma}-1\rceil in [yang], we have \left(m_{RH}<m_{R}\right) due to L > \mu. In MB-SARAH-RHBB+, that’s m_{RH+} = \lceil \frac{2\overline{b}\mu_q \sigma\kappa^+}{\epsilon \gamma(\hat{\alpha} \kappa^+ +1-\tilde{\alpha})}-1\rceil to achieve the same \varepsilon-accuracy. Regardless of rounding errors, it’s very likely that m_{RH+}\leq m_{RH}.

Ineq. (?) indicates that we can locally manipulate \hat{\alpha}, \tilde{\alpha} in the early epochs (e.g., by temporarily using a different h) to address the issue of a poor initial w_0^0 (or w_0^s) with an unexpectedly large \sigma. To our best know, this issue can not be effectively resolved in many existing methods, e.g., [yang] [yang3] [nguyen] [nguyen2] [yangy] [liu3].

For a class of ill-conditioned objective functions P(\cdot) under L \gg \mu, (?) implies m_{RH+}+1\leq m_{RH}+1\approx \frac{1}{\hat{\alpha}}\left(m_{R}+1\right), suggesting the inner speedup is approximately proportional to \mathcal{O}\left(\frac{1}{\hat{\alpha}}\right). In ill-conditioning, we tolerate towards the functional form and the decay rate of h, but remain focus on \hat{\alpha}.

Next, we evaluate the workload in terms of incremental first order oracle (IFO) complexity model in Agarwal et al.[agarwal]. In [ghadimi], it’s SFO under stochastic settings. MB-SARAH-RHBB/RHBB+ are IFO algorithms that are specified through calls to an IFO, regardless of P(\cdot). Each epoch invokes SFO at most 2bm times in the recursive gradient evaluations (?), corresponding to an overall cost of \mathcal{O}\left(n+2bm\right) SFOs. Since the adaptor h is mentor-specified, we can force \hat{\alpha} and \tilde{\alpha} to be arbitrarily large and small. By setting L+\frac{1-\tilde{\alpha}}{\hat{\alpha}}\mu=\mathcal{O}\left(L\right) and L_q+\frac{1-\tilde{\alpha}}{\hat{\alpha}}\mu_q=\mathcal{O}\left(L_q\right), it’s sufficient to have m =\mathcal{O}\left(\frac{\overline{b}\mu}{\varepsilon \gamma\hat{\alpha}}\right) and m =\mathcal{O}\left(\frac{\overline{b}\mu_q}{\varepsilon \gamma\hat{\alpha}}\right). Therefore, we obtain the following conclusions for the complexity bounds.

Corollary.

Suppose Assumption 1 and 2a hold. MB-SARAH-IN-RHBB converges sublinearly in expectation with a rate of \mathcal{O}\left(\mu\overline{b} / \gamma m \hat{\alpha}\right), and the complexity to achieve an \varepsilon-accurate solution is in the order of n+2bm=\mathcal{O}\left(n+\frac{b\overline{b}\mu}{\varepsilon \gamma\hat{\alpha}}\right). Suppose Assumption 2b holds further. MB-SARAH-IN-RHBB+ owns sublinear convergence rate of \mathcal{O}\left(\overline{b}\mu_q/\gamma m \hat{\alpha}\right), and the complexity for the \varepsilon-accuracy corresponds to n+2bm=\mathcal{O}\left(n+\frac{b\overline{b}\mu_q}{\varepsilon \gamma\hat{\alpha}}\right) units of work.

On the basis of Theorem Proof, we can proceed to the analysis of multiple outer steps, and we establish the convergence of MB-SARAH-RHBB and MB-SARAH-RHBB+ in subsequent Theorem ?.

Theorem.

Suppose that Assumption 1, 2a hold. Pick the subsets S, S_1, S_2 \subset\{1, \ldots, n\} of size b, b_1, b_2 uniformly at random, and we choose b, \gamma that satisfy condition (?). In MB-SARAH-RHBB, for any s>1, we have

\mathbb{E}\left[\left\|\nabla P\left(\widetilde{w}_s\right)\right\|^2\right] \leq\left(\frac{\kappa\overline{b}}{\gamma\left(m+1\right)\left(\hat{\alpha}\kappa+1-\tilde{\alpha}\right)}\right)^s\left\|\nabla P\left(\widetilde{w}_0\right)\right\|^2.

If Assumption 2b holds further and the subsets S_1, S_2 are sampled according to the probability distribution Q, and we choose b, \gamma that satisfy condition (?). In MB-SARAH-RHBB+, for any s>1, we have

\mathbb{E}\left[\left\|\nabla P\left(\widetilde{w}_s\right)\right\|^2\right] \leq\left(\frac{\mu_r\kappa^+\overline{b}}{\gamma\left(m+1\right)\left(\hat{\alpha}\kappa^++1-\tilde{\alpha}\right)}\right)^s\left\|\nabla P\left(\widetilde{w}_0\right)\right\|^2 .
Proof

Proof

WQ5F

Deferred to the Appendix D.

Theorem ? indicates that the outer \{\left\|\nabla P\left(\widetilde{w}_s\right)\right\|^2\} converges linearly in expectation. Assume that \left\|\nabla P\left(\widetilde{w}_0\right)\right\|^2=\zeta, to obtain \mathbb{E}\left[\left\|\nabla P\left(\widetilde{w}_s\right)\right\|^2\right] <\varepsilon in MB-SARAH-RHBB, the number of outer epoch s must satisfy

\left(\frac{\kappa\overline{b}}{\gamma\left(m+1\right)\left(\hat{\alpha}\kappa+1-\tilde{\alpha}\right)}\right)^s\cdot\zeta\leq \varepsilon.

It infers s_{RH}=\lceil \frac{log(\zeta)-log(\varepsilon)}{log(\hat{\alpha}\kappa+1-\tilde{\alpha})-log(\kappa)+log(\gamma(m+1))-log(\overline{b})}\rceil. Compared to [yang] with s_{R}=\lceil\frac{log(\zeta)-log(\epsilon)}{log(\gamma(m+1))-log(\overline{b})}\rceil, the overhead of the outer epoch decreases. In MB-SARAH-RHBB+, both \mu_r\leq1, \kappa^+\geq\kappa implies s_{RH+}\leq s_{RH}, indicating the iterative cost can be further reduced via the effective sampling. In ill-conditioning, we then have s_{RH^+}\leq s_{RH}\approx\lceil\frac{log(\zeta)-log(\varepsilon)}{log(\hat{\alpha})+log(\gamma(m+1))-log(\overline{b})}\rceil.

Furthermore, our analysis can be refined to obtain smaller rate constants in some gradient dominated scenarios (see in Polyak et al.[polyak], Reddi et al. [reddi]). If P(\cdot) is \delta-gradient dominated with \delta<\frac{1}{2\mu}, we derive the rate constants

\rho'_{RH}=\frac{2\overline{b}\mu L\delta}{\gamma(m+1)\left(\hat{\alpha}L+(1-\tilde{\alpha})\mu\right)}, \quad \rho'_{RH+}=\frac{2 \overline{b} \mu_q L_q\delta}{\gamma(m+1)(\hat{\alpha} L_q+(1-\tilde{\alpha})\mu_q)},

for MB-SARAH-RHBB and MB-SARAH-RHBB+, respectively. The theoretical convergence speed further increases in virtue of 2\mu\delta<1.

Corollary.

Suppose that Assumption 1 and 2a hold. MB-SARAH-RHBB converges linearly with the total complexity to achieve an \varepsilon-accurate solution as \mathcal{O}\left(\left(n+\frac{b\overline{b}\mu}{\varepsilon \gamma\hat{\alpha}}\right)\log(1/\varepsilon)\right). Suppose that Assumption 2b holds further. MB-SARAH-RHBB+ obtain linear convergence rate, and the overall complexity for the same \varepsilon-accuracy is of order \mathcal{O}\left(\left(n+\frac{b\overline{b}\mu_q}{\varepsilon \gamma\hat{\alpha}}\right)\log\left(1/\varepsilon\right)\right).

Compared with MB-SARAH [nguyen2], MB-SARAH-RBB [yang], MB-SARAH-HD [yang5], iSARAH-BB [yangy], Corollary ? indicates that MB-SARAH-RHBB/RHBB+ have lower complexity when using an appropriate adaptor h(\cdot) and a proper \overline{b}.

Lemma

Lemma 3

QHLA

Suppose that Assumption 1, 2a hold. The subset S is selected uniformly at random with size b. Then, we have an upper bound for the semi-stochastic estimate \tilde{v} (?) as follows

\mathbb{E}\left[\left\|\tilde{v}_k^s\right\|^2\right] \leq \frac{4 L}{b}\left[P\left(w_{k-1}^s\right)\!-P\left(w_*\right)\!+P(\widetilde{w}_{s-1})\!-P\left(w_*\right)\right] \\ +\frac{2}{b}\left\|\nabla P\left(w_{k-1}^s\right)\right\|^2 .
Proof of Lemma 3

Deferred to the Appendix E.

Based on Lemma 3, we present subsequent Theorem 3 to demonstrate the linear convergence of mS2GD-RHBB and mS2GD-RHBB+.

Theorem.

Suppose that Assumption 1, 2a hold. Let \kappa_r=\hat{\alpha}\kappa+1-\tilde{\alpha}, and pick the subsets S, S_1, S_2 \subset\{1, \ldots, n\} of size b, b_1, b_2 uniformly at random. Assume that b\overline{b}>4\kappa_r\gamma_2, and h(\cdot) is chosen such that

\tilde{\rho}_1=\frac{\kappa b \overline{b}^2}{m\gamma_2\kappa_r\left(b \overline{b}-4\gamma_2\kappa_r\right)}+\frac{2\gamma_2 \kappa_r}{b \overline{b}-4\gamma_2\kappa_r}<1.

Then, mS2GD-RHBB converges linearly in expectation with rate \tilde{\rho}_1, that’s

\mathbb{E}\left[P\left(\widetilde{w}_s\right)\right]-P\left(w_*\right) \leq (\tilde{\rho}_{1})^s\left[P\left(\widetilde{w}_0\right)-P\left(w_*\right)\right].

If Assumption 2b holds further, let \kappa_r^+=\hat{\alpha} \kappa^+ +1-\tilde{\alpha}, and sample the subsets S_1, S_2 \subset\{1, \ldots, n\} according to the probability distribution Q. Assume that b\overline{b}>4\kappa_r^+\gamma_2L_r, and h(\cdot) is chosen such that

\tilde{\rho}_{2}=\frac{\mu_r\kappa^+b\overline{b}^2}{m\gamma_2\kappa_r^+\left(b \overline{b}-4\gamma_2\kappa_r^+ L_r\right)}+\frac{2 \gamma_2\kappa_r^+L_r}{b \overline{b}-4\gamma_2\kappa_r^+L_r}<1.

Then, mS2GD-RHBB+ converges linearly in expectation with rate \tilde{\rho}_2, that’s

\mathbb{E}\left[P\left(\widetilde{w}_s\right)\right]-P\left(w_*\right) \leq (\tilde{\rho}_{2})^s\left[P\left(\widetilde{w}_0\right)-P\left(w_*\right)\right].
Proof

Proof

12O1

Deferred to the Appendix F.

Corollary

Corollary 3

0B4U

Suppose that Assumption 1 and 2a hold. The complexity of mS2GD-RHBB to achieve an \varepsilon-accurate solution is \mathcal{O}\left(\left(n+\frac{b\overline{b}}{\gamma_2\tilde{\alpha}}\kappa\right)log\left(\frac{1}{\varepsilon}\right)\right). Supposethat Assumption 2b holds further. To obtain an \varepsilon-accurate solution, the overall complexity of mS2GD-RHBB+ is of order \mathcal{O}\left(\left(n+\frac{b\overline{b}}{L_{r}\gamma_2\tilde{\alpha}}\kappa\right)log\left(\frac{1}{\varepsilon}\right)\right).

Source and licence

The text on this page is from arXiv:2307.13930v2 by Jiangshan Wang, Yiming Yang and Zheng Peng, under the licence CC BY SA 4.0. The corpus made these changes: it read the items out of the LaTeX source, it expanded the macros of the paper, it put each proof after its statement, and it converted the text to HTML. The formulas are the TeX of the paper, and KaTeX renders them. A formula or a reference can look different from the PDF. The page is published under CC BY SA 4.0.

The record of each item is in analysis/objects/2307/2307.13930.jsonl.