Macroeconomic forecasting is essential for policy formulation, risk evaluation, and investment strategy development. However, conventional econometric models like ARIMA and VAR frequently encounter difficulties with high-dimensional data, structural breaks, and long-term forecasting issues. In this research, we create and test transformer-based architectures-Autoformer, ETSformer, iTransformer, and Informer-for multi-horizon macroeconomic forecasting of important indicators such as GDP growth, CPI inflation, the unemployment rate, and policy interest rates. The models are compared to classical and deep learning baselines like ARIMA, VAR, Prophet, LSTM, and GRU using publicly available datasets from FRED, OECD, and the World Bank. Results from rolling-origin evaluation show that transformer-based models always do better than baselines over both short- and long-term periods, lowering RMSE and MAE by as much as 20-35%. Also, using attention heatmaps for interpretability analysis shows how important policy rates and commodity prices are during times of inflation. These results show that transformers are good for making real-world macroeconomic decisions because they are both accurate and clear.
T. T. Nguyen and V. J. Reddi, “Deep reinforcement learning for cyber security,” IEEE Transactions on Neural Networks and Learning Systems, vol. 34, no. 8, pp. 3779-3795, 2021.
H. Wu, J. Xu, J. Wang, and M. Long, “Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting,” Advances in Neural Information Processing Systems, vol. 34, pp. 22419-22430, 2021.
G. Woo, C. Liu, D. Sahoo, A. Kumar, and S. Hoi, “Etsformer: Exponential smoothing transformers for time-series forecasting,” arXiv preprint arXiv:2202.01381, 2022.
Y. Liu, H. Wu, J. Wang, and M. Long, “Non-stationary transformers: Exploring the stationarity in time series forecasting,” Advances in Neural Information Processing Systems, vol. 35, pp. 9881-9893, 2022.
Y. Liu, T. Hu, H. Zhang, H. Wu, S. Wang, L. Ma, and M. Long, “iTransformer: Inverted transformers are effective for time series forecasting,” arXiv preprint arXiv:2310.06625, 2023.
Y. Zhang, H. Li, and X. Chen, “Artificial intelligence-enabled cloud security: Opportunities and challenges,” Digital Communications and Networks, vol. 11, no. 2, pp. 55-66, 2025, [Online]. Available: https://doi.org/10.1016/j.dcan.2025.01.005.
L. T. Nguyen and M. Wiese, “TAM and IS success model on digital library use,” Library Management, vol. 24, no. 1-2, pp. 173-185, 2003, [Online]. Available: https://doi.org/10.1108/01435120310454592.
R. Sharma, P. Gupta, and A. Singh, “Human-computer interaction frameworks for secure digital adoption,” International Journal of Human-Computer Interaction, vol. 41, no. 7, pp. 845-862, 2025, [Online]. Available: https://doi.org/10.1080/10447318.2025.2495843.
W. Sun, Y. Wang, L. Zhang, X. H. Chen, and Y. H. Hoang, “Enhancing economic cycle forecasting based on interpretable machine learning and news narrative sentiment,” Technological Forecasting and Social Change, vol. 215, Art. no. 124094, 2025.
Z. Zhang, Y. Wang, S. Tan, B. Xia, and Y. Luo, “Enhancing transformer-based models for long sequence time series forecasting via structured matrix,” Neurocomputing, vol. 625, Art. no. 129429, 2025.
Q. Wen, T. Zhou, C. Zhang, W. Chen, Z. Ma, J. Yan, and L. Sun, “Transformers in time series: A survey,” arXiv preprint arXiv:2202.07125, 2022.
H. Zhou, S. Zhang, J. Peng, S. Zhang, J. Li, H. Xiong, and W. Zhang, “Informer: Beyond efficient transformer for long sequence time-series forecasting,” in Proc. AAAI Conf. Artificial Intelligence, vol. 35, no. 12, pp. 11106-11115, May 2021.
G. Ballarin, “Essays in time series econometrics and machine learning,” Universitaet Mannheim, Germany, 2024.
Y. Ye, X. Zhuang, C. Yi, D. Liu, and Z. Tang, “Enhancing agricultural futures return prediction: Insights from rolling VMD, economic factors, and mixed ensembles,” Agriculture, vol. 15, no. 11, Art. no. 1127, 2025.
Y. Ke, Y. Liang, Z. Shi, Z. Song, and C. Yang, “Curse of attention: A kernel-based perspective for why transformers fail to generalize on time series forecasting and beyond,” arXiv preprint arXiv:2412.06061, 2024.