arXiv:2601.16514cs.LGcs.AI2026-01

揭示浅层Transformer的快速收敛机制与序列长度无关的优化误差

Finite-Time Analysis of Gradient Descent for Shallow Transformers

  • 在核态下用投影梯度下降分析浅层Transformer
  • 样本量n越大所需宽度仅对数增长,序列长度T不影响优化误差
  • 适合研究Transformer理论性能或对比序列模型的读者

由于非凸优化结构,理解Transformers为何表现优异仍具挑战。本文分析了在核态下由投影梯度下降训练的具有m个独立头的浅层Transformer。主要发现:(i) 非渐近保证所需的宽度仅随样本量n对数增长;(ii) 优化误差与序列长度T无关。这与递归架构形成鲜明对比,后者优化误差可能随T指数级增长。代价是内存:为保留完整上下文,Transformer的内存需求随序列长度增加。我们在教师-学生设置中数值验证了理论结果,并在自回归任务上对比了Transformer与递归架构。

原文摘要 · Abstract (English)

Understanding why Transformers perform so well remains challenging due to their non-convex optimization landscape. In this work, we analyze a shallow Transformer with $m$ independent heads trained by projected gradient descent in the kernel regime. Our analysis reveals two main findings: (i) the width required for nonasymptotic guarantees scales only logarithmically with the sample size $n$, and (ii) the optimization error is independent of the sequence length $T$. This contrasts sharply with recurrent architectures, where the optimization error can grow exponentially with $T$. The trade-off is memory: to keep the full context, the Transformer's memory requirement grows with the sequence length. We validate our theoretical results numerically in a teacher-student setting and compare Transformers with recurrent architectures on an autoregressive task.

Transformer优化分析深度学习理论

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