Differentiable Approximations of Fair OWA Optimization

My H Dinh 1 James Kotary 1 Ferdinando Fioretto 1

Abstract

fairness is essential in fields like energy systems [2], urban planning [3], and multi-objective portfolio optimization[4], [5]. A common approach is using Ordered Weighted
Averaging (OWA) [6] to achieve Pareto-optimal solutions
that fairly balance each objective. However, optimizing an
OWA objective in PtO is challenging due to its nondifferentiability, which prevents backpropagation through x⋆ (c)within machine learning models trained by gradient descent.
To our knowledge, no prior PtO models encounter a nondifferentiable objective, making this challenge novel.

Decision processes in AI and operations researchoften involve parametric optimization problems,
whose unknown parameters must be predictedfrom correlated data. In such settings, the PredictThen-Optimize (PtO) paradigm trains parametric prediction models end-to-end with the subsequent optimization model. This paper extends
PtO to handle optimization of the nondifferentiable Ordered Weighted Averaging (OWA) objectives, known for their ability to ensure fair and robust solutions with respect to multiple objectives.
By proposing efficient differentiable approximations of OWA optimization, it provides a framework for integrating fair optimization concepts
with parametric prediction under uncertainty.

2. Preliminaries
2.1. Fair OWA and its Optimization
The Ordered Weighted Average (OWA) operator [6] is usedin various decision-making fields to fairly aggregate multiple objective criteria [7]. Let y ∈ Rm be a vector of mdistinct criteria, and τ : Rm → Rm be the sorting map thatordersy in increasing order. For any w satisfying w ∈ Rm ,P
i wi = 1, and w ≥ 0, the OWA aggregation with weights
w is piecewise-linear in y [8]:1. Introduction
The Predict-Then-Optimize (PtO) framework [1] models
decision-making processes as optimization problems withunspecified parameters c, which must be estimated by amachine learning (ML) model, given correlated features z.
An estimation of c completes the problem’s specification,
whose solution defines a mapping:x⋆ (c) = argmax f (x, c)

OWAw (y) = wT τ (y),(2)

This paper uses its concave version, Fair OWA [9], characterized by weights in descending order: w1 > . . . > wn > 0.
The following three properties of Fair OWA functions are
crucial for fairly optimizing multiple objectives: (1) Impartiality: Permutations of a utility vector are equivalentsolutions. (2) Equitability: Marginal transfers from a higher
value criterion to a lower one increase the OWA aggregated value. (3) Monotonicity: OWAw (y) is an increasing
function of each element of y. This ensures that solutions
optimizing the OWA objectives are Pareto Efficient, meaning no criterion can be improved without worsening another[8]. Optimization of aggregation functions that possess
these properties leads to equitably efficient solutions, which
satisfy a rigorously defined notion of fairness [10].

(1)

x∈S

The goal is to learn a model ĉ = Mθ (z) from observablefeatures z, such that the objective value f (x⋆ (ĉ), c) underground-truth parameters c is maximized on average. Thisis common in many applications requiring decision-making
under uncertainty, like planning the fastest route througha city with unknown traffic delays or predicting optimal
power generation schedules based on demand forecasts.
Optimization of multiple objectives is crucial in contexts
requiring a balance of competing goals, especially when

2.2. Predict-Then-Optimize Learning

1

Department of Computer Science, University of Virginia, Charlottesville, USA. Correspondence to: My H Dinh
<fqw2tz@virginia.edu>.

Our problem setting fits within the PtO framework. Generally, a parametric optimization problem (1) models an optimal decision x⋆ (c) with respect to unknown parameters cdrawn from a distribution c ∼ C. While the true value of c is

Published at the 2 nd Differentiable Almost Everything Workshop
at the 41 st International Conference on Machine Learning, Vienna, Austria. July 2024. Copyright 2024 by the author(s).

1Differentiable Approximations of Fair OWA Optimization

unknown, correlated feature values z ∼ Z can be observed.
The goal is to learn a predictive model Mθ : Z → C fromfeatures z to estimate problem parameters ĉ = Mθ (z), by
maximizing the empirical objective value of the resulting
solution under ground-truth parameters. That is,argmaxθE(z,c)∼Ω f (x⋆ (Mθ (z)), c) ,highlighting the forward and backward steps required forthis process is provided in Figure 1.

