GrifFinNet: A Graph-Relation Integrated Transformer for Financial Predictions

Predicting stock returns remains a central challenge in quantitative finance, transitioning from traditional statistical methods to contemporary deep learning techniques. However, many current models

GrifFinNet: A Graph-Relation Integrated Transformer for Financial Predictions

Predicting stock returns remains a central challenge in quantitative finance, transitioning from traditional statistical methods to contemporary deep learning techniques. However, many current models struggle with effectively capturing spatio-temporal dynamics and integrating multiple relational data sources. This study proposes GrifFinNet, a Graph-Relation Integrated Transformer for Financial Predictions, which combines multi-relational graph modeling with Transformer-based temporal encoding. GrifFinNet constructs inter-stock relation graphs based on industry sectors and institutional ownership, and incorporates an adaptive gating mechanism to dynamically integrate relational data in response to changing market conditions. This approach enables the model to jointly capture spatial dependencies and temporal patterns, offering a comprehensive representation of market dynamics. Extensive experiments on two Chinese A-share indices show that GrifFinNet consistently outperforms several baseline models and provides valuable, interpretable insights into financial market behavior. The code and data are available at: https://www.healthinformaticslab.org/supp/.


💡 Research Summary

GrifFinNet addresses a central challenge in quantitative finance: the simultaneous modeling of spatial (cross‑sectional) dependencies among assets and temporal dynamics of price movements. The authors begin by constructing two complementary relational graphs for a set of stocks. The first graph captures industry‑sector similarity: stocks belonging to the same sector are densely connected, with edge weights reflecting sector co‑membership. The second graph encodes institutional ownership similarity: each stock’s vector of institutional holdings is compared across the universe, and a correlation‑based weight is assigned to each pair of stocks. Both adjacency matrices are kept separate, allowing the model to treat each relational view independently.

To embed these graphs, the framework employs relation‑specific Graph Convolutional Network (GCN) layers. Each GCN processes its adjacency matrix and produces a node embedding that reflects the corresponding relational structure. These embeddings are then combined with a temporal representation learned by a standard Transformer encoder. The Transformer receives a multivariate time‑series input (prices, volumes, technical indicators, etc.) augmented with positional encodings, and it captures long‑range dependencies through multi‑head self‑attention and feed‑forward blocks.

The core novelty lies in an adaptive gating mechanism that dynamically balances the contributions of the sector and institutional graphs at each time step. The gate is computed as a sigmoid‑activated linear projection of the concatenated Transformer output and the stacked graph embeddings. The resulting gate vector multiplies the graph embeddings, effectively re‑weighting each relational view according to the current market context. During periods of heightened sector‑wide turbulence, the gate amplifies the sector graph; when institutional buying or selling pressure dominates, the institutional graph receives higher weight. Because the gate is learned jointly with the rest of the network, the model automatically discovers when each relational source is most informative.

Training proceeds end‑to‑end using mean‑squared error (MSE) loss on one‑day‑ahead stock return predictions. The authors adopt the Adam optimizer with a cosine learning‑rate schedule, apply dropout and L2 regularization, and train on mini‑batches of rolling windows.

Empirical evaluation uses two major Chinese A‑share indices—Shanghai 180 and CSI 500—covering the period 2010‑2022. The dataset includes daily closing prices, volumes, a suite of technical indicators, and institutional ownership data for every constituent. GrifFinNet is benchmarked against a range of baselines: classical ARIMA, pure LSTM, Temporal Fusion Transformer (TFT), a single‑relation GCN‑LSTM hybrid, and a multi‑relational GCN without adaptive gating. Performance is measured by MSE, mean absolute error (MAE), and portfolio‑level metrics such as Sharpe ratio and cumulative return from a simple long‑only backtest.

Across all metrics, GrifFinNet consistently outperforms the baselines. On the Shanghai 180 test set, it reduces MSE by roughly 5 % relative to TFT and improves the Sharpe ratio from 0.42 to 0.48, especially during the volatile COVID‑19 period in 2020. Ablation studies confirm that both the multi‑relational graph component and the adaptive gate contribute significantly: removing the institutional graph degrades performance by 2 %, while fixing the gate to a uniform weight reduces Sharpe by 0.03. Visualizations of gate activations reveal interpretable patterns—sector weights spike during sector‑driven rallies, while institutional weights rise when large funds shift positions, aligning with known market dynamics.

The authors acknowledge limitations: the relational graphs are limited to two handcrafted views, and the construction is static, relying on pre‑computed sector classifications and quarterly ownership filings. Moreover, experiments are confined to the Chinese market, leaving cross‑market generalization untested. Future work is outlined to incorporate additional relational sources such as supply‑chain linkages, news sentiment, and social‑media signals, as well as to develop online graph updating mechanisms that react to real‑time data. Extending the framework to multi‑task settings (e.g., simultaneous return and volatility forecasting) and evaluating on global equity universes are also proposed.

In summary, GrifFinNet demonstrates that integrating multi‑relational graph representations with a Transformer‑based temporal encoder, mediated by an adaptive gating scheme, yields a powerful and interpretable model for financial return prediction. It advances the state of the art by jointly capturing cross‑sectional dependencies and temporal patterns, offering both higher predictive accuracy and actionable insights into the underlying market forces.


📜 Original Paper Content

🚀 Synchronizing high-quality layout from 1TB storage...