A Differentiable Interior-Point Method in Single Precision

Jon Arrizabalaga, Kevin Tracy, Zac ManchesterNeurIPS 2026

TL;DR

Embedding constrained optimization directly into neural networks is a superpower for robotics and control, except for one glaring catch: classic optimization solvers demand double-precision (64-bit) math, while modern GPUs are built to fly in single-precision (32-bit). When forced into 32-bit arithmetic, standard solvers suffer catastrophic numerical blow-ups right as they reach the optimal answer. This paper introduces a clever mathematical reformulation that keeps the solver's internal equations tame and bounded, unlocking reliable, differentiable quadratic programming natively on low-precision ML hardware.

What Problem Does This Paper Address?

Suppose you want a neural network to output actions that strictly obey physical laws or safety limits—like keeping a robot drone from crashing into trees. A great way to do this is to stick a convex Quadratic Program (QP) solver inside your network as a differentiable layer. For decades, the gold-standard workhorse for solving QPs has been the primal-dual interior-point method (IPM).

Here is the rub: at the heart of every IPM is a "complementarity condition," which mathematically states that for any inequality constraint, either the slack variable ($s$) is zero (you are touching the boundary) or the dual force ($z$) is zero (the boundary isn't pushing on you). As the solver zeroes in on the exact solution, it repeatedly divides $s$ by $z$ inside a core linear system. Depending on whether a constraint is active or inactive, $s/z$ either rushes toward zero or explodes toward infinity.

In 64-bit double precision (f64), direct matrix factorizations can usually stomach this extreme "ill-conditioning." In 32-bit single precision (f32) or TF32—the lifeblood of modern GPUs—those diverging numbers overflow or underflow, spitting out NaNs and ruining both the forward pass and the gradients.

Methods

Instead of trying to bandage this numerical divergence with iterative refinement, the authors surgically remove its source. While the individual building blocks exist in optimization literature, the authors fuse them into the first end-to-end, single-precision differentiable QP pipeline:

  • Implicit Complementarity via Softplus: Rather than solving $z \cdot s = \kappa$ explicitly, the authors introduce an auxiliary variable $v$ and pass it through a smooth softplus retraction map (originally proposed for double-precision solving) that satisfies complementarity automatically by construction.
  • A Tamed KKT Matrix: Because of two neat properties of the softplus derivative—it is strictly bounded between $0$ and $1$, and symmetric inputs sum to $1$—the linear system solved at each Newton step transforms. Every block of the matrix stays completely constant across iterations except for one diagonal block whose entries live peacefully inside $(0, 1)$. No dividing by near-zero numbers; no exploding condition numbers.
  • Three-Stage Relaxed Differentiation: Differentiating directly at a sharp constraint corner yields uninformative gradients. Building on recent central-path relaxation techniques, the pipeline: (1) solves the QP to tight tolerance ($\kappa \to 0$), (2) walks backward slightly along the central path to a smoothed point $\kappa_{\text{relax}}$, and (3) reuses that exact final matrix factorization via the implicit function theorem to compute smooth, accurate gradients almost for free.

Datasets

Rather than static image or text datasets, the authors evaluate their solver across four standard optimization benchmarks and newly configured synthetic/control tasks:

  • OSQP Benchmark Suite: 500 QPs spanning five classic problem classes (random QPs, portfolio optimization, lasso, SVM, and optimal control).
  • Synthetic Polytope Projection: Computing Euclidean projections onto random polytopes with an analytical active-set reference to measure exact gradient error.
  • Robotic Bilevel Trajectory Optimization: Navigating through simulated 2D forest and office obstacle courses using composite Bézier curves.
  • Multi-Agent Safety Filter Learning: End-to-end training of a neural controller paired with a Control Barrier Function (CBF) QP layer for 2 to 9 agents dodging obstacles.

Key Insights and Ideas

  • Algebraic structure beats brute-force precision: You don't need 64-bit floats to get tight optimization tolerances if you reparameterize the manifold so that the numbers never span 15 orders of magnitude in the first place.
  • Decoupling forward accuracy from backward smoothness: Walking backward to $\kappa_{\text{relax}}$ after solving gives you the best of both worlds: an uncompromised, sharp physical solution on the forward pass, and well-behaved, informative derivatives on the backward pass—all reusing the same matrix structure.
  • "Noisy gradient" tolerance won't save standard f32 solvers: Deep learning optimizers like Adam are famously resilient to noisy gradients, leading one to wonder if f32 inaccuracies even matter in practice. The authors show the failure isn't mere noise—standard f32 IPMs outright crash with NaNs on the very first batch.
Figure 1: Implicit complementarity enables accurate and robust single-precision gradients. Left: As problem dimension and active-set size increase, the implicit method maintains low gradient error and remains fully robust, whereas the explicit formulation fails about 60% of the time for n ≥10. Here, mr denotes the ratio of active inequality constraints m to decision variables n. Right: As κrelax decreases, the implicit method continues to track the relaxation-limited gradient accuracy, whereas the explicit f32 formulation plateaus in accuracy and exhibits an escalating failure rate. Reported metrics are medians over three random seeds.

Key Results

  • Forward Solve Reliability: On the 500-problem OSQP suite in f32 at a tight $10^{-6}$ tolerance, the implicit solver succeeds on 497/500 instances (with $3.1 \times 10^{-8}$ median objective error), compared to 154/500 for the standard explicit f32 baseline and 413/500 for the best external GPU solver (cuClarabel / BoxOSQP).
  • Zero NaNs in Gradient Stress Tests: As shown in the figure above, when decision variables reach $n \ge 10$ on polytope projections, the explicit f32 method returns NaNs roughly 60% to 100% of the time as relaxation tightens. The implicit f32 method maintains a 0% failure rate and tracks theoretical accuracy limits down to $10^{-6}$.
  • 2x GPU Scalability in End-to-End Learning: In both bilevel trajectory optimization and multi-agent safety learning, explicit f32 is completely unusable (failing immediately on batch one in the safety task), whereas implicit f32 matches f64 training curves identically while fitting 2x larger batch sizes in GPU memory.

Limitations and Future Work

There is no free lunch in numerical linear algebra:

  • Compute Overhead & Sparsity Fill-in: The reduced matrix contains a $Q - G^\top G$ term (which destroys sparsity when $Q$ and $G$ are sparse) and keeps an extra $p$-dimensional variable around. Consequently, the prototype is 2.2–5.4x slower in median solve time than the explicit f32 baseline.
  • Inherited Ill-Conditioning: The method eliminates complementarity-induced blow-ups, not bad user data. If your problem matrices ($Q, G, A$) are inherently ill-conditioned, the linear system will be too.
  • Scope & Guarantees: The solver currently assumes QPs are feasible (no infeasibility detection yet) and lacks formal global iteration-complexity proofs. Extending this clean retraction trick beyond QPs to general symmetric cones (like second-order or semidefinite cones) is a promising next step.

Summary updated

Abstract

Primal-dual interior-point methods solve constrained convex optimization problems to tight tolerances with speed and robustness. Their solutions are also efficiently differentiable with respect to the problem data through the implicit function theorem. However, the standard treatment of primal-dual complementarity makes the underlying linear systems increasingly ill-conditioned near the solution. While this ill-conditioning is often benign in double precision, it can be catastrophic in single precision, preventing interior-point methods from fully exploiting the accelerated hardware that underpins modern machine learning. This paper introduces a differentiable interior-point method designed for low-precision arithmetic. By using an alternative complementarity representation, we ensure that the underlying linear systems remain spectrally bounded --- even near the solution --- a property that is essential for computing accurate gradients and avoiding arithmetic exceptions. As a result, our method enables interior-point solvers to reliably solve and differentiate optimization problems in single precision that were previously confined to double precision. We demonstrate the approach through an ablation study against the standard interior-point formulation and applications in bilevel and end-to-end learning settings where differentiating through constrained optimization is essential.
BibTeX
@inproceedings{arrizabalaga2026differentiable,
  author = {Jon Arrizabalaga and Kevin Tracy and Zac Manchester},
  title = {{A Differentiable Interior-Point Method in Single Precision}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Xjh9eUGXeN},
}
Figure