Comparative Study of LSTM and Transformer for A-Share Stock Price Prediction
- DOI
- 10.2991/978-94-6463-222-4_7How to use a DOI?
- Keywords
- Transformer; LSTM; A-share; stock prediction
- Abstract
Forecasting stock prices in capital markets holds great significance for the economic development and social stability of a country, necessitating a robust predictive model. This study presents a comprehensive comparison between Long Short-Term Memory (LSTM) and Transformer neural network architectures for predicting A-share stock prices in the Chinese capital market. Although both LSTM and Transformer have demonstrated success in various applications, research comparing their performance in stock price prediction remains limited. In this paper, we employ both LSTM and Transformer models on daily and minute frequency data to predict the closing prices of the Shanghai Composite Index. Our findings indicate that although LSTM outperforms Transformer in terms of Mean Absolute Error and Mean Squared Error, it tends to simplify the problem by falling into the trap of autocorrelation. Conversely, Transformer learns unique dependencies, demonstrating potential for capturing the internal relationships of securities price changes. Our results suggest that Transformer is a more promising model for stock price prediction, as its self-attention mechanism may provide valuable insights to investors, financial practitioners, and fund managers. This study not only contributes to the existing literature on stock price prediction but also serves as a foundation for future research in the Chinese capital market, benefiting researchers and practitioners in finance, economics, and machine learning.
- Copyright
- © 2023 The Author(s)
- Open Access
- Open Access This chapter is licensed under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/), which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
Cite this article
TY - CONF AU - Zhuoran Lin PY - 2023 DA - 2023/08/28 TI - Comparative Study of LSTM and Transformer for A-Share Stock Price Prediction BT - Proceedings of the 2023 2nd International Conference on Artificial Intelligence, Internet and Digital Economy (ICAID 2023) PB - Atlantis Press SP - 72 EP - 82 SN - 2589-4919 UR - https://doi.org/10.2991/978-94-6463-222-4_7 DO - 10.2991/978-94-6463-222-4_7 ID - Lin2023 ER -