StockMamba: State-Space Gated Stock Transformer with Rank-Aware Optimization

Stock price forecasting remains an extremely challenging problem due to the non-stationary nature of financial markets. Recent deep learning approaches model complex stock correlations by learning temporal patterns from individual stock series and then aggregating cross-stock information. However, existing methods select which alpha factors to trust using static projections of market features, ignoring how market regimes evolveover the lookback window—a “recovering from a crash” regime and a “new bull market” produce similar instantaneous statistics but require different factor selections. Moreover, standard MSE training objectives weight all stocks equally, wasting gradient signal on mid-ranked stocks that never enter a long–short portfolio. To address these issues, we introduce StockMamba, a State-Space Gated Stock Transformer with Rank-Aware Optimization. StockMamba replaces static market gating with a Mamba-2 state-space model that scans market regime dynamics in linear time and produces time-varying factor gates via temperature-controlled softmax. For training, StockMamba pairs cross-stock attention and temporal distillation with a U-shaped Rank-Position Loss that concentrates gradients on the head and tail stocks where portfolio P&L is determined. Experiments on CSI-300 and CSI-800 with the Qlib pipeline show that StockMamba achieves 12.1% higher IC and 15.0% higher Rank IC over the MASTER baseline on CSI-300 (13.5% and 14.8% on CSI-800), with ablation studies confirming the contribution of each proposed module. A cross-market evaluation on S&P 500 further confirms that the gains generalize to a structurally different market (9.5% higher IC over MASTER), and a Kolmogorov–Smirnov test on the learned factor gates provides statistical evidence that the gating mechanism is genuinely regime-dependent.

Authors

Institutions

Publication Details

Journal
Mathematics
Published
2026-05-27
DOI
https://doi.org/10.3390/math14111859
Primary Topic
Stock Market Forecasting Methods
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

StockMamba: State-Space Gated Stock Transformer with Rank-Aware Optimization

Peng Zhang
Mathematics
Stock Market Forecasting Methods
article

StockMamba: State-Space Gated Stock Transformer with Rank-Aware Optimization

Peng Zhang
article en

Abstract

Stock price forecasting remains an extremely challenging problem due to the non-stationary nature of financial markets. Recent deep learning approaches model complex stock correlations by learning temporal patterns from individual stock series and then aggregating cross-stock information. However, existing methods select which alpha factors to trust using static projections of market features, ignoring how market regimes evolveover the lookback window—a “recovering from a crash” regime and a “new bull market” produce similar instantaneous statistics but require different factor selections. Moreover, standard MSE training objectives weight all stocks equally, wasting gradient signal on mid-ranked stocks that never enter a long–short portfolio. To address these issues, we introduce StockMamba, a State-Space Gated Stock Transformer with Rank-Aware Optimization. StockMamba replaces static market gating with a Mamba-2 state-space model that scans market regime dynamics in linear time and produces time-varying factor gates via temperature-controlled softmax. For training, StockMamba pairs cross-stock attention and temporal distillation with a U-shaped Rank-Position Loss that concentrates gradients on the head and tail stocks where portfolio P&L is determined. Experiments on CSI-300 and CSI-800 with the Qlib pipeline show that StockMamba achieves 12.1% higher IC and 15.0% higher Rank IC over the MASTER baseline on CSI-300 (13.5% and 14.8% on CSI-800), with ablation studies confirming the contribution of each proposed module. A cross-market evaluation on S&P 500 further confirms that the gains generalize to a structurally different market (9.5% higher IC over MASTER), and a Kolmogorov–Smirnov test on the learned factor gates provides statistical evidence that the gating mechanism is genuinely regime-dependent.

MathematicsVol. 14(11)
Jiangsu Normal University (CN), Southeast University (CN)
Openalex Percentile: Top 4%
Stock Market Forecasting Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.