Constrained Learning With Non-Convex Losses

Luiz F. O. Chamon, Santiago Paternain, Miguel Calvo-Fullana, Alejandro Ribeiro

Abstract

Modern machine learning models, particularly deep neural networks, are increasingly required to satisfy statistical constraints such as fairness, safety, and robustness. Traditional Empirical Risk Minimization (ERM) does not inherently account for these requirements, and standard penalty-based methods often require extensive manual tuning without providing feasibility guarantees. This paper presents a theoretical and practical framework for constrained learning with non-convex losses. By shifting the optimization to the empirical dual domain, we prove that near-optimal performance and constraint satisfaction can be achieved with strong generalization guarantees, leveraging the "hidden convexity" of rich hypothesis classes.

Introduction

The standard paradigm of Empirical Risk Minimization (ERM) focuses on minimizing average loss. However, real-world applications often demand more: a model must not only be accurate but also fair across demographics or robust against adversarial perturbations. While adding weighted penalties to the loss function is a common workaround, it suffers from two major drawbacks: the tedious trial-and-error process of tuning weights and the lack of theoretical guarantees for non-convex models. Direct Empirical Constrained Risk Minimization (ECRM) is often "brittle," where small data perturbations lead to infeasible solutions.

Theoretical Framework: The Empirical Dual Approach

The core innovation of this work is the transition from the "Primal" problem—optimizing parameters directly under constraints—to the Empirical Dual Problem.

The Vanishing Duality Gap

In convex optimization, "strong duality" ensures that the primal and dual problems share the same solution. While deep learning is inherently non-convex, the authors demonstrate a "hidden convexity": the functional version of the learning problem (optimizing over the space of all possible functions) is convex. As neural networks become sufficiently "rich" or over-parametrized, they approximate this functional space, causing the duality gap to nearly vanish.

Mapping the Optimization Landscape

The relationship between the various problem formulations is central to the proposed framework. The authors distinguish between functional and parametrized models, and between statistical (population) and empirical (sample-based) objectives.

Relationships between the functional, parametrized, statistical, and empirical optimization problems.

As shown in the figure above, the framework connects the functional primal (P-CSL) to the empirical dual (D-CSL) through a series of propositions that bound the duality gap and generalization error. This path allows for solving a deterministic, unconstrained problem in the dual domain while maintaining guarantees for the original constrained primal problem.

Methodology: Primal-Dual Ascent

The authors propose a practical iterative algorithm (Primal-Dual Ascent) to solve the constrained problem. In each step, the algorithm performs:

  1. Primal Update: A standard training step (e.g., SGD) to approximately minimize the Lagrangian given current penalty weights.
  2. Dual Update: An update to the dual variables (penalty weights) based on the magnitude of current constraint violations.

This approach treats dual variables as "smart" adaptive penalties that automatically increase when a constraint is violated and decrease when it is satisfied, removing the need for manual weight tuning.

Experimental Evaluation

The framework was tested on two distinct tasks to demonstrate its versatility:

  • Adversarial Robustness (CIFAR-10): Training a ResNet18 to maintain high nominal accuracy while satisfying a constraint on adversarial accuracy. The method found a "warm start" region of the loss landscape that standard adversarial training missed, achieving 85.4% accuracy with superior robustness.
  • Fair Classification (COMPAS): Ensuring a logistic regressor's predictions were fair across racial groups. The constrained learner reduced the bias gap to within 1.5% while maintaining an overall accuracy of 67%, nearly matching the unconstrained model's 68%.

Conclusion

This work introduces the "Near-PACC" framework, providing the first joint optimality-feasibility generalization bounds for non-convex constrained learning. By demonstrating that the dual problem is more robust and easier to solve than the primal ECRM, the authors offer a principled way to integrate hard constraints into deep learning. Future research will explore applications in reinforcement learning and more complex rate-constrained problems.

Summary updated

BibTeX
@article{chamon2021constrained,
  author = {Luiz F. O. Chamon and Santiago Paternain and Miguel Calvo-Fullana and Alejandro Ribeiro},
  title = {{Constrained Learning With Non-Convex Losses}},
  journal = {IEEE Trans. Information Theory},
  year = {2021},
  doi = {10.1109/tit.2022.3187948},
}
Figure