This project aimed to assess the performance of attention extended LSTM and Gated Recurrent Unit models in stock price movement forecasting. The traditional models suffer from the challenges due to noisiness of financial markets, leading to incomplete specification of time dependencies in financial time series. These limitations are addressed by integrating attention mechanisms in LSTM and GRU models to allow the models to focus on specific critical time steps and features. It is shown that these enhanced models attain much improved predictive performance over their traditional counterparts. Long term dependencies and the reduction of the noise in stock price data are captured with increased model efficiency using attention mechanisms. Considering the stock data from seven major tech companies and macroeconomic indicators, the research uses the CRISP-DM methodology for system development. The study develops and tests various deep learning models in the form of traditional LSTM, GRU and attention-based variants, using data cleaning and feature engineering to preprocess the data. It is revealed by the findings that attention enhanced models outperform traditional approaches and that attention LSTM and attention GRU models achieve better performance metrics such as lower RMSE values and higher R2 values. These results reveal the potential of attention mechanisms for stock price movement forecasting as well as their impact on model generalizability and practical implications in the financial market. Future research recommendations include exploring alternative data sources, increasing the explainability of the model, and broadening the scope of predictive applications from different markets.
References
[1]
Kehinde, T.O., Khan, W.A. and Chung, S. (2023) Financial Market Forecasting Using RNN, LSTM, Bilstm, GRU and Transformer-Based Deep Learning Algorithms. Proceedings of the International Conference on Industrial Engineering and Operations Management, Detroit, USA, 10-12 October 2023, 393-403. https://doi.org/10.46254/ev01.20230037
[2]
Li, P., Wei, Y. and Yin, L. (2025) Research on Stock Price Prediction Method Based on the GAN-LSTM-Attention Model. Computers,Materials&Continua, 82, 609-625. https://doi.org/10.32604/cmc.2024.056651
[3]
Zhang, Y. and Tumibay, G.M. (2024) Stock Price Prediction Based on the Bi-Gru-Attention Model. Journal of Computer and Communications, 12, 72-85. https://doi.org/10.4236/jcc.2024.124007
[4]
Chang, V., Xu, Q.A., Chidozie, A. and Wang, H. (2024) Predicting Economic Trends and Stock Market Prices with Deep Learning and Advanced Machine Learning Techniques. Electronics, 13, 3396. https://doi.org/10.3390/electronics13173396
[5]
Li, Y., Zhang, X. and Zhu, X. (2023) Application of LSTM and Attention Mechanism for Stock Price Prediction and Analysis. In: Atlantis Highlights in Intelligent Systems, Atlantis Press International BV, 553-561. https://doi.org/10.2991/978-94-6463-222-4_60
[6]
Meena, J.K. and Banyal, R.K. (2024) Incorporating an Attention Layer in Deep Learning Models to Enhance Short-Term Stock Price Predictions. Research Square. https://www.researchsquare.com/article/rs-5241185/v1
[7]
Thach, T.T. (2025) Forecasting Stock Market Indices Using Integration of Encoder, Decoder, and Attention Mechanism. Entropy, 27, Article 82. https://doi.org/10.3390/e27010082
[8]
Chen, C., Xue, L. and Xing, W. (2023) Research on Improved Gru-Based Stock Price Prediction Method. Applied Sciences, 13, Article 8813. https://doi.org/10.3390/app13158813
[9]
Zhang, J., Ye, L. and Lai, Y. (2023) Stock Price Prediction Using CNN-Bilstm-Attention Model. Mathematics, 11, Article 1985. https://doi.org/10.3390/math11091985
[10]
Lee, M. (2022) Research on the Feasibility of Applying GRU and Attention Mechanism Combined with Technical Indicators in Stock Trading Strategies. Applied Sciences, 12, Article 1007. https://doi.org/10.3390/app12031007
[11]
Gao, Z. and Kuruoğlu, E.E. (2023) Attention Based Hybrid Parametric and Neural Network Models for Non-Stationary Time Series Prediction. Expert Systems, 41, e13419. https://doi.org/10.1111/exsy.13419
[12]
Ahmad, Z., Bao, S. and Chen, M. (2024) Deeponet-Inspired Architecture for Efficient Financial Time Series Prediction. Mathematics, 12, Article 3950. https://doi.org/10.3390/math12243950
[13]
Barua, M., Kumar, T., Raj, K. and Roy, A.M. (2024) Comparative Analysis of Deep Learning Models for Stock Price Prediction in the Indian Market. FinTech, 3, 551-568. https://doi.org/10.3390/fintech3040029
[14]
Lin, Y., Huang, Q., Zhong, Q., Li, M., Li, Y. and Ma, F. (2022) A New Attention-Based LSTM Model for Closing Stock Price Prediction. InternationalJournalofFinancialEngineering, 9, Article 2250014. https://doi.org/10.1142/s2424786322500141
[15]
Hollis, T., Viscardi, A. and Yi, S.E. (2018) A Comparison of LSTMs and Attention Mechanisms for Forecasting Financial Time Series. https://arxiv.org/abs/1812.07699
[16]
He, S. and Gu, S. (2021) Multi-Modal Attention Network for Stock Movements Prediction. https://arxiv.org/abs/2112.13593
[17]
Shi, Z., Hu, Y., Mo, G. and Wu, J. (2022) Attention-Based CNN-LSTM and XGBoost Hybrid Model for Stock Prediction. https://arxiv.org/abs/2204.02623
[18]
Zhang, X., Liang, X., Zhiyuli, A., Zhang, S., Xu, R. and Wu, B. (2019) AT-LSTM: An Attention-Based LSTM Model for Financial Time Series Prediction. IOPConferenceSeries: MaterialsScienceandEngineering, 569, Article 052037. https://doi.org/10.1088/1757-899x/569/5/052037
[19]
Gohari, H.E., Dang, X., Shah, S.Y. and Zerfos, P. (2024) Modality-Aware Transformer for Financial Time Series Forecasting. Proceedings of the 5th ACM International Conference on AI in Finance, Brooklyn, 14-17 November 2024, 677-685. https://doi.org/10.1145/3677052.3698654
[20]
Xiao, J., Deng, T. and Bi, S. (2024) Comparative Analysis of LSTM, GRU, and Transformer Models for Stock Price Prediction. https://arxiv.org/abs/2411.05790