Manuscript Offprint

arXiv:2608.26375

CG4AI: A Column Generation Framework for Training AI Models Under Constraints

Youcef Magnouche, Abderrahmane Driouch, Sébastien Martin, Pierre Bauguion

Abstract

Standard machine-learning training minimizes a loss function over a dataset, but does not guarantee that the resulting model will satisfy predefined rules or constraints on its outputs. In many real-world applications, ranging from autonomous systems to network routing, such guarantees are essential. We propose CG4AI, a framework that builds a convex combination of AI models while enforcing linear constraints on the combined output. A master linear program (LP) determines the optimal mixture weights, while a pricing subproblem generates new models guided by LP dual variables, focusing attention on the most violated constraints. A cutting-plane procedure extends feasibility guarantees beyond the training set. We apply CG4AI to two problems: (i) digit classification on MNIST, where we demonstrate four distinct uses of constraints, learning from constraints alone, improving adversarial robustness, correcting misclassified examples, and enforcing output relabeling; and (ii) the multi-commodity flow problem, where link capacity constraints are enforced on neural-network routing predictors. Experiments on MNIST and standard SNDLIB benchmark networks show that CG4AI reliably produces feasible predictors while achieving better accuracy than single-model baselines.

Keywords: Column generation, Hard constraints, Neural networks, Ensemble learning, Multi-commodity flow, Trustworthy AI, Linear programming, Safety

1 Introduction

Artificial intelligence models are increasingly used to support or automate decisions in critical domains such as transportation, healthcare, and telecommunications. These models are typically trained by minimizing a loss function over a labeled dataset. This process does not provide any explicit guarantee that predictions will respect safety rules, physical laws, or regulatory requirements: a model can behave correctly on the training data and still produce infeasible or unsafe outputs on new inputs.

This limitation becomes particularly important when predictions must satisfy hard constraints, strict conditions that cannot be violated under any circumstances. Hard constraints arise naturally in many settings, as for autonomous vehicles to enforce a collision-avoidance rule, or on radiotherapy planning where the dose delivered to healthy tissue must not exceed a given bound for any tumor configuration. They also arise on network routing to predict as a split of traffic satisfying link capacity constraints. Another interesting application is in regulation and compliance where a lending model must never violate legal fairness requirements, even for unusual applicant profiles.

Enforcing such constraints in learned models is challenging. The most common approach adds penalty terms to the training objective to discourage violations. This transforms hard constraints into soft ones and cannot guarantee feasibility at test time. Tuning penalty weights is also notoriously difficult. More recent methods project the model output onto a feasible set [1, 2] or embed convex optimization as a differentiable layer [3]. Projection methods enforce constraints exactly but require solving an optimization problem at inference time, which increases latency and limits scalability. Optimization layers work well for convex constraints but do not extend naturally to combinatorial or large-scale settings.

In this paper we propose CG4AI, a framework that enforces hard linear constraints during training using column generation. Instead of training a single model, we build a convex ensemble: the final predictor is a weighted combination of simpler models (the columns), and the weights are determined by a master LP. Constraints on the output of the ensemble enter the master LP directly as linear inequalities, which ensures that the combined predictor is feasible whenever the LP is feasible. Each new column is obtained by solving a pricing problem that minimizes the reduced cost of the LP: a quantity combining the supervised training loss with the dual values of the most violated constraints. The dual variables act as importance weights during training, directing the new model toward the inputs where the current ensemble fails to satisfy the constraints. When the set of constraints is large, a cutting-plane procedure adds only the most violated constraints at each iteration, keeping the LP tractable.

The key advantage of CG4AI over penalty-based and projection-based approaches is that constraint satisfaction is enforced at the level of the LP, not through soft penalties or post-hoc corrections. Once the LP is feasible, the convex combination of models is guaranteed to satisfy all enforced constraints, independently of the architecture of the individual models. The CG4AI considers any kind of AI model as sub-problem while it accepts a custom loss function.

References (24)