A Pretrained Spatio-Temporal Hypergraph Transformer for Multi-Stock Trend Forecasting

Yuchen Wu, Liang Xie, Hongyang Wan, Haijiao Xu · Mathematics · 2025

Predicting stock trends has garnered extensive attention from investors and researchers due to its potential to optimize stock investment returns. The fluctuation of stock prices is complex and influenced by multiple factors, presenting two major challenges: the first challenge lies in the the temporal dependence of individual stocks and the spatial correlation among multiple stocks. The second challenge emerges from having insufficient historical data availability for newly listed stocks. To address these challenges, this paper proposes a spatio-temporal hypergraph transformer (STHformer). The proposed model employs a temporal encoder with an aggregation module to capture temporal patterns, utilizes self-attention to dynamically generate hyperedges, and selects cross-attention to implement hypergraph-associated convolution. Furthermore, pretraining based on reconstruction of masked sequences is implemented. This framework enhances the model’s cold-start capability, making it more adaptable to newly listed stocks with insufficient training data. Experimental results show that the proposed model, after pretraining on data from over two thousand stocks, performed well on datasets from the stock markets of the United States and China.

Read the paper · More papers on PaperTik