Convergence Properties of Stochastic Hypergradients
Riccardo Grazzi, Massimiliano Pontil, Saverio Salzo
TL;DR
This work addresses the challenge of efficiently computing hypergradients in bilevel problems where the lower-level constraint is a fixed-point mapping $w(\lambda)=\Phi(w(\lambda),\lambda)$. It introduces Stochastic Implicit Differentiation (SID), a fully stochastic variant of approximate implicit differentiation that uses two stochastic solvers to approximate the inner fixed-point and the associated linear system, and provides a solver-agnostic bound on the mean-square error of the hypergradient estimator. The analysis combines a non-asymptotic bound for stochastic fixed-point iterations with a bias-variance decomposition of the hypergradient estimator, showing convergence to the true gradient as inner accuracies improve. Empirical results on hyperparameter tuning tasks, including regularized logistic regression on MNIST and multinomial tasks on MNIST and Twenty Newsgroups, demonstrate that SID can outperform deterministic AID baselines in large-scale regimes. These findings enable scalable and accurate bilevel optimization for hyperparameter selection and meta-learning in data-rich settings.
Abstract
Bilevel optimization problems are receiving increasing attention in machine learning as they provide a natural framework for hyperparameter optimization and meta-learning. A key step to tackle these problems is the efficient computation of the gradient of the upper-level objective (hypergradient). In this work, we study stochastic approximation schemes for the hypergradient, which are important when the lower-level problem is empirical risk minimization on a large dataset. The method that we propose is a stochastic variant of the approximate implicit differentiation approach in (Pedregosa, 2016). We provide bounds for the mean square error of the hypergradient approximation, under the assumption that the lower-level problem is accessible only through a stochastic mapping which is a contraction in expectation. In particular, our main bound is agnostic to the choice of the two stochastic solvers employed by the procedure. We provide numerical experiments to support our theoretical analysis and to show the advantage of using stochastic hypergradients in practice.