4. Differentiable Approximate OWA
Optimization(3)

This section introduces two differentiable approximationsof the OWA optimization mapping (5). Section 4.1 adapts
a quadratic smoothing technique [12], [13] for a discontinuous linear programming model of OWA. Then, Section
4.2 presents an efficient alternative by employing OWA’s
Moreau envelope approximation. To the best of the author’s knowledge, this is the first instance of using objective smoothing via the Moreau envelope as an effective
technique for approximating nondifferentiable optimization
programs in end-to-end learning.

where Ω represents the joint distribution between Z and C.
The above training goal is often achieved by maximizing
empirical Decision Quality as a loss function [1], defined:
LDQ (ĉ, c) = f (x⋆ (ĉ), c) .

(4)

Gradient descent training of (3) with LDQ requires a model∂Lof gradient ∂DQ
directly or through chain-rule comĉ , either∂LDQ∂x⋆ (ĉ) ∂LDQ
position ∂ ĉ = ∂ ĉ · ∂x⋆ . When x⋆ is not differentiable, as in OWA optimizations, smooth approximations
are required, such as those developed in the next section.

4.1. OWA LP with Quadratic Smoothing
In [8], it’s observed that the OWA optimization (5) can havethe following LP formulation when x ∈ S is linear:x⋆ (C) = argmaxx∈S,y,z z(8a)

3. End-to-End Learning with Fair OWA
Optimization

s.t.: y = Cx

This paper focuses on scenarios where the objective function
f is an ordered weighted average of m linear objectivefunctions, each parameterized by a row of a matrix C ∈Rm×n so that f (x, C) = OWAw (Cx) andx⋆ (C) = argmax OWAw (Cx).

This LP problem is typically solvable with a simplex method.
However, its constraints (8c) grows factorially as m!, wherem is the number of criteria aggregated by OWA.

(5)

x∈S

Our first approach to differentiable OWA optimization combines this LP transformation with the smoothing techniqueof [12], which forms differentiable approximations to linear
programs by adding a scaled Euclidean norm term ϵ|x|2 tothe objective function. This results in a continuous mapping x⋆ (c) = argmaxAx≤b cT x + ϵ∥x∥2 , a quadratic
program (QP) which can be differentiated implicitly via its
KKT conditions as in [14].

Note that this methodology extends to cases where the OWA
objective is combined with additional smooth terms. For
simplicity, the exposition primarily focuses on the pure
OWA objective as shown in equation (5).
The goal is to learn a prediction model Ĉ = Mθ (z) thatmaximizes decision quality through gradient descent on
problem (3), which requires obtaining its gradients w.r.t. Ĉ:∂LDQ (Ĉ, C)
∂ Ĉ

=

∂x⋆
∂ Ĉ
|{z}
J

·

∂OWAw (Cx⋆ )
,
⋆
∂x
{z
}
|

(8b)

z ≤ wτ · y ∀τ ∈ Pm . (8c)Smoothing by the scaled norm of joint variables x, y, z in
8a leads to a differentiable QP approximation, viable whenm is small. This optimization can be solved and differentiated using techniques from [14] or a generic differentiable
optimization solver such as [15]:x⋆ (C) = argmax z + ϵ ∥x∥22 + ∥y∥22 + z 2
(9a)

(6)

g

where x⋆ is evaluated at Ĉ. The main strategy involves
determining the OWA function’s gradient g and then computing J g by backpropagating g through x⋆ .

x∈S,y,zWhile nondifferentiable, the class of OWA functions is subdifferentiable, with subgradients as follows:∂
OWAw (y) = w(σ−1 )(7)∂ywhere σ are the sorting indices on y [11]. Based on
this formula, computing an overall subgradient g =∂/∂x OWA (Cx) is a routine application of the chain rulew
(via automatic differentiation). We apply the differentiableapproximations proposed next to enable its backpropagation through OWA optimization. A schematic illustration

subject to: (8b), (8c).

(9b)

While problem (8) does not fit the exact LP form due toits parameterized constraints (8b), the need for quadraticsmoothing (9a) is illustrated experimentally in Section 5.1.
The main disadvantage of this method is poor scalability inthe number of criteria m, due to constraints (8c). Anotherdrawback is that the transformed QP is much harder to solve
than its original associated LP problems since quadraticsmoothing increases the difficulty of an OWA-equivalent
LP problem. These drawbacks motivate the next smoothing2

