[Paper Review] Imposing Hard Constraints on Deep Networks: Promises and Limitations
The paper shows hard constraints can be imposed on deep networks using a Krylov-subspace approach to solve large constrained optimization problems, but soft constraints with Adam perform better and are more practical.
Imposing constraints on the output of a Deep Neural Net is one way to improve the quality of its predictions while loosening the requirements for labeled training data. Such constraints are usually imposed as soft constraints by adding new terms to the loss function that is minimized during training. An alternative is to impose them as hard constraints, which has a number of theoretical benefits but has not been explored so far due to the perceived intractability of the problem. In this paper, we show that imposing hard constraints can in fact be done in a computationally feasible way and delivers reasonable results. However, the theoretical benefits do not materialize and the resulting technique is no better than existing ones relying on soft constraints. We analyze the reasons for this and hope to spur other researchers into proposing better solutions.
Motivation & Objective
- Motivate constraining deep network outputs to incorporate domain knowledge without relying solely on labeled data.
- Formulate hard-constrained optimization for deep networks and contrast with soft-constraint losses.
- Develop a scalable numerical strategy to handle millions of parameters and large constraint sets.
- Assess practical performance and limitations of hard constraints in deep learning against soft constraints.
Proposed method
- Formulate hard constraints C_j(w) = 0 on network outputs and express the problem as min_w R(w) s.t. C_j(w)=0.
- Apply KKT conditions to derive a linearized system to update w and Lagrange multipliers.
- Use a Krylov subspace method (MINRES-QLP) to solve the large linear systems without forming B explicitly.
- Leverage Pearlmutter’s R-op and L-op to compute Jacobian-vector products for efficient matrix-vector products.
- Incorporate stochastic active constraints to manage very large constraint sets and extend with constrained Adam for updates.
- Optionally implement constraint mining to select the most violated constraints at each iteration.
Experimental results
Research questions
- RQ1Can hard constraints be feasibly imposed on the outputs of deep networks at scale?
- RQ2Do hard constraints offer theoretical or empirical advantages over soft constraints in deep learning?
- RQ3What numerical strategies enable solving large, potentially ill-conditioned linear systems arising from KKT conditions?
- RQ4How do stochastic constraint selection and constrained optimization interact in practice for deep nets?
Key findings
- Hard constraints can be computationally feasible with Krylov-subspace methods and MINRES-QLP, though they are slower than soft constraints.
- Soft constraints with Adam generally yield better predictive performance and more stable training than hard constraints in the tested setup.
- Hard constraints do not guarantee perfect satisfaction of constraints, even on training data, due to subsetting of active constraints each iteration.
- Adam-based constrained updates exhibit better convergence properties than projection-based hard constraint updates in this work.
- Constraint linearizations can be ill-conditioned or slightly incompatible, complicating the optimization and explaining difficulties with hard constraints.
- A synthetic example demonstrates that soft constraints often outperform hard constraints in stability and satisfaction of constraints.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.