Research Article

Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction

Volume: 22 Number: 1 December 24, 2025
TR EN

Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction

Abstract

The performance of learning methods and sliding window size has gained significant importance with the increasing volume of data in online time series modeling and prediction. In the literature, fixed window lengths are traditionally chosen based on prior experience, and the information of the new data is transferred to the model. However, a fixed window length is insufficient due to the dynamic nature of time series data. In this paper, a novel method for intelligent tuning of the sliding window size based on fuzzy logic is proposed to improve the online prediction performance of deep learning models. The main contributions of the study are as follows: i) The well-known stochastic gradient-descent learning with fixed window lengths were used to train the well-known LSTM, GRU, and transformer models, and their success in financial time series estimation was recorded in tables. An important comparison is provided at this stage. These tables provide us with detailed information about the performance of existing models in online time series forecasting. ii) A fuzzy logic model is proposed, and the optimal sliding window size is selected based on the performance values calculated at each sample index. With the proposed method, the size of the sliding window is tuned automatically. Fuzzy rule base is constructed based on the mean absolute error performance of offline training data. The reason for using the MAE value in offline training is that it is still desired to maintain the offline success of the model in case new data arrives. iii) The best and worst-performing models obtained with fixed window length are redesigned with fuzzy logic sliding window size, and their performances are recorded. As a result, the advantage of the proposed method on the performance of recent online LSTM, GRU, and transformer models is clearly demonstrated.

Keywords

Supporting Institution

This research did not receive any specific grant from funding agencies in the public, commercial, or nonprofit sectors.

Ethical Statement

The academic ethical rules were observed during the study.

References

  1. [1] R. J. Hyndman and G. Athanasopoulos, Forecasting: principles and practice, 3rd ed. Melbourne, Australia: OTexts, 2021.
  2. [2] S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput, vol. 9, no. 8, pp. 1735–1780, Nov. 1997, doi: 10.1162/neco.1997.9.8.1735.
  3. [3] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, 2016.
  4. [4] G. P. Zhang, “Time series forecasting using a hybrid ARIMA and neural network model,” 2003. [Online]. Available: www.elsevier.com/locate/neucom
  5. [5] A. İ. Şimşek, “Predicting Bitcoin Price: Comparative Analysis of Machine Learning and Deep Learning Models,” Savunma Bilimleri Dergisi, Apr. 2024, doi: 10.17134/khosbd.1394501.
  6. [6] C. Bulut and B. Hüdaverdi, “Hybrid Approaches in Financial Time Series Forecasting: A Stock Market Application,” Ekoist: Journal of Econometrics and Statistics, vol. 0, no. 37, pp. 53–68, Dec. 2022, doi: 10.26650/ekoist.2022.37.1108411.
  7. [7] G. Kaya Aydın, U. Aydın, and B. Ülengin, “A Comparison of Forecasting Performance of PPML and OLS estimators: The Gravity Model in the Air Cargo Market,” Ekoist: Journal of Econometrics and Statistics, vol. 0, no. 39, pp. 112–128, Dec. 2023, doi: 10.26650/ekoist.2023.39.1310639.
  8. [8] C. Tang, B. Abbatematteo, J. Hu, R. Chandra, R. Martín-Martín, and P. Stone, “Deep Reinforcement Learning for Robotics: A Survey of Real-World Successes,” 2025. [Online]. Available: https://www.arxiv.org/abs/2408.03539

Details

Primary Language

English

Subjects

Electronics, Sensors and Digital Hardware (Other)

Journal Section

Research Article

Early Pub Date

December 24, 2025

Publication Date

December 24, 2025

Submission Date

September 3, 2025

Acceptance Date

November 20, 2025

Published in Issue

Year 2026 Volume: 22 Number: 1

APA
Özen, F., Arslan, A. E., & Beyhan, S. (2026). Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction. Savunma Bilimleri Dergisi, 22(1), 97-108. https://doi.org/10.17134/khosbd.1774200
AMA
1.Özen F, Arslan AE, Beyhan S. Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction. Savunma Bilimleri Dergisi. 2026;22(1):97-108. doi:10.17134/khosbd.1774200
Chicago
Özen, Figen, Ata Eren Arslan, and Selami Beyhan. 2026. “Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction”. Savunma Bilimleri Dergisi 22 (1): 97-108. https://doi.org/10.17134/khosbd.1774200.
EndNote
Özen F, Arslan AE, Beyhan S (April 1, 2026) Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction. Savunma Bilimleri Dergisi 22 1 97–108.
IEEE
[1]F. Özen, A. E. Arslan, and S. Beyhan, “Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction”, Savunma Bilimleri Dergisi, vol. 22, no. 1, pp. 97–108, Apr. 2026, doi: 10.17134/khosbd.1774200.
ISNAD
Özen, Figen - Arslan, Ata Eren - Beyhan, Selami. “Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction”. Savunma Bilimleri Dergisi 22/1 (April 1, 2026): 97-108. https://doi.org/10.17134/khosbd.1774200.
JAMA
1.Özen F, Arslan AE, Beyhan S. Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction. Savunma Bilimleri Dergisi. 2026;22:97–108.
MLA
Özen, Figen, et al. “Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction”. Savunma Bilimleri Dergisi, vol. 22, no. 1, Apr. 2026, pp. 97-108, doi:10.17134/khosbd.1774200.
Vancouver
1.Figen Özen, Ata Eren Arslan, Selami Beyhan. Adaptive Sliding Window Size Based Sequential Learning of LSTM, GRU and Transformer Models Applied to Financial Time Series Prediction. Savunma Bilimleri Dergisi. 2026 Apr. 1;22(1):97-108. doi:10.17134/khosbd.1774200