预训练Transformer能高效学习低维目标函数,优于直接用上下文数据训练。
Pretrained transformer efficiently learns low-dimensional target functions in-context
- 利用非线性MLP层的Transformer通过梯度下降学习单指数函数类。
- 上下文学习所需提示长度仅依赖于函数类的低维结构维度r,不随高维d增长。
- 适用于低维结构显著的场景,如高维但本质简单的函数建模任务。
Transformer能从示例演示中高效实现上下文学习(ICL)。现有理论多关注线性函数类,表明预训练损失最小化等价于对最小二乘目标执行一步梯度下降,但该设定无法体现ICL的统计效率,因预训练模型性能不及直接求解线性回归。本文研究含非线性MLP层的Transformer在非线性函数类上的ICL能力:针对形式为 $f_*(\boldsymbol{x}) = σ_*(\langle\boldsymbol{x},\boldsymbolβ\rangle)$ 的单指数目标函数,其中索引特征 $\boldsymbolβ$ 位于 $r$ 维子空间,我们证明经梯度下降优化的Transformer,其预训练样本复杂度依赖于链接函数 $σ_*$ 的信息指数,可在仅依赖 $r$ 的提示长度下实现高效上下文学习;而直接在测试提示上学习的算法,其统计复杂度随环境维度 $d$ 增长。结果凸显了预训练Transformer对函数类低维结构的自适应能力,使其能实现超越仅访问上下文数据的估计器的样本效率。
原文摘要 · Abstract (English)
Transformers can efficiently learn in-context from example demonstrations. Most existing theoretical analyses studied the in-context learning (ICL) ability of transformers for linear function classes, where it is typically shown that the minimizer of the pretraining loss implements one gradient descent step on the least squares objective. However, this simplified linear setting arguably does not demonstrate the statistical efficiency of ICL, since the pretrained transformer does not outperform directly solving linear regression on the test prompt. In this paper, we study ICL of a nonlinear function class via transformer with nonlinear MLP layer: given a class of \textit{single-index} target functions $f_*(\boldsymbol{x}) = σ_*(\langle\boldsymbol{x},\boldsymbolβ\rangle)$, where the index features $\boldsymbolβ\in\mathbb{R}^d$ are drawn from a $r$-dimensional subspace, we show that a nonlinear transformer optimized by gradient descent (with a pretraining sample complexity that depends on the \textit{information exponent} of the link functions $σ_*$) learns $f_*$ in-context with a prompt length that only depends on the dimension of the distribution of target functions $r$; in contrast, any algorithm that directly learns $f_*$ on test prompt yields a statistical complexity that scales with the ambient dimension $d$. Our result highlights the adaptivity of the pretrained transformer to low-dimensional structures of the function class, which enables sample-efficient ICL that outperforms estimators that only have access to the in-context data.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。