arXiv:2410.14183stat.MLcs.LG2024-10被引 1

理论证明Transformer可实现低预测误差的上下文学习。

In-context Learning for Mixture of Linear Regressions: Existence, Generalization and Training Dynamics

  • 设计特定Transformer结构,实现$ m O( extstyle rac{ extstyle oot extstyle floor{d}}{ extstyle n})$预测误差
  • 在高信噪比下,上下文泛化误差为$ m O(L/ extstyle oot extstyle floor{B})$
  • 适用于理解自注意力机制在回归任务中的动态与性能

我们研究了Transformer在$d$维混合线性回归模型上的上下文学习能力,提供了其存在性、泛化界和训练动态的理论分析。具体而言,证明存在一个Transformer可在高信噪比(SNR)条件下以高概率达到$ m O( extstyle rac{ extstyle oot extstyle floor{d}}{ extstyle n})$的预测误差,其中$n$为训练提示规模。此外,针对两类混合情况,推导出上下文过拟合风险界为$ m O(L/ extstyle oot extstyle floor{B})$,其中$B$为训练提示数,$L$为注意力层数量;并明确刻画了$L$在不同信噪比下的依赖关系。进一步分析单层线性自注意力的训练动态,表明在适当初始化下,对总体均方损失的梯度流优化可收敛至全局最优解。大量模拟实验表明,Transformer在此任务上表现良好,可能优于其他基线方法,如期望最大化算法。

原文摘要 · Abstract (English)

We investigate the in-context learning capabilities of transformers for the $d$-dimensional mixture of linear regression model, providing theoretical insights into their existence, generalization bounds, and training dynamics. Specifically, we prove that there exists a transformer capable of achieving a prediction error of order $\mathcal{O}(\sqrt{d/n})$ with high probability, where $n$ represents the training prompt size in the high signal-to-noise ratio (SNR) regime. Moreover, we derive in-context excess risk bounds of order $\mathcal{O}(L/\sqrt{B})$ for the case of two mixtures, where $B$ denotes the number of training prompts, and $L$ represents the number of attention layers. The dependence of $L$ on the SNR is explicitly characterized, differing between low and high SNR settings. We further analyze the training dynamics of transformers with single linear self-attention layers, demonstrating that, with appropriately initialized parameters, gradient flow optimization over the population mean square loss converges to a global optimum. Extensive simulations suggest that transformers perform well on this task, potentially outperforming other baselines, such as the Expectation-Maximization algorithm.

Transformer上下文学习线性回归泛化分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。