Papers › OptNet: Differentiable Optimization as a Layer in Neural Networks

OptNet: Differentiable Optimization as a Layer in Neural Networks

1 Mar 2017ICML 2017 8arXiv:1703.00443archive 2025-07-28

Brandon Amos, J. Zico Kolter

This paper presents OptNet, a network architecture that integrates optimization problems (here, specifically in the form of quadratic programs) as individual layers in larger end-to-end trainable deep networks. These layers encode constraints and complex dependencies between the hidden states that traditional convolutional and fully-connected layers often cannot capture. We explore the foundations for such an architecture: we show how techniques from sensitivity analysis, bilevel optimization, and implicit differentiation can be used to exactly differentiate through these layers and with respect to layer parameters; we develop a highly efficient solver for these layers that exploits fast GPU-based batch solves within a primal-dual interior point method, and which provides backpropagation gradients with virtually no additional cost on top of the solve; and we highlight the application of these approaches in several problems. In one notable example, the method is learns to play mini-Sudoku (4x4) given just input and output games, with no a-priori information about the rules of the game; this highlights the ability of OptNet to learn hard constraints better than other neural architectures.

PaperPDFConference PDFCodeCode 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="1703.00443")

Code

Syntology Ran 0 of 16 code samples harvested from 2 repositories linked to this paper; 16 have no recorded run.

By repository: official repository: 7 samples from 1 repository, 0 ran; community (archive-listed): 9 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.

locuslab/optnet officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
Kyubyong/sudoku officialmentioned in papertfGPL-3.0 report
kevin-tracy/qpax mentioned on GitHubjaxNOASSERTION report
locuslab/e2e-model-learning mentioned on GitHubpytorchApache-2.0 report
mitmath/matrixcalc mentioned on GitHubjax report
msakai/chainer-optnet mentioned on GitHubApache-2.0 report
pfnet-research/chainer-differentiable-mpc mentioned on GitHubpytorchMIT report
quentinll/diffqcqp mentioned on GitHubtorchBSD-2-Clause report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. 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

16 samples harvested; 0 ran; 0 honoured the contract we drafted; 16 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.

16unverified

Licence: 0 of the 16 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

construct_puzzle_solution locuslab/optnet/sudoku/create.py official repository unverified Apache-2.0 (permissive) · 8ce0efe56f0daa69 · report
get_sudoku_matrix locuslab/optnet/sudoku/models.py official repository unverified Apache-2.0 (permissive) · 7498ea1bc2aeae12 · report
rolling locuslab/optnet/cls/plot.py official repository unverified Apache-2.0 (permissive) · 76cc7194ae64e0dc · report
rolling locuslab/optnet/denoising/plot.py official repository unverified Apache-2.0 (permissive) · 45ceda97985f082a · report
sample locuslab/optnet/denoising/create.py official repository unverified Apache-2.0 (permissive) · 980d886059335925 · report
sample locuslab/optnet/sudoku/create.py official repository unverified Apache-2.0 (permissive) · 36fa1e9e7a5ed275 · report
toOneHot locuslab/optnet/sudoku/create.py official repository unverified Apache-2.0 (permissive) · 7172da2c67065223 · report
bdiag msakai/chainer-optnet/chainer_optnet/solvers/pdipm_batch.py community (archive-listed) unverified Apache-2.0 (permissive) · 1ba2d4c26bccdc35 · report
beye msakai/chainer-optnet/chainer_optnet/solvers/pdipm_batch.py community (archive-listed) unverified Apache-2.0 (permissive) · c28b7bb019347e9f · report
cho_factor_partial msakai/chainer-optnet/chainer_optnet/solvers/pdipm_single.py community (archive-listed) unverified Apache-2.0 (permissive) · 4c4e504d2a7ae4a8 · report
get_array_module msakai/chainer-optnet/chainer_optnet/pivots.py community (archive-listed) unverified Apache-2.0 (permissive) · 34bed16bc8599ae8 · report
get_sizes msakai/chainer-optnet/chainer_optnet/solvers/pdipm_single.py community (archive-listed) unverified Apache-2.0 (permissive) · 19e15be4c1990dda · report
perm_to_pivots msakai/chainer-optnet/chainer_optnet/pivots.py community (archive-listed) unverified Apache-2.0 (permissive) · 57b83d82c3f1dd96 · report
pivots_to_perm msakai/chainer-optnet/chainer_optnet/pivots.py community (archive-listed) unverified Apache-2.0 (permissive) · c2853a223af6c5e9 · report
quadprog msakai/chainer-optnet/chainer_optnet/solvers/cvxpy.py community (archive-listed) unverified Apache-2.0 (permissive) · c49fa6ae7dc3e337 · report
quadprog msakai/chainer-optnet/chainer_optnet/solvers/pdipm_single.py community (archive-listed) unverified Apache-2.0 (permissive) · fb7526f10c27f4b9 · report

Tasks

Bilevel Optimization

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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