In standard machine learning, we typically minimize a simple average of loss functions. However, many modern problems—ranging from reinforcement learning and portfolio management to distributionally robust optimization—require minimizing "nested" functions. These problems take the form $f(g(x))$, where both the inner function $g$ and the outer function $f$ are expectations or finite sums.
While this structure seems like a minor variation of standard optimization, it introduces a fundamental mathematical hurdle: biased gradient estimates. Recent research has focused on overcoming this bias by integrating variance reduction techniques, transforming slow, sublinear algorithms into fast, linearly converging ones.
The Bias Bottleneck
To understand why nested problems are difficult, consider the gradient of the composition $F(x) = f(g(x))$. By the chain rule, the gradient is: $$\nabla F(x) = \nabla g(x)^\top \nabla f(g(x))$$
In a stochastic setting, we don't have access to the exact $g(x)$ or its Jacobian $\nabla g(x)$. Instead, we use samples. If we simply plug a stochastic estimate $\hat{g}(x)$ into the gradient formula, we get $\nabla \hat{g}(x)^\top \nabla f(\hat{g}(x))$.
The problem is that even if $\hat{g}(x)$ is an unbiased estimate of $g(x)$, the term $\nabla f(\hat{g}(x))$ is generally a biased estimate of $\nabla f(g(x))$ because the gradient of $f$ is usually nonlinear. As Junyu Zhang notes in A Stochastic Composite Gradient Method with Incremental Variance Reduction, this structural bias prevents standard stochastic gradient descent (SGD) from converging quickly, often forcing it into slow $O(T^{-1/2})$ or $O(T^{-2/3})$ regimes.
Tracking the Inner State
The core intuition behind solving this is that we cannot treat each sample in isolation. To eliminate bias, we must ensure that our estimate of the inner function $g(x)$ becomes increasingly accurate as the optimization progresses.
Researchers like Xiangru Lian, Mengdi Wang 0001, and Ji Liu 0002 pioneered this by applying Stochastic Variance Reduced Gradient (SVRG) logic to the nested structure. In Finite-sum Composition Optimization via Variance Reduced Gradient Descent, they demonstrate that by maintaining a "snapshot" of the inner function and its Jacobian, the algorithm can systematically diminish the estimation error.
Instead of just sampling, these algorithms maintain separate variance-reduced estimators for two distinct components:
- The Inner Value: An estimate of $g(x)$ that tracks the state of the nested expectation.
- The Jacobian: An estimate of $\nabla g(x)$ that tracks the sensitivity of the inner function.
By forcing the error in these estimates to zero over time, the bias in the overall gradient estimate also vanishes. This allows the algorithm to use a constant learning rate, leading to the first instances of linear convergence for finite-sum composition problems.
From Duality to Robustness
The power of this approach is most evident in complex objective functions like those found in Distributionally Robust Optimization (DRO). In DRO, we seek to minimize the worst-case loss over a set of possible distributions, a task that naturally forms a compositional structure.
Ronak Mehta and colleagues introduced the Prospect algorithm in Distributionally Robust Optimization with Bias and Variance Reduction, which implements simultaneous bias and variance reduction. They show that addressing only one of these factors is insufficient; you must reduce the variance of the samples and the bias of the composition to achieve optimal rates.
Similarly, Adithya M. Devraj and Jianshu Chen explored this through a primal-dual lens in Stochastic Variance Reduced Primal Dual Algorithms for Empirical Composition Optimization. By reformulating the nested objective as a saddle-point (min-max) problem and applying variance reduction to both primal and dual variables, they achieved linear convergence for strongly convex problems, proving that the "nestedness" of a problem is not an inherent barrier to efficiency.
Handling Non-Smoothness and Constraints
The framework has proven robust even when the problems are not perfectly smooth. Bin Gu, Zhouyuan Huo, and Heng Huang extended these ideas to problems with nonsmooth regularization (like L1 penalties) in Accelerated Method for Stochastic Composition Optimization With Nonsmooth Regularization. Their VRSC-PG algorithm uses historical states to bound the bias, allowing proximal gradient methods to function effectively in the compositional setting.
Even in extreme cases, such as probability maximization where the objective is defined via Minkowski functionals, the principle holds. Afrooz Jalilzadeh and Uday Shanbhag showed in Probability Maximization via Minkowski Functionals that variance reduction can make even these non-trivial, non-convex probability tasks tractable by iteratively refining the inner expectation estimate.
Summary of Intuition
The transition from standard stochastic optimization to compositional optimization is a transition from unbiased sampling to stateful tracking.
- The Problem: Nonlinearity in the outer function $f$ turns unbiased samples of the inner function $g$ into biased estimates of the total gradient.
- The Mechanism: Variance reduction (SVRG, SAGA, or SARAH-style estimators) is used to "warm up" and maintain an accurate estimate of the inner function's value and Jacobian.
- The Result: As the inner estimate's variance drops, the outer gradient's bias disappears, enabling the fast convergence rates (linear or $O(1/T)$) previously reserved for simpler, non-nested problems.