Amortized Implicit Differentiation for Stochastic Bilevel Optimization

Michael Arbel, Julien Mairal

Introduction

Bilevel optimization involves solving nested problems where an outer-level objective depends on the solution to an inner-level problem. This structure is foundational to modern AI applications, including hyperparameter tuning, meta-learning, reinforcement learning, and dataset distillation. However, calculating the "hypergradient"—the gradient of the outer objective—is notoriously difficult. Standard methods either require differentiating through the entire inner optimization process (which is memory-intensive) or solving a complex linear system from scratch at every step (which is computationally expensive).

The AmIGO Framework

To address these challenges, the authors propose Amortized Implicit Gradient Optimization (AmIGO). AmIGO utilizes Approximate Implicit Differentiation (AID) with a novel dual warm-start strategy. Instead of re-initializing inner solvers at each outer step, AmIGO treats the inner variable ($y$) and the linear system variable ($z$) as dynamical systems that evolve alongside the outer parameters ($x$).

The AmIGO algorithm structure, highlighting the coupled evolution of variables x, y, and z.

This approach "amortizes" the cost of solving inner problems by spreading the work across multiple outer iterations. By tracking these variables over time, AmIGO maintains accuracy without the overhead of full re-computation at every iteration.

Theoretical Foundations: Three Time-Scales

The theoretical analysis of AmIGO is grounded in singularly perturbed systems from control theory. The algorithm models three coupled variables ($x, y, z$) evolving on distinct time-scales:

  1. Outer Variable ($x$): Moves the slowest, guiding the overall optimization.
  2. Inner Variable ($y$): Moves faster to track the inner-level solution.
  3. Linear System Variable ($z$): Moves at a rate that ensures the hypergradient estimate remains accurate.

This multi-scale approach allows the authors to prove that the "noise" introduced by not solving the inner problems perfectly does not degrade the overall convergence rate of the outer problem.

Empirical Evaluation

AmIGO was evaluated across three diverse scenarios to test its speed and scalability:

  • Synthetic Quadratic Problems: High-dimensional tests showed AmIGO reaching relative errors of $10^{-6}$ orders of magnitude faster than standard AID or Iterative Differentiation (ITD) methods.
  • 20Newsgroup Hyperparameter Optimization: AmIGO successfully optimized over 100,000 hyperparameters, achieving lower validation loss and higher test accuracy than competing bilevel methods.
  • MNIST Dataset Distillation: In this often ill-conditioned task, AmIGO demonstrated superior robustness, succeeding where other methods failed to improve or diverged.

Complexity and Performance

A key contribution of this work is proving that AmIGO matches the theoretical "speed limit" of stochastic optimization. It achieves $O(\epsilon^{-1})$ complexity for strongly convex problems and $O(\epsilon^{-2})$ for non-convex problems—the same rates as an "unbiased oracle" that has direct access to gradients.

Complexity comparison of AmIGO against state-of-the-art bilevel optimization algorithms.

As shown in the complexity comparison, AmIGO improves the dependence on both target accuracy ($\epsilon$) and the problem's condition number ($\kappa$) relative to previous state-of-the-art methods like TTSA or BSA. This theoretical superiority translates directly into the significant speedups observed in practice.

Conclusion

AmIGO represents a significant step forward in making stochastic bilevel optimization scalable and efficient. By amortizing the cost of implicit differentiation through warm-starts and multi-scale dynamics, it achieves optimal theoretical rates and strong empirical performance across high-dimensional tasks. Future research may extend this framework to handle non-smooth objectives or general non-convex inner problems.

Summary updated

BibTeX
@inproceedings{arbel2022amortized,
  author = {Michael Arbel and Julien Mairal},
  title = {{Amortized Implicit Differentiation for Stochastic Bilevel Optimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=3PN4iyXBeF},
}
Figure