Introduction
Predicting stock prices is a notoriously difficult task in quantitative finance, primarily due to the complex and ever-changing relationships between companies, industries, and financial institutions. Traditional models often treat stocks as independent entities, relying solely on historical price sequences through architectures like LSTMs or Transformers. However, these approaches frequently ignore the interconnected nature of the market. While recent graph-based models have attempted to map these connections—such as shared supply chains—they often fail to account for two critical factors: multifacetedness and temporal evolution.
Stock prices are driven by overlapping relationships, including the actions of investment banks and broader industry trends, rather than just peer-company performance. Furthermore, these relationships are not static; they shift daily as institutions rebalance portfolios and macroeconomic conditions change. To address these challenges, this paper introduces the Multi-Relational Dynamic Graph Neural Network (MDGNN), a framework designed to model the stock market as a daily-evolving heterogeneous graph.
The MDGNN Architecture
MDGNN operates through a two-phase process that captures both the spatial complexity of the market on a given day and the temporal evolution of those relationships over time.
1. Intra-day Graph Snapshots
For every trading day, the model constructs a heterogeneous graph where nodes represent stocks, industries, and investment banks. Edges represent specific relationships, such as shared institutional holdings or industry classification. To process this data, MDGNN employs a Hierarchical Multi-relational Graph Embedding Layer. This layer utilizes "meta-paths" (e.g., Stock-Bank-Stock or Stock-Industry-Industry-Stock) to aggregate information across different node types. A multi-head attention mechanism and a relation-aware module then adaptively weight the importance of each meta-path, generating a comprehensive daily embedding for each stock.
2. Inter-day Temporal Extraction
To capture how these daily snapshots evolve, the sequence of node embeddings is fed into a Transformer-based architecture. A key innovation here is the use of ALIBI (Attention with Linear Biases). ALIBI injects an inductive bias that heavily weights recent events over distant historical data, aligning with the financial intuition that the stock market has a "short memory" and that recent market regimes are more predictive of near-term movement. A forward mask is also applied to prevent data leakage from future time steps.
Experimental Setup and Datasets
The model was evaluated using two major Chinese stock market indices over a backtesting period from January 2020 to February 2023:
- CSI100: Comprising 100 stocks, 196 banks, and 97 industries (~18.9M edges).
- CSI300: Comprising 300 stocks, 202 banks, and 191 industries (~62.5M edges).
Each stock is represented by 42-dimensional daily features, including market performance (price, volatility, turnover), company valuation (P/E, P/B ratios), and institutional consensus expectations. The study utilized a rolling 6-month training and 6-month testing setup to ensure robustness.
Key Insights and Results
MDGNN significantly outperformed 10 baseline models, including traditional time-series models (LSTM), static graphs (GCN, GAT, HAN), and existing dynamic graph models (EvolveGCN, HTGNN).
Performance Metrics
On the CSI300 dataset, MDGNN achieved an Information Coefficient (IC) of 0.0322 and a Cumulative Return (CR) of 0.9828, more than doubling the CR of the next best model, HTGNN (0.4653). Similar dominance was observed on the CSI100 dataset, where MDGNN achieved an IC of 0.0123 and a CR of 0.2741.
Ablation and Qualitative Analysis
- The Power of Institutional Data: An ablation study revealed that incorporating Stock-Bank (SB) relationships provided a more significant performance boost than Stock-Industry (SI) relationships. This suggests that investment bank holdings introduce higher information variance and more actionable signals than relatively static industry classifications.
- Meta-path Necessity: Removing the meta-path aggregation module led to the sharpest decline in performance, proving that explicitly modeling the type of connection is vital for accurate signal propagation.
- Case Study: In a qualitative analysis of the commercial banking sector, MDGNN successfully predicted an upward trend for Jiangsu Bank by identifying positive signals propagated through shared institutional holding graphs—a nuance missed by models that only look at price history.
Conclusion and Future Work
MDGNN demonstrates that combining hierarchical graph attention with temporal Transformers can effectively navigate the complexities of the stock market. While the model requires careful hyperparameter tuning to avoid over-smoothing and noise, its ability to integrate multi-relational data sets a new benchmark for financial forecasting. Future research will explore the integration of contrastive learning methods to further refine stock representations and improve predictive accuracy in volatile market conditions.
Summary updated