Pinet: Optimizing hard-constrained neural networks with orthogonal projection layers

Panagiotis D. Grontas, Antonio Terpin, Efe Balta, Raffaello D'Andrea, John Lygeros

International Conference on Learning Representations 2026 · Oral

Overview

The talk "Pinet: Optimizing hard-constrained neural networks with orthogonal projection layers" introduces a novel framework for training neural networks to solve parametric constrained optimization problems. Presented by Panagiotis D. Grontas and his colleagues, this work addresses a critical challenge in applying machine learning to real-world control, robotics, and decision-making scenarios: ensuring that the outputs of a neural network strictly adhere to a set of predefined, non-negotiable constraints. While traditional activation functions can enforce simple bounds (like ReLU for positive outputs or Sigmoid for values between zero and one), complex, multi-dimensional constraint sets (such as a rhombus or more intricate feasibility regions) remain difficult to guarantee.

Watch on SlidesLive

Visual summary for Pinet: Optimizing hard-constrained neural networks with orthogonal projection layers by Panagiotis D. Grontas, Antonio Terpin, Efe Balta, Raffaello D'Andrea, John Lygeros
Visual summary for Pinet: Optimizing hard-constrained neural networks with orthogonal projection layers by Panagiotis D. Grontas, Antonio Terpin, Efe Balta, Raffaello D'Andrea, John Lygeros

Key moments

  1. 0:00 Introduction to hard-constrained neural networks problem
  2. 2:00 Pinet's architecture: Neural network with projection layer
  3. 3:15 Efficient orthogonal projection using alternating projections
  4. 4:15 Handling complex, differentiable objective functions for training
  5. 5:45 Training: Differentiating projection layer via implicit function theorem
  6. 7:00 Experimental results: suboptimality, generalization, inference time
  7. 8:05 Q&A: Addressing generalization with hard constraints

Pinet: Optimizing hard-constrained neural networks with orthogonal projection layers

Speakers: Panagiotis D. Grontas, Antonio Terpin, Efe Balta, Raffaello D'Andrea, John Lygeros

Conference: ICLR 2026

YouTube: https://slideslive.com/39062197

Overview

The talk "Pinet: Optimizing hard-constrained neural networks with orthogonal projection layers" introduces a novel framework for training neural networks to solve parametric constrained optimization problems. Presented by Panagiotis D. Grontas and his colleagues, this work addresses a critical challenge in applying machine learning to real-world control, robotics, and decision-making scenarios: ensuring that the outputs of a neural network strictly adhere to a set of predefined, non-negotiable constraints. While traditional activation functions can enforce simple bounds (like ReLU for positive outputs or Sigmoid for values between zero and one), complex, multi-dimensional constraint sets (such as a rhombus or more intricate feasibility regions) remain difficult to guarantee.

The core innovation of Pinet lies in its architectural design, which integrates a projection layer directly into the neural network's forward pass. This layer takes the raw, potentially infeasible output from a standard neural network backbone and orthogonally projects it onto the desired constraint set, thereby guaranteeing feasibility by design. The talk highlights the method's ability to handle a broad class of convex constraints, including both linear and non-linear types, and its efficient implementation for both forward inference and backward differentiation. This approach is particularly relevant for applications where constraint violations are unacceptable, such as in safety-critical systems or resource-constrained environments.

The significance of Pinet extends to its ability to learn optimal solutions for problems where traditional solvers are slow or unavailable, all while maintaining rigorous adherence to constraints. By leveraging an ADMM-derived alternating projection scheme for the forward pass and the Implicit Function Theorem for efficient backpropagation, Pinet achieves superior performance in terms of solution quality, constraint satisfaction, and inference speed compared to existing machine learning-based optimization proxies. This work represents a substantial step towards making neural networks more reliable and trustworthy for solving complex, real-world optimization challenges under strict operational guidelines.

Background

▶ Watch: Introduction to hard-constrained neural networks problem (0:00)