Differentiable Approximations of Fair OWA Optimization

Figure 1: Predict-Then-Optimize for OWA Optimization.
method, which yields a tractable optimization problem byreplacing the OWA objective with a smooth approximation.
4.2. Moreau Envelope Smoothing

Φ

(13)

Ψ

The partial Jacobian matrices Φ and Ψ above can be foundgiven a differentiable implementation of U . This is achieved∂
OWAβw (x, C) via theby computing the inner gradient ∂xdifferentiable permutahedral projection (12), and solving
the outer projection mapping projS using a generic differentiable solver such as cvxpy [15]. As such, applying U
at a precomputed solution x⋆ (C) allows Φ and Ψ to be
extracted in PyTorch, in order to solve (13); this process isefficiently implemented via the fold-opt library [18].

Instead of adding a quadratic term as in (9), we replace thepiecewise linear function OWAw in (5) with its Moreau
envelope, defined for a convex function f as:1
f β (x) = min f (v) +∥v − x∥2 .
(10)
v
2β
Compared to its underlying function f , the Moreau envelope is β1 smooth while sharing the same optima [16]. The
Moreau envelope-smoothed OWA optimization problem isx⋆ (C) = argmaxx∈S OWAβw (Cx).

∂U (x⋆ , C)∂U (x , C)  ∂x⋆

=

I −
⋆
| ∂x
| ∂C
{z } ∂C
{z }
⋆

(11)

5. Experiments

With its smooth objective function, problem (11) can besolved by gradient-based optimization methods (see Section5.1), and also differentiated for backpropagation.

This section extends the PtO framework to scenarios withmultiple uncertain objectives jointly learned and fairly optimized through OWA aggregation. The Robust Markowitz
Portfolio Optimization evaluates the differentiable approximations from Section 4 against baseline methods.

Differentiation of (11) is nontrivial since its objective function lacks a closed form. We model its Jacobian by differentiating the fixed-point conditions of a gradient-based solver.
To proceed, we first note from [11] that the gradient of theMoreau envelope OWAβw is equal to a projection:
 
x
∂
,
(12)
OWAβw (x) = projC(w̃)∂xβThe training goal is to maximize empirical decision quality
with respect to their Fair OWA aggregation:
LDQ (Ĉ, C) = OWAw Cx⋆ (Ĉ) .
(14)

where w̃ = −(wm , . . . , w1 ) and the permutahedron C(w̃)
is the convex hull of all permutations of w̃.

Evaluations Each model is evaluated based on its ability
to train a model Ĉ = Mθ (z) to achieve high decisionquality (14) for the OWA-aggregated objective. Results arereported using the regret metric of suboptimality, whose 0
corresponds to maximum decision quality:
regret(Ĉ, C) = OWA⋆w (C) − OWAw Cx⋆ (Ĉ) (15)The following approach to differentiation of (11) requires
differentiation of the function (12). For this, we leverage
the differentiable permutahedral projection framework of[17], which was originaly used to implement a soft sorting
model. This allows evaluation and differentiation of (12) inO(m log m) time, via isotonic regression.

