Skip to main content

Benchmarking TPU and GPU for Stock Price Forecasting Using LSTM Model Development

  • Conference paper
  • First Online:
Intelligent Computing (SAI 2023)

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 711))

Included in the following conference series:

  • 777 Accesses

Abstract

Due to the surge in annual stock debuts, it is vital to use deep learning algorithms. Deep learning requires in-depth knowledge of the technology and how to utilize it. Valuable tasks include assessing and projecting stock prices. The complexity of the uncertain behaviour of the stock market requires deploying deep learning models over several processors of competent computer hardware. This research uses TPU and GPU hardware processors and accelerators to train and assess a deep learning model employing a recurrent neural network of long-short-term memory (LSTM). This model was trained using HKEX, FTSE100, and S&P500 stock price datasets across several periods (1-year, 3-year, 5-year, and 10-year). Runtime, execution time, and evaluation metrics were used to compare results. The number of stacked layers rises as model runtime on a TPU increases. In all three situations, the TPU model was quicker at all the scenarios considered. The stock price dataset is used to train the LSTM model and create prediction with reduced root mean squared error, which indicates that GPU has a shorter runtime with near accuracy as TPU, with a more significant runtime more than ten times that of GPU on big datasets. TPU outperforms GPU in stock price predictions when trained on large datasets, whereas GPU outperforms TPU on smaller datasets. More work is needed to justify evaluating the TPU and GPU for stock price prediction using different deep-learning frameworks by adjusting the LSTM hyper-parameters and running them across more than three datasets.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 219.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 279.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Zhang, L., Wang, F., Xu, B., Chi, W., Wang, Q., Sun, T.: Prediction of stock prices based on LM-BP neural network and the estimation of overfitting point by RDCI. Neural Comput. Appl. 30(5), 1425–1444 (2017). https://doi.org/10.1007/s00521-017-3296-x

    Article  Google Scholar 

  2. Zhang, J., Cui, S., Xu, Y., Li, Q., Li, T.: A novel data-driven stock price trend prediction system. Expert Syst. Appl. 97, 60–69 (2017). https://doi.org/10.1016/j.eswa.2017.12.026

    Article  Google Scholar 

  3. Saheed, Y.K., Hambali, M.A.: Customer churn prediction in telecom sector with machine learning and information gain filter feature selection algorithms. In: 2021 International Conference on Data Analytics for Business and Industry (ICDABI), vol. 2021, pp. 208–213 (2021)

    Google Scholar 

  4. Ballings, M., Van Den Poel, D., Hespeels, N., Gryp, R.: Evaluating multiple classifiers for stock price direction prediction. Expert Syst. Appl. 42(20), 7046–7056 (2015). https://doi.org/10.1016/j.eswa.2015.05.013

    Article  Google Scholar 

  5. Roondiwala, M., Patel, H., Varma S.: Predicting Stock Prices Using LSTM. Int. J. Sci. Res. 6, 1754–1756 (2017). https://doi.org/10.21275/ART20172755

  6. Google Colaboratory (2018): Frequently Asked Questions. Accessed 21 Jun 2018. https://research.google.com/colaboratory/faq

  7. Zhang, A., Lipton, Z.C., Li, M., Smola, A.J.: Dive into Deep Learning (2019). https://d2l.ai

  8. Rainbursingh, J., Kimm, H., Kimm, H.A.: Distributed Neural Networks using TensorFlow over Multicore and Many-core Systems. In: 2019 IEEE 13th International Symposium on Embedded Multicore/Many-core Systems-on-Chip (MCSoC) (2019)

    Google Scholar 

  9. Francois Chollet, F.: Deep Learning with Python, Manning Publications (2019). https://www.manning.com

  10. Wang, Yu., Wei, G., Brooks D.: Benchmarking TPU, GPU, and CPU Platforms for Deep Learning (2019) arXiv1907:10701

    Google Scholar 

  11. Di Persio, L., Honchar, O.: Recurrent neural networks approach to the financial forecast of Google assets. Int. J. Math. Comput. Simul. 11, 7–13 (2017)

    Google Scholar 

  12. Naseer, M., Bin, T.Y.: The efficient market hypothesis: a critical review of the literature. IUP J. Financ. Risk Manag. 12(4), 48–63 (2015)

    Google Scholar 

  13. Shah, D., Campbell, W., Zulkernine, F.H.: A comparative study of LSTM and DNN for stock market forecasting. IEEE Int. Conf. Big Data (Big Data) 2018, 4148–4155 (2018). https://doi.org/10.1109/BigData.2018.8622462

    Article  Google Scholar 

  14. Neagoe, V.-E., Ciotec, A.-D., Cucu G.-S.: Deep Convolutional Neural Networks Versus Multilayer Perceptron for Financial Prediction. In: 2018 International Conference on Communications (COMM), pp. 201–206 (2018). https://doi.org/10.1109/ICComm.2018.8484751

  15. Damrongsakmethee, T., Neagoe, V.-E.: A Neural NARX approach for exchange rate forecasting. In: 2019 11th International Conference on Electronics, Computers and Artificial Intelligence (ECAI), pp. 1–6 (2019). https://doi.org/10.1109/ECAI46879.2019.9042094

  16. Nelson D., Pereira A. M., and Oliveira A.A.: Stock market’s price movement prediction with LSTM neural networks. In: International Joint Conference on Neural Networks (IJCNN 2017), pp. 1–10 (2017). https://doi.org/10.1109/IJCNN.2017.7966019

  17. Cheng, L.C., Huang, Y.H., Wu, M.-E.: Applied attention-based LSTM neural networks in stock prediction. In: 2018 IEEE International Conference on Big Data (Big Data), pp. 4716– 4718 (2018). https://doi.org/10.1109/BigData.2018.8622541

  18. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)

    Article  Google Scholar 

  19. Jhang, W.S., Gao, S.-E., Wang C.-M., Hsieh, M.-C.: Share Price Trend Prediction Using Attention with LSTM Structure. In: 20th IEEE/ACIS International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing, (SNPD 2019), pp. 208–211 (2019). https://doi.org/10.1109/SNPD.2019.8935806

  20. Fama, E.F.: Random Walks in Stock Market Prices, pp. 55–59 (1995)

    Google Scholar 

  21. Malkiel, B.G.: A Random Walk Down Wall Street. W.W. Nortin and Company (1999)

    Google Scholar 

  22. Selvin S., Vinayakumar R., Gopalakrishnan E.-A., Menon V. K., Soman K.-P.: Stock Price Prediction Using LSTM, RNN and CNNSliding Window Model. In: 2017 International Conference on Advances in Computing Comm (2017)

    Google Scholar 

  23. Althelaya K. A., El-Alfy E. S. M., Mohammed S.: Evaluation of Bidirectional LSTM for Short and Long-Term Stock Market Prediction. In: 2018 9th International Conference on Information and Communication Systems, (ICICS 2018), , vol. 2018, pp. 151–156 (2018). https://doi.org/10.1109/IACS.2018.8355458

  24. Keyan, L., Jianan, Z., Dayong, D.: Improving stock price prediction using the long short-term memory model combined with online social networks. J. Behav. Exp. Financ. 30, 100507 (2021). https://doi.org/10.1016/j.jbef.2021.100507

    Article  Google Scholar 

  25. Cen, Z., Wang, J.: Crude oil price prediction model with long short term memory deep learning based on prior knowledge data transfer. Energy 169, 160–171 (2019). https://doi.org/10.1016/j.energy.2018.12.016

    Article  Google Scholar 

  26. Kimm, H., Paik, I., Kimm, H.: Performance Comparision of TPU, GPU, CPU on Google Colaboratory Over Distributed Deep Learning. 2021 IEEE 14th International Symposium on Embedded Multicore/Many-Core Systems-on-Chip (MCSoC). Published (2021). https://doi.org/10.1109/mcsoc51149.2021.00053

  27. Wang, Y., Wang, Q., Shi, S., He, X., Tang, Z., Zhao, K., Chu, X.: Benchmarking the performance and energy efficiency of AI accelerators for AI training. In: 2020 20th IEEE/ACM International Symposium on Cluster, Cloud and Internet Computing (CCGRID), 744–751 (2020) https://doi.org/10.1109/CCGrid49817.2020.00-15

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to T. O. Kehinde .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kehinde, T.O., Chung, S.H., Chan, F.T.S. (2023). Benchmarking TPU and GPU for Stock Price Forecasting Using LSTM Model Development. In: Arai, K. (eds) Intelligent Computing. SAI 2023. Lecture Notes in Networks and Systems, vol 711. Springer, Cham. https://doi.org/10.1007/978-3-031-37717-4_20

Download citation

Publish with us

Policies and ethics