Neural Slack Variables for Shape Constraints
Abstract
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, lose their constraint gradients at satisfied locations, allowing previously feasible points to drift back into violation. 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 positive target for the primary network's constraint quantities, inducing feasibility and regularity. On low-dimensional domains where dense supervision is practical, neural slack variables can mitigate constraint drift and bias the constraint profile toward the function class of the auxiliary network, which improves feasibility on our evaluation grids. Finally, in implied volatility surface modelling, an open industrial challenge in quantitative finance, neural slack variables preserve no-arbitrage constraints more reliably than penalty and primal-dual alternatives across both generation and calibration.