Research Article

Multi-step Stock Price Forecasting Based on an LSTM-Attention Hybrid Model

Shuheng Wang*
Xi’an Jiaotong-Liverpool University

* Corresponding author: [email protected]

Abstract

The stock price sequence has a low signal-to-noise ratio, strong nonlinearity and statistical characteristics drift over time. Once it is necessary to continuously predict multiple moments in the future, the error will continue to accumulate along the step length, making the difficulty of prediction significantly increased. In response to this problem, this paper embeds the attention mechanism into the long-term and short-term memory network to construct an LSTM-Attention hybrid model for multi-step prediction: first, LSTM encodes the timing dependence of historical sequences, and then assigns learningable weights to the hidden state of each time step through the attention layer, so as to highlight the key points that are more distinguishable for future trends. Finally, the full connection layer gives the price of several future moments at once. The experiment selects the daily frequency data of the Shanghai-Shenzhen 300 Index from 2015 to 2024 and compares it horizontally with models such as ARIMA, LSTM, GRU, CNN-LSTM and Transformer. The results show that the proposed model leads the overall accuracy of RMSE, MAE, MAPE and direction, and the root mean square error decreases by about 20% compared with the single LSTM; and with the predicted step length increases, the attention mechanism can significantly inhibit the accumulation of error. The average absolute percentage error of 10-step prediction is about 31% lower than that of LSTM, indicating that the hybrid structure has a good effect in multi-step prediction tasks.

Keywords: stock price forecasting; multi-step prediction; LSTM; attention mechanism; deep learning; time series
Published: June 23, 2026
DOI: 10.54254/2753-8818/2026.35018
Volume: TNS Vol.183
pp. 8-14
Download PDF

References

  1. Fischer T, Krauss C. Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 2018, 270(2): 654-669. https: //doi.org/10.1016/j.ejor.2017.11.054
  2. Sezer O B, Gudelek M U, Ozbayoglu A M. Financial time series forecasting with deep learning: A systematic literature review: 2005-2019. Applied Soft Computing, 2020, 90: 106181. https: //doi.org/10.1016/j.asoc.2020.106181
  3. Jiang W. Applications of deep learning in stock market prediction: Recent progress. Expert Systems with Applications, 2021, 184: 115537. https: //doi.org/10.1016/j.eswa.2021.115537
  4. Kim H Y, Won C H. Forecasting the volatility of stock price index: A hybrid model integrating LSTM with multiple GARCH-type models. Expert Systems with Applications, 2018, 103: 25-37. https: //doi.org/10.1016/j.eswa.2018.03.002
  5. Hochreiter S, Schmidhuber J. Long short-term memory. Neural Computation, 1997, 9(8): 1735-1780. https: //doi.org/10.1162/neco.1997.9.8.1735
  6. Bao W, Yue J, Rao Y. A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PLoS ONE, 2017, 12(7): e0180944. https: //doi.org/10.1371/journal.pone.0180944
  7. Lu W, Li J, Li Y, Sun A, Wang J. A CNN-LSTM-based model to forecast stock prices. Complexity, 2020, 2020: 6622927. https: //doi.org/10.1155/2020/6622927
  8. Lim B, Zohren S. Time-series forecasting with deep learning: a survey. Philosophical Transactions of the Royal Society A, 2021, 379(2194): 20200209. https: //doi.org/10.1098/rsta.2020.0209
  9. Qiu J, Wang B, Zhou C. Forecasting stock prices with long-short term memory neural network based on attention mechanism. PLoS ONE, 2020, 15(1): e0227222. https: //doi.org/10.1371/journal.pone.0227222
  10. Lu W, Li J, Wang J, Qin L. A CNN-BiLSTM-AM method for stock price prediction. Neural Computing and Applications, 2021, 33(10): 4741-4753. https: //doi.org/10.1007/s00521-020-05532-z
  11. Lin Y, Huang Q, Zhong Q, Li M, Li Y, Ma F. A new attention-based LSTM model for closing stock price prediction. International Journal of Financial Engineering, 2022, 9(3): 2250014. https: //doi.org/10.1142/S2424786322500141
  12. Zhang J, Ye L, Lai Y. Stock price prediction using CNN-BiLSTM-Attention model. Mathematics, 2023, 11(9): 1985. https: //doi.org/10.3390/math11091985
  13. Kanwal A, Lau M F, Ng S P H, Sim K Y, Chandrasekaran S. BiCuDNNLSTM-1dCNN — A hybrid deep learning-based predictive model for stock price prediction. Expert Systems with Applications, 2022, 202: 117123. https: //doi.org/10.1016/j.eswa.2022.117123
  14. Zhou H, Zhang S, Peng J, Zhang S, Li J, Xiong H, Zhang W. Informer: Beyond efficient transformer for long sequence time-series forecasting. Proceedings of the AAAI Conference on Artificial Intelligence, 2021, 35(12): 11106-11115. https: //doi.org/10.1609/aaai.v35i12.17325