Title: Learning the Efficient Frontier
Venue: NeurIPS 2023
Accepted: yes
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

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 optimization problem 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.

1 Introduction

Making the least risky decision to maximize a cumulative reward over time is a central problem in machine learning and at 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 a 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 as future expectations of asset returns, co-variances, and even simulated client preferences on asset allocation are stochastic (c.f. Table 1). Thus, one needs to repeatedly solve the optimal allocation problem under a large number of different scenarios and Monte Carlo (MC) simulations [39] are commonly used to estimate the expected reward over time. Given an allocation function g and stochastic input Z , we need to compute E ( g ( Z )) = ∫ g ( z ) f Z ( z ) dz where f Z is the density function of Z . Sampling the empiric mean of g ( Z ) approximates E ( g ( Z )) with a convergence rate of O (1 / √ N ) where N denotes

the number of samples. The computational cost of this simulation is therefore influenced by the size of N and the cost of computing g . 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 on accurate estimates of the expected returns E ( R ), portfolio volatility E ( V ) and/or allocations E ( X ). The roll-out of new regulatory frameworks for financial applications of the EF problem (e.g. portfolio management) requiring more rigorous testing of E ( g ( Z )) further increases the minimal acceptable N , exacerbating the need for speed [37, 3].

The core problem then becomes finding a way reduce the computational cost of g , making it possible to run a large number of MC simulations 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, 11, 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 networks (DNNs) and infer the result directly [18, 28, 48, 19]. 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 inequality constraints and optimization inputs, and, ( 4 ) they are not robust to discontinuous behavior of optimization problems.

0.04

0.05

0.06

0.07

0.08

0.09

0.10

0.10

0.15

0.20

0.25

0.30

Return

Portfolio with the minimum volatiltiy possible

Best portfolio for volatility at 6%

Best portfolio for for maximum return per risk

0.4

0.5

0.6

0.7

0.8

Reward

Volatility

This work addresses all the shortcoming of DNN-based approaches mentioned above. We propose NeuralEF, a DNN-based model to approximate the computation of the EF problem robustly. Our model is up to 615X times faster than the baseline convex optimization when used with hardware acceleration. It is able to handle a variable number of assets and inequality 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 2 describes the EF problem and presents related works on convex optimization acceleration. Section 3 introduces NeuralEF and its training methodology. Section 4 outlines our empirical evaluations on the EF optimization problem. Finally, section 5 presents our conclusions.

2 Background and Related Work

2.1 The Efficient Frontier

We seek an optimal allocation x = [ x 1 , · · · x n ] over n risky assets given a soft volatility target V target . This means a portfolio with higher achieved volatility than V target is valid only if the resulting allocation has the minimum volatility that can be achieved on the feasible domain. Finding the optimal allocation maximizing portfolio return at a given volatility target is conditional on the assets' expected returns R = [ r 1 , · · · , r n ], volatilities V = [ v 1 , · · · , v n ], and correlations P = [[ ρ 1 , 1 , · · · , ρ 1 ,n ] , · · · , [ ρ n, 1 , · · · ρ n,n ]]. Constraints that must be satisfied include upper and lower bounds on total allocation of risky assets α max , α min ,

and a minimum and maximum asset allocation limit per asset X min = [ x min 1 , · · · , x min n ], X max = [ x max 1 , · · · , x max n ]. As is typical in finance, assets can belong to a set of m classes C = [ c 1 , · · · , c n ]; c i ∈ [1 , · · · , m ], and allocations are subject to a class maximum ζ MAX = [ ζ c 1 , · · · ζ c m ]; ∑ x ∈ c j x i ≤ ζ c j . We denote the set of convex optimization inputs by Z input = [ R , V , P , X max , X min , C , ζ max , α min , α max , V target ] and the resulting allocation by Z output = EF( Z input ).

This problem is illustrated in fig. 1 using random allocations where the EF is located at the left-most frontier of the plots. We can find this frontier along a range of volatility targets by solving a two-step conditional convex optimization problem where we first find the optimal weights that minimizes risk in a portfolio of n assets subject to linear weight constraints and then maximize the return if the risk of the portfolio is below V target .

Finding this minimum variance portfolio is equivalent to solving a QP problem of the form

where x ∈ R n is a column vector of weights representing the allocation, Q is the covariance matrix of the portfolio's assets, a i is a row vector representing the i -th linear constraint (obtained from α min , α max , X max , X min , ζ max ) and b i is the maximum required value for the i -th constraint. The result of eq. 1 allows us to calculate the minimum volatility V min = x /latticetop Qx that can be achieved on the feasible domain.

If the resulting portfolio risk V min < V target , 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

