Reinforcement-Learning Portfolio Allocation with Dynamic Embedding of Market Information

Jinghai He, Cheng Hua, Chunyang Zhou, Zeyu ZhengarXiv 2025 · DOI

Abstract

Portfolio management in financial markets is complicated by high noise, non-stationarity, and the limitations of traditional "Predict-Then-Optimize" (PTO) frameworks. This paper presents Dynamic Embedding Reinforcement Learning (DERL), an end-to-end framework that integrates generative state embeddings, online meta-learning, and deep reinforcement learning. By utilizing a Wasserstein Autoencoder (WAE) for latent representation and Fully Online Meta-Learning (FOML) for real-time adaptation, DERL effectively navigates changing market regimes. Empirical results over a 30-year period of U.S. equities demonstrate that DERL achieves superior risk-adjusted returns, particularly during high-volatility periods, outperforming both traditional benchmarks and standard machine learning approaches.

1. Introduction

The task of portfolio allocation—distributing capital across a set of assets to maximize returns relative to risk—is a fundamental challenge in finance. Traditionally, this has been approached via a two-step "Predict-Then-Optimize" (PTO) workflow. In this paradigm, a model first predicts future asset returns, and an optimizer (such as the Markowitz mean-variance model) subsequently determines the optimal weights.

However, the PTO approach suffers from three critical weaknesses. First, financial data is characterized by a low signal-to-noise ratio, making high-dimensional prediction difficult. Second, markets are non-stationary; the underlying statistical distributions shift over time, rendering static models obsolete. Third, the optimization step often amplifies small prediction errors, leading to unstable portfolio weights and poor out-of-sample performance. To address these issues, we introduce the DERL framework.

2. The DERL Framework

DERL is an end-to-end architecture designed to bridge the gap between raw market data and actionable portfolio decisions. It consists of three primary modules:

2.1 Generative State Embedding (WAE)

To mitigate noise and high dimensionality, DERL employs a Wasserstein Autoencoder (WAE). Unlike standard autoencoders that focus solely on reconstruction, this generative component is trained to capture transition dynamics. By learning a low-dimensional latent space that represents the evolution of market states, the model filters out noise while preserving the features most relevant to future price movements.

2.2 Online Meta-Learning (FOML)

To combat non-stationarity, the framework incorporates Fully Online Meta-Learning (FOML). Rather than relying on periodic batch retraining—which is often too slow to capture sudden market shifts—FOML allows the model to update its parameters incrementally as new data arrives. This enables the encoder to adapt to new market regimes, such as sudden volatility spikes or structural economic changes, in near real-time.

2.3 Deep Reinforcement Learning (TD3)

The decision-making core of DERL is a Twin Delayed Deep Deterministic Policy Gradient (TD3) agent. The agent receives the latent embeddings from the WAE and directly outputs portfolio weights. By optimizing for a long-term reward (the Sharpe ratio) in an end-to-end fashion, the TD3 agent avoids the error amplification inherent in the PTO workflow.

3. Experimental Methodology

The framework was evaluated using a comprehensive dataset of the top 500 U.S. equities by market capitalization, spanning from January 1, 1990, to December 31, 2022. This 30-year window includes various market cycles, including the dot-com bubble, the 2008 financial crisis, and the COVID-19 pandemic.

The input features included daily OHLCV (Open, High, Low, Close, Volume) data, technical indicators (e.g., RSI, MACD, Bollinger Bands), and macroeconomic variables such as Treasury rates. DERL was benchmarked against:

  • Equal-Weighted (EW) and Value-Weighted (VW) portfolios.
  • A standard Predict-Then-Optimize (PTO) machine learning model.

4. Results and Analysis

DERL demonstrated significant outperformance across the 30-year backtest.

4.1 Risk-Adjusted Performance

The DERL agent achieved an annualized Sharpe Ratio of 1.04, compared to 0.53 for the PTO model and 0.69 for the Equal-Weighted benchmark. This suggests that the integration of dynamic embeddings and reinforcement learning provides a more robust mechanism for capturing market risk and return than traditional methods.

4.2 Crisis Resilience

The performance gap was most pronounced during periods of market stress. In high-volatility regimes, DERL maintained a positive Sharpe ratio of 0.32, whereas the PTO model’s performance turned negative (-0.24). Analysis of the agent's behavior revealed a "volatility timing" capability: the model automatically reduced market exposure during periods of high VIX levels, effectively protecting capital during downturns.

4.3 Statistical Edge

Factor analysis using Fama-French models confirmed that DERL’s excess returns (Alpha) were statistically significant and not merely a byproduct of exposure to known factors like Momentum or Size. Furthermore, the return distribution of DERL exhibited positive skewness, indicating a reduced frequency of extreme downside events compared to the benchmarks.

5. Discussion and Future Work

A key finding of this research is the importance of "next-state awareness." Ablation studies indicated that encoding transition dynamics (predicting the next state) is more effective than simply encoding the current state. This suggests that for reinforcement learning to succeed in finance, the model must understand the trajectory of the market rather than just its current snapshot.

Despite its success, the current DERL implementation has limitations. It assumes a long-only strategy with no leverage, following mutual fund constraints. Future research could explore long-short strategies and the integration of alternative data sources, such as news sentiment or high-frequency macroeconomic indicators, to further enhance the model's adaptability to non-stationary environments.

6. Conclusion

The DERL framework represents a significant step forward in applying deep reinforcement learning to portfolio management. By combining generative embeddings with online meta-learning, the model successfully addresses the challenges of noise and non-stationarity, delivering superior risk-adjusted returns and demonstrating remarkable resilience during financial crises.

Summary updated

BibTeX
@misc{he2025reinforcement,
  author = {Jinghai He and Cheng Hua and Chunyang Zhou and Zeyu Zheng},
  title = {{Reinforcement-Learning Portfolio Allocation with Dynamic Embedding of Market Information}},
  year = {2025},
  eprint = {2501.17992},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.17992},
}
Figure