The convergence of machine learning and optimization has opened new avenues for solving complex decision-making problems. Traditional optimization often relies on iterative solvers that can be computationally expensive, especially for parametric problems where the optimal solution changes with varying input contexts. Machine learning, particularly neural networks, offers the promise of learning a fast, amortized mapping from context to optimal solution, bypassing the need for repeated, slow optimization at inference time. However, a fundamental challenge arises when these optimization problems include "hard" constraints—conditions that must be satisfied by the solution.

Standard neural network architectures are not inherently designed to enforce such strict constraints. While soft constraints can be incorporated into the loss function as penalties, this approach only encourages, but does not guarantee, feasibility. For many applications, particularly in engineering, robotics, and control systems, violating a constraint (e.g., a robot exceeding its joint limits, a vehicle deviating from a safe path, or a power grid operating outside voltage bounds) can lead to catastrophic failures or unsafe conditions. The traditional approach to ensure feasibility is to use projected gradient descent or similar methods, but integrating these directly into an end-to-end differentiable neural network architecture for learning the projection itself has been a non-trivial task.

Prior work in this area has explored various strategies, including specialized activation functions for simple bounds, differentiable optimization layers (e.g., OptNet, DeepOPF), or learning to predict parameters for a subsequent optimization problem. However, these often either lack the generality to handle arbitrary complex convex constraint sets, suffer from computational bottlenecks during training or inference, or do not provide a strong guarantee of feasibility for the neural network's direct output. The problem is exacerbated when the objective function itself is non-standard or non-convex, making it difficult for conventional solvers to provide training data or even find solutions reliably. Pinet emerges from this landscape by proposing a robust and generalizable method to embed hard constraints directly into the neural network architecture, ensuring that the learned solutions are always feasible and high-quality, even for intricate optimization problems like motion planning with complex coverage objectives.

Key Findings

▶ Watch: Efficient orthogonal projection using alternating projections (3:15)

Pinet presents a compelling solution to the problem of hard-constrained neural network optimization, characterized by several key findings:

  1. Feasibility by Design: The most critical finding is the ability to guarantee that the neural network's output always satisfies a set of hard constraints. This is achieved through a novel architecture where a standard neural network backbone maps an input context to a raw, potentially infeasible output, which is then fed into a dedicated projection layer. This layer orthogonally projects the raw output onto the desired constraint set, ensuring the final output is always feasible.
  1. Efficient and Generalizable Projection: The projection layer, despite involving a non-closed-form optimization problem, is implemented efficiently. Pinet leverages the intuition that many complex convex constraint sets C can be decomposed into simpler sets A and K, each admitting efficient projections. An ADMM-derived alternating projection scheme is then used to find the projection onto C. This method is shown to converge and is capable of handling a wide array of convex constraints, including linear equalities, box constraints, general linear inequalities, second-order conic constraints, L1 and L-infinity ball bounds, and simplexes.
  1. Differentiable Projection for End-to-End Training: A significant contribution is the development of a method to differentiate through this non-closed-form projection layer, enabling end-to-end training of the entire neural network. This is achieved by formulating the projection as the fixed point of an operator and applying the Implicit Function Theorem to compute the necessary Jacobian-vector products during backpropagation. This allows the network weights to be optimized based on the objective function evaluated at the feasible projected output.
  1. Superior Performance in Parametric Optimization: Pinet consistently outperforms existing machine learning-based proxies for parametric constrained optimization across multiple metrics.
  • Training Efficiency: It achieves high-quality solutions in a fraction of the training time compared to other learning methods.
  • Generalization: On unseen test problems, Pinet demonstrates substantially better generalization, achieving significantly lower relative suboptimality and lower constraint violation simultaneously, indicating both higher quality and guaranteed feasibility.
  • Inference Speed: Pinet solves challenging non-convex benchmark problems with hard constraints in approximately 5 milliseconds, which is six times faster than traditional solvers (which take around 30 milliseconds for the same problems). While matching the inference speed of other learning methods, Pinet delivers superior solution quality.
  1. Independence from Optimal Solution Data: Unlike many supervised learning approaches to optimization that require a dataset of optimal solutions, Pinet does not. This is a crucial advantage, as generating such datasets can be prohibitively expensive or even impossible for problems without efficient traditional solvers (e.g., problems with exotic objective functions like coverage maximization). The network learns to find feasible, high-quality solutions by minimizing the objective function directly on its projected outputs.

