A central limitation of modern machine learning systems is the lack of formal certificates guaranteeing their behavior beyond empirical, sample-based evaluation. Sum-of-squares (SOS) methods provide such guarantees by certifying polynomial inequalities over continuous domains via semidefinite programming (SDP). While prior work has introduced SDP layers as differentiable components in neural networks, repeated learning calls can lose the computational benefit of the forward program's sparse representation. We propose Sparse SOS Layers, differentiable value layers whose backward passes reuse the local coordinates of the forward solve. Under a fixed template and learned objective coefficients, each layer avoids building dense certificates and reuses its sparse structure across training steps. Compared with existing methods, our approach achieves up to 2.7 times speedup in total warm-call time, with nearly 100 times lower memory usage (1.7 vs. 160 GiB) for relatively large problem sizes for the tested dense parameterization. Experiments cover sparse polynomial certification, pendulum control, combinatorial relaxations, robotics projection, oscillator chains, and pose graph synchronization. A design study achieves zero certified violations across unseen problem instances and sizes, while requiring roughly 7 times fewer optimization solves than estimating gradients by perturbing the objective coefficients and re-solving the problem (finite differences). These results show that sparse certificate values can be effectively integrated into learning pipelines when the backward pass respects the verifier's structure.
Figures & tables
Comparison
Size
Reference
Sparse value route
Generic / value-specialized
N=16
28.851 [0.094]
17.839 [0.080]
Generic / value-specialized
N=128
520.488 [1.550]
196.259 [0.831]
Ambient / chordal
N=16
1.414 [0.003]
3.263 [0.006]
Rebuilt / cached
N=16
5.893 [0.056]
4.431 [0.048]
Rebuilt / cached
N=256
99.040 [5.165]
72.820 [0.754]
Table 1: Controlled total warm-call times, median [interquartile range] in milliseconds.
Implementation
Peak memory (GiB)
Forward (s)
Backward (s)
Dense parameterization
164.07
4161
203.6
Sparse SOS (Ours)
1.69
0.154
0.265
Table 2: Resource measurements at N=384 .
N
Sparse SOS (Ours)
Dense CVXPY
Dense SDPR
96
3.67×10−5
2.00×10−2
1.07×10−2
128
1.88×10−4
8.18×10−1
5.19×10−1
192
2.06×10−5
2.46×10−1
1.96×10−1
256
3.20×10−5
2.70×10−2
4.06×10−1
384
1.49×10−5
Not tested
Not tested
512
1.26×10−5
Not tested
Not tested
Table 3: Minimum relative derivative error over three finite-difference step sizes at ρ=0.45 . Qualification uses the complete record and the absolute-or-relative criterion. All reported primal statuses are optimal.
Family
Width w
Size n
Median ratio
[Q1, Q3]
Banded
4
96
1.068
[1.063, 1.070]
Random chordal
4
96
1.076
[1.038, 1.139]
Random chordal
6
160
1.057
[1.038, 1.070]
Random chordal
8
224
1.047
[0.999, 1.104]
Table 4: First tested size with median ambient/chordal time ratio above one.
Segments
Objective discrepancy
Gradient discrepancy
8
6.80×10−4
5.17×10−4
9
2.93×10−3
1.34×10−4
10
1.50×10−4
1.77×10−3
11
1.68×10−3
1.68×10−3
Table 5: Robot projection: relative discrepancies against SDPR on the matched Shor relaxation.
N
Certificate value
Gradient value
Sparse SOS (Ours)
CVXPY
Sparse SOS (Ours)
CVXPY
4
0.072584
0.072584
−0.242536
−0.242536
6
0.108876
0.108876
−0.363803
−0.363803
8
0.145168
0.145168
−0.485071
−0.485071
Table 6: Coupled oscillator certificate values and gradients for the same multiplier SOS program.
Poses
Forward time (s)
Backward time (s)
Sparse SOS (Ours)
CVXPY
SDPR
Sparse SOS (Ours)
CVXPY
SDPR
10
0.019
0.027
0.011
4.72⋅10−4
4.17⋅10−3
2.57⋅10−3
16
0.023
0.094
0.016
1.12⋅10−3
0.026
5.36⋅10−3
22
0.029
0.171
0.022
2.66⋅10−3
0.063
9.80⋅10−3
28
0.034
11.24
0.031
3.41⋅10−3
0.130
0.015
Table 7: Pose graph synchronization: implementation-level times in seconds.
Pendulum
Method
Training signal
Cert. margin
Cert. rate
1
Sparse SOS (Ours)
certificate margin
0.0274±0.0014
1.000
1
Sampled surrogate
sampled grid loss
0.0234±0.0013
1.000
1
Post hoc
no certificate during training
−0.7957±0.7453
0.200
2
Sparse SOS (Ours)
certificate margin
0.0036±0.0002
1.000
2
Sampled surrogate
sampled grid loss
0.0024±0.0002
1.000
2
Post hoc
no certificate during training
0.0019±0.0004
1.000
Table 8: Pendulum control certificate outcomes.
Training signal
Train
Test
n=96
n=160
Solves
Sparse SOS (Ours)
0/80
0/30
0/20
0/30
480
Finite differences
4/80
0/30
4/20
6/30
3360
Sampled surrogate
9/80
4/30
5/20
12/30
0
Stop gradient
80/80
30/30
20/20
30/30
480
No layer
80/80
30/30
20/20
30/30
0
Table 9: Violations of the certified lower-bound requirement.
Layer choice
Final test loss
Forward total (s)
Backward total (s)
Time-to- 10−3 (s)
Sparse SOS (Ours)
1.06⋅10−7
32.93
5.37
22.28
SDPR
3.78⋅10−5
20.67
268.33
71.94
CVXPY
3.66⋅10−5
2023.60
361.12
594.36
Table 10: Training loop case study at problem size 96 .
Semidefinite programming optimizes linear objectives over positive semidefinite matrices to solve convex problems and build tractable relaxations and certificates.
Certified robustness is critical for deploying neural networks in safety-sensitive settings, but computing exact certificates typically requires solving nonconvex optimization problems. Practical verifiers use convex relaxations: linear programming (LP) relaxations are scalable but often too conservative, whereas semidefinite programming (SDP) relaxations can be substantially tighter but are computationally expensive. We introduce a hierarchy of second-order cone programming (SOCP) relaxations that provide stronger certificates than LP while avoiding the cost of global positive-semidefinite constraints. Our construction combines convex-hull relaxations of ReLU activations, selective McCormick lifting over certified variable bounds, and second-order cone constraints induced by 2-by-2 principal minors. Adding these constraints progressively yields a monotone hierarchy of increasingly tight bounds with a controllable computation-tightness trade-off. On fully connected and convolutional networks on MNIST and CIFAR-10, SOCP-based verification improves certified robust accuracy over LP-based verification and is competitive with alpha,beta-CROWN, while remaining orders of magnitude faster than SDP-based verification. These results position selective second-order constraints as a practical middle ground between scalable LP-based and tight SDP-based certification. Finally, we introduce class-optimized robust evaluation (CORE), which applies tighter relaxations only to target classes not certified by cheaper ones. On the fully connected MNIST benchmark, CORE variants match SDP-cert's certified robust accuracy while reducing average verification time by up to 86.30%.
Mohammadreza Maleki, Daniel Sadig, Rushendra Sidibomma +3
Toronto Metropolitan University · University of Minnesota Twin Cities · Johns Hopkins University +2
Existing linear program (LP) and semidefinite program (SDP) relaxations for rectified linear unit (ReLU) neural network (NN) verification yield overly-conservative safety guarantees due to significant relaxation gaps. While the completely positive program (CPP) formulation closes this gap, it is NP-hard to solve. Its cheapest tractable relaxation, the doubly non-negative program (DNN), retains critical constraints as an SDP, but one whose size exceeds the reach of interior-point methods at practical scale. While Burer-Monteiro (BM) factorization has been applied to make SDP-based verification scalable, no such result exists for the strictly tighter DNN formulation. A key obstacle is that additional non-negativity constraints in the DNN cause dual multipliers for optimality certification to be non-unique, making standard certification methods inapplicable. We propose a novel eigenvalue maximization procedure that searches the non-unique multiplier space for a valid certificate, i.e. a global optimality guarantee. Experiments demonstrate that our approach (DNN)2 produces bounds consistently tighter than the standard SDP method, often matching the exact solution, and that our certification procedure confirms global optimality when a valid certificate exists. These results are a key step toward providing tight, certifiable, and computationally scalable verification guarantees needed to deploy neural network controllers and perception modules in safety-critical autonomous systems.
Hanna Jiamei Zhang, Alan Papalia, Michael Everett +1
Departments of Computer Science, Electrical and Computer Engineering, and Mathematics Northeastern University, Boston, MA. · Department of Naval Architecture and Marine Engineering, University of Michigan, Ann Arbor, MI.
The global Lipschitz constant of a neural network is related to robustness and generalization, yet unlike in many classical models, it is not plainly legible from the parameters. This has motivated sophisticated verification algorithms, especially semidefinite programming (SDP) based on incremental quadratic constraints on the activation functions, to improve on the fast but often loose product of layerwise Lipschitz constants (the trivial bound). We ask why Lipschitz verification is a problem in the first place. Our answer is that the difficulty is structural: estimating a network's Lipschitz constant requires knowing which hidden states are reachable, and reachability is NP-hard. If P!=NP, then reachability is a barrier to any polynomial-time algorithm. Through explicit constructions, we show that this blindness can force SDP-based bounds to inherit the same qualitative failures as the trivial bound, including but not limited to polynomial per-layer conservatism. We show that the difficulties of NP-hard questions are not isolated to worst-case computational reductions, but actually afflict every instance of the verification problem. Thus SDP is not sufficient for Lipschitz verification. We also argue that it is not necessary: several apparent failures of the trivial bound arise from removable parameterization pathologies, and can be mitigated by optimizing or regularizing the trivial bound itself. We demonstrate this claim via a "spherical cow" linear model and numerical proofs of concept. While the main contribution is theoretical and negative, we finally motivate a novel form of trigonometric layers that do not need biases for universal approximation. Combined with trivial bound regularization, they make the trivial bound provably and practically tight.
Simon Kuang, Yuezhu Xu, S. Sivaranjani +1
Department of Mechanical and Aerospace Engineering University of California, Davis · Edwardson School of Industrial Engineering Purdue University