2 Optimization proxies
A high-level outline of the architectures of optimization proxies is shown in Figure 9.1. Optimization proxies combine a predictive component (typically a deep neural network) that produces an approximation with a repair layer that transforms into a feasible solution , that is, satisfies . In a first approximation, the repair layer can be thought of as a projection of into the feasible space of the optimization problem. It could be computed for instance using the following optimization model [26]:
In practice, however, there are limitations with this approach:
-
The projection may be computationally expensive and the optimization proxy may not bring significant benefits compared to the original optimization.
-
When training the model end-to-end in the style of [9], [7], the projection may again introduce significant computational costs. Other approaches (e. g., [13], [25], [11]) assume that a strictly feasible point is available, which is not always the case in practice.
As a result, whenever possible, it is preferable to design dedicated repair layers and learning architectures to ensure fast training and inference times.

Figure 9.1 The architecture of optimization proxies.
Differentiable programming
The repair layers of optimization proxies may rely on differentiable programming, a generalization of deep neural networks that exploits Dynamic Computational Graphs (DCGs). These DCGs can be automatically and transparently differentiated, making it possible to train optimization proxies end-to-end efficiently. For illustration purposes, consider a simplified version of the Economic Dispatch (ED) run by the Independent Systems Operators (ISOs) in the United States:
The goal of the ED optimization is to find a generator dispatch that minimizes generation costs and satisfies the power balance, reserve, and generator constraints. (The reserve constraints are omitted here for simplicity). Objective (9.1a) minimizes the generation costs and the violations of the line thermal limits. Constant is a large coefficient to ensure that these constraints are almost always satisfied. Constraints (9.1b) capture the global power balance and Constraints (9.1c) enforce minimum and maximum limits on each generator energy. Constraints (9.1d) express the thermal constraints on each branch using a power transfer distribution factor representation. As traditional in electricity markets in the US [14], [15], the thermal constraints are soft constraints, that is, they can be violated but doing so incurs a (high) cost. By virtue of being a regression, the approximation in the proxy does not satisfy the power balance constraint. The repair layer however uses ideas from control systems, and scales all generators proportionally, up or down, to obtain a feasible solution as follows:
where and are defined as
and and are the lower and upper bounds on the generators. This repair layer is differentiable almost everywhere and can thus be naturally integrated in the training of the machine learning model. The optimization proxy, which is depicted in Figure 9.2 for the ED problem with reserve constraints, guarantees feasibility during training and inference.

Figure 9.2 The optimization proxy for the economic dispatch problem.
More precisely, the optimization proxy is a differentiable program that can be trained end-to-end using self-supervised learning. can be trained using stochastic gradient descent: Its loss function
is backpropagated through the repair layers to adjust the parameters θ of the neural network. Once trained, the resulting differentiable program with tuned parameters can be used at inference time to produce a feasible solution in milliseconds for any instance x [5].
Primal-dual learning
Another approach to find feasible solutions is to develop optimization proxies that adapt traditional optimization algorithms to the learning context. Consider the constrained optimization problem:
where x represents instance parameters that determine the objective function and the equality constraints . The Augmented Lagrangian Method (ALM) solves unconstrained optimization problems of the form
where ρ is a penalty coefficient and are the Lagrangian multiplier approximations. These multipliers are updated using the rule
Primal-Dual Learning (PDL) [20] jointly learns two neural networks: a primal neural network that learns the input/output mapping of the ALM unconstrained optimizations and a dual network that learns the dual updates. The overall architecture of PDL is shown in Figure 9.3. At each iteration, the primal learning step updates the parameters θ of the primal network while keeping the dual network fixed. After completion of the primal learning, PDL applies a dual learning step that updates the parameters ϕ of the dual network . The training of the primal network uses the loss function
which is the direct counterpart of the unconstrained optimization (9.2). The dual learning training uses the loss function
which is the direct counterpart of the update rule for the Lagrangian multipliers of the ALM (9.3). These two steps, that is, the training of the primal and dual networks, are iterated in sequence until convergence. Observe that PDL is self-supervised and does not require labeled data. PDL has been applied to preventive Security-Constrained Optimal Power Flow (SCOPF) problems with automatic primary response [19], an application which cannot be solved by state-of-the-art optimization and is discussed later in the paper.

Figure 9.3 The architecture of primal-dual learning (from [20]).