Technical Deep Dive

▶ Watch: Handling complex, differentiable objective functions for training (4:15)

The technical foundation of Pinet rests on a clever integration of optimization theory within a deep learning framework, addressing the challenges of both forward pass feasibility and backward pass differentiability.

Architecture and Forward Pass

The Pinet architecture is conceptually straightforward yet powerful:

  1. Neural Network Backbone: A standard neural network (e.g., an MLP or CNN) takes the context x as input and produces a raw output y_raw. This y_raw is typically a high-dimensional vector representing a candidate solution, which may or may not satisfy the desired constraints.
  2. Projection Layer: The y_raw is then passed through the core innovation: the projection layer. This layer computes the orthogonal projection of y_raw onto the constraint set C. Mathematically, this involves solving the following quadratic program:

y_proj = argmin ||y - y_raw||^2

subject to y ∈ C

The output y_proj is guaranteed to be a feasible point, satisfying all hard constraints.

  1. Objective Evaluation: Finally, the objective function phi(y_proj, x) is evaluated at the feasible point y_proj and the context x. This value forms the basis of the loss function during training.

The critical challenge in the forward pass is the efficient computation of y_proj. Since the projection onto a general convex set C often lacks a closed-form solution, Pinet employs an iterative algorithm. The core intuition is that while projecting onto C might be hard, C can frequently be decomposed as the intersection of two simpler convex sets, A and K, for which projections are efficient (e.g., A could be linear equalities, K could be box constraints). Pinet uses an algorithm derived from the Alternating Direction Method of Multipliers (ADMM), which iteratively projects onto A and K. This alternating projection scheme is guaranteed to converge to the true projection onto C under standard convexity assumptions.

Pinet's implementation provides out-of-the-box support for a wide range of convex constraints, including:

  • Linear Constraints: Linear equalities (Ay = b), box constraints (l <= y <= u), and general linear inequalities (Gy <= h).
  • Non-linear Convex Constraints: Second-order conic constraints (e.g., ||Ay + b||_2 <= c^T y + d), L1 ball bounds (||y||_1 <= r), L-infinity ball bounds (||y||_inf <= r), and simplex constraints (sum(y_i) = 1, y_i >= 0).

For all these types, efficient projection operators are either known or can be derived, making the ADMM-based alternating projection scheme practical.

The objective function phi itself can be highly complex, as long as it is differentiable. The talk provides an example of maximizing "coverage along trajectories" for multiple robots, where the objective involves attaching Gaussians to robot positions over time, rasterizing the workspace, and integrating Gaussian contributions to form a bitmap whose brightness (coverage) is maximized. Such exotic objectives are difficult for traditional solvers but pose no fundamental problem for Pinet, as gradients are computed via automatic differentiation.

Backward Pass and Training

Training Pinet involves minimizing the average objective function value over a dataset of contexts x. The loss function is simply L = E_x [phi(y_proj(y_raw(x, theta)), x)], where theta represents the neural network weights. To update theta, the gradient dL/dtheta is required. Using the chain rule, this gradient involves three main terms:

dL/dtheta = (dphi/dy_proj) (dy_proj/dy_raw) (dy_raw/dtheta)

  • dphi/dy_proj: The gradient of the objective function with respect to the projected output. This is typically straightforward to compute with automatic differentiation frameworks (e.g., PyTorch, TensorFlow).
  • dy_raw/dtheta: The gradient of the raw neural network output with respect to its weights. This is the standard backpropagation through the backbone neural network, also handled by automatic differentiation.
  • dy_proj/dy_raw: This is the challenging term: the Jacobian of the projection operation with respect to its input. Since the projection is computed via an iterative algorithm rather than a closed-form expression, direct differentiation is not possible.