where OWA⋆w (C) is the true optimal value of (5). This
experiment evaluates the proposed differentiable approximations (9) and (11), named OWA-QP and OWA-Moreau.
Two common baselines are compared against our methods: (1) Two-stage: This standard baseline for PtO (3) [1]
trains the prediction model Ĉ = Mθ (z) by minimizing
MSE LT S (Ĉ, C) = ∥Ĉ − C∥2 without considering thedownstream optimization model, used only at test time. (2)Unweighted sum (UWS): This baseline (Sum-QP) uses an∂
OWAβw (x, C)), a proLetting U (x, C) = projS (x − α · ∂xjected gradient descent step on (11) is xk+1 = U (xk , C).
Differentiating the fixed-point conditions of convergence
where xk = xk+1 = x⋆ , and rearranging terms yields a⋆
linear system for ∂x∂C :3

Differentiable Approximations of Fair OWA Optimization

OWA-LP

Two-Stage

Sum-QP

OWA-QP

OWA-Moreau

100

Regret (%)

80
60
40
20
0

3 Scenario

5 Scenario

7 Scenario

Figure 2: Percentage OWA regret (lower is better) on test set, on robust portfolio problem over 3,5,7 scenarios.

0.07
0.06
0.05
0.04
0.03
0.02
0.01

5.1. OWA Optimization Under Uncertainty: Robust
Markowitz Portfolio Problem
The classic Markowitz portfolio problem is concerned withconstructing an optimal investment portfolio, given future returns c ∈ Rn on n assets, which are unknown and predictedfrom exogenous data. An alternative risk-aware approachconsiders robustness over scenarios. In [19], m future pricescenarios are represented by a matrix C ∈ Rm×n , where theith row contains per-asset prices for the ith scenario. Thus,
an optimal allocation is modeled as:x⋆ (C) = argmax OWAw (Cx).

OWA-QP
OWA-Moreau

Time (s) Per Sample

LP model: x⋆ (C) = argmaxx∈S 1T (Cx) in end-to-end
training, with quadratic smoothing [12] in Section 5.1.

3

4

5

6

7

# of Scenario

89

Figure 3: Average solving time of 2 smoothed OWA optimization models, on Robust Portfolio Optimization, over1000 input samples. Missing data points past 7 scenarios are
due to memory overflow as the QP model grows factorially.

(16)

x∈∆n

This experiment integrates robust portfolio optimization (16)end-to-end with per-scenario price prediction Ĉ = Mθ (z).
This experiment’s setting is detailed in Appendix B.

6. Related Work
Modern approaches to the Predict-Then-Optimize setting,formalized in Section 2.2, typically maximize decision quality as a loss function, enabled by backpropagation throughthe mapping c → x⋆ (c) defined by (1). When this mapping
is differentiable, backpropagation can be performed using
differentiable optimization libraries [14], [15], [18], [20].
Otherwise, effective training techniques are typically basedon forming continuous approximations of (1), whether bysmoothing the objective function [13], [21], [22], introducing random noise [23], [24], or estimation by finite differencing [25]. This paper falls into that category, due tonondifferentiability of the OWA objective, requiring approximation of (1) by differentiable functions. An extended
review of related work is provided in Appendix A.

Results. Figure 2 shows average percent regret in the
OWA objective over the test set (lower is better). The endto-end training Sum-QP outperforms Two-stage approach.
However, both OWA-QP and OWA-Moreau achieve substantially higher decision quality. While OWA-QP performs
slightly better, it cannot scale past 5 scenarios, highlighting
the importance of the Moreau envelope smoothing. Moreresults on an alternate dataset can be found in Appendix B.
OWA-LP uses the OWA’s equivalent LP as a differentiable
optimization without smoothing. Grey bars show nonsmoothed OWA LP results implemented with implicit differentiation in cvxpylayers [15]. This comparison highlights the accuracy improvement due to quadratic smoothing
in OWA-QP. The poor performance of OWA subgradienttraining under non-smoothed OWA-LP demonstrates thenecessity of the proposed approximations in Section 4.

7. Conclusions
This work presents an efficient methodology for integrating Fair OWA optimization with predictive models. This
proposal shows the potential of OWA optimization in datadriven decision-making, which has important applications inareas such as risk management and fair resource allocation.

Runtimes of the smoothed models (9) and (11) are comparedin Figure 3. Moreau envelope smoothing keep runtimes low
as m increases, while the QP approximation suffers pastm = 5 and encounters memory overflow beyond m = 6.
4

Differentiable Approximations of Fair OWA Optimization

References
[1]

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

[10]

[11]

[12]

J. Mandi, J. Kotary, S. Berden, et al., “Decision-focusedlearning: Foundations, state of the art, benchmark and future opportunities,” Journal of Artificial Intelligence Research, vol. TBA, TBA, 2024. DOI: 10.48550/arXiv.
2307.13565.
T. Terlouw, T. AlSkaif, C. Bauer, and W. van Sark, “Multiobjective optimization of energy arbitrage in community
energy storage systems using different battery technologies,” Applied Energy, vol. 239, pp. 356–372, 2019, ISSN:
0306-2619. DOI: https : / / doi . org / 10 . 1016 /j . apenergy . 2019 . 01 . 227. [Online]. Available:
https://www.sciencedirect.com/science/
article/pii/S0306261919302478.
J. Salas and V. Yepes, “Enhancing sustainability and resilience through multi-level infrastructure planning,” International Journal of Environmental Research and Public Health, vol. 17, no. 3, p. 962, Feb. 4, 2020. DOI: 10.
3390/ijerph17030962.
D. A. Iancu and N. Trichakis, “Fairness and efficiency inmultiportfolio optimization,” Operations Research, vol. 62,
no. 6, pp. 1285–1301, 2014. DOI: 10 . 1287 / opre .
2014 . 1310. [Online]. Available: https : / / doi .
org/10.1287/opre.2014.1310.
Y. Chen and A. Zhou, “Multiobjective portfolio optimization via pareto front evolution,” Complex and Intelligent
Systems, vol. 8, pp. 4301–4317, 2022. DOI: 10.1007/
s40747-022-00715-8. [Online]. Available: https://doi.org/10.1007/s40747-022-00715-8.
R. R. Yager, “On ordered weighted averaging aggregation operators in multicriteria decisionmaking,” in Readings in Fuzzy Sets for Intelligent Systems, D. Dubois, H.
Prade, and R. R. Yager, Eds., Morgan Kaufmann, 1993,
pp. 80–87, ISBN: 978-1-4832-1450-4. DOI: https://doi . org / 10 . 1016 / B978 - 1 - 4832 - 1450 4 . 50011 - 0. [Online]. Available: https : / / www .
sciencedirect.com/science/article/pii/
B9781483214504500110.
R. R. Yager and J. Kacprzyk, The Ordered Weighted Averaging Operators: Theory and Applications. Springer Publishing Company, Incorporated, 2012, ISBN: 1461378060.
W. Ogryczak and T. Śliwiński, “On solving linear programswith the ordered weighted averaging objective,” European
Journal of Operational Research, vol. 148, no. 1, pp. 80–
91, 2003.
W. Ogryczak, H. Luss, M. Pióro, D. Nace, and A.
Tomaszewski, “Fair Optimization and Networks: A Survey,” Journal of Applied Mathematics, vol. 2014, no. SI08,
pp. 1–25, 2014. DOI: 10.1155/2014/612018. [Online]. Available: https : / / doi . org / 10 . 1155 /2014/612018.
M. M. Kostreva and W. Ogryczak, “Linear optimization with multiple equitable criteria,” RAIRO-Operations
Research-Recherche Opérationnelle, vol. 33, no. 3,
pp. 275–297, 1999.
V. Do and N. Usunier, “Optimizing generalized gini indices for fairness in rankings,” in Proceedings of the 45th
International ACM SIGIR Conference on Research andDevelopment in Information Retrieval, 2022, pp. 737–747.

[13]

[14]

[15]

[16]
[17]

[18]

[19]

[20]

[21]

[22]

[23]

[24]

[25]

[26]

5

B. Wilder, B. Dilkina, and M. Tambe, “Melding the datadecisions pipeline: Decision-focused learning for combinatorial optimization,” in AAAI, vol. 33, 2019, pp. 1658–
1665.
B. Amos, V. Koltun, and J. Z. Kolter, “The limited multilabel projection layer,” arXiv preprint arXiv:1906.08707,
2019.
B. Amos and J. Z. Kolter, “Optnet: Differentiable optimization as a layer in neural networks,” in ICML, JMLR. org,
2017, pp. 136–145.
A. Agrawal, B. Amos, S. Barratt, S. Boyd, S. Diamond, andJ. Z. Kolter, “Differentiable convex optimization layers,”
Advances in neural information processing systems, vol. 32,
2019.
A. Beck, First-order methods in optimization. SIAM, 2017.
M. Blondel, O. Teboul, Q. Berthet, and J. Djolonga, “Fastdifferentiable sorting and ranking,” in International Conference on Machine Learning, PMLR, 2020, pp. 950–959.
J. Kotary, M. H. Dinh, and F. Fioretto, “Backpropagation ofunrolled solvers with folded optimization,” in International
Joint Conference on Artificial Intelligence, ijcai.org, 2023,
pp. 1963–1970. DOI: 10.24963/ijcai.2023/218.
[Online]. Available: https://doi.org/10.24963/
ijcai.2023/218.
D. Cajas, “Owa portfolio optimization: A disciplined convex programming framework,” Available at SSRN 3988927,
2021.
A. Agrawal, S. T. Barratt, S. P. Boyd, E. Busseti, and W. M.
Moursi, “Differentiating through a cone program,” Journal of Applied and Numerical Optimization, 2019. [Online]. Available: https://api.semanticscholar.
org/CorpusID:121394814.
B. Wilder, B. Dilkina, and M. Tambe, “Melding the datadecisions pipeline: Decision-focused learning for combinatorial optimization,” in Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), vol. 33, 2019,
pp. 1658–1665.
J. Mandi and T. Guns, “Interior point solving for lp-based
prediction+optimisation,” in Advances in Neural Information Processing Systems (NeurIPS), 2020.
Q. Berthet, M. Blondel, O. Teboul, M. Cuturi, J.-P. Vert,and F. Bach, “Learning with differentiable pertubed optimizers,” Advances in neural information processing systems, vol. 33, pp. 9508–9519, 2020.
M. Paulus, D. Choi, D. Tarlow, A. Krause, and C. J.
Maddison, “Gradient estimation with stochastic softmax
tricks,” Advances in Neural Information Processing Systems, vol. 33, pp. 5691–5704, 2020.
M. V. Pogančić, A. Paulus, V. Musil, G. Martius, and M. Rolinek, “Differentiation of blackbox combinatorial solvers,”
in International Conference on Learning Representations,
2019.
J. Kotary, F. Fioretto, P. Van Hentenryck, and B. Wilder,“End-to-end constrained optimization learning: A survey,”in Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, 2021, pp. 4475–
4482. DOI: 10.24963/ijcai.2021/610. [Online].
Available: https://doi.org/10.24963/ijcai.
2021/610.

