betaFeedback

WorksMathematics

Optimal Momentum Methods for Stochastic Multilevel Compositional Optimization

Abstract

This paper investigates stochastic multi-level optimization where the objective is a nested composition of several smooth non-convex functions. We assume that only stochastic estimates of the gradient and function values for each level are accessible. Consequently, obtaining an accurate estimate of the overall gradient is challenging due to the nested structure. To address this, we employ a momentum-based estimator with mini-batches to track the function values of each level, which are subsequently used to construct momentum gradient estimators. We establish an optimal sample complexity of O(ε−4)\mathcal{O}(ε^{-4}) for finding an εε-stationary point, avoiding the stronger average smoothness assumption commonly relied upon in prior literature. Furthermore, by employing a normalization technique, we attain the same rate without requiring problem-dependent constants to set hyperparameters. To achieve the optimal rate without mini-batches, we further develop a batch-free method that incorporates a first-order approximation and a clipping technique for function value estimation. Finally, we validate the effectiveness of our proposed methods through experiments on risk-averse portfolio optimization and hierarchical tilted empirical risk minimization.

Introduction

In this paper, we study stochastic multi-level compositional optimization (Yang et al., 2019; Chen et al., 2021; Zhang & Xiao, 2021; Balasubramanian et al., 2022; Jiang et al., 2025}) of the form

min⁡xF(x)=fT∘⋯∘f1(x).(1)\min_x F(x) = f_T \circ\cdots\circ f_1(x). \tag*{(1)}

Here, the objective is a nested composition of TT smooth and non-convex functions. We assume that only unbiased stochastic estimates are available for the function values and gradients at each level ii, denoted as fi(⋅;ξi)f_i(\cdot;\xi_i) and ∇fi(⋅;ξi)\nabla f_i(\cdot;\xi_i), such that Eξi[fi(⋅;ξi)]=fi(⋅)\mathbb{E}_{\xi_i}[f_i(\cdot;\xi_i)] = f_i(\cdot) and Eξi[∇fi(⋅;ξi)]=∇fi(⋅)\mathbb{E}_{\xi_i}[\nabla f_i(\cdot;\xi_i)] = \nabla f_i(\cdot).

Multi-level optimization enjoys broad applications in machine learning, including risk-averse optimization ([3, 23]), reinforcement learning ([9]), model-agnostic meta-learning ([14]), graph neural network training ([7]), stochastic variational inequalities ([22]), adversarial attacks and defenses in deep neural networks ([27]), risk management ([6, 10]), and hierarchical tilted empirical risk minimization ([19, 20]). Unlike traditional single-level stochastic optimization, where unbiased stochastic gradient evaluations are readily available, obtaining an unbiased estimate of the overall gradient and function value is generally infeasible in multi-level problems. This difficulty stems from the nested composition structure, specifically:

EξT,…,ξ2,ξ1[fT(⋯f2(f1(x;ξ1);ξ2)⋯ ;ξT)]≠EξT[fT(⋯Eξ2[f2(Eξ1[f1(x;ξ1)];ξ2)]⋯ ;ξT)].\mathbb{E}_{\xi_T,\ldots,\xi_2,\xi_1}\left[f_T\left(\cdots f_2\left(f_1(x;\xi_1);\xi_2\right)\cdots;\xi_T\right)\right] \ne\mathbb{E}_{\xi_T}\left[f_T\left(\cdots\mathbb{E}_{\xi_2}\left[f_2\left(\mathbb{E}_{\xi_1}\left[f_1(x;\xi_1)\right];\xi_2\right)\right]\cdots;\xi_T\right)\right].

Furthermore, estimation errors can accumulate as the composition depth increases, making the problem more challenging. To improve sample complexity, existing literature often imposes additional average smoothness and average Lipschitz conditions ([5, 17] (Zhang & Xiao 2021)), which require that stochastic estimates of each layer be smooth and Lipschitz continuous. However, in single-level stochastic optimization, it is well known that momentum-based methods can achieve the optimal sample complexity of O(ϵ−4)O(\epsilon^{-4}) under standard smoothness assumptions (rather than the stronger average smoothness condition). This motivates the following question: Is it possible to obtain the optimal rate in stochastic multi-level optimization without these additional assumptions?

