Abstract
Bilevel optimization is a core component of modern machine learning workflows, including hyperparameter tuning, meta-learning, and neural architecture search. Despite its importance, these problems are computationally demanding because the outer optimization step depends on the optimal solution of an inner problem. We present the Stochastic Recursive Bilevel Algorithm (SRBA), a variance-reduced method designed for bilevel empirical risk minimization. SRBA achieves a sample complexity of $O((n + m)^{1/2} \epsilon^{-1})$, which we prove is near-optimal by establishing a matching lower bound. Our results suggest that bilevel optimization can be performed with the same theoretical efficiency as standard single-level nonconvex optimization.
1. Introduction
Bilevel optimization involves minimizing an outer objective function $F$ subject to an inner optimization constraint $G$. Formally: $$\min_{x} h(x) = F(z^*(x), x) \quad \text{s.t.} \quad z^*(x) = \arg\min_{z} G(z, x)$$ The primary challenge lies in computing the gradient of the value function $h(x)$, known as the hypergradient. This requires solving a linear system involving the Hessian of the inner function $G$. In large-scale settings with millions of samples, exact computation is infeasible, leading to the development of various stochastic approximation methods.
2. The SRBA Algorithm
We introduce SRBA (Stochastic Recursive Bilevel Algorithm), which leverages variance reduction to improve convergence rates. Unlike traditional nested-loop approaches, SRBA employs a simultaneous update strategy for three variables: the inner variable $z$, a linear system surrogate $v$, and the outer variable $x$.
The algorithm's efficiency stems from three key components:
- Simultaneous Updates: By updating $z, v,$ and $x$ in parallel, SRBA maintains a "warm-start" for the inner problem, avoiding the need to solve it from scratch at each outer iteration.
- Recursive Gradient Estimation: Inspired by the SARAH algorithm, SRBA uses recursive estimators for the inner gradient, the linear system direction, and the hypergradient. These estimators are periodically reset with full-batch gradients to maintain accuracy while using small batches for intermediate steps.
- Stability via Projection: To ensure robust convergence, the linear system variable $v$ is projected onto a bounded ball, a technique justified by the boundedness of the true solution $v^*(x)$ under standard regularity assumptions.
3. Theoretical Analysis and Optimality
A central contribution of this work is the characterization of the sample complexity for bilevel empirical risk minimization. We demonstrate that SRBA achieves a complexity of $O((n + m)^{1/2} \epsilon^{-1})$, where $n$ and $m$ are the number of samples in the outer and inner problems, respectively.
As shown in Table 1, SRBA improves upon previous state-of-the-art methods like SABA by a factor of $(n+m)^{-1/6}$. Furthermore, we prove a lower bound of $\Omega(m^{1/2} \epsilon^{-1})$ for linear bilevel algorithms, confirming that SRBA is near-optimal. This result is significant as it matches the lower bound for single-level nonconvex optimization, implying that the nested structure does not inherently degrade the optimal scaling with respect to the number of samples.
4. Experimental Evaluation
We evaluated SRBA against several baseline solvers, including SABA, AmIGO, and VRBO, across synthetic and real-world datasets such as IJCNN1 and MNIST.
In our experiments on hyperparameter selection for $\ell_2$-regularized logistic regression (IJCNN1), SRBA exhibited significantly faster convergence than AmIGO and VRBO. While its performance was comparable to SABA in early stages, SRBA consistently reached lower error levels and showed greater stability across different random seeds.
5. Conclusion
SRBA represents a significant step forward in making bilevel optimization practical for large-scale machine learning. By hitting the theoretical "speed limit," it provides a robust and efficient tool for complex nested optimization tasks. Future work will focus on relaxing the requirement for inner strong convexity to accommodate deep learning applications where the inner task is non-convex.
Summary updated