Differentiable Approximations of Fair OWA Optimization
[27]

[28]

[29]

[30]

[31]

[32]

[33]

[34]

[35]

[36]

[37]
[38]

[39]

S. Gould, B. Fernando, A. Cherian, P. Anderson, R. S. Cruz,and E. Guo, “On differentiating parameterized argmin andargmax problems with application to bi-level optimization,”
arXiv preprint arXiv:1607.05447, 2016.
B. Amos and J. Z. Kolter, “Optnet: Differentiable optimization as a layer in neural networks,” in International
Conference on Machine Learning, PMLR, 2017, pp. 136–
145.
T. Konishi and T. Fukunaga, “End-to-end learning for prediction and optimization with gradient boosting,” in Joint
European Conference on Machine Learning and Knowledge Discovery in Databases, Springer, 2021, pp. 191–
207.
P. Donti, B. Amos, and J. Z. Kolter, “Task-based end-toend model learning in stochastic optimization,” in NIPS,
2017, pp. 5484–5494.
A. Nemirovski, “Advances in convex optimization: Conic
programming,” in International Congress of Mathematicians, vol. 1, 2007, pp. 413–444.
E. Busseti, W. M. Moursi, and S. Boyd, “Solution refinement at regular points of conic problems,” Computational
Optimization and Applications, vol. 74, no. 3, pp. 627–643,
2019.
M. C. Grant and S. P. Boyd, “Graph implementations fornonsmooth convex programs,” in Recent advances in learning and control, Springer, 2008, pp. 95–110.
A. Ferber, B. Wilder, B. Dilkina, and M. Tambe, “Mipaal:
Mixed integer program as a layer,” in Proceedings of the
AAAI Conference on Artificial Intelligence, vol. 34, 2020,
pp. 1504–1511.
S. Sekhar Sahoo, M. Vlastelica, A. Paulus, V. Musil, V.
Kuleshov, and G. Martius, “Gradient backpropagation
through combinatorial algorithms: Identity with projection
works,” arXiv e-prints, arXiv–2205, 2022.
J. Kotary, F. Fioretto, P. Van Hentenryck, and Z. Zhu, “Endto-end learning for fair ranking systems,” in Proceedingsof the ACM Web Conference 2022, 2022, pp. 3520–3530.
A. N. Elmachtoub and P. Grigas, “Smart “predict, then
optimize”,” Management Science, 2021.
Nasdaq, Nasdaq end of day us stock prices, https :/ / data . nasdaq . com / databases / EOD /documentation, Accessed: 2023-08-15, 2022.
A. Martins and R. Astudillo, “From softmax to sparsemax:
A sparse model of attention and multi-label classification,”in International conference on machine learning, PMLR,
2016, pp. 1614–1623.

