Efficient and Modular Implicit Differentiation
Mathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig, Stephan Hoyer, Felipe Llinares-López, Fabian Pedregosa, Jean-Philippe Vert
Abstract
Automatic differentiation (autodiff) has revolutionized machine learning. It allows to express complex computations by composing elementary ones in creative ways and removes the burden of computing their derivatives by hand. More recently, differentiation of optimization problem solutions has attracted widespread attention with applications such as optimization layers, and in bi-level problems such as hyper-parameter optimization and meta-learning. However, so far, implicit differentiation remained difficult to use for practitioners, as it often required case-by-case tedious mathematical derivations and implementations. In this paper, we propose automatic implicit differentiation, an efficient and modular approach for implicit differentiation of optimization problems. In our approach, the user defines directly in Python a function capturing the optimality conditions of the problem to be differentiated. Once this is done, we leverage autodiff of and the implicit function theorem to automatically differentiate the optimization problem. Our approach thus combines the benefits of implicit differentiation and autodiff. It is efficient as it can be added on top of any state-of-the-art solver and modular as the optimality condition specification is decoupled from the implicit differentiation mechanism. We show that seemingly simple principles allow to recover many existing implicit differentiation methods and create new ones easily. We demonstrate the ease of formulating and solving bi-level optimization problems using our framework. We also showcase an application to the sensitivity analysis of molecular dynamics.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
96 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Amortized Implicit Differentiation for Stochastic Bilevel Optimization cites On the Iteration Complexity of Hypergradient Computation
- Amortized Implicit Differentiation for Stochastic Bilevel Optimization cites Bilevel Optimization: Convergence Analysis and Enhanced Design
- Bilevel Optimization: Convergence Analysis and Enhanced Design cites On the Iteration Complexity of Hypergradient Computation
- On Implicit Bias in Overparameterized Bilevel Optimization cites On the Iteration Complexity of Hypergradient Computation
- On Implicit Bias in Overparameterized Bilevel Optimization cites Bilevel Optimization: Convergence Analysis and Enhanced Design
- Equivariance with Learned Canonicalization Functions cites Fast Differentiable Sorting and Ranking
Cited by top-tier papers96
- Theseus: A Library for Differentiable Nonlinear OptimizationLuis Pineda, Taosha Fan, Maurizio Monge, Shobha Venkataraman et al.NeurIPS 2022 · 124 citations
- Equivariance with Learned Canonicalization FunctionsSékou-Oumar Kaba, Arnab Kumar Mondal, Yan Zhang, Yoshua Bengio et al.ICML 2023 · 109 citations
- Amortized Implicit Differentiation for Stochastic Bilevel OptimizationMichael Arbel, Julien MairalICLR 2022 · 78 citations
- A-NeSI: A Scalable Approximate Method for Probabilistic Neurosymbolic InferenceEmile van Krieken, Thiviyan Thanapalasingam, Jakub M. Tomczak, Frank van Harmelen et al.NeurIPS 2023 · 62 citations
- On Implicit Bias in Overparameterized Bilevel OptimizationPaul Vicol, Jonathan P. Lorraine, Fabian Pedregosa, David Duvenaud et al.ICML 2022 · 48 citations
Builds on14
- Bilevel Optimization: Convergence Analysis and Enhanced DesignKaiyi Ji, Junjie Yang, Yingbin LiangICML 2021 · 343 citations
- Fast Differentiable Sorting and RankingMathieu Blondel, Olivier Teboul, Quentin Berthet, Josip DjolongaICML 2020 · 285 citations
- On the Iteration Complexity of Hypergradient ComputationRiccardo Grazzi, Luca Franceschi, Massimiliano Pontil, Saverio SalzoICML 2020 · 241 citations
- JAX MD: A Framework for Differentiable PhysicsSamuel S. Schoenholz, Ekin Dogus CubukNeurIPS 2020 · 195 citations
- On Training Implicit ModelsZhengyang Geng, Xin-Yu Zhang, Shaojie Bai, Yisen Wang et al.NeurIPS 2021 · 111 citations
Related papers
- A Fully First-Order Layer for Differentiable OptimizationZihao Zhao, Kai-Chia Mo, Shing-Hei Ho, Brandon Amos et al.ICML 2026 · 1 citation
- Scalable Meta-Learning via Mixed-Mode DifferentiationIurii Kemaev, Dan A. Calian, Luisa M. Zintgraf, Gregory Farquhar et al.ICML 2025
- BOME! Bilevel Optimization Made Easy: A Simple First-Order ApproachBo Liu, Mao Ye, Stephen Wright, Peter Stone et al.NeurIPS 2022 · 170 citations
- Implicit differentiation of Lasso-type models for hyperparameter optimizationQuentin Bertrand, Quentin Klopfenstein, Mathieu Blondel, Samuel Vaiter et al.ICML 2020 · 73 citations
- Scalable Bayesian Meta-Learning through Generalized Implicit GradientsYilang Zhang, Bingcong Li, Shijian Gao, Georgios B. GiannakisAAAI 2023 · 14 citations
