[Paper Review] A Universal End-to-End Approach to Portfolio Optimization via Deep Learning
This paper proposes a universal end-to-end deep learning framework for portfolio optimization that directly learns optimal portfolio weights without forecasting returns or estimating the covariance matrix. By integrating constraints like cardinality, maximum position, and leverage into differentiable neural layers, the method uses gradient ascent to optimize diverse objectives—including Sharpe ratio and mean-variance trade-off—achieving superior performance on synthetic and real-world datasets with over 20 years of historical data.
We propose a universal end-to-end framework for portfolio optimization where asset distributions are directly obtained. The designed framework circumvents the traditional forecasting step and avoids the estimation of the covariance matrix, lifting the bottleneck for generalizing to a large amount of instruments. Our framework has the flexibility of optimizing various objective functions including Sharpe ratio, mean-variance trade-off etc. Further, we allow for short selling and study several constraints attached to objective functions. In particular, we consider cardinality, maximum position for individual instrument and leverage. These constraints are formulated into objective functions by utilizing several neural layers and gradient ascent can be adopted for optimization. To ensure the robustness of our framework, we test our methods on two datasets. Firstly, we look at a synthetic dataset where we demonstrate that weights obtained from our end-to-end approach are better than classical predictive methods. Secondly, we apply our framework on a real-life dataset with historical observations of hundreds of instruments with a testing period of more than 20 years.
Motivation & Objective
- To overcome the limitations of classical two-step portfolio optimization, which relies on unstable return forecasting and covariance matrix estimation.
- To develop a scalable, end-to-end deep learning framework that directly optimizes portfolio weights without intermediate forecasting steps.
- To incorporate practical constraints such as cardinality, maximum position, leverage, and short-selling into the optimization process in a differentiable and trainable manner.
- To evaluate the framework's performance against classical methods on both synthetic data with known optimal weights and real-world data spanning over 20 years.
- To demonstrate robustness under transaction costs and market turbulence, including the 2008 crisis and 2020 pandemic crash.
Proposed method
- The framework bypasses traditional return forecasting and covariance matrix estimation by directly mapping historical asset returns to optimal portfolio weights via a deep neural network.
- It formulates objective functions—including Sharpe ratio, mean-variance trade-off, and minimum variance—within a differentiable deep learning pipeline.
- Specialized neural network layers are designed to enforce constraints such as cardinality (number of assets), maximum position per asset, and leverage, embedding them directly into the loss function.
- Gradient ascent is used to optimize the entire end-to-end pipeline, enabling effective training even under non-convex constraint landscapes.
- The model is trained on historical returns using various architectures (LSTM, MLP, CNN) and evaluated under realistic transaction costs.
- The framework is tested on a synthetic dataset with known optimal weights and a real-world WRDS dataset of hundreds of stocks over 20+ years.
Experimental results
Research questions
- RQ1Can an end-to-end deep learning framework outperform classical two-step portfolio optimization in terms of proximity to optimal weights when the true optimal weights are known?
- RQ2How does the proposed framework perform in real-world settings with hundreds of assets and over two decades of data, particularly in terms of Sharpe ratio and risk control?
- RQ3To what extent can differentiable neural layers effectively encode complex portfolio constraints such as cardinality, maximum position, and leverage in a differentiable optimization framework?
- RQ4How robust is the end-to-end deep learning approach under high transaction costs and market shocks such as the 2008 financial crisis and 2020 pandemic crash?
- RQ5Can the framework generalize across different deep learning architectures (e.g., LSTM, MLP, CNN) while maintaining superior performance on key risk-adjusted return metrics?
Key findings
- On the synthetic dataset, the end-to-end framework produced portfolio weights significantly closer to the known optimal weights than classical predictive methods.
- On the WRDS dataset with 20+ years of historical data, the E2E-LSTM model achieved a Sharpe ratio of 7.388 (with 2 bps transaction costs), outperforming other models and classical approaches.
- The E2E-LSTM model maintained a rolling Sharpe ratio mostly above zero and a near-zero rolling beta against the S&P 500, indicating market-neutral performance and robustness during crises.
- The drawdown was well-controlled during the 2008 and 2020 market crashes, demonstrating resilience under extreme market conditions.
- The inclusion of constraints such as leverage, cardinality, and maximum position improved risk control and allowed for tailored portfolio construction without sacrificing performance.
- The framework demonstrated superior generalization and scalability compared to classical mean-variance optimization, especially in high-dimensional settings with many assets.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.