STORM: A Spatio-Temporal Factor Model Based on Dual Vector Quantized Variational Autoencoders for Financial Trading

Yilei Zhao, Wentao Zhang, Tingran Yang, Yong Jiang, Fei Huang, Wei Yang Bryan Lim

TL;DR

STORM is a novel spatio-temporal latent factor model for financial trading that utilizes a dual Vector Quantized Variational Autoencoder (VQ-VAE) architecture. By processing stock data from both cross-sectional (spatial) and time-series (temporal) perspectives and representing factors as discrete, multi-dimensional embeddings, STORM significantly reduces market noise and avoids multicollinearity. The model acts as a versatile all-rounder, outperforming state-of-the-art baselines in stock return prediction, portfolio management, and algorithmic trading.

What Problem Does This Paper Address?

In quantitative finance, factor models are essential tools used to explain asset returns and manage risk by identifying underlying drivers of the market (like the famous Fama-French risk factors). Recently, deep learning researchers have turned to Variational Autoencoders (VAEs) to automatically learn these factors from data in a self-adaptive way.

However, existing latent factor models suffer from three major flaws:

  1. Simplistic Representations: They typically represent factors as single scalar values, which lack the capacity to capture the highly non-linear and noisy complexity of financial markets.
  2. Factor Inefficiency: They focus heavily on cross-sectional (market-wide) data while neglecting individual stock temporal patterns. Furthermore, their continuous latent spaces are highly susceptible to noise, and the learned factors often suffer from multicollinearity (lack of independence).
  3. Lack of Factor Selection: They generate factors without providing a mechanism to differentiate, categorize, or select the most impactful ones.

Methods

To solve these challenges, the authors propose STORM (Spatio-Temporal factOR Model). Instead of a single continuous VAE, STORM introduces a dual VQ-VAE architecture that processes data through two distinct lenses:

  • Time-Series (TS) Module: Extracts fine-grained temporal patterns by partitioning data into patches of individual stock sequences over time.
  • Cross-Sectional (CS) Module: Captures spatial market correlations by looking at all stocks simultaneously on a given trading day.
Figure 1: Overall architecture of STORM

Both modules use Transformer encoders to extract continuous features, which are then passed through a Vector Quantization (VQ) bottleneck. This step maps the continuous features to the nearest vectors in a learnable discrete codebook. To ensure the learned factors are high-quality and distinct, the authors apply two crucial constraints: an orthogonality loss (forcing factors to be independent) and a diversity loss (preventing the model from over-relying on just a few codebook vectors).

Finally, a Factor Module fuses these discrete spatial and temporal tokens using a cross-attention mechanism and contrastive learning to align them semantically. A prior-posterior learning framework is then used to predict future stock returns without leaking future information during inference.

Figure 2: The architecture of our proposed STORM model

Datasets

The model was evaluated using 16 years of daily stock data (from April 1, 2008, to March 31, 2024) from two major U.S. indices:

  • SP500: Representing a broad, diversified set of 408 stocks.
  • DJ30: Representing 28 large-cap industrial blue-chip stocks.

The input features consisted of standard OHLC (Open, High, Low, Close) price data alongside 152 technical indicators derived from the open-source quantitative finance platform Qlib (Alpha158).

Key Insights and Ideas

  • From Scalars to Embeddings: Moving from traditional scalar factor values to multi-dimensional embeddings allows the model to retain rich, non-linear market structures that are otherwise lost.
  • The Power of Discretization in Finance: Financial data has an notoriously low signal-to-noise ratio. By forcing the latent space to be discrete via VQ-VAE codebooks, STORM effectively filters out minor market fluctuations (noise) and clusters similar market states together.
  • Codebooks as Factor Selectors: Because the codebook vectors act as cluster centers, they provide a transparent way to categorize and select factors, addressing the "black box" nature of traditional latent factor models.
  • Spatio-Temporal Synergy: Ablation studies showed that removing either the TS or CS module significantly degraded performance, proving that robust asset pricing requires looking at both historical individual stock trends and macro cross-sectional market conditions simultaneously.

Key Results

STORM was tested across three tasks: future return prediction, portfolio management, and algorithmic trading. It proved to be a powerful generalist, whereas baseline models were typically specialized in only one or two tasks.

Table 1: Comparison of baselines across different tasks
  • Portfolio Management: Using a standard TopK-Drop trading strategy, STORM achieved an Annualized Percentage Yield (APY) of 18.8% on SP500 and 14.8% on DJ30, outperforming the best baseline models (like FactorVAE and HireVAE) by 137.97% and 94.74% respectively. It also demonstrated a massive improvement in risk-adjusted return metrics like the Sharpe Ratio (ASR) and Calmar Ratio (CR).
Table 2: Portfolio management task results of all models across six metrics (mean ± range, computed across 10 runs).
  • Algorithmic Trading: When paired with a Proximal Policy Optimization (PPO) reinforcement learning agent for single-stock trading, STORM achieved a 43.64% average improvement in APY across five prominent stocks (AAPL, JPM, IBM, INTC, MSFT) compared to other RL and deep learning baselines.

Limitations and Future Work

While STORM excels at learning internal market dynamics from price and technical indicators, it currently operates in a vacuum regarding exogenous data. The authors note that financial markets are heavily driven by macroeconomic news, policy changes, and social sentiment. As a promising future direction, they plan to extend STORM by incorporating side information, such as financial news text, to capture the impact of these external shocks.

Summary updated

BibTeX
@misc{zhao2024storm,
  author = {Yilei Zhao and Wentao Zhang and Tingran Yang and Yong Jiang and Fei Huang and Wei Yang Bryan Lim},
  title = {{STORM: A Spatio-Temporal Factor Model Based on Dual Vector Quantized Variational Autoencoders for Financial Trading}},
  year = {2024},
  eprint = {2412.09468},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.09468},
}
Figure