Thus, the efficient frontier can be summarized by

The EF optimization is sensitive at inflection points where one asset becomes more attractive than another. All else held equal, an infinitesimal difference in expected returns can cause a 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 [13, 44, 12]. In particular, [11] showed that solving numerous optimizations simultaneously in a single batch leads to significant speedup. We replicated this experiment by writing a vectorized implementation of the optimization of eq. 3 in Pytorch to solve multiple EF problems at once. We observed accelerations which are consistent with the order of magnitude achieved in these works, but not sufficient to allow the completion of a full simulation in a matter of few seconds unless the GPU used has high memory capacity (e.g. 40 GB).

Several works [4, 1, 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. 1 and eq. 2. Their approaches aim to solve a parameterized optimization problem ensuring a constrained layer's output to align with homogeneous linear inequality constraints established by Z input . This is done either by solving the optimization problem during training [4, 1], or when initializating the model [20]. To support a heterogenous set of constraints, one would need to specify a set of linear inequality constraints ahead of time. This approach is impractical as it cannot generalize to unspecified sets of constraints.

Other existing supervised learning (SL) approaches to approximate convex optimization with DNNs do not provide the desired flexibility and robustness for large-scale generalization

[48, 2, 18, 28]. They use a DNN that takes Z input as input and outputs Z output , treating inequality constraints as soft during training. Reinforcement learning (RL) approaches like POMO [31] and PPO [35] 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 Z input and Z output 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.

3 Neural Approximation of the Efficient Frontier

Input

Embedding

+

Multi-Head

Attention

Add & Norm

Feed Forward

Add & Norm

Raw Feature

Sorting Module

Cleaning Module

D x

Dynamic Greedy Allocation

Rebalancing Module

Original indices to sort the allocation back to their original order

Sorting module

Estimated Optimal

Portfolio Weights

Axial Positional Embeding

Max Pool & Add

Asset #1 Identifier

Add

Token 1

Token 2

Token 3

Global

Optimization

Inputs

Asset #1 Specific

Inputs

Asset #2 Identifier

Global

Optimization

Inputs

Asset #2 Specific

Inputs

Asset #3 Identifier

Global

Optimization

Inputs

Asset #3 Specific

Inputs

Projection To a Sequence Representation

Activation function

To approximate the computation of the QP and conditional SOCP optimization described in sec. 2.1, 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 a sequence-to-sequence (SEQ2SEQ) problem [45] 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 mathematical problem by parsing the problem using a mix of natural language and mathematical notation where a forecast is built using the same notation [33, 15], our SEQ2SEQ formulation explicitly parse the whole optimization problem by considering the optimization input directly and forecasts the output in 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 features: global optimization inputs ( P , ζ max , α min , α max , V target ) and asset specific inputs ( R , V , Υ max , X min , C ). These features along with a sequence of asset identifier ( n values evenly spaced within [0 , 1]) are used to rearrange the optimization input parameters into a set of vectors and are linearly projected into higher dimensional

tokens t 1 , · · · , t n as shown in the left part of fig. 2 3 . Since the projection is made on 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 overcoming 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 inputs before being projected to remove any unnecessary complexity during training. Second, the model must be invariant to the sequence ordering [41, 49, 40] given as input. Building on insights from [47], 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 easier.

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 = [ x 1 , · · · , x N ] with its upper and lower bounds X max and X min as in eq. 4. We extract an ordering of the assets K = [ k, · · · ] := argsort( -X ; N ) where k ∈ [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 α max by computing a cumulative sum following the ordering established previously and then altering the allocation on assets such that it does not exceed α max as in eq. 6. A similar process is applied to cases where ˜ α ′ alloc < α min , where we inflate the allocation of the assets greedily following K until we reach a total allocation ˜ α alloc which we compute by eqs. 7-10. 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 ζ max mentioned in sec. 2.1, and the volatility constraint (non-linear) which are both limitations of DGAR.

4 Experiments

We used a MC sampling scheme to cover the entire domain in table. 1 uniformly to generate a dataset of approximately one billion samples D train = [( Z input , 1 , EF (( Z input , 1 ) , · · · ], which we used to train NeuralEF in a supervised fashion:

We generated two test datasets D test , D validation of 1 million samples each on the the same domain as the training set described in table 1. 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 at least two optimization inputs within /epsilon1 proximity of each other to target discontinuity areas of eq. 3. This synthetic data allows for precise control over optimization inputs and encompasses a broad spectrum of scenarios, ranging from extreme to real-world cases targeting mainly the discontinuity regions. Consequently, it 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 ( α max = α min = 1) and partial allocation ( α max > α min ) where there is no obligation to allocate the full budget. Only valid optimization inputs Z input , i.e. where EF ( Z input ) does not fail because of numerical difficulties in the solver or that no solution exists, where considered.

NeuralEF is a 7.9M parameter DNN and was trained on a single NVIDIA A100 GPU with stochastic gradient descent using the AdamW optimizer [34] and the L 2 loss. We also used an annealing learning rate decay starting from 5 . 5 e -5 to 1 . 0 e -6 . As stated in sec. 2, we also implemented a baseline EF optimization in PyTorch that we used solely for comparing the evaluation throughput (evaluations/seconds) between NeuralEF over the base pricer which was implemented using CVXOPT [14]. The hyperparameters of NeuralEF are described in table. 2 and were selected by estimated guesses from the accuracy measured on D validation .

4.1 In-domain Interpolation

10

10

10

8

10

6

10

4

10

2

10 0

Sum of allocation error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

16

10

13

10

10

10

7

10

4

10

1

Portfolio error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

14

10

11

10

8

10

5

10

2

Volatility error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

We assess NeuralEF's accuracy by measuring its ability to predict portfolio weights, returns and volatility on D test . 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 ( ˜ V target = Z /latticetop output QZ output ≤ max ( V target , V min )), 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 portfolio 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, ζ max and V target ) are by design highly sensitive to a slight /epsilon1 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 easily be applied within MC simulations that targets E ( R ), E ( 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 E ( g ( Z )).

Asset case

Portfolio weights MSE

Portfolio weights MAE

95 quantile

99.865 quantile

99.997 quantile

Ranking precision

2

1.24e-06

1.11e-03

1.22e-02

3.39e-02

1.05e-01

91.122 %

3

2.37e-15

3.97e-08

1.50e-02

3.78e-02

1.06e-01

99.080 %

4

8.80e-07

6.03e-04

1.66e-02

4.57e-02

1.39e-01

98.421 %

5

2.95e-06

1.33e-03

1.47e-02

4.15e-02

1.75e-01

96.587 %

6

1.96e-05

2.02e-03

1.50e-02

4.35e-02

1.50e-01

93.896 %

7

2.82e-06

1.19e-03

1.68e-02

4.43e-02

2.00e-01

90.426 %

8

1.02e-05

2.35e-03

1.60e-02

4.59e-02

1.57e-01

87.861 %

9

7.81e-06

1.67e-03

1.98e-02

5.17e-02

1.93e-01

84.895 %

10

1.07e-05

2.15e-03

2.00e-02

5.23e-02

1.70e-01

81.519 %

11

1.21e-05

1.78e-03

2.22e-02

5.83e-02

2.30e-01

80.003 %

12

1.64e-08

1.04e-04

1.98e-02

5.28e-02

2.14e-01

78.067 %

Portfolio return MSE

Portfolio return MAE

95 quantile

99.865 quantile

99.997 quantile

ζ

precision

2

2.86e-06

1.69e-03

7.74e-03

2.20e-02

7.54e-02

100 %

3

8.84e-06

2.97e-03

1.22e-02

3.15e-02

1.12e-01

93.927 %

4

3.20e-06

1.79e-03

1.47e-02

4.10e-02

1.76e-01

90.221 %

5

8.70e-06

2.95e-03

1.49e-02

3.60e-02

9.09e-02

89.406 %

6

1.33e-10

1.15e-05

1.53e-02

3.63e-02

1.23e-01

88.690 %

7

3.31e-10

1.82e-05

1.66e-02

3.94e-02

1.49e-01

85.186 %

8

5.77e-06

2.40e-03

1.72e-02

4.22e-02

1.49e-01

83.326 %

9

1.79e-06

1.34e-03

2.12e-02

5.18e-02

1.72e-01

87.125 %

10

5.75e-10

2.40e-05

2.31e-02

5.33e-02

1.55e-01

83.003 %

11

1.35e-07

3.67e-04

2.48e-02

5.80e-02

1.71e-01

81.934 %

12

1.14e-06

1.07e-03

2.50e-02

5.72e-02

1.83e-01

83.999 %

Volatility return MSE

Volatility return MAE

95 quantile

99.865 quantile

99.997 quantile

V

target

precision

2

2.86e-06

1.69e-03

7.74e-03

2.20e-02

7.54e-02

98.417 %

3

8.84e-06

2.97e-03

1.22e-02

3.15e-02

1.12e-01

95.115 %

4

3.20e-06

1.79e-03

1.47e-02

4.10e-02

1.76e-01

90.793 %

5

8.70e-06

2.95e-03

1.49e-02

3.60e-02

9.09e-02

87.406 %

6

1.33e-10

1.15e-05

1.53e-02

3.63e-02

1.23e-01

82.080 %

7

3.31e-10

1.82e-05

1.66e-02

3.94e-02

1.49e-01

80.465 %

8

5.77e-06

2.40e-03

1.72e-02

4.22e-02

1.49e-01

71.728 %

9

1.79e-06

1.34e-03

2.12e-02

5.18e-02

1.72e-01

69.426 %

10

5.75e-10

2.40e-05

2.31e-02

5.33e-02

1.55e-01

67.423 %

11

1.35e-07

3.67e-04

2.48e-02

5.80e-02

1.71e-01

70.261 %

12

1.14e-06

1.07e-03

2.50e-02

5.72e-02

1.83e-01

70.769 %

We plot the error distribution per asset by displaying the cumulative distribution of the sum error for all x 1 , · · · , x n , the absolute error on the expected return and the portfolio volatility in Fig. 4. 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 is only noticeable in 1% of cases. From the remaining tail exceeding the 1% total deviation, we measured 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 discontinuous regions, but instability in these areas exposes a weakness of approximating function with discontinuous behavior using DNNs. We illustrate this behavior using one example from the 99.997th quantile worst predictions of D test , where we vary a single input parameter ( r 10 ∈ [ -1 . 0 , 2 . 0]) while keeping the others constant, in Fig. 5. NeuralEF approximates discontinuities for most assets 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 a 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

1.0

0.5

0.0

0.5

1.0

1.5

2.0

0.0

0.1

0.2

0.3

0.4

0.5

Allocation

1.0

0.5

0.0

0.5

1.0

1.5

2.0

0.0

0.1

0.2

0.3

0.4

0.5

Allocation

x

1

x

2

x

3

x

4

x

5

x

6

x

7

x

8

x

9

x

10

Prediction

Ground Truth

volatility, as illustrated in fig. 6 (a-b). An ablation study motivating the different NeuralEF's components is presented in sec. C.2

0.0

0.5

1.0

Ground Truth

0.2

0.0

0.2

0.4

0.6

0.8

1.0

1.2

Prediction

(a) Return

0.0020

0.0025

0.0030

0.0035

Ground Truth

0.00200

0.00225

0.00250

0.00275

0.00300

0.00325

0.00350

0.00375

Prediction

(b) Volatility

0

10

20

30

Number of processes

2000

4000

6000

8000

10000

Troughput (eval./sec.)

0

10

20

30

Number of processes

0.01

0.02

0.03

0.04

0.05

Emission/sec

(c) EF CPU scaling with concurrent processes.

4.2 Throughput Evaluation and Carbon Footprint Impact

10 1

10 3

10 5

Batch size

10 1

10 2

10 3

10 4

10 5

Throughput (valuations per second)

Torch EF Rewrite

10 0

10 1

10 2

10 3

10 4

10 5

Batch size

10 1

10 2

10 3

10 4

10 5

NeuralEF FP16

10 0

10 1

10 2

10 3

10 4

10 5

Batch size

10 1

10 2

10 3

10 4

10 5

Neural FP32

model

NeuralEF A100

NeuralEF 3090

NeuralEF 2080TI

NeuralEF (ISR)

mode

cleaning only

no preprocessing

with preprocessing

We report a significant acceleration in the performance of NeuralEF compared to the singletread baseline optimizer, with a 623X time improvement on a CPU (AMD 5950X achieving 559 eval./s). The main factors contributing to this improvement are running multiple optimizations in batches, the smaller computational cost of inferring the result compared to numerically solving the optimization using an interior-point solver, and the use of halfprecision floating-point format 4 . We demonstrate the scalability of NeuralEF on fig. 7 for

both GPUs and CPUs as well as the impact of the different components. The highest achieved throughput are presented on table. 4.

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 a maximum throughput of 10377.80 eval./sec. 5 . It would take 26.77 hours to generate a billion evaluations, 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 an ease of use standpoint, the accelerated

0

2000

4000

6000

8000

10000

number of assets in portfolio

10 3

10 4

10 5

10 6

10 7

Throughput (valuations per second)

batch_size

1

10

100

1000

2000

5000

10000

15000

20000

10 2

10 4

batch size

10 3

10 4

10 5

10 6

10 7

Throughput (valuations per second)

10 1

10 2

10 3

10 4

number of assets in portfolio

10 4

10 5

10 6

10 7

Throughput (valuations per second)

device

3090

2080ti

A100

fp16/bf16

False

True

throughput of NeuralEF on a few devices is more cost-effective than maintaining and running multiple machines to achieve the same throughput on CPU or 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.

NeuralEF is less environmentally impactful than running the same optimization on CPU. For a single AMD Ryzen 9, if we consider the total time to generate our training dataset of 1 billion EF optimizations, the total simulation on CPU would approximate to 1.39 kgCO 2 e. Increasing the throughput by running concurrent processes increases the CO 2 emission on the chip as 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 2 e. At inference, the total emissions for forecasting a billion EF optimization using NeuralEF is estimated to be 0.03 kgCO 2 e 6 . Hence, we can offset the total cost of training NeuralEF by running approximately 4.20 billions evaluations. Since MC error converges as O (1 / √ N ), one could get a 4x more precise approximation to E ( g ( Z )) with NeuralEF in the time it would takes to obtain N simulations on a single CPU. Given that the EF problem is a cornerstone

of multiple applications in finance, 4.20 billions evaluations is easily offset in less than a week by a single organization.

4.3 Out-of-domain Generalization

10

9

10

7

10

5

10

3

10

1

Sum of allocation error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2.0

3.0

4.0

5.0

6.0

7.0

8.0

9.0

10.0

11.0

12.0

10

16

10

13

10

10

10

7

10

4

10

1

Portfolio error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2.0

3.0

4.0

5.0

6.0

7.0

8.0

9.0

10.0

11.0

12.0

10

11

10

8

10

5

10

2

10 1

Volatility error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2.0

3.0

4.0

5.0

6.0

7.0

8.0

9.0

10.0

11.0

12.0

The generalization ability of our model was measured by testing it on a larger input domain on a new dataset D ood of 1 million samples using the same domain as in D test , but instead considering V target ∈ [0 . 01 , 0 . 3], R ∈ [0 , 4], α min ∈ [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. 3 when all returns have the same sign (e.g., R = [0 . 3 , 0 . 4 , 0 . 5] ≈ [3 . 3 , 3 . 4 , 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 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. Otherwise, one can always train NeuralEF on a bigger domain than table. 1 with most likely more data. Because NeuralEF has been trained on synthetic data, we haven'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/volatilities /epsilon1 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, a 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 linear 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 [6, 38].

More importantly, our reformulation of convex optimization as SEQ2SEQ 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 a 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 achieving strong mathematical reasoning [23]. Converting a quantitative mathematical problem into a sequence representation and then forecasting the results presents a more practical approach than solving it directly. This conceptually separate reasoning, i.e. how to formulate a mathematical problem given some inputs using a LLM, and solving it as two independent learning tasks that can be combined at inference.

References

A. Agrawal, B. Amos, S. Barratt, S. Boyd, S. Diamond, and J. Z. Kolter. Differentiable convex optimization layers. Advances in neural information processing systems , 32, 2019.

A. Agrawal, S. Barratt, and S. Boyd. Learning convex optimization models. IEEE/CAA Journal of Automatica Sinica , 8(8):1355-1364, 2021.

I. Akkizidis and L. Kalyvas. Final basel III modelling: Implementation, impact and implications . Springer, 2018.

B. Amos and J. Z. Kolter. Optnet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning , pages 136-145. PMLR, 2017.

D. F. Anderson, D. J. Higham, and Y. Sun. Computational complexity analysis for monte carlo approximations of classically scaled population processes. Multiscale Modeling & Simulation , 16(3):1206-1226, 2018.

P. Boyle, M. Broadie, and P. Glasserman. Monte carlo methods for security pricing. Journal of economic dynamics and control , 21(8-9):1267-1321, 1997.

P. Brandimarte. Handbook in Monte Carlo simulation: applications in financial engineering, risk management, and economics . John Wiley & Sons, 2014.

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 , 33:1877-1901, 2020.

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 , 33:1877-1901, 2020.

R. E. Caflisch. Monte carlo and quasi-monte carlo methods. Acta numerica , 7:1-49, 1998.

J. Charlton, S. Maddock, and P. Richmond. Two-dimensional batch linear programming on the gpu. Journal of Parallel and Distributed Computing , 126:152-160, 2019.

P. Charoenphaibul and N. Juneam. Gpu-accelerated method for simulating efficient portfolios in the mean-variance analysis. In 2020 17th International Joint Conference on Computer Science and Software Engineering (JCSSE) , pages 171-176. IEEE, 2020.

D. Cole, S. Shin, F. Pacaud, V. M. Zavala, and M. Anitescu. Exploiting gpu/simd architectures for solving linear-quadratic mpc problems. arXiv preprint arXiv:2209.13049 , 2022.

S. Diamond and S. Boyd. Cvxpy: A python-embedded modeling language for convex optimization. The Journal of Machine Learning Research , 17(1):2909-2913, 2016.

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. A neural network solves, explains, and generates university math problems by program synthesis and few-shot learning at human level. Proceedings of the National Academy of Sciences , 119(32):e2123433119, 2022.

E. J. Elton and M. J. Gruber. Modern portfolio theory, 1950 to date. Journal of banking & finance , 21(11-12):1743-1759, 1997.

M. Estecahandy, L. Bordes, S. Collas, and C. Paroissin. Some acceleration methods for monte carlo simulation of rare events. Reliability Engineering & System Safety , 144: 296-310, 2015.

Z. Feinstein and B. Rudloff. Deep learning the efficient frontier of convex vector optimization problems. arXiv preprint arXiv:2205.07077 , 2022.

A. Fernández and S. Gómez. Portfolio selection using neural networks. Computers & operations research , 34(4):1177-1191, 2007.

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.

M. Giles, F. Y. Kuo, I. H. Sloan, and B. J. Waterhouse. Quasi-monte carlo for finance applications. ANZIAM Journal , 50:C308-C323, 2008.

P. Glasserman. Monte Carlo methods in financial engineering , volume 53. Springer, 2004.

D. Hendrycks, C. Burns, S. Kadavath, A. Arora, S. Basart, E. Tang, D. Song, and J. Steinhardt. Measuring mathematical problem solving with the MATH dataset. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, Neurips Datasets and Benchmarks 2021, December 2021, virtual , 2021.

J. Ho, N. Kalchbrenner, D. Weissenborn, and T. Salimans. Axial attention in multidimensional transformers. arXiv preprint arXiv:1912.12180 , 2019.

J. C. Hull. Options futures and other derivatives . Pearson Education India, 2003.

T. Ibaraki and N. Katoh. Resource allocation problems: algorithmic approaches . MIT press, 1988.

P. Jäckel. Monte Carlo methods in finance , volume 2. J. Wiley, 2002.

R. Kannan and J. R. Luedtke. A stochastic approximation method for approximating the efficient frontier of chance-constrained nonlinear programs. Mathematical Programming Computation , 13(4):705-751, 2021.

J. D. M.-W. C. Kenton and L. K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT , pages 41714186, 2019.

N. Kitaev, L. Kaiser, and A. Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations , 2020.

Y.-D. Kwon, J. Choo, B. Kim, I. Yoon, Y. Gwon, and S. Min. Pomo: Policy optimization with multiple optima for reinforcement learning. Advances in Neural Information Processing Systems , 33:21188-21198, 2020.

A. Lacoste, A. Luccioni, V. Schmidt, and T. Dandres. Quantifying the carbon emissions of machine learning. arXiv preprint arXiv:1910.09700 , 2019.

A. Lewkowycz, A. J. Andreassen, D. Dohan, E. Dyer, H. Michalewski, V. V. Ramasesh, 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.

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.

Y. Ma, J. Li, Z. 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.

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(1):77-99, 2007.

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.

D. L. McLeish. Monte Carlo simulation and finance , volume 276. John Wiley & Sons, 2011.

N. Metropolis and S. Ulam. The monte carlo method. Journal of the American statistical association , 44(247):335-341, 1949.

H. Pan and R. Kondor. Permutation equivariant layers for higher order interactions. In International Conference on Artificial Intelligence and Statistics , pages 5987-6001. PMLR, 2022.

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.

P. 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 3, 2018, Workshop Track Proceedings , 2018.

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.

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.

I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. Advances in neural information processing systems , 27, 2014.

A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems , 30, 2017.

O. Vinyals, S. Bengio, and M. Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391 , 2015.

X. Warin. Deep learning for efficient frontier calculation in finance. Journal of Computational Finance , 26(1), 2022.

M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. R. Salakhutdinov, and A. J. Smola. Deep sets. Advances in neural information processing systems , 30, 2017.

A Numerical example of the EF problem

We provide a numerical example of the EF problem in the case of a 4-asset problem with 2 classes and α min < 1 (see Eq.12). Only the constraints are presented here. It is important to note that the matrices A and B representing all w constraints grow in size by (2 n +2+ m ) as n increases, where m is the number of distinct asset classes. If X max is not defined, then all entries of X max can be set to α max . Solving Eq.1 is achieved by directly considering A and B and the covariance matrix Q = diag( V ) P diag( V ) obtained from the other inputs. If V min = x /latticetop Qx , then we solve a second-order cone program (SOCP) to increase the portfolio's volatility without exceeding V target and get better returns.

We obtain the volatility constraint through the Cholesky decomposition of the covariance matrix Q ′ = L ( Q ) L ( Q ) T where L is the lower-triangular operator.

E ∈ R [ n +1 ,n ] is built by stacking Q ′ and [0 , · · · 0] such that F ∈ R [ n +1 , 1] = [ √ V target , 0 , · · · ]. Then, eq. 2 can be reformulated as follow:

The complete optimal allocation of eq. 3 can be summarized by the following python script:

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 we discuss the ambiguity and propose a standardized solution for processing inputs in an optimized manner prior to token projection.

When the i -th asset belongs to the j -th asset class and x max i > ζ c j , the constraint x max i is overridden by ζ c j . This means that there is no combination of assets where the allocation of the i -th asset can be higher than ζ c j . To address this constraint, we clip x max i to ζ c j by using the formula: x ′ max i = min(max( x max i , ζ c j ) , 0) for all 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 to the j -th class, ζ c j and x max j 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 to setting ζ c j = 0. By processing the optimization inputs 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.

C Experimental Section

C.1 Dataset

The size and description of the dataset we used are presented in table. 5. We used an asymmetric weighting scheme to generate all datasets, favoring more complex optimizations (see Table 6). As the number of assets increases, the number of unstable regions also increases, where allocation can significantly change. To ensure training and evaluation encompass these unstable regions, we generated a higher proportion of optimization inputs with more assets.

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 a SEQ2SEQ representation. Secondly there is a 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) 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.

To show the effectiveness of DGAR, we've trained two NeuralEF models (w/ and w/o DGAR) trained for 5 days with a fixed learning rate of 5 . 5 e -5 and present the distributional error an

10

5

10

4

10

3

10

2

10

1

10 0

Sum of allocation error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

8

10

6

10

4

10

2

10 0

Portfolio error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

10

10

8

10

6

10

4

10

2

Volatility error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

10

10

8

10

6

10

4

10

2

10 0

Sum of allocation error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

16

10

13

10

10

10

7

10

4

10

1

Portfolio error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

12

10

9

10

6

10

3

Volatility error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

(b) D test distribution error NeuralEF w/ DGAR trained w/ constant lr=5e-5 for 5 days

optimality gap of the metrics that are not respected on fig. 10-11 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 is associated to class C 2 , which is its only member, we changed the value of the constraints to be ambiguous relative to another and show in fig. 12 how accuracy deteriorates when the model encounter request that are ambiguous.

C.3 Accuracy with half-precision floating-point format

The results obtained using single-precision floating-point (FP32) and the model quantized to half-precision floating-point (FP16) are on the same order of accuracy as shown in table 7 and fig. 13. The quantization process to FP16 maintains the necessary precision for the calculations, resulting in equivalent outcomes as the FP32 counterpart. While a degradation

2

4

6

8

10

12

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

cls_constraint_violated

portfolio_volatility_constraint_violated

lower_bound_violated

upper_bound_violated

max_allocation_violated

(a) D test optimality gap NeuralEF trained w/o DGAR w/ constant lr=5e-5 for 5 days

2

4

6

8

10

12

0.000

0.025

0.050

0.075

0.100

0.125

0.150

0.175

cls_constraint_violated

portfolio_volatility_constraint_violated

lower_bound_violated

upper_bound_violated

max_allocation_violated

(b) D test optimality gap NeuralEF w/ DGAR trained w/ constant lr=5e-5 5 for 5 days

1.0

0.5

0.0

0.5

1.0

1.5

2.0

returns on

x

10

0.0

0.1

0.2

0.3

0.4

0.5

allocation on

x

10

prediction

ground truth

pertrubation on

10

pertrubation on

c

2

1.0

0.5

0.0

0.5

1.0

1.5

2.0

returns on

x

10

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

allocation on

x

10

prediction

ground truth

pertrubation on

10

pertrubation on

c

2

(a) Prediction of the 10-th asset with the cleaning module using the example of fig.6 under request perturbation (b) Prediction of the 10-th asset without the cleaning module using the example of fig.6 under request perturbation

in the ability to rank assets 7 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 it. 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.

10

6

10

4

10

2

10 0

Sum of allocation error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

16

10

13

10

10

10

7

10

4

10

1

Portfolio error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

10

11

10

9

10

7

10

5

10

3

10

1

Volatility error

0.0

0.2

0.4

0.6

0.8

1.0

Proportion

number of assets

2

3

4

5

6

7

8

9

10

11

12

Asset case

Portfolio weights MSE

Portfolio weights MAE

95 quantile

99.865 quantile

99.997 quantile

Ranking precision

2

9.54e-07

9.77e-04

1.25e-02

3.37e-02

1.09e-01

93.012 %

3

7.95e-08

1.63e-04

1.51e-02

3.78e-02

1.06e-01

98.394 %

4

6.85e-07

5.34e-04

1.65e-02

4.59e-02

1.39e-01

97.231 %

5

2.52e-06

1.25e-03

1.48e-02

4.08e-02

1.77e-01

94.064 %

6

1.94e-05

2.00e-03

1.51e-02

4.28e-02

1.68e-01

89.798 %

7

2.84e-06

1.19e-03

1.67e-02

4.50e-02

1.95e-01

85.224 %

8

1.06e-05

2.40e-03

1.61e-02

4.49e-02

1.57e-01

81.598 %

9

7.72e-06

1.65e-03

1.99e-02

5.20e-02

2.08e-01

77.217 %

10

1.16e-05

2.21e-03

2.00e-02

5.25e-02

1.71e-01

74.899 %

11

1.11e-05

1.72e-03

2.22e-02

5.85e-02

2.36e-01

71.646 %

12

3.48e-08

1.30e-04

1.98e-02

5.31e-02

2.11e-01

68.804 %

Portfolio return MSE

Portfolio return MAE

95 quantile

99.865 quantile

99.997 quantile

ζ

precision

2

2.69e-06

1.64e-03

7.87e-03

2.26e-02

6.98e-02

97.555 %

3

9.48e-06

3.08e-03

1.24e-02

3.19e-02

1.12e-01

90.949 %

4

3.58e-06

1.89e-03

1.48e-02

4.05e-02

1.77e-01

87.576 %

5

8.79e-06

2.96e-03

1.49e-02

3.57e-02

9.32e-02

86.583 %

6

1.60e-13

3.99e-07

1.52e-02

3.58e-02

1.21e-01

85.592 %

7

2.15e-09

4.63e-05

1.68e-02

3.94e-02

1.51e-01

82.323 %

8

5.74e-06

2.40e-03

1.72e-02

4.25e-02

1.49e-01

84.808 %

9

2.11e-06

1.45e-03

2.13e-02

5.19e-02

1.74e-01

83.589 %

10

2.38e-09

4.88e-05

2.31e-02

5.36e-02

1.55e-01

83.707 %

11

1.31e-07

3.62e-04

2.49e-02

5.75e-02

1.75e-01

83.190 %

12

1.28e-06

1.13e-03

2.49e-02

5.75e-02

1.84e-01

83.197 %

Volatility MSE

Volatility MAE

95 quantile

99.865 quantile

99.997 quantile

V

target

precision

2

2.69e-06

1.64e-03

7.87e-03

2.26e-02

6.98e-02

87.649 %

3

9.48e-06

3.08e-03

1.24e-02

3.19e-02

1.12e-01

81.729 %

4

3.58e-06

1.89e-03

1.48e-02

4.05e-02

1.77e-01

83.229 %

5

8.79e-06

2.96e-03

1.49e-02

3.57e-02

9.32e-02

79.704 %

6

1.60e-13

3.99e-07

1.52e-02

3.58e-02

1.21e-01

80.056 %

7

2.15e-09

4.63e-05

1.68e-02

3.94e-02

1.51e-01

80.270 %

8

5.74e-06

2.40e-03

1.72e-02

4.25e-02

1.49e-01

76.472 %

9

2.11e-06

1.45e-03

2.13e-02

5.19e-02

1.74e-01

77.205 %

10

2.38e-09

4.88e-05

2.31e-02

5.36e-02

1.55e-01

79.268 %

11

1.31e-07

3.62e-04

2.49e-02

5.75e-02

1.75e-01

81.682 %

12

1.28e-06

1.13e-03

2.49e-02

5.75e-02

1.84e-01

79.517 %

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe 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.\n\nSTRENGTHS:\nThe 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\nWEAKNESSES:\n- 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.\n\nQUESTIONS:\n- 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?\n\nLIMITATIONS:\n- 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.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-04"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe 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.\n\nSTRENGTHS:\nThe 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.\n\nWEAKNESSES:\nLack 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\nQUESTIONS:\n1 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.\n\nLIMITATIONS:\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\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.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-05"}

comments: 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.

This 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. 
By experimental results, the proposed  NeuralEF is a viable solution to accelerate large-scale simulation.

STRENGTHS:
- The paper is well-written with clear notations and definitions.
- 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.
- r
- The methodology, especially the mathematical programming techniques, including formations in eq. 4-10 and the solver implementation details in Sec 4.2 are clear.

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.
- 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.

QUESTIONS:
- What behavior bias characteristics does the proposed NeuralEF have?
- In Sec. 4.1, what does the solution accuracy look like in different regimes?

LIMITATIONS:
no concern.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-07-07

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn 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.\n\nSTRENGTHS:\n1. 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.\n\nWEAKNESSES:\n1. 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.\n\nQUESTIONS:\n1. 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?\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-22"}