TLDR: MaGNet is a novel Mamba dual-hyperGraph Network designed for stock prediction. It integrates a MAGE block for comprehensive temporal learning, 2D spatiotemporal attention for feature fusion, and a dual hypergraph framework (Temporal-Causal and Global Probabilistic Hypergraphs) to capture both localized temporal dependencies and global market structures. Extensive experiments on six major stock indices demonstrate MaGNet’s superior predictive accuracy, exceptional investment returns, and robust risk management capabilities compared to existing methods.
Predicting stock market trends is a complex challenge, yet it’s vital for successful trading and managing investments. The market’s unpredictable nature, rapid changes over time, and intricate relationships between different stocks make accurate forecasting difficult. Traditional methods often struggle to capture these dynamic elements, sometimes overlooking broader market influences or relying on outdated assumptions about how stocks interact.
A new research paper introduces MaGNet, a novel Mamba dual-hyperGraph Network designed to tackle these challenges. MaGNet aims to improve stock prediction by combining advanced methods for understanding how data changes over time with sophisticated ways to model the relationships between stocks. The researchers behind this work are Peilin Tan, Chuanqi Shi, Dian Tu, and Liang Xie. You can find their full paper here: MaGNet: A Mamba Dual-Hypergraph Network for Stock Prediction via Temporal-Causal and Global Relational Learning.
MaGNet’s Core Innovations
MaGNet stands out with three key innovations:
First, it features a unique component called the MAGE block. This block uses a bidirectional Mamba model, which is excellent at processing sequences of data efficiently, to understand both past and future temporal patterns. It also includes adaptive gating mechanisms to intelligently combine these insights, a sparse Mixture-of-Experts layer to adjust to different market conditions (like bullish or bearish trends), and multi-head attention to capture long-range dependencies across the entire stock data sequence. This combination allows MaGNet to model complex temporal dynamics effectively.
Second, MaGNet incorporates Feature-wise and Stock-wise 2D Spatiotemporal Attention modules. These modules are designed to precisely combine various financial features and understand how different stocks influence each other. Unlike methods that might flatten data or process features separately, these modules preserve the inherent structure of financial data, enhancing its usefulness for predicting stock movements.
Third, the model utilizes a dual hypergraph framework. This framework consists of two complementary parts: the Temporal-Causal Hypergraph (TCH) and the Global Probabilistic Hypergraph (GPH). The TCH focuses on capturing detailed causal relationships between stocks over time, ensuring that predictions respect the temporal order of events. The GPH, on the other hand, models broader, market-wide patterns by allowing stocks to belong to multiple groups with varying degrees of membership. Together, these hypergraphs help MaGNet distinguish between localized, time-dependent influences and instantaneous global market structures, enabling a multi-faceted understanding of stock relationships.
Demonstrated Performance
The researchers conducted extensive experiments on six major stock indices, including DJIA, HSI, NASDAQ 100, S&P 100, CSI 300, and Nikkei 225. MaGNet consistently outperformed existing state-of-the-art methods in both predictive accuracy and investment returns. For instance, it achieved high accuracy on indices like HSI (54.19%) and CSI 300 (54.90%).
Beyond just prediction, MaGNet also showed exceptional results in simulated investment scenarios. It delivered superior risk-adjusted returns, with Sharpe Ratios exceeding 1.0 on multiple markets and annual returns reaching up to 22.6%. The model also demonstrated robust risk management capabilities, keeping maximum drawdowns (the largest peak-to-trough decline in a portfolio) below 10% across all tested indices, and even under 5% for CSI 300 and DJIA. These results highlight MaGNet’s ability to translate its predictive power into practical profitability and controlled risk in real-world trading.
Also Read:
- Dynamic AI for Food Security: Forecasting Global Trade Links with IVGAE-TAMA-BO
- Optimizing Retail Pricing: How Graph Attention Enhances Multi-Agent Reinforcement Learning
Why MaGNet Matters
MaGNet represents a significant step forward in stock prediction. By integrating advanced temporal modeling with dynamic relational learning through its MAGE block, 2D spatiotemporal attention, and dual hypergraph framework, it offers a more comprehensive and accurate approach to understanding and forecasting complex financial markets. This could lead to more profitable trading strategies and more effective portfolio management for investors.