In this work, we answer this question affirmatively by proving the optimal O(ϵ−4)O(\epsilon^{-4}) sample complexity using a simple momentum-based approach with mini-batches. Our analysis avoids the restrictive average smoothness and Lipschitz continuous conditions. Furthermore, we provide a normalized variant that eliminates the need for prior knowledge of problem-dependent constants when setting hyperparameters. Finally, to avoid large batches, we develop a batch-free method that leverages first-order approximation together with clipping, preserving the optimal sample complexity with a constant batch size. To summarize, our main contributions are as follows:

  • Our proposed MML method uses momentum-based estimators to track function values and gradients, obtaining the optimal O(ϵ−4)O(\epsilon^{-4}) sample complexity with mini-batches. Our analysis does not rely on the average smoothness and Lipschitz continuity used in previous literature.

  • Employing a normalization technique, our MML-v2 removes the reliance on problem-dependent constants to set hyperparameters while preserving optimal sample complexity.

  • To avoid large batches, the proposed MMLFA method uses a first-order approximation for function-value tracking, combined with a clipping operation to control the estimator range. This design allows us to maintain the optimal rate with a constant batch size.

  • We validate the effectiveness of the proposed methods through numerical experiments on risk-averse portfolio optimization and hierarchical tilted empirical risk minimization.

Related Work

In this section, we review related work on stochastic multi-level optimization and its decentralized/federated variants.

Multi-level Optimization

Multi-level compositional optimization was first investigated by Yang et al. [26], who developed stochastic methods based on an extrapolation-interpolation scheme. They established a sample complexity of O(ϵ−(7+T)/2)O(\epsilon^{-(7+T)/2}) for non-convex objectives and O(ϵ−(3+T)/4)O(\epsilon^{-(3+T)/4}) for strongly convex objectives. To further improve the convergence rate, Chen et al. [5] proposed the stochastically corrected stochastic compositional gradient method, deriving a sample complexity of O(ϵ−4)O(\epsilon^{-4}). However, their analysis requires the stronger average smoothness assumption, which is typically used to obtain improved O(ϵ−3)O(\epsilon^{-3}) rates via variance reduction. Concurrently, Balasubramanian et al. [2] obtained O(ϵ−6)O(\epsilon^{-6}) sample complexity for a momentum-based method with mini-batches and improved the rate to O(ϵ−4)O(\epsilon^{-4}) using linearized stochastic estimates. However, their analysis neglects dependency issues, rendering the results invalid (a detailed discussion is provided in the appendix). To enhance the rate under the average smoothness assumption, Zhang & Xiao [28] introduced the normalized proximal approximate gradient method, which evaluates gradients via nested variance reduction with large batch sizes. They achieved a total sample complexity of O(ϵ−3)O(\epsilon^{-3}) in the expectation setting, and O(n+nϵ−2)O(n+\sqrt{n}\epsilon^{-2}) for the finite-sum structure, where nn denotes the number of component functions across all levels. Similar results were obtained by Jiang et al. [15, 17] using a constant batch size, further deriving optimal rates for convex and strongly convex functions.

Beyond smooth non-convex settings, Ruszczyński [22] considered non-smooth non-convex multi-level optimization, assuming that functions at each level are locally Lipschitz continuous and differentiable in a generalized sense. For smooth and convex problems, Zhang & Lan (2025) proposed a stochastic sequential dual method, achieving a sample complexity of O(ϵ−2)O(\epsilon^{-2}). Constrained multi-level optimization has also been studied recently. Xiao et al. [24] proposed a projection-free conditional gradient-type algorithm, attaining O(ϵ−2)O(\epsilon^{-2}) and O(ϵ−3)O(\epsilon^{-3}) complexities for stochastic first-order and linear-minimization oracles. Following this, Jiang et al. [16] presented a comprehensive study on projection-free methods, covering non-convex, convex, and strongly convex objectives. Recent studies have also focused on analyzing stability and generalization performance ([21]) and extending multi-level optimization to minimax settings (Zhang & Gao, 2025).

Decentralized/Federated Multi-level Optimization

Multi-level optimization has also been widely studied in decentralized and federated environments. Gao [12] first studied decentralized stochastic multi-level optimization, proposing two algorithms that achieve level-independent convergence rates for non-convex problems under milder conditions. For smooth and strongly convex objectives, Yang & Li [25] proposed the federated stochastic compositional gradient extrapolation method. Based on a double-loop strategy, this method attains an optimal O(log⁡(1/ϵ))\mathcal{O}(\log(1/\epsilon)) communication complexity while maintaining an almost optimal O~(1/ϵ)\widetilde{\mathcal{O}}(1/\epsilon) sample complexity. To address imbalanced data classification in federated learning, Zhang et al. [30] developed a federated multi-level compositional minimax algorithm for AUC maximization, equipped with rigorous theoretical guarantees. To achieve linear speedup under heterogeneous settings, Gao [11] developed a federated stochastic multi-level algorithm based on a Jacobian-vector product estimator and proved level-independent convergence for non-convex objectives.

