# A Penalty Approach for Differentiation Through Black-Box Quadratic Programming Solvers

arXiv: https://arxiv.org/abs/2602.14154 · HTML: https://mlsanity.com/paper/2602.14154/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Builds on 17 of its 38 references that are in the map.
- First posted on arXiv 15 Feb 2026.

## Builds on (most cited first, 17 of 17)

- [OptNet: Differentiable Optimization as a Layer in Neural Networks](https://mlsanity.com/paper/1703.00443/) (2017)
- [Differentiable Convex Optimization Layers](https://mlsanity.com/paper/1910.12430/) (2019)
- [Smart "Predict, then Optimize"](https://mlsanity.com/paper/1710.08005/) (2017)
- [Efficient and Modular Implicit Differentiation](https://mlsanity.com/paper/2105.15183/) (2021)
- [Differentiating Through a Cone Program](https://mlsanity.com/paper/1904.09043/) (2019)
- [Theseus: A Library for Differentiable Nonlinear Optimization](https://mlsanity.com/paper/2207.09442/) (2022)
- [Reinforcement-Learning based Portfolio Management with Augmented Asset Movement Prediction States](https://mlsanity.com/paper/2002.05780/) (2020)
- [Alternating Differentiation for Optimization Layers](https://mlsanity.com/paper/2210.01802/) (2022)
- [Multi-Period Trading via Convex Optimization](https://mlsanity.com/paper/1705.00109/) (2017)
- [Efficient differentiable quadratic programming layers: an ADMM approach](https://mlsanity.com/paper/2112.07464/) (2021)
- [Differentiation Through Black-Box Quadratic Programming Solvers](https://mlsanity.com/paper/2410.06324/) (2024)
- [BPQP: A Differentiable Convex Optimization Framework for Efficient End-to-End Learning](https://mlsanity.com/paper/2411.19285/) (2024)
- [Constrained Optimization via Exact Augmented Lagrangian and Randomized Iterative Sketching](https://mlsanity.com/paper/2305.18379/) (2023)
- [SCQPTH: an efficient differentiable splitting method for convex quadratic programming](https://mlsanity.com/paper/2308.08232/) (2023)
- [Smooth Exact Penalty Functions: A General Approach](https://mlsanity.com/paper/1801.06567/) (2018)
- [The Augmented Lagrangian Methods: Overview and Recent Advances](https://mlsanity.com/paper/2510.16827/) (2025)
- [Implementing a smooth exact penalty function for general constrained nonlinear optimization](https://mlsanity.com/paper/1912.02093/) (2019)

## Built on by (most cited first, 2 of 2)

- [Efficient and provably convergent end-to-end training of deep neural networks with linear constraints](https://mlsanity.com/paper/2605.11526/) (2026)
- [dOPT: Differentiating Conic Optimization via Geometric Reduction](https://mlsanity.com/paper/2609.33828/) (2026)

## Abstract (arXiv)

Differentiating through the solution of a quadratic program (QP) is a central problem in differentiable optimization. Most existing approaches differentiate through the Karush--Kuhn--Tucker (KKT) system, but their computational cost and numerical robustness can degrade at scale. To address these limitations, we propose dXPP, a penalty-based differentiation framework that decouples QP solving from differentiation. In the solving step (forward pass), dXPP is solver-agnostic and can leverage any black-box QP solver. In the differentiation step (backward pass), we map the solution to a smooth approximate penalty problem and implicitly differentiate through it, requiring only the solution of a much smaller linear system in the primal variables. This approach bypasses the difficulties inherent in explicit KKT differentiation and significantly improves computational efficiency and robustness. We evaluate dXPP on various tasks, including randomly generated QPs, large-scale sparse projection problems, and a real-world multi-period portfolio optimization task. Empirical results demonstrate that dXPP is competitive with KKT-based differentiation methods and achieves substantial speedups on large-scale problems. Our implementation is open source and available at https://github.com/mmmmmmlinghu/dXPP.
