A Surrogate Objective Framework for Prediction+Programming with Soft Constraints

Kai Yan, Jie Yan, Chuan Luo, Liting Chen, Qingwei Lin, Dongmei Zhang

In many industrial applications, practitioners face a two-step challenge: first, predict a hidden parameter (like future electricity demand or stock returns), and second, use that prediction to solve an optimization problem (like scheduling power plants or balancing a portfolio). Traditionally, these steps are siloed. The predictor is trained to minimize a generic error metric like Mean Squared Error (MSE), which might have little to do with the final "regret" or cost of the actual decision.

This paper introduces a novel framework to unify these steps, specifically tackling the thorny issue of soft constraints in a way that allows for seamless, end-to-end training. By converting hard constraints into soft penalties and using a smooth surrogate for the max operator, the authors derive closed-form gradients that allow neural networks to be trained directly on final decision quality.

End-to-end prediction and optimization pipeline

The Challenge: Inconsistent Criteria and Soft Constraints

The core issue in traditional pipelines is the "inconsistency of criteria." A model might be excellent at predicting average demand (achieving a low MSE) but terrible at predicting the sudden peaks that lead to massive penalties in a resource allocation problem.

Recent "decision-focused" approaches, such as SPO+ or OptNet, attempt to fix this by differentiating through the optimization solver itself. However, these methods struggle with soft constraints—penalties often expressed using the max(z, 0) operator (e.g., "pay a fine only if you exceed the budget"). Because the max operator has a "kink" at zero, it is not differentiable everywhere, breaking the standard backpropagation used to train neural networks. Furthermore, existing methods often require solving complex KKT (Karush-Kuhn-Tucker) systems, which can be computationally expensive and numerically unstable.

A Differentiable Surrogate Framework

To make the entire pipeline differentiable, the authors propose a three-step framework:

  1. Softening Hard Constraints: They prove that hard constraints (e.g., $Ax \le b$) can be mathematically transformed into soft constraints (penalties) using a sufficiently large multiplier $\beta$. They provide theoretical bounds for these multipliers to ensure the optimal solution remains unchanged.
  2. The Differentiable Surrogate: To handle the non-differentiable max(z, 0) term, they introduce a smooth surrogate function $S(z)$. This function is piecewise: it is zero for very negative values, linear for very positive values, and features a quadratic "bridge" in a small window around zero.
  3. Analytical Gradients: Instead of relying on implicit differentiation through KKT conditions, they derive a closed-form solution for the Jacobian of the decision $x$ with respect to the predicted parameters $\theta$. This makes the gradient calculation straightforward and highly efficient for training.

Key Theoretical Insights

One of the most powerful ideas in this work is treating hard constraints as "very expensive" soft constraints. This allows the authors to rewrite the entire problem as an unconstrained optimization, which is much easier to differentiate.

Geometric representations of acute angles and cones in the feasible region

The authors also identify that the difficulty in bounding penalty multipliers often stems from "acute angles" in the feasible region—areas where two constraints nearly overlap. Their theoretical work provides a robust way to calculate multipliers that remain valid even in these tricky geometric cases. Finally, by deriving a closed-form Jacobian, the method avoids the need to solve a large system of linear equations (the KKT system) at every training step, removing a major bottleneck found in competing methods like OptNet.

Evaluation and Results

The framework was evaluated across three distinct scenarios, consistently outperforming traditional two-stage (MSE-based) methods and existing decision-focused baselines:

  • Synthetic Linear Programming: Using data generated from structural causal models to simulate complex, non-linear relationships, the proposed method achieved significantly lower "regret" (the difference between the chosen decision's value and the true optimal value).
  • Portfolio Optimization: Using the SP500 daily price dataset (2004–2017) to predict equity returns subject to regulatory soft constraints, the surrogate framework reduced regret by roughly 10-20% compared to the next best decision-focused method.
  • Resource Provisioning: Using the ERCOT energy dataset to predict regional loads, the goal was to minimize the asymmetric costs of under- and over-provisioning. The method successfully learned to bias its predictions to avoid the more expensive mistake (under-provisioning), whereas standard L1/L2 losses were completely blind to this cost asymmetry.

Limitations and Future Work

While highly effective, the framework has a few limitations. The current theoretical proofs for the multipliers rely on the assumption that certain hard constraint parameters (like the matrix $A$) are non-negative. While common in resource tasks, this is not universal.

Additionally, the model currently predicts a single "best guess" point estimate for parameters. Moving toward distributional predictions could further improve robustness in highly volatile environments. Finally, while more efficient than KKT-based methods, the matrix inversion required for the closed-form gradient still scales with the number of decision variables, which may pose challenges for extremely large-scale optimization problems.

Summary updated

BibTeX
@inproceedings{yan2021surrogate,
  author = {Kai Yan and Jie Yan and Chuan Luo and Liting Chen and Qingwei Lin and Dongmei Zhang},
  title = {{A Surrogate Objective Framework for Prediction+Programming with Soft Constraints}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure