arXiv:2505.24531cs.LG2025-05

证明了带softmax注意力的Transformer在双曲空间中可统一一致地做回归。

Transformers Are Universally Consistent

  • 在双曲空间中用softmax注意力实现稳定函数回归
  • 误差随输入长度增加以O(t^(-1/2d))速率下降
  • 适用于真实数据,对连续与类别变量都有效

尽管Transformers在基础模型和大规模语言建模中扮演核心角色,但其理论基础仍不完全清楚。现有研究多聚焦于语言理解与上下文学习能力,常基于线性注意力等理想假设。最初用于序列到序列转换的Transformer,是否能稳健地对输入序列执行函数回归仍是未解问题,尤其在现实数据分布具有非欧几里得几何特征时更为关键。本文证明:当输入和输出嵌入在双曲空间中时,使用softmax非线性注意力的Transformer在执行普通最小二乘(OLS)回归任务时具有统一一致性。我们推导出经验误差的确定性上界,在渐近情况下以$\mathcal{O}(t^{-1/2d})$的速率衰减,其中$t$为输入标记数,$d$为嵌入维度。值得注意的是,该分析涵盖欧氏空间作为特例,恢复了基于数据流形内在维度的类似收敛保证。这些理论发现通过在包含连续与类别响应变量的真实数据集上的实证评估得到验证。

原文摘要 · Abstract (English)

Despite their central role in the success of foundational models and large-scale language modeling, the theoretical foundations governing the operation of Transformers remain only partially understood. Contemporary research has largely focused on their representational capacity for language comprehension and their prowess in in-context learning, frequently under idealized assumptions such as linearized attention mechanisms. Initially conceived to model sequence-to-sequence transformations, a fundamental and unresolved question is whether Transformers can robustly perform functional regression over sequences of input tokens. This question assumes heightened importance given the inherently non-Euclidean geometry underlying real-world data distributions. In this work, we establish that Transformers equipped with softmax-based nonlinear attention are uniformly consistent when tasked with executing Ordinary Least Squares (OLS) regression, provided both the inputs and outputs are embedded in hyperbolic space. We derive deterministic upper bounds on the empirical error which, in the asymptotic regime, decay at a provable rate of $\mathcal{O}(t^{-1/2d})$, where $t$ denotes the number of input tokens and $d$ the embedding dimensionality. Notably, our analysis subsumes the Euclidean setting as a special case, recovering analogous convergence guarantees parameterized by the intrinsic dimensionality of the data manifold. These theoretical insights are corroborated through empirical evaluations on real-world datasets involving both continuous and categorical response variables.

Transformer函数回归双曲空间一致性

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