Abstract
We develop and analyze stochastic approximation algorithms for solving nested compositional bi-level optimization problems. These problems involve a nested composition of $T$ potentially non-convex smooth functions in the upper-level, and a smooth and strongly convex function in the lower-level. Our proposed algorithm does not rely on matrix inversions or mini-batches and can achieve an $\epsilon$-stationary solution with an oracle complexity of approximately $\tilde{O}_T(1/\epsilon^{2})$, assuming the availability of stochastic first-order oracles for the individual functions in the composition and the lower-level, which are unbiased and have bounded moments. Here, $\tilde{O}_T$ hides polylog factors and constants that depend on $T$. The key challenge we address in establishing this result relates to handling three distinct sources of bias in the stochastic gradients. To demonstrate the effectiveness of our approach, we apply it to the problem of robust feature learning for deep neural networks under covariate shift, showcasing the benefits and advantages of our methodology in that context.
Introduction
Most machine learning tasks involve minimizing a single loss function. However, "bi-level" optimization is required when one task depends on the optimal solution of another, such as in hyperparameter tuning or meta-learning. This paper addresses a significantly more complex variant: Nested Compositional Bi-level Optimization.
In this setup, the "outer" problem (e.g., learning features) depends on an "inner" problem (e.g., learning regression weights), and the outer objective is a chain of $T$ functions ($f_1 \circ f_2 \circ \dots \circ f_T$). This structure is particularly relevant for Distributionally Robust Optimization (DRO), where models must maintain performance despite shifts between training and test data distributions. The primary technical hurdle is managing "triple bias" arising from the compositional structure, the lack of an exact inner solution, and the approximations used to avoid computationally expensive matrix inversions.
The BiLiNASA Algorithm
The authors introduce BiLiNASA (Bi-level Linearized Nested Averaging Stochastic Approximation), a fully online, batch-free algorithm. Its architecture is built on three pillars:
- Nested Hypergradient Estimation (NHE): To avoid the $O(n^3)$ cost of inverting a Hessian matrix, BiLiNASA utilizes a Neumann series approximation. It employs a specific weighted average of stochastic Hessian-vector products to keep estimation bias controlled.
- Linearized Nested Averaging: To manage the $T$-layer composition, the algorithm maintains "averaging" variables that track function values at each level, effectively smoothing the noise inherent in stochastic samples.
- Fully Online & Batch-Free Operation: Unlike competing methods that require large mini-batches to stabilize gradients, BiLiNASA operates with single samples, making it highly memory-efficient for deep learning applications.
Theoretical Comparison
BiLiNASA achieves an $\epsilon$-stationary solution with an oracle complexity of $\tilde{O}_T(1/\epsilon^2)$. This matches the complexity of standard stochastic gradient descent (SGD) despite the added complexity of the nested bi-level structure.
As shown in the table above, BiLiNASA is the first method to achieve this optimal sample complexity while simultaneously supporting nested compositions ($T \ge 1$), avoiding matrix inversions, and functioning without mini-batches.
Robust Feature Learning under Covariate Shift
The effectiveness of BiLiNASA was evaluated through a robust feature learning simulation using a multi-index model. The model was trained on uniformly distributed data but tested on various Beta distributions to simulate "covariate shift."
- Superior Generalization: BiLiNASA consistently achieved lower test loss under covariate shift compared to standard optimizers like Adam and specialized bi-level optimizers like SOBA.
- Stability: The averaging mechanism in BiLiNASA resulted in significantly lower variance across trials compared to LiNASA (a non-bi-level compositional solver), demonstrating that the bi-level formulation is essential for robust learning.
Conclusion and Future Work
BiLiNASA provides a theoretically sound and computationally efficient framework for nested bi-level problems. While it achieves near-optimal convergence, the current analysis relies on the strong convexity of the lower-level problem. Future research may focus on relaxing this requirement, removing remaining polylogarithmic factors in the complexity, and scaling the nested architecture to massive models like Transformers.
Summary updated