HardNet++: Nonlinear Constraint Enforcement in Neural Networks

Andrea Goertzen, Kaveh Alim, Navid Azizan
4/21/2026
cs.LG

No confident code implementation found for this paper.

Abstract

Enforcing constraint satisfaction in neural network outputs is critical for safety, reliability, and physical fidelity in many control and decision-making applications. While soft-constrained methods penalize constraint violations during training, they do not guarantee constraint adherence during inference.

Show full abstract

Other approaches guarantee constraint satisfaction via specific parameterizations or a projection layer, but are tailored to specific forms (e.g., linear constraints), limiting their utility in other general problem settings. Many real-world problems of interest are nonlinear, motivating the development of methods that can enforce general nonlinear constraints. To this end, we introduce HardNet++, a constraint-enforcement method that simultaneously satisfies linear and nonlinear equality and inequality constraints. Our approach iteratively adjusts the network output via damped local linearizations. Each iteration is differentiable, admitting an end-to-end training framework, where the constraint satisfaction layer is active during training. We show that under certain regularity conditions, this procedure can enforce nonlinear constraint satisfaction to arbitrary tolerance. Finally, we demonstrate tight constraint adherence without loss of optimality in a learning-for-optimization context, where we apply this method to a model predictive control problem with nonlinear state constraints.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{goertzen2026hardnet,
  title  = {HardNet++: Nonlinear Constraint Enforcement in Neural Networks},
  author = {Andrea Goertzen and Kaveh Alim and Navid Azizan},
  year   = {2026},
  eprint = {2604.19669},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.19669v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.19669.svg)](https://codeofpaper.com/paper/2604.19669)

Discussion