为什么Transformer在上下文时间序列预测中失败? Why Do Transformers Fail to Forecast Time Series In-Context? 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2025-10-10
👁️ 预览文献
💡 AI 中文简介
这篇论文从上下文学习理论角度,分析了Transformer在时间序列预测中为何常不如简单线性模型。研究基于AR(p)数据证明:线性自注意力模型的预测误差无法低于经典线性模型;当上下文长度趋于无穷时,它只能渐近恢复最优线性预测器;而使用思维链推理时,预测会指数级坍缩到均值。实验验证了这些理论,为设计更有效的预测架构提供了启示。
领域机器学习 / 时间序列预测
适合谁读需要一定专业背景(机器学习、时间序列分析基础)
核心贡献首次从上下文学习理论严格证明Transformer在时间序列预测中的局限性;揭示思维链推理导致预测坍缩到均值的现象。
关键数据线性自注意力模型无法低于经典线性模型的期望MSE;上下文长度趋于无穷时渐近恢复最优线性预测器;思维链推理下预测指数级坍缩到均值。
推荐理由如果你好奇为什么强大的Transformer在时间序列预测上打不过简单线性模型,这篇理论文章给出了严谨的答案,值得一读。
关键词["时间序列预测", "Transformer", "上下文学习", "线性自注意力", "思维链", "理论分析"]

原文摘要

查看英文原文摘要

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.