Momentum-based Multi-level Algorithm

In this section, we first outline the assumptions used and then present the proposed momentum-based methods, followed by their convergence guarantees.

Assumptions

We adopt the following assumptions, which are standard in stochastic multi-level optimization ([26, 5, 2, 17] (Zhang & Xiao 2021)).

Assumption 3.1. Denote F⋆=min⁡xF(x)F_{\star} = \min_{\boldsymbol{x}} F(\boldsymbol{x}) and suppose F(x1)−F⋆≤ΔFF(\boldsymbol{x}^{1}) - F_{\star} \le\Delta_{F} for the initial point x1\boldsymbol{x}^{1}.

Assumption 3.2. All functions f1,…,fTf_{1},\ldots,f_{T} are LfL_{f}-Lipschitz continuous, and their gradients ∇f1,…,∇fT\nabla f_{1},\ldots,\nabla f_{T} are also LJL_{J}-Lipschitz continuous.

Remark: Under Assumption 3.2, the objective FF is LFL_{F}-smooth, where LF:=Lf2T−1LJ∑i=1TLf−iL_{F} := L_{f}^{2T-1}L_{J}\sum_{i=1}^{T}L_{f}^{-i}.

Assumption 3.3. The function and gradient estimates are unbiased with bounded variance, i.e.,

Eξ[fi(x;ξ)]=fi(x),Eξ[∇fi(x;ξ)]=∇fi(x),\mathbb{E}_{\xi}[f_i(\boldsymbol{x};\xi)] = f_i(\boldsymbol{x}), \qquad\mathbb{E}_{\xi}[\nabla f_i(\boldsymbol{x};\xi)] = \nabla f_i(\boldsymbol{x}),
Eξ[∥fi(x;ξ)−fi(x)∥2]≤σ2,Eξ[∥∇fi(x;ξ)−∇fi(x)∥2]≤σ2.\mathbb{E}_{\xi}\left[\left\|f_i(\boldsymbol{x};\xi)-f_i(\boldsymbol{x})\right\|^2\right] \le\sigma^2,\qquad\mathbb{E}_{\xi}\left[\left\|\nabla f_i(\boldsymbol{x};\xi)-\nabla f_i(\boldsymbol{x})\right\|^2\right] \le\sigma^2.

Remark: These assumptions are standard in traditional stochastic compositional optimization. Some existing multi-level literature ([5, 17] (Zhang & Xiao 2021)) requires the stronger average smoothness and Lipschitz condition, namely, for each 1≤i≤T1 \le i \le T:

Eξ[∥fi(x;ξ)−fi(y;ξ)∥2]≤Lf2∥x−y∥2,Eξ[∥∇fi(x;ξ)−∇fi(y;ξ)∥2]≤LJ2∥x−y∥2.\mathbb{E}_{\xi}\left[\left\|f_i(\boldsymbol{x};\xi)-f_i(\boldsymbol{y};\xi)\right\|^2\right] \le L_f^2\|\boldsymbol{x}-\boldsymbol{y}\|^2,\qquad\mathbb{E}_{\xi}\left[\left\|\nabla f_i(\boldsymbol{x};\xi)-\nabla f_i(\boldsymbol{y};\xi)\right\|^2\right] \le L_J^2\|\boldsymbol{x}-\boldsymbol{y}\|^2.

However, this assumption is not required in our work.

The Proposed Method

We now present our algorithm for stochastic multi-level optimization. In traditional stochastic non-convex optimization ([18, 8]), we can directly access an unbiased stochastic gradient estimate of the overall objective ∇F(x)\nabla F(\boldsymbol{x}). However, this is no longer possible in multi-level optimization, even though unbiased estimates of the function and gradient at each individual layer are available. Since the overall gradient ∇F(x)\nabla F(\boldsymbol{x}) typically involves nested expectations, multiplying the stochastic gradients of each layer via the chain rule, i.e., ∏i=1T∇fi(x;ξi)\prod_{i=1}^{T}\nabla f_i(\boldsymbol{x};\xi_i), yields only a biased estimation, potentially resulting in significant error. This limitation arises from the nested nature of the problem, since Eξ,ζ[f2(f1(x;ζ);ξ)]≠Eξ[f2(Eζ[f1(x;ζ)];ξ)]\mathbb{E}_{\xi,\zeta}[f_2(f_1(\boldsymbol{x};\zeta);\xi)] \ne\mathbb{E}_{\xi}[f_2(\mathbb{E}_{\zeta}[f_1(\boldsymbol{x};\zeta)];\xi)].

