Saved in:
Bibliographic Details
Main Authors: Zhao, Zihao, Mo, Kai-Chia, Ho, Shing-Hei, Amos, Brandon, Wang, Kai
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2512.02494
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912742882934784
author Zhao, Zihao
Mo, Kai-Chia
Ho, Shing-Hei
Amos, Brandon
Wang, Kai
author_facet Zhao, Zihao
Mo, Kai-Chia
Ho, Shing-Hei
Amos, Brandon
Wang, Kai
contents Differentiable optimization layers enable learning systems to make decisions by solving embedded optimization problems. However, computing gradients via implicit differentiation requires solving a linear system with Hessian terms, which is both compute- and memory-intensive. To address this challenge, we propose a novel algorithm that computes the gradient using only first-order information. The key insight is to rewrite the differentiable optimization as a bilevel optimization problem and leverage recent advances in bilevel methods. Specifically, we introduce an active-set Lagrangian hypergradient oracle that avoids Hessian evaluations and provides finite-time, non-asymptotic approximation guarantees. We show that an approximate hypergradient can be computed using only first-order information in $\tilde{\oo}(1)$ time, leading to an overall complexity of $\tilde{\oo}(δ^{-1}ε^{-3})$ for constrained bilevel optimization, which matches the best known rate for non-smooth non-convex optimization. Furthermore, we release an open-source Python library that can be easily adapted from existing solvers. Our code is available here: https://github.com/guaguakai/FFOLayer.
format Preprint
id arxiv_https___arxiv_org_abs_2512_02494
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Fully First-Order Layer for Differentiable Optimization
Zhao, Zihao
Mo, Kai-Chia
Ho, Shing-Hei
Amos, Brandon
Wang, Kai
Machine Learning
Differentiable optimization layers enable learning systems to make decisions by solving embedded optimization problems. However, computing gradients via implicit differentiation requires solving a linear system with Hessian terms, which is both compute- and memory-intensive. To address this challenge, we propose a novel algorithm that computes the gradient using only first-order information. The key insight is to rewrite the differentiable optimization as a bilevel optimization problem and leverage recent advances in bilevel methods. Specifically, we introduce an active-set Lagrangian hypergradient oracle that avoids Hessian evaluations and provides finite-time, non-asymptotic approximation guarantees. We show that an approximate hypergradient can be computed using only first-order information in $\tilde{\oo}(1)$ time, leading to an overall complexity of $\tilde{\oo}(δ^{-1}ε^{-3})$ for constrained bilevel optimization, which matches the best known rate for non-smooth non-convex optimization. Furthermore, we release an open-source Python library that can be easily adapted from existing solvers. Our code is available here: https://github.com/guaguakai/FFOLayer.
title A Fully First-Order Layer for Differentiable Optimization
topic Machine Learning
url https://arxiv.org/abs/2512.02494