Explainable Temporal Heterogeneous Graph Transformer for Stock Return Prediction
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Accurate stock return prediction remains a challenging problem in computational finance due to market volatility, nonlinear temporal behavior, and evolving relationships among financial assets. Traditional forecasting models often struggle to simultaneously capture temporal dependencies, inter-stock interactions, and heterogeneous external market signals. To address these limitations, this study proposes an Explainable Temporal Heterogeneous Graph Transformer (ETHGT) framework for stock return prediction. The proposed framework integrates temporal sequence learning, heterogeneous graph representation, technical indicators, macroeconomic variables, market indices, and financial sentiment information within a unified forecasting architecture. Dynamic correlation-based heterogeneous graphs are constructed to model evolving relationships among financial entities, while Transformer-based temporal learning is employed to capture sequential market dynamics and long-range dependencies. In addition, explainable artificial intelligence techniques, including SHAP and LIME, are incorporated to improve model interpretability and analyze the contribution of different financial variables to the prediction process. The proposed ETHGT framework is evaluated against multiple recurrent neural networks and transformer-based baseline models, including LSTM, GRU, Transformer, TFT, Informer, Autoformer, DLinear, and N-BEATS. Experimental results demonstrate that the proposed framework achieves the best forecasting performance in terms of average RMSE and average MAE across all stocks. The explainability analysis further reveals that macroeconomic indicators, lagged return features, technical indicators, and sentiment signals all contribute meaningfully to forecasting behavior. Overall, the findings suggest that integrating heterogeneous financial information, dynamic graph learning, temporal attention mechanisms, and explainable artificial intelligence can improve both the robustness and interpretability of stock return prediction models under volatile market conditions.