Abstract
In "predict-then-optimize" workflows, machine learning models are typically trained to minimize prediction error (e.g., Mean Squared Error), which does not necessarily translate to optimal downstream decisions. While decision-focused learning (DFL) attempts to bridge this gap by training models to minimize final decision regret, existing DFL methods often fail when optimization objectives include non-differentiable soft constraints. This paper introduces a novel, analytically differentiable surrogate framework that smoothly handles these constraints. By converting hard constraints into penalized soft constraints and employing a piecewise differentiable surrogate, the proposed method outperforms existing baselines in decision quality while running 2-3x faster than traditional KKT-based approaches.
Introduction
Many real-world operational problems—ranging from supply chain management to power grid scheduling—require predicting unknown parameters (like future demand) before solving a mathematical optimization problem. The traditional two-stage approach trains a model to minimize prediction error and then feeds those predictions into a solver. However, this ignores the downstream impact of prediction errors on the final objective, known as "regret."
Decision-focused learning addresses this by differentiating through the optimization solver to train the model directly on regret. A significant hurdle in this field is the presence of soft constraints, which penalize target violations using the max(z, 0) operator. Because this operator is non-differentiable at zero, standard DFL methods like SPO+ or OptNet often struggle to pass accurate gradients, leading to suboptimal performance when the optimal solution lies on a constraint boundary.
Methodology
The authors propose a three-step framework to make linear and semi-definite negative quadratic programs fully differentiable:
- Softening Hard Constraints: Hard constraints (inequalities and non-negativity) are mathematically converted into piecewise linear soft constraints. The authors provide theoretical bounds for penalty multipliers to ensure the unconstrained problem's solution matches the original constrained one.
- Differentiable Surrogate: To address the non-differentiability of the
max(z, 0)operator, they introduce a piecewise surrogate function that acts as a smooth quadratic curve in a small region around zero and remains linear elsewhere. - Analytical Gradients: By designing the surrogate to be piecewise and convex/concave, the authors can solve the local surrogate analytically to obtain closed-form gradients (the Jacobian). This bypasses the computationally expensive process of differentiating through KKT optimality conditions.
Experimental Evaluation
The framework was evaluated across three distinct domains:
- Synthetic Linear Programming: A dataset generated via structural causal models to simulate realistic physical processes.
- Portfolio Optimization: Real-world SP500 daily price data (2004–2017) used to optimize a 50-equity portfolio.
- Resource Provisioning: The ERCOT energy dataset, focusing on hourly energy output across Texas with asymmetric penalties (e.g., under-provisioning being 100x more costly than over-provisioning).
Key Results
Across all benchmarks, the proposed method consistently achieved the lowest regret. In the Portfolio Optimization task, it reached a regret of 3.662%, significantly better than the decision-focused baseline (4.016%). In Resource Provisioning with asymmetric penalties, it achieved a regret of 20.8, compared to 79.0 for a weighted L1 baseline. Furthermore, the analytical gradient approach proved to be 2-3x faster than KKT-based methods.
Geometric Insights
A core finding is that traditional DFL methods are often "blind" to the geometry of soft boundaries. Because optimal solutions frequently reside exactly on the non-differentiable boundary of a soft constraint, methods that cannot handle this geometry fail to provide useful learning signals. The proposed surrogate framework effectively "sees" these boundaries, allowing the model to learn more effectively from the optimization landscape.
Conclusion
This paper presents a robust and efficient framework for decision-focused learning under soft constraints. By bypassing KKT conditions in favor of an analytical surrogate, the method offers both superior decision quality and computational efficiency. Future work includes extending the theoretical proofs to handle negative constraint parameters and moving toward distributional prediction models to further enhance robustness.
Summary updated