Papers › A Fully First-Order Layer for Differentiable Optimization

A Fully First-Order Layer for Differentiable Optimization

2 Dec 2025ICMLarXiv:2512.02494added by Syntology

Zihao Zhao, Kai-Chia Mo, Shing-Hei Ho, Brandon Amos, Kai Wang

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

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 Õ(1) time, leading to an overall complexity of Õ(δ⁻¹ε⁻³) 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. The source code is available at https://github.com/guaguakai/FFOLayer.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2512.02494")

Code

Syntology Ran 0 of 27 code samples harvested from 1 repository linked to this paper; 27 have no recorded run.

By repository: found in paper text by Syntology: 27 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

GT-KOALA/FFOLayer found in paper text by SyntologyMIT report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

27 samples harvested; 0 ran; 0 honoured the contract we drafted; 27 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

27unverified

Licence: 0 of the 27 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from GT-KOALA/FFOLayer. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AltDiffLayer GT-KOALA/FFOLayer/baselines/AltDiff_my.py found in paper text by Syntology unverified MIT (permissive) · 5da01a2cfc6e4a3c · report
AltDiffLayer GT-KOALA/FFOLayer/baselines/AltDiff_socp.py found in paper text by Syntology unverified MIT (permissive) · 721a2edf0c8c6c88 · report
BPQPLayer GT-KOALA/FFOLayer/baselines/BPQP_cvxpy.py found in paper text by Syntology unverified MIT (permissive) · f059057e92cf65ce · report
FFOLayer GT-KOALA/FFOLayer/src/ffolayer/ffocp_eq.py found in paper text by Syntology unverified MIT (permissive) · 5ae4fc2c87a7123b · report
active_counts_dict GT-KOALA/FFOLayer/src/ffolayer/ffocp_eq.py found in paper text by Syntology unverified MIT (permissive) · 40c8b005ce29c676 · report
alt_diff_qp_ball GT-KOALA/FFOLayer/baselines/AltDiff_socp.py found in paper text by Syntology unverified MIT (permissive) · 0ed505c799b8ab88 · report
alt_qp_solve_batched GT-KOALA/FFOLayer/baselines/AltDiff_my.py found in paper text by Syntology unverified MIT (permissive) · 965a326c258ca206 · report
bpqp_backward GT-KOALA/FFOLayer/baselines/BPQP.py found in paper text by Syntology unverified MIT (permissive) · 51a84d27ffe9312e · report
bpqp_backward GT-KOALA/FFOLayer/baselines/BPQP_cvxpy.py found in paper text by Syntology unverified MIT (permissive) · bc3853e5579d499e · report
compact_active_rows GT-KOALA/FFOLayer/src/ffolayer/ffoqp_eq.py found in paper text by Syntology unverified MIT (permissive) · 9073396df5ed4d7f · report
ffoqp GT-KOALA/FFOLayer/src/ffolayer/ffoqp.py found in paper text by Syntology unverified MIT (permissive) · 472594fac39e3ee0 · report
get_feasible_b GT-KOALA/FFOLayer/sudoku/models_sudoku.py found in paper text by Syntology unverified MIT (permissive) · a007b5cf56c8bae4 · report
get_feasible_h GT-KOALA/FFOLayer/sudoku/models_sudoku.py found in paper text by Syntology unverified MIT (permissive) · cb22acf193c96cee · report
kkt_schur_complement GT-KOALA/FFOLayer/src/ffolayer/ffoqp_eq.py found in paper text by Syntology unverified MIT (permissive) · 2b5d032faf67c537 · report
make_schur_op GT-KOALA/FFOLayer/src/ffolayer/ffoqp_eq.py found in paper text by Syntology unverified MIT (permissive) · ad95d972f968bea3 · report
osqp_solve GT-KOALA/FFOLayer/baselines/BPQP.py found in paper text by Syntology unverified MIT (permissive) · 72e51987bf0b497f · report
pack_osqp GT-KOALA/FFOLayer/baselines/BPQP.py found in paper text by Syntology unverified MIT (permissive) · e79ddef8d0f4a1b9 · report
proj GT-KOALA/FFOLayer/baselines/AltDiff.py found in paper text by Syntology unverified MIT (permissive) · cdcb4c4d2efd9bcd · report
relu GT-KOALA/FFOLayer/baselines/AltDiff.py found in paper text by Syntology unverified MIT (permissive) · 75a806c121e013d2 · report
setup_cvxpy_synthetic_problem GT-KOALA/FFOLayer/synthetic_task/models.py found in paper text by Syntology unverified MIT (permissive) · 6e7c154f827b7fea · report
setup_cvxpy_synthetic_problem_with_cones GT-KOALA/FFOLayer/synthetic_task/models.py found in paper text by Syntology unverified MIT (permissive) · a2a1f2f1f52d1afe · report
sgn GT-KOALA/FFOLayer/baselines/AltDiff.py found in paper text by Syntology unverified MIT (permissive) · b7c2cacc2ff70644 · report
slice_params_for_batch GT-KOALA/FFOLayer/src/ffolayer/utils.py found in paper text by Syntology unverified MIT (permissive) · e9c8c0ade37ae3f5 · report
solve_loss GT-KOALA/FFOLayer/ffo_sdp.py found in paper text by Syntology unverified MIT (permissive) · ffbf19d3814db061 · report
to_numpy GT-KOALA/FFOLayer/src/ffolayer/ffoqp.py found in paper text by Syntology unverified MIT (permissive) · 61f11299147431ec · report
to_numpy GT-KOALA/FFOLayer/src/ffolayer/utils.py found in paper text by Syntology unverified MIT (permissive) · 00d531ce728a6d76 · report
to_torch GT-KOALA/FFOLayer/src/ffolayer/utils.py found in paper text by Syntology unverified MIT (permissive) · ed333bcc321221bc · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2512.02494, was issued in December 2025, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections