Why Do Transformers Fail to Forecast Time Series In-Context?
Preprint
Abstract
Time series forecasting (TSF) remains a challenging and largely unsolved problem in machine learning, despite significant recent efforts leveraging Large Language Models (LLMs), which predominantly rely on Transformer architectures. Empirical evidence consistently shows that even powerful Transformers often fail to outperform much simpler models, e.g., linear models, on TSF tasks; however, a rigorous theoretical understanding of this phenomenon remains limited. In this paper, we provide a theoretical analysis of Transformers' limitations for TSF through the lens of In-Context Learning (ICL) theory. Specifically, under AR($p$) data, we establish that: (1) Linear Self-Attention (LSA) models $\textit{cannot}$ achieve lower expected MSE than classical linear models for in-context forecasting; (2) as the context length approaches to infinity, LSA asymptotically recovers the optimal linear predictor; and (3) under Chain-of-Thought (CoT) style inference, predictions collapse to the mean exponentially. We empirically validate these findings through carefully designed experiments. Our theory not only sheds light on several previously underexplored phenomena but also offers practical insights for designing more effective forecasting architectures. We hope our work encourages the broader research community to revisit the fundamental theoretical limitations of TSF and to critically evaluate the direct application of increasingly sophisticated architectures without deeper scrutiny.
Keywords
All Related Versions
This publication has 12 references indexed in Scilit:
- Theoretical limitations of multi-layer Transformer2025
- The Parallelism Tradeoff: Limitations of Log-Precision TransformersTransactions of the Association for Computational Linguistics, 2023
- Large Language Models Are Zero-Shot Time Series Forecasters2023
- Visual Instruction Tuning2023
- Transformers learn to implement preconditioned gradient descent for in-context learning2023
- What Can Transformers Learn In-Context? a Case Study of Simple Function Classes2022
- Machine learning advances for time series forecastingJournal of Economic Surveys, 2021
- Neural tangent kernel: convergence and generalization in neural networks (invited paper)2021
- Time Series Analysis, Forecasting, and ControlTechnometrics, 1995
- On a Formula for the Product-Moment Coefficient of any Order of a Normal Frequency Distribution in any Number of VariablesBiometrika, 1918