Fast inference and strict constraint satisfaction are essential for learning-based decision-making. Existing methods often rely on constraint-specific projections or feasible-set parameterizations, while iterative repair can be costly. We introduce Convex-SKM-Net, a convex constraint-satisfaction layer that forms linearization halfspaces from residual and (sub)gradient oracles without constraint-specific inequality projectors. It applies fixed-depth dual projected-gradient descent (dual PGD) to minimum-displacement block problems using GPU-friendly matrix operations. We jointly learn the predictor and a positive-definite mobility, adapting the correction geometry to improve objective quality. We prove convergence of the outer iterates at fixed dual depth and linear convergence in distance under Slater's condition and bounded subgradients. All our test outputs on three second-order-cone model-predictive control (SOC-MPC) horizons and six power-system convex relaxations satisfy a 10−3 feasibility tolerance. Comparisons with the latest constraint-satisfaction methods show inference speedups of up to 144.3× on SOC-MPC and 7.7× on a convex quadratically constrained quadratic programming (QCQP) benchmark with joint training. On QCQP, the mean objective gap is 0.012%, with full test feasibility at 10−4. Learning mobility reduces the five-seed affine-task mean gap by 22.4% and improves gaps in matched power-system comparisons.
Figures & tables
Figure 1: Repair in reduced space with fixed (blue) or learned (red) mobility. The inset shows block reselection under one linearization. Trajectories are schematic.
Operation
Local objective
Computation
Single-row SKM
Minimum displacement into one halfspace
Closed-form projection
Equality-LS
Boundary fit on all selected rows
Pseudoinverse or linear solve
Block-pinv
Boundary fit on violated rows
Pseudoinverse
Violation-GD
21∥[UBΔ+s]+∥2
Primal gradient steps
Dual PGD (ours)
Minimum displacement under inequalities
Dual projected-gradient steps
Table 1: Local operations on selected linearizations. Boundary fitting selects a minimum-norm least-squares displacement.
Method
Gap (%)
Feas. (%)
Time (ms)
Gurobi
0.000
100
20.809
MOSEK
0.000
100
4.974
DC3
5.909
100
0.566
Π net
0.130
100
75.952
SnareNet
2.913
100
58.567
Ours
0.192
100
0.941
Table 2: SOC-MPC: 1,000 tests per horizon; mean signed Gap and mean single-instance time. Bold marks best neural Gap/time. Gurobi/MOSEK use single-thread CPUs. —: SnareNet training exceeded 24 GB on RTX 4090 with default XLA.
Figure 2: Fixed-depth SOC-MPC: columns H=20,40,80 ; mean signed Gap (top) and maximum original violation (bottom) versus mean latency. Each point covers 1,000 tests at tolerance 10−3 . Other methods: Table 2 settings. Full values: Appendix D.1 .
Method
57 buses
118 buses
300 buses
Gap (%)
Feas. (%)
Time (ms)
Gap (%)
Feas. (%)
Time (ms)
Gap (%)
Feas. (%)
Time (ms)
(a) SOCP
MOSEK
0.000
100
31.234
0.000
100
108.978
0.000
100
410.376
Π net
0.059
100
203.366
0.396
98.5
2169.503
0.106
99.2
20934.989
FSNet
0.053
100
26.556
0.395
97.0
355.968
0.112
8.5
3199.870
SnareNet
0.116
100
48.862
0.530
88.25
6452.791
—
—
—
Table 3: SOCP/SDP: mean Gap and mean single-instance time, including failures. External postprocessors share full FT post’s raw predictions. Bold compares our variants, including rounded ties; —: case-300 SnareNet was too slow to evaluate fully.
Figure 3: Affine-task fixed-depth comparison: mean nonnegative Gap (left) and maximum violation over 5,120 outputs (right) versus latency; both axes are logarithmic. Tolerance is 10−3 . Gap and latency average five seeds. Full values: Appendix D.2 .
Method
Gap (%)
Time (ms)
DC3
66.918
0.600
SnareNet
0.159
18.963
Π net ( K=200 )
0.040
6.126
Ours
0.012
2.469
Table 5: QCQP: all seven configurations achieve 100% feasibility at 10−4 . Mean nonnegative Gap and prediction-plus-repair latency, averaged over three complete test passes. Bold marks best Gap/time per mode, including rounded ties.
Figure 4: QCQP fixed-depth sweep: joint/post columns, mean Gap/maximum original violation rows, and mean latency; all 833 tests per point at tolerance 10−4 . Axes are logarithmic except joint Gap on [0,0.01%] . Full values: Appendix D.7 .
Method
Squared affine
Log-sum-exp
Rotated SOC
Single row (frozen)
29.745 /
107.956
34.383 /
100.015
18.444 /
66.106
M-SSP
16.916 /
41.322
23.284 /
67.219
11.842 /
73.798
Violation-GD
4.076 /
5.004
3.438 /
4.257
2.790 /
3.585
BPP-16
54.299 /
43.175
33.791 /
28.204
29.333 /
24.068
Dual PGD (ours)
3.470 /
4.759
3.047 /
3.822
2.363 /
3.201
Table 6: Median time to feasibility (ms), small/medium per cell, five successful instances each. Small/medium (n,neq,m)=(256,32,2048)/(512,64,4096) .
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
Task
Training
Validation
Test
SOC-MPC, each H
8,000
1,000
1,000
Affine-constrained nonconvex optimization
7,952
1,024
1,024
Convex QCQP
8,334
833
833
ACOPF, 57 buses
2,000
200
200
ACOPF, 118 buses
4,000
400
400
ACOPF, 300 buses
10,000
1,000
1,000
Appendix
Table 7: Training, validation, and test sizes. SOC-MPC data are generated separately for each horizon. Each ACOPF relaxation uses the listed sizes.
H
Step
Train steps
Penalty
Test cap
20
0.1
5
0.5
500
40
8.75876×10−4
20
5
8000
80
3.54856×10−6
5
5
12800
Appendix
Table 8: SOC-MPC DC3 correction settings.
Buses
Train outer
Train inner
Train dual
Test inner
Test dual
57
2
4
4
4
8
118
2
10
10
10
20
300
2
20
20
20
40
Appendix
Table 9: ACOPF train and test correction budgets.
Primitive
g(y)
Subgradient
Affine
a⊤y+c
a
Squared affine
21(a⊤y+c)2−b
(a⊤y+c)a
Log-sum-exp
log∑jepj⊤y+βj−b
∑jπjpj
Norm minus affine
∥My+c∥−t⊤y−b
M⊤u−t
Squared norm
∥Fy+c∥2−b
2F⊤(Fy+c)
PSD
−λmin(W(y))
(−v∗Wjv)j
Appendix
Table 10: Decision-space residuals and selected subgradients.
H
Mobility
Head rate
Gap (%)
Time (ms)
20
Identity
fixed
0.19939
0.828
20
Learned, common-rate control
3×10−4
0.33924
1.308
20
Learned, main
3×10−5
0.19200
0.941
40
Identity
fixed
0.77589
0.947
40
Learned, main
3×10−4
0.23561
1.061
80
Identity
fixed
0.94790
1.100
Appendix
Table 11: SOC-MPC mobility controls. Gaps retain their signs; time is mean single-instance latency.
H
Fixed K
Gap (%)
Max viol.
Feas. (%)
Time (ms)
20
10
23.58977
6.13×10−2
44.1
2.281
20
25
5.41482
3.65×10−2
14.8
5.055
20
50
0.54972
1.29×10−2
9.5
9.841
20
100
0.14579
2.75×10−3
49.9
19.278
20
200
0.11107
1.36×10−3
97.8
38.747
20
400
0.13016
6.21×10−4
100.0
75.952
Appendix
Table 12: Π net fixed test depths on SOC-MPC (1,000 cases per horizon). Gap is the signed mean per-case relative objective difference; Max viol. is the maximum original constraint violation over all cases; time averages all instances. Feasibility uses tolerance 10−3 . Rows K=400 at all three horizons are the main-table results. Each depth is evaluated separately; the original K=(1000,1000,400) rows reuse the archived runs on the same checkpoints.
H
Stopping
Gap (%)
Max viol.
Feas. (%)
Time (ms)
20
Original
0.01904
7.291×10−3
77.9
20.534
20
Calibrated
2.91321
2.642×10−4
100.0
58.567
40
Original
0.06786
4.385×10−3
79.2
61.758
40
Calibrated
1.76219
2.418×10−4
100.0
175.515
Appendix
Table 13: SnareNet SOC-MPC stopping controls, using one checkpoint and all 1,000 test cases per horizon. Original settings use internal threshold 10−3 and cap 100 ; validation-calibrated settings use 10−4 and 500 and appear in the main table. Gap retains its sign; external feasibility always uses 10−3 . Time is mean single-instance latency.
H
Method
Gap (%)
Feas. (%)
Time (ms)
20
Gurobi
-4.50e-5
100
20.809
20
MOSEK
-1.07e-6
100
4.974
20
DC3
5.90896
100
0.566
20
Π net
0.13016
100
75.952
20
SnareNet
2.91321
100
58.567
20
Ours
0.19200
100
0.941
Appendix
Table 14: SOC-MPC main-table results at full precision; settings match Table 2 .
Method
Gap (%)
Max viol.
Feas. (%)
Single time (ms)
Batch time (ms)
DC3
7.89393
0.30938
99.824
3.043
3.809
JAXopt
0.38841
9.999×10−4
100
7.226
111.679
SnareNet
6.16897
9.02×10−4
100
3.041
61.441
Π net ( K=50 )
0.33117
1.02×10−4
100
0.642
5.370
Ours (identity mobility)
0.24518
9.999×10−4
100
0.410
1.864
Ours (learned mobility)
0.19032
9.995×10−4
100
0.523
4.384
Appendix
Table 15: Complete affine-task results, including maximum original violation and batch timing. Five seeds each test 1,024 instances; violation takes the maximum, other columns average seeds.
Test mode
Gap (%)
Max viol.
Feas. (%)
Single time (ms)
Batch time (ms)
K=1
29.77461
2.381×100
75.84
0.079
0.410
K=2
4.14283
4.083×100
0
0.106
0.554
K=5
0.02529
1.738×100
0
0.158
0.845
K=10
0.25240
2.711×10−1
0
0.211
1.335
K=15
0.35811
7.469×10−2
0.059
0.266
1.833
K=20
0.32809
1.794×10−2
0.02
0.312
2.317
Appendix
Table 16: Fixed-depth and early-stop Π net on the affine task. Gap and latency average five seeds; Max viol. is the maximum across all 5,120 outputs. Feasibility uses 10−3 , and Gap includes infeasible outputs.
Mobility
Train tol
Test tol
Gap (%)
Max viol.
Single time (ms)
Batch time (ms)
Identity
10−3
10−3
0.24518
9.999×10−4
0.410
1.864
Learned
10−3
10−3
0.19032
9.995×10−4
0.523
4.384
Identity
10−6
10−3
0.24606
9.99×10−4
0.341
1.678
Identity
10−6
10−6
0.24636
9.96×10−7
0.833
2.918
Learned
10−6
10−3
0.19167
9.99×10−4
0.543
4.908
Learned
10−6
10−6
0.19215
9.999×10−7
3.605
9.267
Appendix
Table 17: Training and test tolerance controls for our method on nonconvex optimization with affine constraints; all rows are 100% feasible at their test tolerance.
Epochs
AdaRel
Gap (%)
Max viol.
Single time (ms)
Batch time (ms)
50
Off
13.06420±2.36947
9.61×10−4
3.525
62.326
50
On, main
6.16897±1.72330
9.02×10−4
3.041
61.441
100
Off
8.72578±1.79889
8.28×10−4
4.465
65.159
100
On
4.72325±1.43125
9.91×10−4
2.943
58.483
Appendix
Table 18: SnareNet relaxation and training-duration controls. Each row aggregates five seeds, each testing all 1,024 instances. Gap gives mean ± sample standard deviation. Every configuration is 100% feasible at 10−3 . The 100 -epoch runs retain the 25 -epoch relaxation decay.
Mean gap (%)
Post
Joint
Relax.
Buses
Full
Head
Identity full
Identity head
Learned head
SOCP
57
0.05115
0.05142
0.04430
0.05013
0.05010
SOCP
118
0.41878
0.18361
0.40576
0.17931
0.16658
SOCP
300
0.09816
0.04123
0.09951
0.04130
0.03676
SDP
57
0.07490
0.06420
0.07079
0.06408
0.06401
Appendix
Table 19: ACOPF control mean gaps (%). All models are 100% feasible at 10−3 ; sample sizes are 200, 400, and 1,000 for 57, 118, and 300 buses.
Task
Method
Failed / Total
At cap
Max eq.
Max ineq.
SOCP118
Π net
6/400
6
2.408×10−12
1.008×10−2
SOCP118
FSNet
12/400
12
1.855×10−3
1.221×10−2
SOCP118
SnareNet
47/400
47
1.398×10−3
3.522×10−2
SDP57
SnareNet
25/200
25
9.795×10−4
2.278×10−3
SDP118
SnareNet
295/400
295
1.501×10−3
4.317×10−2
SOCP300
FSNet
915/1,000
915
4.780×10−3
8.692×10−3
Appendix
Table 20: Infeasible ACOPF baseline outputs and iteration limits. “At cap” counts only infeasible outputs; maximum residuals include all test outputs.
Case
Step
Epochs
Feasible tests
Max ineq. violation
SOCP57
3×10−11
2000
0/200
0.19304
SOCP118
3×10−14
2000
0/400
189.69979
SDP57
3×10−11
2000
0/200
0.13667
SDP118
3×10−14
2000
0/400
94.37722
Appendix
Table 21: DC3 tests after step calibration and increased penalty; maximum violation uses native residuals.
Relax.
Buses
Max equality
Max inequality
Build time (ms)
SOCP
57
1.590×10−7
2.557×10−7
5.378
SOCP
118
7.072×10−4
7.370×10−4
12.333
SOCP
300
2.135×10−4
1.216×10−4
27.268
SDP
57
6.393×10−6
3.777×10−7
16.649
SDP
118
5.205×10−6
4.890×10−7
53.069
SDP
300
9.826×10−4
1.195×10−4
331.634
Appendix
Table 22: MOSEK native-residual audit and mean model-construction time over 200/400/1,000 tests.
Method
Success
Stop time (ms)
Mean outer
Max viol.
Paired ratio
Squared affine
Single-row SKM
5/5
75.606
589.0
9.952e-04
21.79
Single-row frozen
5/5
29.745
117.8
9.516e-04
9.23
Equality-LS/pinv
0/5
1045.233 †
8.0
1.887e+02
–
Equality-LS/lstsq
0/5
1044.895 †
8.0
8.198e+02
–
Block-pinv
5/5
547.114
5.4
8.586e-04
152.52
Appendix
Table 23: Small synthetic systems (n,neq,m)=(256,32,2048) . Dagger: time includes failed outputs.
Method
Success
Stop time (ms)
Mean outer
Max viol.
Paired ratio
Squared affine
Single-row SKM
0/5
182.660 †
1024.0
1.092e-02
–
Single-row frozen
5/5
107.956
242.2
9.847e-04
21.93
Equality-LS/pinv
0/5
1066.688 †
8.0
2.561e+02
–
Equality-LS/lstsq
0/5
1069.191 †
8.0
2.539e+02
–
Block-pinv
5/5
642.880
5.6
6.650e-04
136.56
Appendix
Table 24: Medium synthetic systems (n,neq,m)=(512,64,4096) . Dagger: time includes failed outputs.
Time (ms)
Scale
Family
M-SSP
Dual PGD
Ratio
M-SSP outer
Small
Squared affine
16.916
3.617
4.88
140.2
Log-sum-exp
23.284
3.257
7.43
160.2
Rotated SOC
11.842
2.315
5.11
95.0
Medium
Squared affine
41.322
4.898
9.44
297.6
Log-sum-exp
67.219
4.303
15.90
362.2
Appendix
Table 25: M-SSP versus same-device dual PGD. Both succeed on all five seeds per group. Ratios are medians of paired instance ratios.
Absolute gap
Mode
Method
Geom. mean
Max
Max ineq.
Max eq.
Joint
DC3
8.7725242
13.8658313
9.980×10−7
1.293×10−14
Joint
SnareNet
0.0202505
0.0749286
2.16×10−5
3.33×10−5
Joint
Π net ( K=200 )
0.00194093
0.0616385
1.347×10−8
1.205×10−14
Joint
Ours
0.00130975
0.0165973
1.00×10−6
8.95×10−15
Post
SnareNet
0.500654
1.038013
1.42×10−5
1.85×10−5
Appendix
Table 26: Convex QCQP absolute objective gaps and maximum original residuals. Absolute gap is fx(y)−fxref ; its geometric mean and maximum cover all test instances. All gaps are positive. All configurations are 100% feasible at 10−4 .
Epochs
Test correction
Gap (%)
Feas. (%)
Max viol.
Time (ms)
1,000
Released
78.19945
97.719
5.080×10−1
0.372
1,500
Released
66.90930
96.279
1.752×100
0.378
1,500
Calibrated
66.91845
100
9.980×10−7
0.600
Appendix
Table 27: DC3 training-budget and test-correction controls. Each row covers all 833 test inputs. Feasibility uses 10−4 original-residual tolerance; Gap and latency include failures. Calibration uses validation data only. The last row is the main-table configuration.
Mode
K
Gap (%)
Max viol.
Feas. (%)
Time (ms)
Joint
5
0.00000
1.996×100
0
0.330
10
0.00032
5.884×10−1
0
0.465
20
0.06495
1.119×10−1
0
0.753
30
0.08713
3.960×10−2
0
1.057
50
0.04274
8.110×10−3
0
1.639
75
0.04031
8.920×10−4
58.583
2.422
Appendix
Table 28: Complete fixed-depth Π net sweep on convex QCQP. Each row tests all 833 instances. Max viol. is the largest original residual; feasibility uses 10−4 . Gap includes infeasible outputs. The joint K=200 and post K=400 rows also appear in the main table.
Graph-structured optimization with linear constraints is fundamental to critical infrastructure but faces scalability limits due to massive strict hard constraints and high dimensionality. While recent projection-based methods such as Trainable Sampling Kaczmarz-Motzkin Net (T-SKM-Net) guarantee feasibility, they face high computational costs in dynamic environments by processing the entire constraint set and requiring expensive matrix factorizations. To bridge this gap, we propose the Accelerated Trainable-SKM (AT-SKM) Net framework. To concentrate computation on the active constraints and eliminate redundant calculations, we introduce a hybrid sampling strategy guided by a topology-aware heterogeneous GNN model. To efficiently handle topological shifts in graph-based constraints, we employ a Cholesky Update mechanism that theoretically reduces the equality projection complexity from O(N^3) to O(N^2) under low-rank perturbations. Experiments on random geometric graphs, N-1 Security-Constrained DC-OPF, and minimum-cost gas transport problem demonstrate that AT-SKM reduces iteration counts by up to 85% and achieves 2.95x-7.29x SKM layer speedups, while maintaining zero constraint violations.
Precise constraint satisfaction is a prerequisite to deploying learned models in many areas, motivating methods that repair raw neural predictions with a repair procedure. Current methods unroll multiple repair steps in training and softly penalize constraint violations that remain after the unroll. This is compute- and memory-intensive, lacks robustness when the repair fails to converge, and surrenders most of the constraint satisfaction work to the repair. Our central finding is that, contrary to common practice, a single detached projection step suffices in training. We accomplish this with a Projection-Adaptive Loss (PAL), which uses the constraint residual after this single step to adaptively weigh constraint penalties on the raw prediction. In experiments, PAL is the only method that retains virtually perfect feasibility on extremely nonlinear constraints, and matches or outperforms current methods on synthetic and engineering benchmarks. Because it only requires a single detached projection step, PAL trains 2.5x faster than the canonical repair-based method (DC3) on its own ACOPF benchmark. PAL can also be trained when constraints are expensive to evaluate (e.g., via neural surrogates), a setting where current unrolled methods are memory-intractable.
Enforcing functional inequality constraints such as monotonicity and convexity in neural networks is a fundamental challenge in many industrial and scientific applications. Classical one-sided penalty methods, along with primal-dual methods gated by complementary slackness, provide constraint gradients only at violated locations, resulting in fragile satisfaction. Architectures that guarantee feasibility by construction, on the other hand, remain largely limited to elementary cases and impose additional inductive biases. We introduce neural slack variables, a deep learning native primal-side approach that converts constraint enforcement into a regression problem by coupling the primary network with a jointly learned auxiliary network. The auxiliary network serves as a valid target for the primary network's constraint quantities, inducing feasibility and regularity. Neural slack variables achieve zero measured violations on dense-grid monotonicity and convexity test cases, where penalty and primal-dual baselines leave residual violations, and enable arbitrage-free learning of volatility surfaces, an open industrial challenge in quantitative finance.
Ruben Wiedemann, Antoine Jacquier, Lukas Gonon
Imperial College London London, UK · University of St. Gallen St. Gallen, Switzerland