Pinet addresses this challenge by leveraging the Implicit Function Theorem (IFT). The projection y_proj is a fixed point of the ADMM-derived operator Phi used in the alternating projection scheme: y_proj = Phi(y_raw, y_proj). This equation implicitly defines y_proj as a function of y_raw. By differentiating both sides of this fixed-point equation with respect to y_raw and applying the chain rule, a linear system of equations can be derived whose solution yields the Jacobian dy_proj/dy_raw. Specifically, the expression for the vector-Jacobian product v^T (dy_proj/dy_raw) (which is what's needed in backpropagation) can be found by solving a linear system involving the Jacobians of the Phi operator itself (which are known and computable because Phi is constructed from simple, differentiable projection steps). This approach allows for efficient computation of gradients through the projection layer without needing to explicitly form the full Jacobian matrix.

The overall training procedure involves repeatedly sampling mini-batches of contexts, performing the forward pass (NN backbone, ADMM projection, objective evaluation), computing the loss, and then backpropagating gradients using the IFT for the projection layer. Weights are then updated using standard optimizers like Adam or SGD. A significant advantage of this approach is that it does not require pre-computed optimal solutions for training, which simplifies dataset generation and enables learning for problems where no off-the-shelf solver exists.

Experimental Setup & Results

▶ Watch: Experimental results: suboptimality, generalization, inference time (7:00)

The evaluation of Pinet focuses on demonstrating its efficacy in solving parametric constrained optimization problems, comparing its performance against other machine learning-based optimization proxies and traditional optimization solvers. The key metrics assessed include solution quality (relative suboptimality), adherence to constraints (constraint violation), training efficiency (wall-clock time during training), and inference speed.

Comparison Baselines:

  • Other ML-based proxies: These typically involve training a neural network to directly predict optimal solutions or parameters for a solver, often using soft constraints or post-hoc projection.
  • Traditional Solvers: State-of-the-art optimization algorithms (e.g., interior-point methods, sequential quadratic programming) that directly solve the constrained optimization problem for each instance.

Evaluation Scenarios:

The talk uses "non-convex benchmark problems" and specific examples like the complex motion planning task for five robots with coverage maximization, which inherently involve hard constraints. These problems highlight Pinet's ability to handle both standard and exotic objectives.

Key Results:

  1. Training Efficiency (Relative Suboptimality vs. Wall-Clock Time):
  • Pinet (represented by a thin blue line in the presented graph) demonstrates superior efficiency during training. It achieves high-quality solutions, indicated by low relative suboptimality, in a "fraction of the training time" compared to other learning methods. This suggests that Pinet converges faster or more effectively to desirable solutions, making the learning process more practical.
  1. Generalization Performance (Constraint Violation vs. Relative Suboptimality):
  • This metric is crucial for real-world applicability, as it evaluates performance on unseen test problems. A 2D plot with constraint violation on the x-axis and relative suboptimality on the y-axis is used, where the lower-left corner represents optimal performance (low violation, low suboptimality).
  • Pinet "substantially outperforms existing learning methods." It consistently achieves significantly lower constraint violation (often near zero) while simultaneously maintaining very low relative suboptimality. This confirms Pinet's core promise: outputs are not only high-quality but also strictly feasible, even for new, unseen problem instances. The speaker emphasizes that for parametric constraint optimization, guaranteeing feasibility is not a loss of generalization but a fundamental requirement of the problem itself.
  1. Inference Time:
  • The speed at which solutions can be generated is critical for real-time applications. Pinet's inference time for these non-convex benchmark problems is approximately 5 milliseconds.
  • In contrast, traditional solvers require about six times the amount, meaning around 30 milliseconds, to find a solution for a single instance. This demonstrates Pinet's significant speed advantage over conventional optimization methods for real-time deployment.
  • When compared to other learning methods, Pinet achieves similar inference times but with the crucial distinction of providing "much better solution quality" (as shown in the generalization plot), particularly in terms of guaranteed constraint satisfaction.

In summary, Pinet's experimental results robustly support its claims: it offers a method for learning solutions to hard-constrained optimization problems that are not only fast to infer but also guaranteed to be feasible and of high quality, outperforming existing learning paradigms and providing substantial speedups over traditional solvers.

Practical Implications

▶ Watch: Q&A: Addressing generalization with hard constraints (8:05)

The Pinet framework offers significant practical implications for a wide range of fields where constrained optimization is paramount:

  • For Practitioners and Model Builders: Pinet empowers data scientists and ML engineers to build neural network models that can be confidently deployed in safety-critical or resource-constrained environments. By guaranteeing constraint satisfaction by design, it eliminates the guesswork and post-processing often required to ensure feasibility from standard neural network outputs. This is particularly valuable in robotics (e.g., collision avoidance, joint limit adherence), autonomous systems (e.g., path planning, vehicle dynamics), and control systems (e.g., power grid stability, process control), where constraint violations can have severe consequences.
  • For Infrastructure Teams: The ability to achieve fast inference times (around 5 milliseconds) for complex optimization problems means that Pinet-based solutions can be integrated into real-time decision-making pipelines. This reduces the computational load on inference servers compared to traditional solvers, potentially lowering latency and hardware requirements. The framework's flexibility in handling various convex constraint types also means infra teams can support a broader range of applications with a consistent ML-based optimization approach.
  • Amortized Optimization for Complex Objectives: Pinet's capacity to handle exotic, differentiable objective functions (like coverage maximization) that are challenging for traditional solvers opens up new possibilities for optimizing non-standard performance metrics. This allows for more nuanced and context-aware decision-making, moving beyond simple cost minimization to objectives that reflect complex human preferences or environmental goals, amortized across many instances.
  • Reduced Data Generation Costs: The framework's independence from pre-computed optimal solution datasets during training is a major advantage. Generating such datasets can be a costly and time-consuming bottleneck, especially for problems where traditional solvers are slow or unreliable. Pinet allows direct training on the objective function, significantly streamlining the development workflow for constrained optimization tasks.

Tradeoffs and Limitations:

While powerful, Pinet does have certain considerations:

  • Convexity Requirement: The ADMM-derived projection algorithm and its differentiability via the Implicit Function Theorem rely on the constraint set C being convex. Non-convex constraints remain a more challenging problem for this specific approach.
  • Computational Overhead of Projection Layer: Although efficient, the iterative projection layer adds computational cost during both inference and training compared to a purely feedforward neural network. However, the demonstrated 5ms inference time shows this overhead is manageable and often significantly faster than traditional solvers.
  • Complexity of Implementation: Implementing the ADMM-based projection and its implicit differentiation requires a deeper understanding of optimization and numerical methods than standard neural network training, though Pinet aims to provide these components out-of-the-box.

Despite these considerations, Pinet offers a robust and highly effective paradigm for integrating hard constraints into neural networks, pushing the boundaries of what is achievable with ML-based optimization in real-world applications.

Key Takeaways

  • Guaranteed Feasibility by Design: Pinet introduces a novel neural network architecture that ensures outputs always satisfy hard constraints through an integrated, differentiable projection layer, critical for safety-critical applications.
  • Efficient and Generalizable Projection: The framework employs an ADMM-derived alternating projection scheme that efficiently handles a broad class of convex constraints, including linear and various non-linear types, without closed-form solutions.
  • End-to-End Differentiability via Implicit Function Theorem: Pinet leverages the Implicit Function Theorem to differentiate through the non-closed-form projection layer, enabling seamless end-to-end training of the entire network based on feasible outputs.
  • Superior Performance: It significantly outperforms other ML-based optimization proxies in terms of solution quality, generalization (low suboptimality and constraint violation), and achieves inference speeds (approx. 5ms) that are six times faster than traditional solvers.
  • No Optimal Solution Data Required: Pinet's training process does not necessitate pre-computed datasets of optimal solutions, simplifying data generation and enabling learning for problems where traditional solvers are unavailable or too slow.
  • Enables Complex Objective Optimization: The architecture can handle highly complex and exotic differentiable objective functions, allowing for more sophisticated and nuanced optimization goals beyond simple cost functions.

About the Speaker(s)

The talk was presented by Panagiotis D. Grontas, who is the lead author of the Pinet research. He is part of a collaborative team including Antonio Terpin, Efe Balta, Raffaello D'Andrea, and John Lygeros. While specific titles and affiliations for all speakers were not detailed in the transcript, Panagiotis's clear and detailed explanation of the complex technical aspects of Pinet demonstrates his deep expertise in the intersection of neural networks, optimization, and control systems. The collective effort of the team, as evidenced by the comprehensive nature of the work, highlights a strong background in developing advanced solutions for challenging engineering problems.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026