To address this issue, we first provide a detailed analysis of the gradient estimation error. For clarity, we consider the simple two-level case where T=2T=2. The objective function is F(x)=Eξ[f2(Eζ[f1(x;ζ)];ξ)]F(\boldsymbol{x}) = \mathbb{E}_{\xi}[f_2(\mathbb{E}_{\zeta}[f_1(\boldsymbol{x};\zeta)];\xi)], and its gradient is ∇F(x)=Eξ[∇f2(Eζ[f1(x;ζ)];ξ)]⋅Eω[∇f1(x;ω)]\nabla F(\boldsymbol{x}) = \mathbb{E}_{\xi}[\nabla f_2(\mathbb{E}_{\zeta}[f_1(\boldsymbol{x};\zeta)];\xi)] \cdot\mathbb{E}_{\omega}[\nabla f_1(\boldsymbol{x};\omega)]. Note that there exist three distinct expectations Eξ,Eζ,Eω\mathbb{E}_{\xi}, \mathbb{E}_{\zeta}, \mathbb{E}_{\omega}. To construct an effective gradient Algorithm 1 MML method

  1. Input: parameters η\eta, α\alpha

  2. for time step k=1k = 1 to KK do

  3. Set u00=xku_0^0 = x^k

  4. Compute the function estimator according to equation (2)

  5. Compute the gradient estimator zkz^k according to equation (3)

  6. (v1) Update the weight: xk+1=xk−ηzkx^{k+1} = x^k - \eta z^k

  7. (v2) Update the weight: xk+1=xk−ηzk∥zk∥x^{k+1} = x^k - \eta\frac{z^k}{\lVert z^k\rVert}

  8. end for

estimator, we must derive accurate estimates of the gradients Eξ[∇f2(⋅;ξ)]⋅Eω[∇f1(⋅;ω)]\mathbb{E}_{\xi}[\nabla f_2(\cdot;\xi)] \cdot\mathbb{E}_{\omega}[\nabla f_1(\cdot;\omega)] and the inner function values Eζ[f1(⋅;ζ)]\mathbb{E}_{\zeta}[f_1(\cdot;\zeta)]. Therefore, we first employ a momentum-based estimator to track the function values of each layer ii at time step kk:

uik=(1−α)uik−1+α1B1∑j=1B1fi(ui−1k−1;ξi,jk),(2)u_i^k = (1-\alpha)u_i^{k-1} + \alpha\frac{1}{B_1}\sum_{j=1}^{B_1} f_i(u_{i-1}^{k-1};\xi_{i,j}^k), \tag*{(2)}

