CG4AI: A Column Generation Framework for Training AI Models Under Constraints
Organizations: Huawei Technologies Ltd., France Research Center, 18 Quai du Point du Jour, Boulogne-Billancourt, 92100, France.
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.
Figures & tables
| Notation | Description |
|---|---|
| Size of the input data set | |
| Size of the hard constraints set | |
| Input size of the AI model | |
| Output size of the AI model | |
| Set of all possible AI models (candidates) | |
| Set of inputs for which output constraints must be satisfied |
| Variant | Split | ||
|---|---|---|---|
| Baseline (CE only) | — | 52.4 | 77.3 |
| CG-margin | all constrained | 57.1 | 83.8 |
| CG-proba | all constrained | 57.5 | 85.7 |
| CG-margin | , rest optimize | 54.8 | 78.7 |
| CG-proba | , rest optimize | 68.5 | 69.3 |
| CG-margin | , rest optimize | 51.7 | 66.1 |
| Method | ||
|---|---|---|
| Baseline (single model, CE) | 56.08 | 70.98 |
| Penalty (L2), | 16.18 | 52.00 |
| Augmented Lagrangian | 18.80 | 61.35 |
| DC3 ( steps) | 56.70 | 71.73 |
| Projection † (oracle) | 82.37 | 90.42 |
| CG-margin | 69.70 | 86.30 |
| Method | ||
|---|---|---|
| Baseline | 99.7 | 99.7 |
| Penalty (L2) | 7.0 | 11.2 |
| Augmented Lagrangian | 9.3 | 16.7 |
| DC3 | 99.7 | 99.7 |
| CG-margin | 100.0 | 69.7 † |
| CG-proba | 100.0 | 100.0 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Column | Description |
|---|---|
| instance | Network instance name. |
| #d | Number of demands. |
| #p | Number of candidate paths per demand. |
| #iter | Total iterations of the combined column-generation and cutting-plane procedure. |
| #cols | Total columns generated. |
| #rows | Constraints (rows) added by the cutting-plane step. |
| instance | #d | #p | #iter | #cols | #rows | col_time | row_time | tot_time | opt_mlu | #mod | val. loss | max_diff |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| abilene | 5 | 3 | 4 | 4 | 0 | 284.83 | 875.47 | 1160.41 | 7.63e-02 | 2 | 0.021 | 0.38 |
| 10 | 3 | 57 | 36 | 9 | 2207.11 | 7831.87 | 10040.36 | 1.57e-01 | 34 | 0.013 | 0.46 | |
| 15 | 3 | 28 | 21 | 0 | 1336.92 | 1215.77 | 2553.48 | 4.26e-02 | 3 | 0.015 | 0.42 | |
| 5 | 5 | 11 | 8 | 4 | 463.05 | 1190.41 | 1653.69 | 9.14e-02 | 10 | 0.027 | 0.42 | |
| atlanta | 5 | 3 | 45 | 26 | 10 | 2229.10 | 13427.90 | 15658.01 | 6.07e-01 | 43 | 0.010 | 0.33 |
| 10 | 3 | 63 | 42 | 16 | 2832.30 | 19045.30 | 21879.00 | 9.91e-02 | 53 | 0.017 | 0.37 |
Constrained Optimization
Constrained optimization finds the best decisions while satisfying equality, inequality, resource, safety, or fairness requirements.
See all 337 papers