TL;DR
GrifFinNet is a novel deep learning framework for stock return prediction that tightly integrates multi-relational stock graphs (industry sectors and institutional ownership) with temporal Transformer encoding. By introducing an adaptive gating mechanism, the model dynamically shifts its reliance between different stock relationships in real time based on changing market conditions, significantly outperforming traditional sequential and graph-based baselines.
What Problem Does This Paper Address?
Predicting stock returns is a foundational challenge in quantitative finance, complicated by the market's highly dynamic and non-linear nature. Stocks do not move in isolation; their price trajectories are shaped both by their own historical trends (temporal dynamics) and by their connections to other securities (spatial dynamics)—such as belonging to the same industry sector or sharing institutional investors.
Existing spatio-temporal models suffer from two major limitations:
- Loose Integration: They often treat spatial (graph) and temporal (sequential) modules as separate, loosely connected components, leading to suboptimal joint representations.
- Static or Feature-Level Gating: Current gating mechanisms primarily operate at the feature-selection level. They lack the capacity to adaptively fuse heterogeneous relation types or dynamically adjust their relative importance when market regimes shift (e.g., during sudden market crashes or bull runs).
Methods
GrifFinNet addresses these gaps through an end-to-end architecture composed of four tightly integrated modules:
- Feature Processing & Representation Learning: Raw features are categorized into company-specific indicators and market-level indicators, linearly transformed, and injected with sinusoidal positional encodings to preserve temporal order.
- Graph Relational Attention Mechanism: Using financial data, the model constructs two explicit inter-stock graphs: an industry affiliation graph and an institutional co-ownership graph. These relation matrices are embedded directly into a modified multi-head attention mechanism, strengthening the attention weights between fundamentally connected stock pairs.
- Adaptive Gating Fusion Mechanism: Instead of statically blending the two graphs, a sigmoid-based gating module calculates dynamic weights for each relation type per stock. This allows the model to continuously adjust how much it prioritizes industry trends versus institutional behavior.
- Temporal Transformer Encoding: The fused relational representations are passed directly into a Transformer encoder to capture long-range temporal dependencies and lagged market effects.
- Prediction Module: The framework applies global average pooling across time steps and utilizes a multi-layer perceptron (MLP) head to output cross-sectional return rankings, optimized using MSE loss with L2 regularization.
Datasets
The model was evaluated on two widely used Chinese equity benchmarks:
- CSI300: Represents the top 300 stocks on the Shanghai and Shenzhen stock exchanges.
- CSI800: A larger, more complex universe representing the top 800 stocks.
The sample period spans from January 2008 to December 2022, partitioned into training (2008–2020), validation (early 2020), and testing (mid 2020–2022) subsets. Features are constructed from the standard Alpha158 quantitative factor set and enriched with 63 market-level variables.
Key Insights and Ideas
- Regime-Sensitive Gating: Analyzing the learned gate dynamics revealed a fascinating "aha" moment: on extreme market days, the gating mechanism exhibits clear, interpretable patterns. During market upswings, the model increases its reliance on industry sector relations. Conversely, during market downturns, it prioritizes institutional co-ownership relations, effectively capturing the risk-averse herd behavior of institutional investors.
- The Indispensability of Time: Ablation studies showed that removing the temporal encoder caused the most catastrophic performance drop (a 63% decrease in predictive accuracy on CSI300). This underscores that spatial relationships in finance must be tightly contextualized within sequential, long-term temporal structures to be effective.
- Shallow is Better for Noisy Data: Hyperparameter sensitivity analysis demonstrated that a single Transformer layer achieved the best balance. Increasing the number of Transformer layers provided only marginal accuracy improvements while causing significant declines in practical portfolio metrics, indicating that deeper architectures easily overfit to financial noise.
Key Results
GrifFinNet consistently outperformed a diverse set of baselines, including sequential models (LSTM, GRU, Transformer), graph-based methods (GAT, GCN, DTML), tree ensembles (XGBoost, Random Forest), and state-of-the-art quantitative frameworks (MASTER, FactorVAE, StockMixer).
- Predictive Accuracy: Achieved an Information Coefficient (IC)—which measures the linear alignment between predicted and realized returns—of 0.081 on CSI300 (a 37.3% improvement over the SOTA MASTER model) and 0.097 on CSI800.
- Portfolio Profitability: In a daily trading simulation selecting the top 30 ranked stocks, GrifFinNet achieved an outstanding Information Ratio (IR) of 3.937 on CSI300, vastly outperforming the baseline models.
- Risk Management: Incorporating multi-relational modeling yielded a final cumulative return of 386.8% compared to just 162.9% for an ablation variant without relations, while simultaneously reducing annualized volatility by 5.9%.
Limitations and Future Work
The authors acknowledge three primary limitations:
- Restricted Relational Space: The model currently only accounts for industry and institutional networks, omitting other potentially powerful relational data sources like investor sentiment, supply-chain dependencies, and geographical clustering.
- Short-Term Horizon: The focus remains strictly on short-term return predictions, limiting its direct applicability to long-horizon asset allocation strategies.
- Coarse Interpretability: While the gating mechanism offers macro-level insights into market regimes, the model still lacks fine-grained interpretability at the individual stock or investment-decision level.
Future research directions include expanding the relational graphs, extending the framework to multi-horizon prediction tasks, and integrating advanced counterfactual or attribution-based interpretability techniques.
Summary updated