References

  1. [1]Yossi Arjevani, Yair Carmon, John C. Duchi, Dylan J. Foster, Nathan Srebro, and Blake E. Woodworth. Lower bounds for non-convex stochastic optimization. ArXiv e-prints, arXiv:1912.02365, 2019.arxiv.org/abs/1912.02365
  2. [2]Krishnakumar Balasubramanian, Saeed Ghadimi, and Anthony Nguyen. Stochastic multilevel composition optimization algorithms with level-independent convergence rates. SIAM Journal on Optimization, 32(2):519–544, 2022.arxiv.org/abs/2008.10526
  3. [3]Sergio Bruno, Shabbir Ahmed, Alexander Shapiro, and Alexandre Street. Risk neutral and risk averse approaches to multistage renewable investment planning under uncertainty. European Journal of Operational Research, 250(3):979–989, 2016.DOI
  4. [4]Chih-Chung Chang and Chih-Jen Lin. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1–27:27, 2011.
  5. [5]Tianyi Chen, Yuejiao Sun, and Wotao Yin. Solving stochastic compositional optimization is nearly as easy as solving stochastic optimization. IEEE Transactions on Signal Processing, 69:4937–4948, 2021.DOI
  6. [6]Shawn Cole, Xavier Giné, and James Vickery. How Does Risk Management Influence Production Decisions? Evidence from a Field Experiment. The Review of Financial Studies, 30(6):1935–1970, 2017.
  7. [7]Weilin Cong, Rana Forsati, Mahmut Kandemir, and Mehrdad Mahdavi. Minimal variance sampling with provable guarantees for fast training of graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1393–1403, 2020.arxiv.org/abs/2006.13866
  8. [8]Ashok Cutkosky and Francesco Orabona. Momentum-based variance reduction in non-convex SGD. In Advances in Neural Information Processing Systems 32, pp. 15210–15219, 2019.arxiv.org/abs/1905.10018
  9. [9]Christoph Dann, Gerhard Neumann, and Jan Peters. Policy evaluation with temporal differences: a survey and comparison. Journal of Machine Learning Research, 15:809–883, 2014.DOI
  10. [10]Darinka Dentcheva, Spiridon I. Penev, and A. Ruszczynski. Statistical estimation of composite risk functionals and risk optimization problems. Annals of the Institute of Statistical Mathematics, 69 (4):737–760, 2017.
  11. [11]Hongchang Gao. A doubly recursive stochastic compositional gradient descent method for federated multi-level compositional optimization. In Proceedings of the 41st International Conference on Machine Learning, volume 235, pp. 14540–14610, 2024a.
  12. [12]Hongchang Gao. Decentralized multi-level compositional optimization algorithms with level-independent convergence rate. In Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, pp. 4402–4410, 2024b.arxiv.org/abs/2306.03322
  13. [13]Florian Hübler, Junchi Yang, Xiang Li, and Niao He. Parameter-agnostic optimization under relaxed smoothness. In Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, pp. 4861–4869, 2024.arxiv.org/abs/2311.03252
  14. [14]Kaiyi Ji, Junjie Yang, and Yingbin Liang. Multi-step model-agnostic meta-learning: Convergence and improved algorithms. ArXiv e-prints, arXiv:2002.07836, 2020.
  15. [15]Wei Jiang, Bokun Wang, Yibo Wang, Lijun Zhang, and Tianbao Yang. Optimal algorithms for stochastic multi-level compositional optimization. In Proceedings of the 39th International Conference on Machine Learning, pp. 10195–10216, 2022.arxiv.org/abs/2202.07530
  16. [16]Wei Jiang, Sifan Yang, Wenhao Yang, Yibo Wang, Yuanyu Wan, and Lijun Zhang. Projection-free variance reduction methods for stochastic constrained multi-level compositional optimization. In Proceedings of the 41st International Conference on Machine Learning, pp. 21962–21987, 2024.arxiv.org/abs/2406.03787
  17. [17]Wei Jiang, Sifan Yang, Yibo Wang, Tianbao Yang, and Lijun Zhang. Revisiting stochastic multi-level compositional optimization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 47 (7):5613–5624, 2025.DOI
  18. [18]Diederik P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.arxiv.org/abs/1412.6980
  19. [19]Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. Tilted empirical risk minimization. In International Conference on Learning Representations, 2021.arxiv.org/abs/2007.01162
  20. [20]Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. On tilted losses in machine learning: Theory and applications. Journal of Machine Learning Research, 24(142):1–79, 2023.
  21. [21]Xiaokang Pan, Xingyu Li, Jin Liu, Tao Sun, Kai Sun, Lixing Chen, and Zhe Qǔ. Stability and generalization for stochastic recursive momentum-based algorithms for (Strongly-)Convex one to k-level stochastic optimizations. In Proceedings of the 41st International Conference on Machine Learning, pp. 39201–39275, 2024.
  22. [22]Andrzej Ruszczyński. A stochastic subgradient method for nonsmooth nonconvex multilevel composition optimization. SIAM Journal on Control and Optimization, 59(3):2301–2320, 2021.
  23. [23]Alexander Shapiro, Darinka Dentcheva, and Andrzej Ruszczyński. Lectures on Stochastic Programming: Modeling and Theory. Society for Industrial and Applied Mathematics, 2021.
  24. [24]Tesi Xiao, Krishnakumar Balasubramanian, and Saeed Ghadimi. A projection-free algorithm for constrained stochastic multi-level composition optimization. In Advances in Neural Information Processing Systems 35, pp. 19984–19996, 2022.
  25. [25]Shouguang Yang and Fengpei Li. A communication-efficient algorithm for federated multilevel stochastic compositional optimization. IEEE Transactions on Signal Processing, 72:2333–2347, 2024.
  26. [26]Shouguang Yang, Mengdi Wang, and Ethan X. Fang. Multilevel stochastic gradient methods for nested composition optimization. SIAM Journal on Optimization, 29(1):616–659, 2019.
  27. [27]Xiaoyong Yuan, Pan He, Qile Zhu, and Xiaolin Li. Adversarial examples: Attacks and defenses for deep learning. IEEE Transactions on Neural Networks and Learning Systems, 30(9):2805–2824, 2019.
  28. [28]Junyu Zhang and Lin Xiao. Multilevel composite stochastic optimization via nested variance reduction. SIAM Journal on Optimization, 31(2):1131–1157, 2021.
  29. [30]Xinwen Zhang, Ali Payani, Myungjin Lee, Richard Souvenir, and Hongchang Gao. A federated stochastic multi-level compositional minimax algorithm for deep AUC maximization. In Proceedings of the 41st International Conference on Machine Learning, volume 235, pp. 59601–59640, 2024.

Paper details

vlnc:W_4cra2nhk
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents