Automatic Differentiation of Optimization Algorithms with Time-Varying Updates

Sheheryar Mehmood, Peter Ochs

Introduction

In modern machine learning, bilevel optimization problems are ubiquitous, appearing in hyperparameter tuning, meta-learning, and neural architecture search. These problems consist of an "inner" optimization loop (e.g., training a model) and an "outer" loop (e.g., optimizing hyperparameters). Updating the outer loop requires computing the gradient of the inner solver's solution with respect to its parameters, a task typically handled by Automatic Differentiation (AD) through "unrolling" the inner solver's iterations.

However, a significant theoretical gap has persisted: most existing convergence theory for AD assumes the inner solver uses a fixed, stationary update rule. In practice, efficient solvers rely on time-varying updates, such as line searches, variable step-size schedules, or dynamic momentum parameters. This paper bridges that gap by providing the first rigorous theoretical guarantees for the convergence and convergence rates of AD when applied to optimization algorithms with time-varying updates.

Methodological Approach

The authors analyze a parametric iterative process where the update mapping, $A_k$, changes at each step $k$. Their theoretical framework is built on several key pillars:

  • Generalizing Classical Theory: The authors extend the foundational work of Beck (1994) by eliminating the strict requirement that the sequence of update mappings $A_k$ must converge pointwise to a single limit mapping $A$. Instead, the analysis focuses on the regularity and contraction properties of the sequence itself.
  • Linear Convergence Analysis: A central theoretical contribution is establishing that if the primary iterates $x^{(k)}$ converge linearly, the derivative iterates $Dx^{(k)}$ will also converge linearly to the derivative of the solution mapping.
  • Application to Partly-Smooth Problems: The theoretical results are specifically adapted to Proximal Gradient Descent (PGD) with variable step sizes and Accelerated Proximal Gradient (APG/FISTA). This relies on the "manifold identification" property—the phenomenon where these algorithms eventually lock onto the smooth part of a non-smooth objective (such as the sparsity pattern in Lasso regression).
  • Bridging ID and AD: The paper demonstrates that Implicit Differentiation (which applies the Implicit Function Theorem to the final solution) and Automatic Differentiation (which differentiates the iterative steps) converge to the identical result under these time-varying conditions.

To validate their theoretical claims, the authors conducted experiments across three classic machine learning benchmarks: Lasso Regression (on synthetic datasets), $\ell_2$-regularized Binary Logistic Regression (on the MADELON dataset), and Multiclass Multinomial Logistic Regression (on CIFAR10).

Key Insights and Results

The most significant insight from this research is the "Mirror Effect": the convergence rate of an optimization algorithm is directly reflected in its derivative iterates. If the underlying solver converges linearly, the unrolled gradient converges linearly at essentially the exact same rate.

By relaxing the pointwise convergence assumption, the authors prove that as long as the time-varying updates are well-behaved, the derivatives will converge even if the update rule continuously changes. For non-smooth problems, this relies heavily on manifold identification; once the active manifold is identified, the problem effectively becomes smooth, allowing the derivative theory to apply.

The paper provides explicit error bounds (Theorems 2.7 and 3.7) demonstrating that the distance between the AD-computed derivative and the true derivative shrinks at a rate governed by the algorithm's contraction mapping. Numerical experiments strongly confirm this theory: plotting the error of the iterates alongside the error of the derivatives reveals nearly identical slopes on a log-scale. Furthermore, this work provides one of the first formal justifications for differentiating through the accelerated updates of FISTA in a time-varying context.

Limitations and Future Directions

While the theoretical guarantees are robust, they come with certain limitations. Some of the strongest convergence rate proofs are local, requiring the initial iterate to be "sufficiently close" to the optimal solution, even though AD generally succeeds in practice from arbitrary initializations. Additionally, the current framework assumes the objective functions are "partly smooth," which covers many, but not all, non-smooth regularizers. Finally, this research focuses strictly on deterministic optimization. Extending these time-varying rate guarantees to noisy, stochastic settings (like Stochastic Gradient Descent) remains a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{mehmood2025automatic,
  author = {Sheheryar Mehmood and Peter Ochs},
  title = {{Automatic Differentiation of Optimization Algorithms with Time-Varying Updates}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=wW1gRFTqhx},
}
Figure