6Differentiable Approximations of Fair OWA Optimization

A. Extended Related Work
Recent literature has been developed around constrained optimization models that are trained end-to-end with machinelearning models [26]. In the Predict-Then-Optimize setting, a machine learning model predicts the unknown coefficients ofan optimization problem. Then, backpropagation through the optimal solution of the resulting problem allows for end-to-end
training of its objective value, under ground-truth coefficients, as a loss function. The primary challenge is backpropagation
through the optimization model, for which a variety of alternative techniques have been proposed. Differentiation throughconstrained argmin problems in the context of machine learning was discussed as early as [27], who proposed first to
implicitly differentiate the argmin of a smooth, unconstrained convex function by its first-order optimality conditions, definedwhen the gradient of the objective function equals zero. This technique is then extended to find approximate derivatives forconstrained problems, by applying it to their unconstrained log-barrier approximations. Subsequent approaches applied
implicit differentiation to the KKT optimality conditions of constrained problems directly [13], [28], but only on special
problem classes such as Quadratic Programs. [29] extend the method of [28], by modeling second-order derivatives of the
optimization for training with gradient boosting methods. [30] uses the differentiable quadratic programming solver of[28] to approximately differentiate general convex programs through quadratic surrogate problems. Other problem-specificapproaches to analytical differentiation models include ones for sorting and ranking [17], linear programming [22], andconvex cone programming [20].
The first general-purpose differentiable optimization solver was proposed in [15], which leverages the fact that any convex
program can be converted to a convex cone program [31]. The equivalent cone program is subsequently solved anddifferentiated following [20], which implicitly differentiates a zero-residual condition representing optimality [32]. A
differentiable solver library cvxpy is based on this approach, which converts convex programs to convex cone programs by
way of their graph implementations as described in [33].
A related line of work concerns end-to-end learning with discrete optimization problems, which includes linear programs,
mixed-integer programs, and constraint programs. These problem classes often define discontinuous mappings with respect
to their input parameters, making their true gradients unhelpful as descent directions in optimization. Accurate end-to-end
training can be achieved by smoothing the optimization mappings, to produce approximations that yield more usefulgradients. A common approach is to augment the objective function with smooth regularizing terms such as Euclidean norm
or entropy functions [12], [22], [34]. Others show that similar effects can be produced by applying random noise to theobjective [23], [24], or through finite difference approximations [25], [35]. This enables end-to-end learning with discrete
structures such as constrained ranking policies [36], shortest paths in graphs [37], and various decision models [12].

B. Portfolio Optimization Experiment
The classic Markowitz portfolio problem is concerned with constructing an optimal investment portfolio, given future returnsc ∈ Rn on n assets, which are unknown and predicted from exogenous data. A common formulation maximizes future
returns subject to a risk limit, modeled as a quadratic covariance constraint. Define the set of valid fractional allocations∆n = {x ∈ Rn : 1T x = 1, x ≥ 0}, then :x⋆ (c) = argmax cT x s.t.: xT Σx ≤ δ.

(17)

x∈∆n

where Σ ∈ Rn×n are the price covariances over n assets. The optimal portfolio allocation (17) as a function of future
returns c ∈ Rn is differentiable using known methods [15], and is commonly used in evaluation of Predict-Then-Optimize
methods [1].

Settings. Historical prices of n = 50 assets are obtained from the Nasdaq online database [38] years 2015-2019, andN = 5000 baseline asset price samples ci are generated by adding Gaussian random noise to randomly drawn price vectors.
Price scenarios are simulated as a matrix of multiplicative factors uniformly drawn as U (0.5, 1.5)m×n , whose rows are
multiplied elementwise with ci to obtain Ci ∈ Rm×n . While future asset prices can be predicted on the basis of various
exogenous data including past prices or sentiment analysis, this experiment generates feature vectors zi using a randomly
generated nonlinear feature mapping. The experiment is replicated in three settings which assume m = 3, 5, and 7 scenarios.
Two sets of stocks were selected to generate two different datasets based on their average returns across observations. The
first set consists of assets from the index with average returns within the 25th to 50th quantile range, while the second set
includes assets from the 75th quantile.
7

Differentiable Approximations of Fair OWA Optimization

Table 1: Hyperparameters
Hyperparameter

Min

Max

learning ratesmoothing parameter ϵsmoothing parameter β0
MSE loss weight λ

−3

−1

1e
0.1
0.005
0.1

OWA-LP

1e
1.0
10.0
0.5

Final Value
OWA-LP

Two-Stage

Sum-QP

OWA-QP

OWA-Moreau

Sur-QP

1e
N/A
N/A
0.4

5e
N/A
N/A
N/A

1e
1.0
N/A
0.3

1e
1.0
N/A
0.4

1e
N/A
0.05
0.1

1e−2
1.0
N/A
0.3

−2

Two-Stage−3

Sum-QP−2

OWA-QP−2−2

OWA-Moreau

Regret (%)

100
80
60
40
20
0

3 Scenario

5 Scenario

7 Scenario

Figure 4: Percentage OWA regret (lower is better) on test set, on robust portfolio problem over 3,5,7 scenarios.

The predictive model Mθ is a feedforward neural network with three shared hidden layers followed by one separated hidden
layer for each species that is trained using Adam Optimizer and with a batch size of 64. The size of each shared layer ishalved, and the output dimension of the separated layer is equal to the number of assets. Hyperparameters were selected as
the best-performing on average among those listed in Table 1). Results for each hyperparameter setting are averaged over
five random seeds. In the OWA-Moreau model, the forward pass is executed using projected gradient descent for 300, 500,
and 750 iterations, respectively, for scenarios with 3, 5, and 7 inputs. The update step size is set to γ = 0.02.
At test time, Mθ is evaluated over a test set for the distribution (z, C) ∈ Ω, by passing its predictions to a projected
subgradient solver of (16).
B.1. Additional Results
Figure 4 and 2 display models’ performance on datasets generated from assets with average returns in the 75th quantile
and within the 25th-50th percentiles, respectively. The y-axis represents the percentage of regret based on optimal OWA
values. A consistent trend is observed in both datasets: end-to-end approaches tend to outperform two-stage approaches.
Additionally, our proposed frameworks (OWA-QP and OWA-Moreau) perform better than Sum-QP, with improvements
ranging from 5-30%. OWA-QP performs better when the number of scenarios is small but struggles to scale beyond 6
scenarios.
B.2. Effect of adding MSE loss
Figure 5 illustrates the impact of combining the Mean Squared Error loss LM SE in a weighted combination with the decisionquality loss LDQ . With the exception of OWA-LP, which exhibited instability, and Two-Stage, already trained with MSE
Loss, the addition of MSE resulted in slight enhancements to the regret performance.
B.3. Solution Methods
The OWA portfolio optimization problem (16) is solved at test time, for each compared method, by projected subgradientdescent using OWA subgradients (7) and an efficient projection onto the unit simplex ∆ as in [39]:8Differentiable Approximations of Fair OWA Optimization

100

100
80

0
1

au
OWA
-More

0

QP

20

Sum-

au

OWA
-More

OWA
- QP

QP
Su m-

tage
Two-S

LP
OWA

au

0

add_mse

40

ge

0
1

Two-S
ta

add_mse

20

OWA
-More

OWA
-QP

QP

ge

Sum-

Two-S
ta

OWA

LP

20

40

LP

0
1

60

OWA

add_mse40

Regret (%)

60

0

80

60

Regret (%)

Regret (%)

80

Figure 5: Effect of MSE Loss on differentiable optimization models. From left to right: 3, 5, 7 scenarios∂
xk+1 = proj∆ xk − α
OWAw (Cx)∂x(18)

For the Moreau-envelope smoothed OWA optimization (11) proposed for end-to-end training, the main difference is that its
objective function is differentiable (with gradients (12)), which allows solution by a more efficient Frank-Wolfe method[16], whose inner optimization over ∆ reduces to the simple argmax function which returns a binary vector with unit value
in the highest vector position and 0 elsewhere, which can be computed in linear time:
xk+1 =

k2
xk +argmax
k+2
k+2

9



∂
OWAw (Cxk )∂x(19)