Learning the Efficient Frontier
Authors: Philippe Chatigny
Ivan Sergienko
Ryan Ferguson
Jordan Weir
Maxime Bergeron
Venue: NeurIPS 2023 poster (2023)
Keywords: Efficient Frontier
Convex Optimization
Resource Allocation
Constrainted Optimization
Finance

Abstract: The efficient frontier (EF) is a fundamental resource allocation problem where one has to find an optimal portfolio maximizing a reward at a given level of risk. This optimal solution is traditionally found by solving a convex optimization problem. In this paper, we introduce NeuralEF: a fast neural approximation framework that robustly forecasts the result of the EF convex optimizations problems with respect to heterogeneous linear constraints and variable number of optimization inputs. By reformulating an optimization problem as a sequence to sequence problem, we show that NeuralEF is a viable solution to accelerate large-scale simulation while handling discontinuous behavior.

Learning the Efficient Frontier
Philippe Chatigny'
Ivan Sergienko Beacon Platform
Ryan Ferguson
Riskfuel
Riskfuel
Toronto
New York
Toronto
pc0riskfuel.com com
ivan. wen..sergienkoobaaccn.ioo
rf@riskfuel.com com
Jordan Weir
Maxime Bergeron
Riskfuel
Riskfuel
Toronto
Toronto
jw0riskfuel.com
mb@riskfuel.com
Abstract
The efficient frontier (EF) is a fundamental resource allocation problem where one has find an optimal portfolio maximizing reward given level of risk. This optimal solution is traditionally found by solving a convex optimization problem. In this paper, we introduce NeuralEF: a fast neural approximation framework that robustly forecasts the result of the EF convex optimization problem with respect heterogencous lincar constraints and variable number of optimization inputs. By reformulating an optimization problem as sequence to sequence problem, we show that NeuralEF is viable solution to accelerate large-scale simulation while handling discontinuous behavior.
Introduction
Making the least risky decision to maximize cunulative reward over time is central problem in machine learning and the core of resource allocation optimization problems [26] In modern portfolio theory [16], this problem is commonly referred to as the efficient frontier (EF) 36. It involves distributing resources among n risky assets to maximize return on investment while respecting various constraints. These constraints (e.g., maximum allocation allowable for an asset) are set to prevent. aggressive or unrealistic allocations in practice. Finding the optimal solution to this optimization problem given the expected risk and return of each asset under a set of constraints can be done by solving a convex optimization problem of quadratic programs (QP) and second-order cone programs (SOCP). Although single optimization problem is not time-consuming to solve, its current computational cost remains the most significant bottleneck when performing the simulations necessary for financial applications
22 7
Indeed, inputs to the EF problem such future expectations of asset returns, co-variances, and even simulated client preferences on asset allocation are stochastic (c.f. Table I Thus, needs to repeatedly solve the optimal allocation problem under large number of different scenarios and Monte Carlo (MC) simulations By) are commonly used to estimate the expected reward over time. Given allocation function 9 and stochastic input Z, we need to compute E(g(Z)) ((=) dz where fz is the density function of Z. Sampling the empiric mean of (() approximates E(g(Z)) with convergence rate of O(Iv/N) where N denotes
"Crresponning author
(Contribution was made when working Riskfuel
37th Conference on Neural Information Processing Systems (NeurIPS 2023).

---

the number of samples. The computational cost of this simulation is therefore influenced by the size of N and the cost of computing 9. In spite of the vast literature of variance reduction techniques 5 17 and the use of low-discrepancy sampling methods [10] 21 that aim to reduce N, the results of the simulation will be misleading if the assumptions are not valid, leaving the cost of running g(z) as the principal bottleneck. This makes it practically impossible to run multiple MC simulations on different candidate assumptions in real time unless significant computational resources are available. Applications that heavily depend on MC simulations of the EF problem like basket option derivatives pricing face this bottleneck because their valuation depends accurate estimates of the expected returns E E(R), portfolio volatility E(V) and/or allocations B(X). The roll-out of new regulatory frameworks for financial applications of the EF problem (e.g. portfolio management) requiring more rigorous testing of [Z)) further increases the minimal acceptable N, exacerbating the need for speed 3Y 8]
The core problem then becomes finding a way reduce the computational cost of 9, making it possible to run a large number of MC simulations
tiitii in the sinur poriie
6.5
in a few seconds [27 25]. Accelerating the optimization on highly-parallel hardware like graphical processing units (GPUs) can accelerate some convex optimization problems 13, 44 [T] 12 but not enough to run MC simulation in real-time effectively. Instead of only exploiting hardware, others have proposed to approximate the optimization step using deep neural net notworks (DNNs) and infer the result directly [ 28 48 [9] However, proposed approaches fall short since they fail to simultaneously satisfy the following key requirements: (1) they do not provide theoretical guarantees that their forecast is within the domain set by constraints, (2) they do not show that their results can be applied at large scale faster than the optimization itself, (3) they can't handle a variable amount of heterogeneous incquality constraints and optimization inputs, and, (4) they are not robust to discontinuous behavior of optimization problems.
6.55
0.0
025
6.37 3:80 5.30
Figure 1: Iulssaaation of the EF problem.
The optimal allocations are at the frontier of the plot where the expected returns is maximized for level of volatility, The ycllow dot denotes the best allocation for eq. / for Viarget = 0.06. The location of the yellow dot will vary under different conditions, which can be approximated under different scenarios (Z) using MC simulations.
This work addresses all the shortcoming of DNN- approaches mentioned above. We propose NeuralEF, DNN-based model to approximate the computation of the EF problem robustly. Our model up 615X times faster than the baseline convex optimization when used with hardware acceleration. It is able to handle a variable number of assets and incquality constraints with consistent accuracy. In particular, we introduce a dynamic greedy allocation module to respect the constraints robustly that is agnostic to the DNN architecture. The remainder of this paper is organized as follows. Section P describes the EF problem and presents related works convex optimization acceleration. Section introduces NeuralEF and its training methodology. Section outlines our empirical evaluations on the EF oplimization problem. Finally, section presents our conclusions.
2
Background and Related Work
2.1 The Efficient Frontier
We seek an optimal allocation x = [.1.-.. ... vn.] over n risky assets given a soft volatility target Viarget- This means a portfolio with higher achieved volatility than Vearget is valid only if the resulting allocation has the minimum volatility that can be achieved on the feasible domain. Finding the optimal allocation maximizing portsolio return at a given volatility larget is conditional on the assets' expected returns R = [ri,... .Tn), volatilities ies V = ["i,..., vy). and correlations P = [pI,,,.. Pl.m),.... ... [Pr,1, ... pn,a]]- Constraints that must be satisfied include upper and lower bounds on total allocation of risky assets auxx Quas.
2

---

and a minimum and maximum asset allocation limit per asset X
XMAX [at :-.. 2m J. As is typical in finance, assets can belong a set of classes C C= (e..... Cal:: E [T,... ml. and allocations are subject to a class maximum [MAX
Enee di S Cez- We denote the set of convex optimization inputs by Zinput =
R.V.P. X,Xxxx X C, SSLA CANN: OSAAN Viarget] and the resulting allocation by Zoupput EF (Zmput).
This problem is illustrated in fig, [ Jusing random allocations where the EF is located at the left-most frontier of the plots. We can find this frontier along range of volatility targets by solving a two-step conditional convex optimization problem where we first find the optimal weights that minimizes risk in portfolio of assets subject to linear weight constraints and then maximize the return the risk of the portfolio is below Vearget-
Finding this minimum variance portfolio is equivalent to solving QP problem of the form
== minimize 2 =T Qa subject to a. < b; Vi Vi
(1)
where a E R" is a column vector of weights representing the allocation, Q is the covariance matrix of the portfolio's assets, a; is row vector representing the i-th linear constraint (obtaincd from OsNN; Osax XIAx. XAIN Suux) and b, is the maximum required value for the i- ih constraint. The result of eq. allows us to calculate the minimun volatility Vmin = x' Qa: that can be achieved on the feasible domain.
If the resulting portfolio risk Vini Viagett, then we can afford to maximize portfolio return. In this case, the objective function of the first problem becomes one of the constraints of a SOCP problem of the form
Φ = minimize - R T x subject to 2²
Qu S Tx
Vearget and a. < <bVi 1........... w.
(2)
Thus, the efficient frontier can be summarized by
Zoutput EF (Ziput)) = + if Vinn > Viargst else Φ
(3)
The EF optimization is sensitive at inflection points where one asset becomes more attractive than another. All else held equal, infinitesimal difference in expected returns can cause jump in optimal allocation for all assets. Modeling the EF problem is challenging due to the presence of such discontinuities, which grows factorially (O(N!)) as the number of assets increases.
2.2 Accelerating Convex Optimizations
The simplest way to speed up eq. 3 is to implement the solver for direct use with highly parallelizable hardware. This has been done using GPUs for various convex optimizations, particularly for large problems with numerous unknowns [ showed that solving numerous optimizations simultancously significant speedup. We replicated this experiment by writing vectorized implementation of the optimization eq. 3 in Pytorch to solve multiple EF problems at once. We obsorved accelerations which consistent with the order of magnitude achieved in these works, but not sufficient to allow the completion of a full simulation in a matler of few seconds unless the GPU used has high memory capacity (e.g. 40 GB).
24 12] In particular, [[] a single batch Icads to
Several works 4 20 embed differentiable optimization problems in DNNs, offering a solution to robustly approximate the EF problem including the handling of the inequality constraints in eq. [ and eq. 2 Their approaches aim to solve a parameterized optimization problem ensuring constrained layer's output to align with homogeneous linear inequality constraints ostablished by Zimput- This is donc cither by solving the optimization problem during training 4 I, when initializating the model 20. To support hetcrogenous set of constraints, one would need to specify a set of linear incquality constraints ahcad of time. This approach is impractical as it cannot generalize to unspecified sets of constraints.
Other existing supervised learning (ST.) approaches to approximate convex optimization with DNNs do not provide the desired flexibility and robustness for large-scale generalization
3

---

They use DNN that takes Zuput as imput and outputs Zoutput, treating inequality constraints as soft during training. Reinforcement learning (RL) approaches like POMO [T and PPO [5 have also been applied variable length input combinatorial optimization problems with high label retrieval complexity where their learned policy tries to reduce an optimally gap by measuring the regrets from the optimal allocation. These DNN approaches do not guarantee that predicted values remain within the feasible domain and are often unable to handle the changing dimensionality of Zipput and Zoutput based on n and the set of constraints selected. Our proposed method addresses these issues, resulting in a fast and accurate approximation of the convex optimizer that respects constraints.
48 2 18 28
3 Neural Approximation of the Efficient Frontier
Model
Pool Aocoolli.
Row
Fead Foreoa
Adhationn
Prgjeries Bes
Dysona donndy dioctioo
Rooi
dedu
dinnu
Sociin Hooks
Hullit for
Ineds
lppets
Amst Spacils
Aami Eavcii
+
Colmmled Opaiaal Ports Meighta
Add
+
Touas
Acci Postiorall Crrsscng
Modal Oudg
Iigul
Figure 2: Illustration of the Transformer Encoder architecture of NeuralEF. On the left side the projection to sequence representation from the optimization inputs considering 3 assets is shown as an example.
To approximate the computation of the QP and conditional SOCP optimization described in sec. 2. we use a stacked transformer encoder architecture 46 29 as shown in fig. 2 The principal idea behind NeuralEF is to consider the optimization problem as sequence-to-sequeee and use the self attention mechanism to consider the relationships between the optimization inputs when approximating eq- 3 Contrary to large language models (LLMs) that solve quantitative mathenatical problem by parsing the problem using a mix of natural language and mathematical notation where a forecast. is built using the same notation [3] 15,, our SEQ2SEQ formulation explicitly parse the whole optimization problem by considering the optimization input directly and forecasts the output the solution domain. We setup the SEQ2SEQ problem such that the inputs are a set of tokens, each representing a single asset, and the outputs are a one dimensional sequence of the optimal allocation. To convert the optimization problem in eq. 3 to a sequence representation, we divide the optimization input parameters in two types of leatures: global optimization inputs (MAK, QsIN, OMax Vearget) and asset specific inputs (R, Y. XMIN; C). These features along with a sequence of asset identifier (n values evenly spaced within [0, 1)) are used rearrange the optimization input parameters into set of vectors and are linearly projected into higher dimensional
(SEQ2SEQ) problem 45
6000
xX
x
Figure 3: Illustration with two assets of the domain output space that the dynamic greedy allocation rebalancing module will enforce. The output domain is highlighted by the cross hatch patterns and the constraints are highlighted by the red lines.
4

---

tokens ti by as shown in the left part of fig. Since the projection is made numerical features instead of categorical embeddings like language model 9. the linear projection can express an infinity of tokens and this can induce learning difficulties during training.
Preprocessing optimization inputs before sequence projection is crucial to improving model performance and overeoming two training difficulties when considernig EF as a SEQ2SEQ problem. First, there are various input combinations that represent the same optimization problem. For example, when an asset's maximum weight surpasses its class constraint, the asset's maximum weight is effectively constrained by its class limit. We address this issue by preprocessing all imputs before being projected to remove any unnecessary complexity during training. Second, the model must be invariant to the sequence ordering A1l input. Building on insights from Ar NeuralEF sorts assets by returns, adding a positional embedding before the transformer encoder. This approach accelerates convergence to higher accuracy because assets with higher returns are more likely to receive greater allocation. When both of these approaches are combined, model training becomes significantly casier.
40 given as
We introduce DGAR, a dynamic greedy allocation strategy, to constrain the encoder's forecast to stay within the domain set by the constraints, as shown in fig, 3 It consists of first clipping the forecast X - [x1, [ with its upper and lower bounds X mmax and X Xmin as in eq. 4 We extract an ordering of the assets [k.....] := argsort(-X:, (x;; N) where k E [1..... .N. such that assets with higher allocation are prioritized in the reallocation. We also compute an estimate of the total allocation based on the upper bound and lower bound of the domain using eq- 5 We then identify whether the total allocation is above OMAX by computing a cumulative sum following the ordering established previously and then altering the allocation on assets such that it does not exceed QMAX as in eq. G A similar process applied to cases where CALLO < ChaNN where we inflate the allocation of the assets greedily following IC until we reach a total allocation âsLsc which we compute by eqs. 7 The dynamic nature of the greedy allocation strategy allows using dynamic programming to perform the allocation in O(Nlog(N)). DGAR guarantees that the forecast. is within the allowed domain of linear constraints except for the class constraints Saax mentioned in sec. 2.1 and the volatility constraint (non-lineat) which are both limitations of DGAR.
z min(maz(zz,.)) ","",, =(Ax)
(4)
aALLOG min (maz x axux). assxx)
(5)
x4 + (amax a
Σ/ mz)), if Σi= z4 > anax
.0)
.0)
x min max
OMaX
(6)
otherwise
if ā T'uLoo < otherwise
ChII d'ALLO
m
0,
x
(7)
á
axuroll
(8)
by
min(I
MAX 2%/,
(9)
a = x + m0 by mar(0, (aa
bk)))
(10)
4 Experiments
We used MC sampling scheme to cover the entire domain in table. I uniformly to generate
a dataset of approximately one billion samples Derain = [Zinput, EF Im)p "" "> which we used to train NeuralEF in supervised fashion:
@NeuralEF argmin
Σ N
1 [(NeuralEF (Zmput, (NeuratEr) ) EF (Z)mputt)))
(11)
NouralRp
3 "There are many ways to set up an optimization problem into a SEQ2SEQ problem. Similar to prompt engineering on LLMs B. different formulations influence the model accuracy. We do not focus on finding the best formulation to convert optimization problem into input tokens.
5

---

We generated two test datasets Drest, Dvalidation of 1 million samples each on the the same domain as the training set described in table I All synthetic datasets mimic real-life distributions for the volatility and correlation inputs, encompassing area of the optimization domain around the discontinuity areas. Around 84% of the test samples feature least two optimization inputs within proximity of each other to target discontinuity areas of eq. 3 This synthetic data allows for precise control over optimization inputs and encompasses broad spectrum of scenarios, ranging from extreme to real-world cases targeting mainly the discontinuity regions. Consequently, facilitates a comprehensive evaluation of the model's performance across various settings. All datasets have varying numbers of assets and asset classes, and include two allocation scenarios: full allocation (AMAx = QauN = 1) and partial allocation (Axax > Osass where there is no obligation allocate the full budget. Only valid optimization inputs Zimput, i.e. where EF (Zipuut does not fail because of numerical difficulties in the solver that no solution exists, where considered.
Feature
Range
Feature
Range
(Vergett) volatility target
[0.05, 0.15
(V) volatility
00, 2
(P) Correlation matrix
[11
(R) returns
[122
(Guax) maximum class allocation
0.2. 1.0
(wituxx) maximum asset allocations
[0.01, 1.0
(asax) Allocation lower bound
[0.6, 1.0]
(Amax) Allocation upper bound
1.0
(n) Number of assel sampled
[2.12]
(m) Possible class
[0.1.2]
Table 1: Input Domain of optimization input used for training.
NeuralEF is a 7.9M parameter DNN and was trained on a single NVIDIA A100 GPU with stochastic gradient descent using the AdamW optimizer [3]] and the L loss. We also used an annealing learning rate decay starting from 5.5e to 1.0e-5. As stated in sec. 2 we also implemented baseline EF optimization in PyTorch that we used solely for comparing the evaluation throughput (evaluations/secan /scoonds) between NeuralEF over the base pricer which was implemented using CVXOPT [1] The hyperparameters of NeuralEF are described in table. 2 and were selected by estimated guesses from the accuracy measured on Dvalidation-
Name
Value
Name
Value
Token dimension
320
(D) Transformer depth
Transformer # heads
8
Transformer heads dimension
32
Feed forward projection
1024
Output activation
Sigmoid Swish 42
Embedding method
30
24
Hidden activation
Table 2: HyperParameters of NeuralEF. Adjusting accuracy the expense of throughput
can be easily done by increasing the token dimension.
4.1 In-domain Interpolation
0.8
0.6
0.5
popurcon
popurion
0.4
0.4
0.4
100
0.2
0.8
0.0
10-10
10-1
10-4
10-4
10-h 10-th
10-30
10-7
10-4
10
10-14
10-11
10th
10-1
10-1
Portidio
Figure 4: Cumulative distributions of the sum of absolute allocation error of allocations and portfolio returns per number of assets

---

We assess NeuralEF's accuracy by measuring its ability to predict portfolio weights, returns and volatility on Durst. We use Mean square error (MSE), mean absolute error (MAE), and quantiles to evaluate the error distribution for portfolios with varying numbers of
assets. Additionally, we test NeuralEF's precision in ranking asset importance in the allocation, check the precision of our model to forecast volatility (Vuareet = Z output Q output S mar V mar(Vaarge:; Vinn)), and check for feasibility of violating constraints. Table 3 summarizes the accuracy results for different numbers of assets considered. Overall, NeuralEF shows accurate performance on portsolio weight prediction with slight deviations only in the higher upper quantiles for all asset cases. The model also demonstrates a high level of accuracy on returns and volatility. The ability to rank assets in order of importance correlates with the ability to respect constraints not captured by DGAR. The optimality gap metrics (ranking precision, SMAX and Viarget) are by design highly sensitive to a slight deviation, which in practice wouldn't necessarily be impactful. However, this limitation is to be considered when considering NeuralEF in safety-critical scenarios. NeuralEF can casily be applied within MC' simulations that targets E(R), B(V), and/or E(x) as failure to respect the unsupported constraints does not necessarily lead to large error on the allocation. With a sufficiently large N, these errors do not impact the derived distributional features of B(g(2)).
weights
wrigits
Banking
126-16
-110-11
1.22-12
5.50-12
1.56-01
9.112
25h-16
LE0--G
8.Te-4G
1.te-61
$5/003
315-16
1:33-11
1.
+15--0
1.Te-011
91.55
15te.46
2/12-411
Li0x-C
4.5e-1G
180--61
$1,815
4
96-429
100--15
1:35-11
1.0-10
155e-10
1.57-01
7.51d4
158.40
6.17-40
155k-41
$4.815
2.15-43
5550-10
933--11
17
105-001
5 5.26
76.017
2
_/33o433
7.Ta-45
2.3k-4GG
7.54-42
500
390--6
1.5--13
1.47e-00
90:311
3
8.76--66
1.85-113
1.10--10
3100-10
600--00
65- 116
1.5a-10
:.15-41
1.5k-11
8106-18
1.25-11
3/43-413
1.70--00
4 150-
61.31
1.3--11
13
120e-77
3.53--11
1.10-10
5 14
61:111
11fe16
1/77-11
10
5 17a
115-00
Volutiilty return Mis
Voiitility return MAK
95 quaatile
29.863 quaatille
99.997 quastill
procliion
2
2.
-.30-411
7.N--15
2 2.36-12
754--2
28-412
2.70+413
1.47x-12
1.10-12
1.71e-13
5
KTT6-16:
1435-411
1-tb--1
3116-12
010--12
07-415
851e-10
188-05
1
3.
1.0061
55.655
8.77--1:
1.404111
1-73-12
4.22-14
1.00-01
73.788
1-7te-18:
1.72-11
66-458
3.40-05
25le10
5 555k-10
135--0
1.60.0
2.06-00
5 5.50-0
171601
70:30
1.36-16
5/066411
250-11
ATa-12
1.5--11
70/209
Table 3: Accuracy of portfolio weights, implied return and resulting volatility
We plot the error distribution per asset by displaying the cumulative distribution of the sum error for all æi.-.. ; the absolute error on the expected return and the portfolio volatility in Fig. | The total weight allocation error does not exceed 1% total deviation in around 98% of cases, but the impact on the resulting returns and volatility only noticeable in 1% of cases. From the remaining tail excceding the 1% total deviation, we mcasured no case violating the volatility constraint and only 8% exceeded the class constraint. The source of these errors was mainly found in regions with abrupt changes in the allocation due to the nature of the optimization.
NeuralEF accurately captures the qualitative behavior of the optimization in discontimous regions, but instability in these areas exposes weakness of approximating function with discontinuous behavior using DNNs. We illustrate this behavior using one example from the 99.997th quantile worst predictions of Drest where we vary a single input parameter (r10 E 1-100, 2.0) while keeping the others constant, in Fig. 5] NeuralEF approximates discontinuities for most asscts accurately, and errors on the portfolio returns are often attributed to ranking failure when NeuralEF transitions through these discontinuities. At the expense of always respecting constraints, DGAR can spread forecast errors to other assets with poor K. ordering leading to a larger absolute error in the resulting forecast than not using DGAR Despite some assets not being modeled properly, we observe often that for practical purposes, this doesn't impact the resulting portfolio return or the portfolio
7

---

0.4
0.4
Allocation
Allecation
-1.0
-1.0
Prediction
Ground
Figure 5: Illusraatonn of the behavior NeuralEF discontinuous points of the optimization. The unstable regions on the allocation occurs where ri0 E [0, 0.5). All assels change allocation eir smoothly through that region or suddenly by a jumnp discontinuity.
volatility, as illustrated in fig. (a-b). An ablation study motivating the different NeuralEF's components is presented in sec.
10000
0.05
1.0
0.00300
8000
Emicssontee
0.04
0.60335
0.00303
Troughput
6000
0.03
0.4
0.0033
2000
0.01
0.00233
.02
10
20
30
10
20
30
Ground Tuch
Ground Trush
Number processes
Number
(a) Return
(b) Volatility
(c) EF CPU scaling with concurrent processes.
Figure 6: Impact of the inflection point prediction failure using the same prediction shown fig. 5 on the estimated return and volatility respectively (a.b). EF numerical calculation throughput per concurrent process and its emissions in kgCO2e/ b/khh (c). Emissions presented
are for computing 1000 evaluations per concurrent process and are scaled by a factor of 1e3.
4.2 Throughput Evaluation and Carbon Footprint Impact
Torch Aawete
m2c
1.0
167
2903
17
107
Notth
Bitch
Figure Throughput of the vectorized EF version on GPU (left), NeuralEF in FP16- precision (midle) and NeuralEF in FP32 precision (right) by batch size compared to the single-thread and multi-thread pricer.
We report a significant acceleration in the performance of NeuralEF compared to the single- tread baseline optimizer, with a 623X time improvement CPU (AMD 5950X achieving 559 /s)../s). The main factors contributing to this improvement are running multiple optimizations in batches, the smaller computational cost of inferring the result compared to mumerically solving the optimization using an interior-point solver, and the use of half- precision floating-point forma We demonstrate the scalability of NeuralEF fig. for
'We don't observe a significant impact on accuracy using half-precision floating-poin precision.
See sec. C
8

---

both GPUs and CPUs as well as the impact of the different components. The highest achieved throughput are presented on table.
Parallelizing the execution on CPU through concurrent processes of the base pricer can increase throughput, but the scaling ability of this approach is inferior to NeuralEF'. Fig. 7 (c) shows that the throughput scales linearly with the number of cores until the concurrent processes saturate the CPU usage and prevent further speedup. Considering the AMD 5950X CPU as an example, we achieved maximum throughput of 10377.80 eval./sec. []] It would take 26.77 hours to generate billion evalnations, whereas it would only take 41 minutes or 1.25 hours with NeuralEF respectively on a A100 or on two ISR chips. When accelerated on GPU, impractical large batch sizes are needed to compete with a concurrent CPU setup. Pytorch-EF needs batches of 1.2 million request to reach a maximum throughput of 111479 eval./sec. In comparison, NeuralEF can achieves 343760 eval./sec. using batch size of 80k request. From ease of use standpoint, the accelerated throughput of NeuralEF on a few devices is more cost-effective than maintaining and rumning multiple machines to achieve the same throughput CPU having to deal with large batch size in practice. The scaling advantage of NeuralEF also offer an avenue to reduce the carbon footprint of large-scale simulations.
15000
4038
LEKE
Ceice
10
124
201
20*
Figure 8: throughput by number of assets and batch size.
Scalability of DGAR
A100:
Througbput (evall. /sec))
2080TI:
Throughput (evall//aec.)
Pytorch EF
111479.30
Pytorch-ED EF
26152.00
NeuralEF (Gp32)
128850 46
NeuralEF (4332)
37521.00 00
NeuralEF (fp16)
343760.77
NeuralEF (dp16)
107259. 29
NearaFFF (fp16) clean-only
396450 96
NeusaRFP (fp15) clean-olly
114160.65
NearlEF (f816) no preprocesiin
401641.8
NewralEF (fp16) no preprocessing
118711.91
Intel Xeon Platinum 8480+ (ISR)
3090:
Throughput
(eval.//sce) /sec))
NeuraEEF (fp82)
56050.30
Pyturch EF
410055 25
NeuralEF [bll6- AMX)
221787 48
NeuralEF (1p32)
77859
AMD 5950X (reference)
NeuralEF (fp16)
167594 .55
sirge-hhrud
$59.15
NeuralRF (fp15) clean-omly
173388. 66
Concurent procteses (23)
10377.80
NeuralEF (Ip16) prepocessing
170650.
Table 4: Maximum average throughput achieved. Note that two Intel Xeon Platinum 8480
CPUs were used simullaneously on a dual-sockel machine to achieve the best throughput.
NeuralEF is less environmentally impactful than rumning the same optimization on CPU. For a single AMD Ryzen 9, if we consider the total time to generale our training dataset of 1 billion EF optimizations, the total simulation on CPU would approxinate to 1.39 kg Increasing the throughput by running concurrent processes increases the CO2 emission on the chip it requires more energy as show in fig, 6 (c). Training NeuralEF is more environmentally expensive due to a cumulative 336 hours of computation on a single A100 GPU with an AMD server-grade CPU server resulting in approximately 5.71 kgCO,e. At inference, the total emissions for forccasting a billion EF optimization using NeuralEF is estimated to be 0.03 kg Hence, can offset the total cost of training NeuralEF by running approximately 4.20 billions evaluations. Since MC error converges O(1/VN), one could get a 4x more precise approximation to E(g(Z)) with NeuralEF in the time it would takes to obtain N simulations single CPU, Given that the EF problem is cornerstone
expensive
SCPUs of newer generations and with higher number of core are expected to perform better. "CO, estimations were conducted using CODECARBON ن for the throughput of NeuralEF and eq. 3 The "Machine Learning Impact calculator' 32 (MLIC) was used estimate the cost of training. Both approaches were measured using a carbon efficiency of 0.025 kgCOze/kWh to approximate its use in an environmentally friendly data center. Since we didn't 't track total amount of our emission during training, the estimate for model emission made with the MLIC is less accurate.
9

---

of multiple applications in finance, 4.20 billions evaluations is casily offset in less than a week by a single organization.
4.3
Out-of-domain Generalization
1.0
3,0
08
4.0
1.0
5.0
3.0
6.0
Imsporter
Pepprtee
0.4
30.0
13.0
15.0
11.0
11.0
13.0
02
12.0
22
120
02
12.0
10'0
10"1
10-1
13-1
10-1
10-1h 10-1
13-th
10t1
10-1
20-1
13-1
10:1
16-1
20nd
200
Sart of on arcr
Volac eme
Figure 9: Cumulative distributions of the sum of absolute allocation error of allocations and portfolio returns per number of assets for Dond
The generalization ability of our model was measured by testing it on a larger input domain on new dataset Dond of 1 million samples using the same domain as in Dosst, but instead considering Vearger E [0.01, 0.3), R E [0,4], ObaI E [0.2, 1.0]. The accuracy of the model degrades significantly on the tail of the distribution, especially for larger asset cases, indicating that it is not recommended to use NeuralEF outside the training domain. However, scale invariance in eq. when all returns have the same sign (e.g., R [0.3, 0.4, 0.5] = [3.3, 3.5), allows the model to accurately estimate optimization even with returns outside the training domain by rescaling R by À such that they fit within the training domain. One can revert to the basc optimization in the rare cases that it goes out of the domain, c.g. where assets go above 200% returns or the 200% volatilities, both being highly unlikely cases. Otherwise, one can always train NeuralEF on bigger domain than table. D with most likely more data. Because NeuralEF has been trained on synthetic data, we haven't 't observed behavior bias that arises directly from certain regime aside in cases where assets would oscillate in the inflection area of the optimization, i.e. when two 'attractive' assets have returns/voll /olatilitess close to each other and/or near 0 across a prolonged period of time.
5 Conclusion and Broader Impacts
In this work we introduce NeuralEF, fast DNN-based model that approximates the solution of a convex optimization problem by treating it as a SEQ2SEQ problem. Using the Efficient Frontier, a highly discontinuous resource allocation problem, we demonstrate NeuralEF's accuracy and its ability to handle variable-length input optimization parameters while robustly respecting lincar constraints by means of a novel dynamic greedy allocation rebalancing module. This positions NeuralEF as an attractive solution to reduce the computational footprint of running large scale simulations and offers a practical means to accelerate convex optimization problems in application that rely on MC simulation such as securities pricing, portfolio management. and valuation of unit-linked insurance policies [ B8
More importantly, our reformulation of convex optimization as SEQQSEQ offers a tangible step towards solving quantitative mathematical problems efficiently with DNNs 33 15
Whether it is easier to expedite optimization problems with heterogeneous constraints though a RL training paradigm 31 35
or SL paradigm like done with NeuralEF hinges on additional experimental insights. However, we know that current LLMs struggle to solve hard mathematical tasks 33 and simply scaling them is impractical for achicving strong mathematical reasoning 23 Converting quantitative mathematical problem into sequence representation and then lorecasting the results presents a more practical approach than solving it directly. This concept separate reasoning, L.e. how to formulate mathematical problem given some inputs using LLM, and solving it as two independent learning tasks that can be combined at inference.
10

---

References
[4] A. Agrawal, B. Amos, S. Barratt, Boyd, S. Diamond, and J. Z. Kolter. Differentiable convex optimization layers. Advances in neural information processing systems, 32, 2019.
2 A. Agrawal, S. Barratt, and S. Boyd. Learning convex optimization models. IEEE/CAA Journal of Automatica Sinica, 8(8):1355 1364, 2021.
3 L. Akkizidis and L. Kalyvas. Final basel III modelling: Implementation, impact and implications. Springer, 2018.
[4] B. Amos and J. 7. Kolter. Opinet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning, pages 136 145. PMLR, 2017.
5 D. F. Anderson, D. Higham, and Y. Sun. Computational complexity analysis for monte carlo approximations of classically scaled population processes. Multiscale Modeling & Simulation, 16(3):1206-1226, 2018.
[6] Boyle, M. Broadie, and P. Glasserman. Monte carlo methods for security pricing. Journal of economic dynamics and control, (18-9))1267-1322) 1997.
[7] Brandimarte. Handbook in Monte Carlo simulation: applications in financial engineering, risk management, and economics. John Wiley & Sons, 2014.
[8] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. Advances neural information processing systems, 43:1877-1901 2020.
99] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 15:187--1901 2020.
[10] R. E. Caftisch. Monte carlo and quasi-monte carlo methods. Acta numerica, 7:1-49, 1998.
[11] J. Charlton, S. Maddock, and P. Richmond. Two-dinensional batch linear programming on the gpu. Journal of Parallel and Distributed Computing, 126:152-100 160, 2019.
[12] P. Charoenphaibul and N. Juneam. Gpu-accelerated method for simulating efficient portsolios in the mean-variance analysis. In 2020 17th International Joinl Conference on Compuler Science and Software Engiinering (JCSSE), pages 171 IEFF, 2020.
[13] D. Cole, S. Shin, F. Pacaud, V. M. Zavala, and M. Anitescu. Exploiting gpu/simd architectures for solving linear- quear-qua mpc problems. arXiv preprint arXiv:2209.188: 13049, 2022.
[14] S. Diamond and S. Boyd. Cvxpy: A python-embeddded modeling language for convex optimization. The Journal of Machine Learning Research, 17(1):2909 2913, 2016.
[15] I. Drori, S. Zhang, R. Shuttleworth, L. Tang, A. Lu, E. Ke, K. Liu, L. Chen, S. Tran, N. Cheng, R. Wang, N. Singh, T. L. Patti, J. Lynch, A. Shporer, N. Verma, E. Wu, and G. Strang. neural network solves, explains, and generates university math problems by program synthesis and few-shot learning human level. Proceedings of the National Academy of Sciences, (1933)): 2022.
[16] E. J. Elton and M. J. Gruber. Modern portfolio theory, 1950 to date. Journal of banking & finance, (111-1)):1743 -759, 1997.
[17] M. Estecahandy, L. Bordes, S. Collas, and C. Paroissin. Some acceleration methods for monte carlo simulation of rare events. Reliabilily Engineering System Safely, 144: 296 -10, 2015.
11

---

[18] Z. Feinstein and B. Rudloff. Deep learning the efficient frontier of convex vector optimization problems. arXiv preprint $5l:2205.07077 2022.
[19] A. Fornández and S. Gómez. Portfolio selection using neural networks. Computers operations research, 34(4):1177-1191, 2007.
[20] T. Frerix, M. Nießner, and D. Cremers. Homogeneous linear inequality constraints for neural network activations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 748-749, 2020.
[21] M. Giles, F. Y. Kno, I. H. Sloan, and B. J. Waterhouse, Quasi-monte carlo for finance applications. ANZIAM M Journal, 50:C308 C323, 2008.
[22] P. Glasserman. Monte Carlo methods in financial engineering, volume 53. Springer, 2004.
[23] D. Hendrycks, C. Burns, S. Kadavath, A. Arora, S. Basart, E. Tang, D. Song, and J. Steinhardt. Mcasuring mathematical problem solving with the MATH datasct. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, Neurips Datasets and Benchmarks 2021, December 2021, virtual, 2021.
[24] J. Ho, N. Kalchbrenner, D. Weissenborn, and T. Salimans. Axial attention in multidimensional transformers. arXiv preprint or 1912: 12180, 2019.
[25] J. C. Hull. Options futures and other derivatives. Pearson Education India, 2003.
[26] T. Ibaraki and N. Katoh. Resource allocation problems: algorithmic approaches. MIT
press, 1988.
[27] P. Jäckel. Monte Carlo methods in finance, volume 2. J. Wiley, 2002.
[28] R. Kannan and J. Luedtke. A stochastic approximation method for approximating the efficient frontier of chance-constrained nonlinear programs. Mathematical Programming Computation, 13(4):705-775 751, 2021.
[29] J. D. M.-W. C. Kenton and L. K. Toutanova. Bort: transformers for language understanding. In Proceedings of NAACL-HLT, pages 4171- 4186, 2019.
Pro-training of deep bidirectional
[30] N. Kitaev, L. Kaiser, and A. Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations, 2020.
[31] Y.-D. Kwon, J. Choo, B. Kim, I. Yoon, Y. Gwon, and S. Min. Pomo: Policy optimization with multiple optima for reinforcement learning. Advances Neural Information Processing Systems, 13:21188-2111 21198, 2020.
[32] A. Lacoste, A. Luccioni, V. Schmidt, and T. Dandres. Quantifying the carbon emissions of machine learning. arXiv preprint arXiv: 09700, 2019.
[33] A. Lewkowyez, A. J. Andreassen, D. Dohan, E. Dyer, H. Michalowski, V. V. Ramascsh, A. Slone, C. Anil, I. Schlag, T. Gutman-Solo, et al. Solving quantitative reasoning problems with language models. In Advances in Neural Information Processing Systems, 2022.
[34] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
35 Y. Ma, J. Ti, 7. Cao, W. Song, L. Zhang. Z. Chen, and J. Tang. Learning to iteratively solve routing problems with dual-aspect collaborative transformer. Advances in Neural Information Processing Systems, 34:11096 11107, 2021.
(36] Y. Markovits, A. J. Davis, and R. Van Dick. Organizational commitment profiles and job satisfaction among greek private and public sector employees. International journal of cross cultural management, 7(7) 99, 2007.
12

---

[3] O. McCullagh, M. Cummins, and S. Killian. The fundamental review of the trading book: implications for portfolio and risk management in the banking sector. Journal of Money, Credit and Banking, 2022.
[38] D. L. McLeish. Monle Carlo simulaaiio and finance volume 276. John Wiley & Sons, 2011.
[39] N. Metropolis and S. Ulam. The monte carlo method. Journal of the American statistical association, 44(247):335 341, 1949.
[40] H. Pan and R. Kondor. Permutation equivariant layers for higher order interactions. In International Conference Artificial Intelligence and Statistics, pages 5987 6001. PMLR, 2022.
[41] C. R. Qi, H. Su, K. Mo, and L. J. Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 652-660, 2017.
[42] Ramachandran, B. Zoph, and Q. V. Le. Searching for activation functions. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 May 8, 2018, Workshop Track Proceedings, 2018.
[43] V. Schmidt, K. Goyal, A. Joshi, B. Feld, L. Conell, N. Laskaris, D. Blank, J. Wilson, S. Friedler, and S. Luccioni. Codecarbon: estimate and track carbon emissions from machine learning computing. Cited on, page 20, 2021.
[44) M. Schubiger, G. Banjac, and J. Lygeros. Gpu acceleration of admm for large-scale quadratic programming. Journal of Parallel and Distributed Computing, 144:55-67, 2020.
[45] T. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. Advances in neural information processing systems, 27, 2014.
[46] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L.. Kaiser, and L. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
[47] O. Vinyals, S. Bengio, and M. Kudlur, Order matters: Sequence to sequence for sets. arxiv preprint 2Xxc:1511.0639. 2015.
[48] X. Warin. Deep learning for efficient frontier calculation in finance. Journal of Computational Finance, 26(1), 2022.
[49] M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. R. Salakhutdinov, and A. J. Smola. Deep sets. Advances neural information processing systems, 30, 2017.
13

---

A
Numerical example of the EF problem
We provide numerical example of the EF problem in the case of a 4-asset problem with classes and Q 1 (see Eq [2) Only the constraints are presented here. It is important
0
0.591
00000000000
1
0.749
0 0
0.412
note that the matrices A and B representing all constraints grow in size by (2n + + m2)m) m) as increases, where m is the number of distinct asset classes. If X Max is defined, then all entries of XMA can be set to 0Max- Solving Eq is achieved and and the (12) by directly considering
10000
O
0.545
- 0 O O
0.
-1 0 0 -1 11111
0.
A
-1 0
0.
-1 1101
-0.81
1
1.
covariance matrix Q diag(V) Pdiag(( obtained from the other inputs. Vini
1000
0.74
0.58
Qx, then solve second-order cone program (SOCP) to increase the portfolio's volatility without exceeding Viarget and get better returns.
C
[0, 0, 1,:
1|; SMAX 10.74, 0.58)
X MAX (0.5910.749, 0.412, 0.545)
X XIN = 0,000
We obtain the volatility constraint through the Cholesky decomposition of the covariance matrix Q' (Q)) where L the lower-triangular operator. E E g[++1,1] is built by stacking Q' and [0, [0....00 -0] such that F Ri++1ll = O.. Then, eq. can be reformulated as follow:
ObaN 0.81, OMAX
= minimize R subject to A A B and ESF.
(13)
The complete optimal allocation of eq. can be summarized by the following python script:
MFnEF evalsation ane
inport copy
import logging
inport on
import cvxopt
inport numpy as
scalar 10000
def ovxopt sacippt__olle_eeeeeee (P,, 9, G=None, hellone, **uargg)): P.T) make sure is syanetric
P 0.5 arga [evxopt. (P)) pxxop..natrix(q))
if is not None:
arge. (cvzop natrix(()) ovxopt. matriz(())) sol cvxopt. solvers. apraagg,, **kuargs) ["statuss"] "optimal":
raise ValueBrror (*DP SOLVER: sol, atl-st 1a 'optimal"""
return np. arpearayyeol (xx"] reehape
shape(i),)), (Fetsse((PP.aaape(1)))) mun_iteratione
def crxopt__olve__ooe
G1, hl, Gq. bq. +*kaargs):
= [evxopt matrix(c), cvxopt. (G1ri cuxopt. (nopt.matrix(hl)) [evxopt.matring matrix((q)), [evxopt.mate maxopt.natrix(hq)]11
sol evxopt. solvers wwwopt.eolvers..... solvers.ssoc(eeargs socp(>arge, **kvarge)
mun ium_iteratoons sol("iteratione)
"ol["status"] "optinal";
raise MalueErro("SSOS SOLVER: sol.status l- 'optimal
return mp. arrayyro "erageeell""))).rraaa((((((( shape[1), ,)), atniitoraiions
def efficient, efficient_freatieerr wwwpsrffrrttttteeeeeeeeeeeeeeeee (nex)errree__eeee weights, vol_target, conditione, condition_nsx, vol, correl);
n_assets Len(max Len(max_veighte. veights)
min_Neights- [o] a_assete
v_t vol_target voi_target scalar
np. np.vstack aap. acsets, -ap epp.eya(n_ ancetn) conditions])
# hstack [nax, weights, min, seighta, condition__axx]
6ov scalar up. ap.natmml (op. iat.llllalllllmmmmmmmmmmmmll (op diag(vol), correl), up ap.diag(vol))
cvxopt_eolve_qpce
иp. zerosers__ie (re)r)),,,,,, 6, B) #eg
xt up minimnnnistt moximun (list(ut), min_reights)), mox_weights)
reehhpp [[a_ aesete,
14

---

variance up.natmul (ap. netaul (vtid. cov), vtid) o] if variance v_t:
up.array(ret)
chol =pp.linalg- cholesky(cov)
6q np.vatack( (np. (n assets), chol])
np.peros (n_essets
[0] up. =p..qrt(v_t)
cvxopt__ollo__eee sorpppret, d1-6, bl-it, Ggrūq, hgrhq) #eg
xt np. mp..iiimmn (tp..a.aimmmiiattee... min saighta)), nax, waighta)
B Preprocessing
We encounter ambiguity in optimization problems due to various combinations of inputs representing the same problem. To address this, we provide three examples where discuss the ambiguity and propose a standardized solution for processing inpuls in an optimized manner prior token projection.
When the i-th asset belongs to the j-th asset class and a; > Se, the constraint 2;Axx is overridden by Sey- This means that there combination of assets where the allocation of the i-th asset can be higher than Say. To address this constraint, we clip xAA to Say by using the formula: x min (ainmmxx)))) O) for i-th assets belonging to the j-th class.
The remaining two cases are additional edge cases related to the previous condition. If only one asset is assigned the j-th class, Se, and zANa should be equal because it is equivalent to having no class constraint for that class. Also, if a class constraint is set but no assets belong to that class, it is equivalent setting Sc, in this manner, we ensure that any ambiguity on the class constraints are standardized, allowing for equivalent linear projections into token before the transformer encoder part of the network.
By processing the optimization inputs
C Experimental Section
C.1 Datasct
Dataset name
Size
Description
Drrain
1.2B samples
Sampled at random over the domain in table. Sampled at random the domain in table. Sampled following the indication of sec.
D Drest
990K samples
Dood
990K samples
Table 5: Description of the dataset used
The size and description of the dataset we used are presented in table. 5 asymmetric weighting scheme to generate all datasets, favoring more complex optimizations (see Table (). the number of assets increases, the number of unstable regions also increases, where allocation significantly change. To ensure training and evaluation encompass these unstable regions, we generated a higher proportion of optimization inputs with more assets.
We used an
C.2 Ablation study
NeuralEF comprises three parts. First, the preprocesses step (1.1) sort requests by asset returns, (1.2) reduce optimization input ambiguity (Appendix B), and (1.3) project them into tokens for SEQ2SEQ representation. Secondly there is bidirectional encoder transformer that solve EF as SEQ2SEQ. Finally, there is DGAR to enforce constraints. The preprocessing and DGAR help accurate forecasting. (1.1) and (1.2) optional for training if accounted in the training data but help at inference to ensure the sorting requirement NeuralEF and clean request of some optimization input ambiguities.
To show the effectiveness of DGAR, we' ve trained two NeuralEFF models (w/ and w/o DGAR)
trained for 5 days with fixed learning rate of 5.5e 5 and present the distributional error
15

---

Assel case Proportion (%)
2.517
2.551
2.539
2.603
6.834
6,879
10.346
9 10.377
13.526
11
13,850
27.658
Table 6: Proportion of assets in each datasets.
(a) Drest distribution NeuralEF w/o DGAR trained w/ constant 1r=5e-5 for 5 days
(b) Diest distribution NeuralEF w/
DGAR trained w/ constant 1r=5e-5 for 5 days
Figure 10: Accuracy W/ DGAR vs W/O DGAR
optimality gap of the metrics that are not respected on fig. 10 highlighting that model with DGAR achieves better MAE. Also, DGAR exhibits a reduced optimally gap of constraint adherence, further motivating the use of DGAR.
The cleaning module of NeuralEF were attached before the transformer part of the model to address the possible ambiguities provided in the optimization inputs. Using the same example of fig. 5 where the 10-th asset associated class C2. which is its only member, we changed the value of the constraints to be ambiguous relative to another and show in how accuracy deteriorates when the model encounter request that are ambiguous.
fig. 12
C.3 Accuracy with half-precision floating-point format.
The results obtained using single-precision doating-poin (FP32) and the model quantized to half-precision floating-point (FP16) are on the same order of accuracy shown in table 7 and fig. 13. The quantization process to FP16 maintains the necessary precision for the calculations, resulting in equivalent outcomes the FP32 counterpart. While degradation
020
027
5.500
5.20
012
605
3.00
(a) Diees optimality gap NeuralEF trained w/o DGAR w/ constant 1r=5e-5 for days
(b) Drest optimality gap NeuralEF
w/ DGAR trained w/ constant
5r=5-- 5 for 5 days
Figure 11: Optimiality gap W/ DGAR vs W/O DGAR
16

---

0.5
6.7
predition
ground truth
0.4
6.6
pertmubation XIC"
0.5
pertnubation G.
allocation
atlecation
0.2
0.3
prediction
truth
0.0
pertrub ab on
0.0
Xin
Kto
(a) Prediction of the 10-th asset with the (b) Prediction of the 10-th asset without the cleaning module using the example of fig.6 cleaning module using the example of fig.6 under request perturbation
under request perturbation
Figure 12: Issue of semantically equivalent requests with perturbation æ10 E [0.5, 1] and Sez E [0.5.
in the ability rank assets and respect the volatility and class constraint occurs, we observe that this does not impact the overall distributional properties and the downstream applications that would benefit from As such, there is no discrepancy in the results between the two representations, demonstrating the viability of using the lower-precision FP16 for computational efficiency.
1.0
1.0
1.0
number
FAITIDAY
number
0.8
0.8
Prpprrtee
0.6
Properstin
0.6
0.6
02
0.
0,0
0.0
0.0
10
10
10
10
10:1
10
10 10" 10 10
10:
10
10:7
10
10th
10t1
5um evtrr
Portfolo emt
Weltt Bly wrme
Figure 13: Cumulative distributions of the sum of absolute allocation error of allocations and portfolio returns per number of assets for the FP16 quantized NeuralEF.
"The ranking of the results has been computed with a tolerance le-4, where a slight deviations permissible and don't hurt the accuracy. This was made such that negligible allocation made by NeuralEF which can be disregarded for practical purpose neglected.
17

---

Portillo Portbillo MAX
$8.661
$8.397
Ranking preeitoo
85
$77x01
1.30-t
106--1
23.033
6.5500
4.0x-42
250-16
4180x10
1.7m-01
01.01
2.5-466
4
100--15
3/93-41
150601
61.50 61.504
77a-16
12::412
6.50-42
1722-0
2220-00
6.50x12
23
71,849
133001
1.
5 S3lerf
2.1e001
04.911
Portiollo return MSL
Portiollo return MAX
95 quaatile
39.863 quaatile
99.997 quaatile
210--16
07-535
8.10-412
3.
1.40-C0
4.00x-2
1.76-01
55.5
TTw-16
3.5m-19
153-41
1.2-40
2.10x-00
4.00-05
L16--2
8.56-12
18h-01
$5,823
3.40-111
1.7h-10
10
2.50--00
4.50445
2.hx-1
6.50x122
186--1
$5,007
11
1.51-07
1,03-44
6 6.
1.
55.130
Volntilly MS51:
Volitillty MAA
95 qunaztie
20.565
quastile
90.997 quaatile
Finget procision
6:65-6
3.55-01
1.5t-10
8 11-000
110-01
36
1.8b-03
1.45xt0
4 E00-00
1.77-01
61.229
8.T1a-16
1-40-112
75,244
2.10x 100000
1.5--05
1.05-10
8 3.
[5160]
60,200
1.Ta-12
75-422
1.35.05
2.51-00
0 530-10
110e01
75.358
3.53-1
1.6601
$1,611
Table 7: Accuracy of portfolio weights, implied return and resulting volatility for the FP16 quantized NeuralEF.
18


Reviews:
[{"review_id": "3Bb7K36dpP", "reviewer": "Reviewer_Ygwb", "summary": "In this paper, the authors propose NeuralEF, a deep neural network (DNN) approach that approximates what is known as the ``efficient frontier'' (EF) in economics. To this end, they use a stacked transformer encoder architecture, as well as pre-processing steps (such as ordering assets) and a greedy algorithm (DGAR) that uses dynamic programming to come up with an asset allocation. The main idea behind NeuralEF is to formulate the EF optimization problem as a sequence-to-sequence (SEQ2SEQ) problem. This allows them to use self attention inside a large language model (LLM) framework. The authors claim that this allows them to understand the relationships between the optimization inputs. They provide experimental results using NeuralEF on a convex optimization problem from generated data.", "questions": "1. What is an intuitive explanation of why it makes sense to sequentialize the assets? There is no natural ordering in a portfolio of assets and so, would you need to worry about making your solutions invariant to reordering?\n2. What is the contribution of the main components of NeuralEF to the overall performance? For example, how much does the DGAR component affect the accuracy attained and the compute time needed? How much does the preprocessing contribute to the overall performance? \n3. How does DGAR scale to larger number of assets? Even with $O(N\\log N)$ complexity, this part seems costly with a sizeable portfolio.\n4. Why include a class constraint when DGAR seems to just ignore it?\n5. Does the result of NeuralEF depend on the initial asset allocation chosen?\n6. How is the data generated? What is the function used to generate the data? What kind of noise is added to the data? \n7. Why does the training set need to be so big (i.e. a billion examples)?\n8. Why is the data generated for the experiments convex? Are there convexity assumptions or requirements for NeuralEF? \n9. How does NeuralEF and the results in the paper contribute to understanding the relationship between optimization inputs to the EF problem?\n10. The authors claim that discontinuities due to switching between assets doesn't impact the resulting portfolio return. Is this robustness to discontinuities also observed for the resulting volatility of the portfolio?", "limitations": "Yes", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. The paper is on an interesting topic: applying self-attention and LLMs to economics problems. This is important because many economic problems can not be solved in high dimension with standard tools and analysis from Economics.\n2. Despite using a DNN, the authors are conscientious of their carbon footprint and compute resource usage. This makes their proposed approach more environmental as well as accessible to those with limited compute resources.\n3. The authors wrote a vectorized implementation to solve multiple EF problems at once. Their proposed methodology is computationally efficient.\n4. The authors augment existing DNN approaches by introducing separate modules that perform pre-processing and a dynamic greedy allocation module to respect constraints. ", "weaknesses": "1. Some claims by the authors seem not to be substantiated. For example, they claim that their approach allows them to understand the relationships between the optimization inputs. Yet, there is little discussion of these relationships in the paper, and it is also unclear how their experimental results shed light in this area. The claim that their approach is robust to discontinuities resulting from large switches in assets appears also unsubstantiated.\n\n2. NeuralEF has many moving parts and thus is difficult to understand and to use. It is unclear what the contribution of each component is. There are some details missing in the explanation of how NeuralEF works (e.g. how the initial allocation is chosen).\n\n3. Beyond being able to leverage recent advances in LLMs, it is unclear why a SEQ2SEQ encoding of the problem makes sense in the context of solving the EF problem. Intuitively, multiple portfolios are equally efficient and there is no natural ordering of the assets in general. \n\n4. The significance of the experimental results are unclear to me because the data generation process does not appear to be explained in the paper.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# W(1)&Q(9):\n\nWe meant to say that the use of self-attention is to help the model understand the relationships between inputs. The relationships of EF are well understood. An expansion in the appendix can detail these relationships: e.g. assets with higher expected returns and lower risks yield higher weights, leading to allocation shifts with small changes in returns or volatility around 0. The correlation matrix influences diversification benefits, shifting the efficient frontier. Constraints like maximum asset allocation impact the domain of the solution by truncating the attractivity of certain assets (as in Fig.3), etc. Regarding robustness in the presence of discontinuities, figures 5-6 (paper) and figure 2(b) of the global author response demonstrate a concrete example of our model in presence of the discontinuities. The test set was also designed to incorporate these discontinuities, with 84% of the samples having at least 2 optimization inputs within ε proximity of each other. Thus, we believe that table 3 of the paper accounts for the challenging optimization region because most of the test data samples are within the discontinuity region of the EF problem. We can point out this detail in the appendix.\n\n# W(2)&Q(2):\n\nWe redirect the reviewer to the global author response in sec. \"Ablation study w/ and w/o DGAR:\" for answers to the reviewer’s questions and an explanation of the contribution of each part. We also provide an ablation study of the components motivating their contribution both in terms of accuracy and throughput.\n\n# W(3)&Q(1):\n\nEmploying SEQ2SEQ to approximate EF holds a dual rationale: EF's optimization inputs grow by N (except the correlation, with has quadratic growth) and ordering optimization inputs on a standardized length basis (as illustrated in fig2 of the paper) allows to treat inputs as a set. Scaling-wise, solving a SEQ2SEQ problem is more resource-efficient than running the optimization itself. Since portfolio assets lack inherent ordering, any permutation of input tokens and output allocations is equivalent. Ensuring NeuralEF's invariance to reordering would enhance inference speed. However, we found that ordering tokens based on asset returns with [1.1] within a sequence accelerates training convergence and boosts accuracy, aligning with insights from https://arxiv.org/abs/1511.06391.\n\n# W(4)&Q(6-7):\n\nWe used an MC sampling scheme to cover the entire domain (Table 1) uniformly. We made all synthetic datasets mirror real-life distributions for the volatility and correlation inputs, including rare and extreme scenarios like W(1), and explicitly target the area of the optimization where discontinuities are. We can present examples of the data generated in the appendix. Figure 2 of the attached PDF displays training set size impact on accuracy. We have observed that (1) smaller sets have lower forecast quality at inflection points and (2) larger sets enhance robustness in a wide variety of scenarios. Both small and large datasets can still achieve good MAE, but more data helps model robustness. Given the relatively low cost of generating training data we went with ~1B.\n\n# Q(3) & Q(4):\n\nDGAR doesn't encounter scaling problems, yet the number of inputs sent to GPU may be challenging. For instance, with 1K assets, dimensions to be sent reach a total of ~503k (mostly correlation inputs). Although there's no bottleneck in terms of complexity to solve the 1k portfolio under eq(3), DGAR's throughput varies with asset count (10, 100, 1000, 10000) and batch sizes (1 to 20000), as depicted in fig 2.c. Regarding constraints, we haven't found a way to make DGAR's respect both the maximum class and asset allocation constraints. To address this in the evaluation, we introduced metrics to measure if the class constraints and the volatility constraint were respected, allowing a direct comparison against the convex optimization eq(3), shedding light on our approach's optimality gap. We are happy to point out this detail in sec4.\n\n# Q(5):\n\nNeuralEF solves eq(3) without needing an initial allocation. Future work may consider an initial allocation and transaction costs with rebalancing constraints.\n\n# Q(10):\n\nFig 2b) in the attached PDF illustrates the impact of inflection points, using the same example from fig.6 of the paper, where increasing the 10th asset's returns causes a jump in the allocation and affects resulting volatility. The optimal portfolio's volatility shifts with varying volatility levels, oscillating between 0.340% and 0.374% which is below the 95th quantile in term of accuracy."}, {"review_id": "GjVYlMIR2k", "reviewer": "Reviewer_oNAD", "summary": "This paper considers the problem of solving efficient frontier (EF), a fundamental resource allocation problem where one has to find an optimal portfolio maximizing a reward at a given level of risk. Traditionally, this optimization is solved by quadratic optimization techniques.\n\nThis paper introduces NeuralEF, a sequence-to-squence formulation, attempting to make fast neural approximations of EF. The purpose is to robustly forecast the result of the EF convex optimization problem with respect to heterogeneous linear constraints and variable number of optimization inputs. \nBy experimental results, the proposed  NeuralEF is a viable solution to accelerate large-scale simulation.", "questions": "- What behavior bias characteristics does the proposed NeuralEF have?\n- In Sec. 4.1, what does the solution accuracy look like in different regimes?", "limitations": "no concern.", "rating": 8, "confidence": 5, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The paper is well-written with clear notations and definitions.\n- In the problem of solving for EF, obtaining robust and smooth results is a challenge given its discontinuous nature. The proposed method is shed light on how data-driven methods can help in smoothing the result in an organic way.\n- r\n- The methodology, especially the mathematical programming techniques, including formations in eq. 4-10 and the solver implementation details in Sec 4.2 are clear.\n\n", "weaknesses": "- Out-of-sample result is not discussed. It would be interesting to check the out-of-sample results in a distributional manner, to highlight the behavior bias of the proposed method in practical cases.\n- Out-of-domain generalization is briefly discussed in Sec. 4.3. However, EF are dependent on correlation regime and shock, therefore it makes sense to discuss the solution accuracy in different regimes.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# W(1-2)& Q(2):\n\nOut-of-sample results were not discussed in detail, mostly due to the page limit. The safe use of NeuralEF could be solved by training it on a bigger domain than what was shown in Table 1 (most likely on a longer time period and with more data) if the input domain needs to be larger. Otherwise, one can revert to the base optimization in the rare cases that it goes out of the domain, e.g. where assets go above 200% returns or the 200% volatilities, both being highly unlikely cases. With respect to correlation regime and shock, we can identify one area where NeuralEF accuracy would degrade significantly: in a regime where assets oscillate in the inflection area of the optimization, i.e. when two attractive assets have returns/volatilities  ε close to each other and/or near 0. If the returns are of the same sign and ε close to 0, then the scale invariance trick mentioned in 4.3 can be used to palliate to model potential forecast failures. Because NeuralEF has been trained on synthetic data, we haven't observed behavior bias that arises directly from certain regime aside from the behavior shown in fig 6.0, where there are non-continuous changes in allocation in EQ(3). We show on fig.4 c) the distributional error of the OOD data, similar to what we did for fig.4) in the paper. We can also measure the optimality gap of the constraint and provide them in the appendix of a revised version of the manuscript, if desired.\n\n# Q(1):\n\nRegarding DGAR’s behavioral characteristics, there is a possibility that DGAR propagates errors over other assets due to a bad selection of the K most important assets if it can do so with respect to the constraints. For instance, consider the case of three assets where the true allocation is x=[0.5, 0.3, 0.2], the estimated allocation before DGAR is x^=[0.2, 0.7, 0.3], the maximum assets allocation is x=[0.5, 0.6, 1.0], and we have a full allocation setup c1max=αmax=αmin=1 with all assets belonging to the same class. Then DGAR will clip the allocation at the first step x'=[0.5, 0.6, 0.2] and we will get the ordering K=[1,2,0], which will force the allocation to go back to x'''=x''=[0, 0.6, 0.4]. This allocation will have a higher MAE 0.33 vs the original prediction of 0.27. We haven't spotted areas of the input domain where there are more errors when forecasting x', but we can note that some of the bigger errors arise from this issue. Hence, it would be interesting to extend this approach in such a way that DGAR can account for the confidence it has over the allocation or learn an optimal ordering policy."}, {"review_id": "l6rqe4OyQa", "reviewer": "Reviewer_5SDP", "summary": "The paper presents a sequence-to-sequence (SEQ2SEQ) deep learning model, called NeuralEF, to solve the Efficient Frontier (EF) problem in portfolio optimization. The authors reformulate the EF problem as a SEQ2SEQ task and train a deep neural network (DNN) to approximate the convex optimizer. The proposed method aims to provide a fast and accurate approximation of the EF while handling variable-length inputs and robustly respecting linear constraints. A Dynamic Greedy Allocation Rebalancing (DGAR) module is introduced to ensure that the model's forecasts remain within the feasible domain and respect the constraints.", "questions": "1 The formatting template used in this paper is incorrect; it should follow the NeurIPS 2023 guidelines instead.\n\n2 Insufficient justification for the claimed speedup and practical significance:\nThe paper claims a significant speedup of the NeuralEF method compared to the baseline optimizer, but the justification for this speedup is not thoroughly provided. Furthermore, the practical significance of the speedup is not well addressed, considering the potential trade-offs between solution quality and training requirements. The authors claim that their NeuralEF method is 396 times faster than the baseline optimization method. However, if this speedup takes into account the 25x acceleration achieved by using a GPU, as mentioned in line 116, the actual speedup of the NeuralEF method compared to the baseline technique is approximately 15.84 times (396 / 25). It is important to consider whether this speedup is significant enough to justify the use of the proposed method over traditional techniques, given that this nework is already trained using 1 biliion samples. Moreover, there are concerns about the solution quality of the NeuralEF method, which might be worse than the baseline method when calculating the speedup.\n\n3 Lack of comprehensive comparison with other optimization techniques:\n As shown in Table 3, the accuracy for Asset case 12 is below 84% across all three metrics. Without any comparison to other methods, it is difficult to determine if this level of accuracy is good or not. It also difficult to determine if it is sufficient for practical applications.", "limitations": "Inadequate demonstration of the effectiveness of the DGAR module:\nThe effectiveness of the Dynamic Greedy Allocation Rebalancing (DGAR) module, which is a key component of the NeuralEF method, is not thoroughly demonstrated or compared with the model's performance without it. This raises questions about the impact of the DGAR module on the model's performance and its ability to handle discontinuous behavior and diverse constraint types. To address this weakness, the authors should provide a more detailed analysis of the effectiveness of the DGAR module, including an ablation study or comparison with the model without DGAR. \n\nPoor out-of-domain generalization:\nThe NeuralEF method exhibits poor performance when applied to out-of-domain examples, which limits its potential applicability in real-world scenarios.", "rating": 5, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "The paper proposes a novel deep learning-based approach to tackle the EF problem, leveraging the powerful capabilities of SEQ2SEQ models.\nThe DGAR module is an interesting addition that ensures the feasibility of the solutions generated by the DNN.", "weaknesses": "Lack of innovation in employing sequence-to-sequence models for convex optimization problems:\nWhile the paper presents the NeuralEF method as a novel approach for solving convex optimization problems using sequence-to-sequence models, it is important to acknowledge that existing research has already explored similar ideas. For instance, sequence-to-sequence models have been applied to combinatorial optimization problems, and transformers have been used for embedding[1,2]. To strengthen the paper, the authors should discuss the novelty of their approach in light of these existing works and emphasize the unique contributions of their method to the field.\n\n\nInadequate demonstration of the effectiveness of the DGAR module:\nThe effectiveness of the Dynamic Greedy Allocation Rebalancing (DGAR) module, which is a key component of the NeuralEF method, is not thoroughly demonstrated or compared with the model's performance without it. This raises questions about the impact of the DGAR module on the model's performance and its ability to handle discontinuous behavior and diverse constraint types. To address this weakness, the authors should provide a more detailed analysis of the effectiveness of the DGAR module, including an ablation study or comparison with the model without DGAR. \n\nReferences:\n[1] Pomo: Policy optimization with multiple optima for reinforcement learning. Advances in Neural Information Processing Systems 33 (2020)\n[2] Learning to iteratively solve routing problems with dual-aspect collaborative transformer. Advances in Neural Information Processing Systems 34 (2021)\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# W(1):\n\n[1-2] and our work explore input set optimization, each with distinct yet interconnected goals. Combinatorial optimization tackles discrete choices for optimal arrangements, while EF addresses continuous portfolio weight selection for risk-return equilibrium. PPO [2] and POMO [1], powerful RL algorithms, can potentially train NeuralEF for EF optimization as it can for problems where there exists a difficulty in retrieving training labels. However, unlike [1-2], the choice between RL and supervised training (ST) hinges on experimental insights due to the low label retrieval complexity of EF and complexity vs the NP-hard problem accounted for in these studies. POMO and PPO do not guarantee hard-constraint problem-solving, a void we bridge with DGAR. Uniting and evaluating these methods for convex optimization, like EF, is interesting so as to explore how to expedite optimization problems with heterogenous constraints, though the context favoring RL or ST remains unclear. We will acknowledge these nuances in our conclusion and references.\n\n# W(2) and limitations:\n\nWe refer to our global author response in section \"Ablation study w/ and w/o DGAR:\" to address this point, where we further elaborate DGAR's effectiveness. On OOD generalization, training NeuralEF on a broader input domain beyond table 1 can encompass more extreme returns and volatility scenarios. For cases with assets having over 200% returns or volatilities (unlikely in reality), NeuralEF can revert to EF optimization. Hence, NeuralEF's OOD accuracy limitation applies only in such scenarios which considering [3-4] didn't occurs over multiple financial regime including recent financial crashes.\n# Q(1):\n\nWe used the template on Overleaf authored by the NeurIPS Program Committee. If there are any formatting issues, please point them out explicitly, and we will gladly fix the errors.\n# Q(2):\n\nWe revamped throughput experimentation, conducting ablation studies on: (1) preprocessing at inference under certain conditions, (2) DGAR's inference impact, (3) batch size vs. multi-threaded EF execution, and (4) comparisons with Torch-EF and NeuralEF*. Results validate NeuralEF's substantial speedup over the baseline optimizer. New achievable throughput data further confirms acceleration for both methods, offering practical trade-off insights. Including these results in the paper clarifies speedup metrics and prevents oversimplification of the X-fold improvement mention, allowing for a more nuanced understanding:\n\na) Pytorch-EF achieves lower throughput than NeuralEF on an equivalent GPU, necessitating larger batches to surpass concurrent multi-thread CPU baseline throughput. Employing GPU-accelerated approach for many independent synchronized MC simulations is beneficial, though often infeasible due to insufficient parallel simulations. For instance, on an A100 GPU, Pytorch-EF requires 1.2 million optimization batches for 111479 evals/sec max throughput, whereas NeuralEF achieves 343760 eval/sec with 80k optimizations and 401641 eval/sec without cleaning requests.\n\nb) In fig.1 of the attached PDF, we observe the impact of preprocessing and DGAR on achievable throughput, even on relatively affordable hardware. Efficient EF computation can be further scaled using varied frameworks: CPUs optimized for matrix multiplication, like Intel Xeon Platinum 8480+, ideal for small requests (<1K), and GPUs for at least 1K requests, justifying the proposed method over traditional approaches. Capital derivative pricing, employing MC simulations of EF for single valuation, meets the GPU requirement with simulations often consuming substantial compute time. Accelerating them with minimal constraints (e.g., GPUs) yields significant time gains.\n# Q(3):\n\nAssessing constraints below the 84% level, not explicitly enforced in NeuralEF, is nuanced. In safety-critical scenarios demanding strict adherence, NeuralEF suits cases without ζmax requirement and Vtarget deviations. For MC simulations targeting E[R], E[V], and E[x], NeuralEF is suitable. These 3 metrics measure an optimality gap where NeuralEF predictions might not be the most \"optimal\" solution (similar to [1]). Ranking precision responds to ε deviations between assets, often with limited practical impact. To our knowledge, no other work handles robustly heterogeneous linear constraints for EF, making method comparisons a study of accuracy-constraint trade-offs. We address this trade-off in part in the global author response within sec \"Ablation study w/ and w/o DGAR\".\n\n[3]: Mazur, Mieszko, Man Dang, and Miguel Vega. \"COVID-19 and the march 2020 stock market crash. Evidence from S&P1500.\" Finance research letters 38 (2021): 101690. [4] Andersen, Torben G., et al. \"The distribution of realized stock return volatility.\" Journal of financial economics 61.1 (2001): 43-76."}, {"review_id": "k9PDn1mXsD", "reviewer": "Reviewer_o9F6", "summary": "The authors propose a novel deep learning method, NeuralEF, to tackle large-scale constraint convex optimization problems by formulating them as sequence-to-sequence (SEQ2SEQ) problems. The key idea is to learn the complex relationship using an attention mechanism between financial conditions and optimal portfolio allocation, which is often a time-consuming task in portfolio management. They demonstrate the efficacy of NeuralEF on the Efficient Frontier problem in finance, a problem known for its non-continuous and highly variable nature. In the experiments, the authors utilize a synthetic dataset with varying conditions. The results illustrate NeuralEF's ability to effectively provide accurate portfolio allocations, all the while significantly reducing the computational resources required for large-scale simulations.", "questions": "- Could the authors clarify how the NeuralEF model handles uncertainties in expected returns and volatilities? These are critical aspects in the field of asset management, and their treatment could significantly impact the model's performance and applicability.\n- Could the authors consider evaluating the model using real-world financial data? Such evaluations could give more insight into how the model would perform in practice and help to assess its real-world applicability.\n- How would the proposed model compare with other modern portfolio strategies, such as risk-based portfolios, that don't rely heavily on expected returns due to the difficulty in their accurate estimation?", "limitations": "- The paper does not address the assumptions made about the certainty of expected returns and volatilities. These assumptions could significantly impact the model's performance and applicability in real-world settings where such values are typically estimated with uncertainty.\n- The practical utility of the proposed model remains somewhat uncertain without empirical validation using real-world financial data and without comparison with other portfolio approaches like risk-based portfolios, which are often used due to their reduced reliance on expected returns.", "rating": 5, "confidence": 2, "soundness": 2, "presentation": 2, "contribution": 2, "strengths": "The originality and advancement of this paper lie in the proposed NeuralEF approach, which formulates a convex optimization problem as a SEQ2SEQ problem. The paper contributes to the development of the field by applying SEQ2SEQ modeling, originally a tool used in natural language processing, to a completely different domain of portfolio optimization. The concept of learning the mapping from financial conditions to portfolio allocation through deep learning has the potential to be applied to a variety of other optimization problems.\n", "weaknesses": "- This work seems to operate under the assumption that expected returns and volatilities are known with certainty. This might be a limiting factor when considering the application of this model in real-world scenarios, where such accurate estimation is challenging.\n- The study lacks a rigorous evaluation on real-world financial data. While the synthetic data-based experiments might provide insights into the model's capabilities, the applicability of the model to real-world scenarios remains unclear without empirical validation on real datasets.\n- It's also worth noting that modern portfolio approaches, such as risk-based portfolios, often rely less on expected returns due to the inherent difficulty in their estimation. Without comparative studies against such methods, it might be challenging to evaluate the practicality and superiority of NeuralEF.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "# W(1) & Q(1): \nBoth EQ(3) and NeuralEF rely on known expected returns, volatilities, and correlation matrices for optimization, yet they can be used in tandem with methods for handling uncertainty, such as Monte Carlo (MC). in the global author response, we provide two practical examples illustrating the relevance of NeuralEF with practical applications and how we can account input uncertainty. However, it's important to emphasize that our paper's focus is on accelerating EQ(3) solution. NeuralEF isn't a generalized framework for other portfolio-based methods like Minimum Variance Portfolio (EQ(1)), Risk Parity Portfolio, etc... Nonetheless, extending our work to encompass diverse portfolio allocation problems is intriguing, as these applications can be reformulated as convex optimization problems. NeuralEF effectively accelerates solving the Markowitz model [0], a cornerstone of modern portfolio theory with multiple financial applications. We provide two examples of application in the global author response in sec. \"Example of real-life applications\" and would be happy to mention one of the applications within introduction & related work of the manuscript in a revised version.   \n\n# W(2) & Q(2): \nAssessing our model's performance on real financial data is useful for \"what-if\" scenario evaluations. We opted for synthetic data testing due to the following reasons: (1) Real-world financial data exhibit biases, conforming to established financial narratives, which undermines unbiased evaluation due to limited coverage of alternative financial events: if we sample two assets both in the same period, they all evolved with the same macro dynamics. (2) Variances in historical data length, correlation matrix computation, and volatility measure introduce complexities in allocation testing by altering optimization inputs, posing challenges for unbiased assessments of NeuralEF. Our synthetic data tackles these complexities by simplifying historical data selection and risk measures, while also encapsulating extreme real-world scenarios from [3-4]. It covers measures up to 200% volatility and return, providing a comprehensive outlook on model accuracy across all scenarios, including recent market crashes. We also target discontinuities by having 84% of the test data having optimization input near the discontinuity region. We can provide further details on these aspects in Section 4 with additional details about our synthetic data generation process as suggested in a different reviewer response.\n\n# W(3)& Q(3): \nas pointed out in W(1), NeuralEF is not meant to be a trading strategy or solve different equations than eq(3) by itself and we can point this out more clearly in the introduction and the abstract. A comparative study against different modern portfolio approaches on historical data for instance would allow us to answer what strategy works the best but this goes outside the scope of our paper. We provide a comparative study of NeuralEF against EQ(3) directly to assess whether the acceleration achieved by NeuralEF is sufficiently accurate which we showed in table 3 and figure 6. Additional details of this study are provided in the global author response within sec \"Ablation study w/ and w/o DGAR\" demonstrating its speed and accuracy advantages. The practicality and superiority of NeuralEF over running EQ(3) then becomes a question of (1) additional throughput, (2) ease of use of this methodology and (3) accessibility, (4) environmental cost of running the calculation.  \n\n[0] https://en.wikipedia.org/wiki/Markowitz_model\n[1] Gatheral, Jim, and Antoine Jacquier. \"Arbitrage-free SVI volatility surfaces.\" Quantitative Finance 14.1 (2014): 59-71.\n[3]: Mazur, Mieszko, Man Dang, and Miguel Vega. \"COVID-19 and the march 2020 stock market crash. Evidence from S&P1500.\" Finance research letters 38 (2021): 101690.\n[4] Andersen, Torben G., et al. \"The distribution of realized stock return volatility.\" Journal of financial economics 61.1 (2001): 43-76. "}]

Author rebuttal:
First, we would like to thank all reviewers for their appreciation of our paper and their valuable questions and comments. We answer all questions and provide new experimental results enhancing both the clarity of the paper and the experimental section. We would be happy to address all these aspects by stating the element of our responses in a revised paper-ready version and in the appendix to improve the paper.

# Summary of points and questions

We summarize the main points of our response from the questions and limitations stated in the review:

- Clarification on the EF problem, relationships between inputs.
- Clarification on the synthetic data generation and rationale for both training and test
- Relation with other RL works
- Ablation study of the NeuralEF components on accuracy and scaling and robustness on discontinuities
- Revamped throughput experimentation showing a more detailed picture of the speedup
- Optimality gap discussion & soundness of the experimental section w.r.t to accuracy of NeuralEF in real-case application and likelihood of in domain vs OOD accuracy.

Some of the questions and weaknesses mentioned express similar concerns. We've decided to discuss them in the global response to all reviewers to prevent repeating points across reviews. We explicitly mentioned in the official comment of the review whether a weakness (W) of a question (Q) is answered in this section.
# Ablation study w/ and w/o DGAR and preprocessing components:

NeuralEF comprises three parts. [1] preprocesses by [1.1] sorting requests by asset returns, [1.2] reducing optimization input ambiguity (Appendix B), and [1.3] projection for SEQ2SEQ. [2] a Bidirectional Encoder Representations from Transformers (BERT) that solve EF as SEQ2SEQ, with [3] DGAR to enforce constraints. [1] and [3] help accurate forecasting. [1.1] and [1.2] are optional for training if accounted in the training data but help at inference to ensure the sorting requirement of NeuralEF and clean request of some optimization input ambiguities. Fig.3 in the attached PDF illustrates an example of an ambiguity. We show an example where the 10-th asset is associated to class (c2), which is its only member. By changing the value of $\\zeta_{c_2}$ and $x\_1^{\\text{max}}$ constraints to be ambiguous relative to another, we show how accuracy deteriorates. This motivates the cleaning module. Figure 3.a-b) in the attached PDF displays the accuracy of NeuralEF models (w/ and w/o DGAR) trained for 5 days at a fixed learning rate of 5.5e−5, revealing better MAE with DGAR. DGAR exhibits a reduced optimality gap (Figure 4.a-b) of constraint adherence, further motivating the use of DGAR. Throughput of fig 1) shows that the cleaning steps are computationally inexpensive at inference.

Due to the page limit and time constraints associated to the author response period, a comprehensive ablation study considering various training data types (sort-returns/shuffled-assets;clean/no-clean) and usage of preprocessing components during training cannot be presented both for training and generating the data. This would requires us to generate 3Bs points and train multiple variants of the model for 5 days to be consistent with the other models presented in the ablation study. Note that all achieved throughput of fig 1) doesn't account for model optimization like the use of [A], which can increase the throughput of NeuralEF approach further.

# Example of real-life applications:

We provide concrete application in real-world scenarios where NeuralEF can be used:

Ex.1) Pricing financial derivatives tied to an asset basket that needs to estimate E[R], E[V], and E[x] from optimal portfolios to value options at different maturity times. Through Monte Carlo (MC) simulation using geometric Brownian motion, input uncertainty across time can be considered. Asset spot prices "S" can be simulated using the formula: Sᵢ₊₁ = Sᵢ * exp((interest_rateᵢ - (σᵢ^2)/2) * Δt + σᵢ * √(Δt) * Zᵢ, where Δt is the difference between ᵢ₊₁ and ᵢ, and Zᵢ is a normal distribution sample. This setup generates diverse paths under varying conditions, accommodating events like structural breaks in financial crashes. Calibration for volatility aspects can use option data and SSVI methods known in quantitative finance [1].

Ex.2) Quantifying forecast uncertainty impact on portfolio allocation: NeuralEF can be applied to historical data with multiple forecast degradation over the ground truth to see how error in the estimation of the optimization inputs will impact the portfolio performance over the most optimal allocation. This setup allows to back-test existing and proposed trading strategies reliant on expected returns and volatilities, highlighting suboptimal areas.

We are committed to incorporating the answer to your questions and comments into the manuscript. This will significantly strengthen the paper ensuring that we (1) highlight the novelty of NeuralEF, (2) show its impact on portfolio allocation settings and potential impact on other optimization problems with heterogenous constraints; and finally (3) make the evaluation convincing and accessible both in term of resources needed and reproducibility.

[A] https://dl.acm.org/doi/10.1145/3575693.3575702

Meta-review: This paper proposes a neural-network based approach for computing approximate solutions of the efficient frontier problem. This is a portfolio optimization problem in finance where the goal is to compute an allocation of a small number of assets such that certain constraints (including volatility) are satisfied. The main contribution of this paper is the custom architecture for this problem and the empirical comparison of the approach in terms of solution accuracy and compute efficiency compared to a baseline solver.

The reviewers generally found the application of neural networks to solve the efficient frontier problem compelling and appreciated the presentation of this work. They also liked that the paper carefully compared the carbon footprint and compute resource usage of the proposed solution. However, there were also several concerns raised. Among them were:

* Missing ablation studies: The paper only presents an evaluation of the overall architecture but not which components are actually important.
* Missing comparisons to other neural-network approaches for approximately solving optimization problems such as *Pomo: Policy optimization with multiple optima for reinforcement learning.* or *Learning to iteratively solve routing problems with dual-aspect collaborative transformer.*
* Synthetic data generation and relation to real world applications: The paper does not disclose the data generation process and it is therefore not clear how close it is to real-world data.

The authors' rebuttal provided an ablation study of their preprocessing and DGAR module, key components of their approach. They also clarified the data generation process and the relationship to existing approaches and promised to include a more detailed discussion in the paper. All in all, the author's responses could alleviate the reviewers' concerns and every reviewer is leaning positively on this paper. The AC follows this sentiment and hence acceptance is recommended.
Decision: Accept (poster)