Alternating Differentiation for Optimization Layers
Haixiang Sun, Ye Shi, Jingya Wang, Hoang Duong Tuan, H. Vincent Poor, Dacheng Tao
Abstract
The idea of embedding optimization problems into deep neural networks as optimization layers to encode constraints and inductive priors has taken hold in recent years. Most existing methods focus on implicitly differentiating Karush-Kuhn-Tucker (KKT) conditions in a way that requires expensive computations on the Jacobian matrix, which can be slow and memory-intensive. In this paper, we developed a new framework, named Alternating Differentiation (Alt-Diff), that differentiates optimization problems (here, specifically in the form of convex optimization problems with polyhedral constraints) in a fast and recursive way. Alt-Diff decouples the differentiation procedure into a primal update and a dual update in an alternating way. Accordingly, Alt-Diff substantially decreases the dimensions of the Jacobian matrix especially for optimization with large-scale constraints and thus increases the computational speed of implicit differentiation. We show that the gradients obtained by Alt-Diff are consistent with those obtained by differentiating KKT conditions. In addition, we propose to truncate Alt-Diff to further accelerate the computational speed. Under some standard assumptions, we show that the truncation error of gradients is upper bounded by the same order of variables' estimation error. Therefore, Alt-Diff can be truncated to further increase computational speed without sacrificing much accuracy. A series of comprehensive experiments validate the superiority of Alt-Diff.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 12238eb8-5497-433a-ae7a-26eb2c271e58Cited by top-tier papers15
- BPQP: A Differentiable Convex Optimization Framework for Efficient End-to-End LearningJianming Pan, Zeqi Ye, Xiao Yang, Xu Yang et al.NeurIPS 2024 · 18 citations
- IKOL: Inverse Kinematics Optimization Layer for 3D Human Pose and Shape Estimation via Gauss-Newton DifferentiationJuze Zhang, Ye Shi, Yuexin Ma, Lan Xu et al.AAAI 2023 · 18 citations
- Differentiation Through Black-Box Quadratic Programming SolversConnor W. Magoon, Fengyu Yang, Noam Aigerman, Shahar Z. KovalskyNeurIPS 2025 · 14 citations
- End-to-End Probabilistic Framework for Learning with Hard ConstraintsUtkarsh Utkarsh, Danielle C. Maddix, Ruijun Ma, Michael W. Mahoney et al.ICLR 2026 · 13 citations
- Reduced Policy Optimization for Continuous Control with Hard ConstraintsShutong Ding, Jingya Wang, Yali Du, Ye ShiNeurIPS 2023 · 10 citations
Builds on11
- Efficient and Modular Implicit DifferentiationMathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig et al.NeurIPS 2022 · 386 citations
- Multiscale Deep Equilibrium ModelsShaojie Bai, Vladlen Koltun, J. Zico KolterNeurIPS 2020 · 272 citations
- Implicit Graph Neural NetworksFangda Gu, Heng Chang, Wenwu Zhu, Somayeh Sojoudi et al.NeurIPS 2020 · 188 citations
- Smart Predict-and-Optimize for Hard Combinatorial Optimization ProblemsJayanta Mandi, Emir Demirovic, Peter J. Stuckey, Tias GunsAAAI 2020 · 184 citations
- Is Attention Better Than Matrix Decomposition?Zhengyang Geng, Meng-Hao Guo, Hongxu Chen, Xia Li et al.ICLR 2021 · 171 citations
Related papers
- Nonsmooth Implicit Differentiation for Machine-Learning and OptimizationJérôme Bolte, Tam Le, Edouard Pauwels, Antonio Silveti-FallsNeurIPS 2021 · 85 citations
- Revisiting Implicit Differentiation for Learning Problems in Optimal ControlMing Xu, Timothy L. Molloy, Stephen GouldNeurIPS 2023 · 16 citations
- Efficient Riemannian Meta-Optimization by Implicit DifferentiationXiaomeng Fan, Yuwei Wu, Zhi Gao, Yunde Jia et al.AAAI 2022 · 3 citations
- Efficient Differentiable Simulation of Articulated BodiesYi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. LinICML 2021 · 68 citations
- A Penalty Approach For Differentiation Through Black-box Quadratic Programming SolversYuxuan Linghu, Zhiyuan Liu, Qi DengICML 2026 · 1 citation
