证明Transformer能用少量示例实现高效任务学习
Transformers Meet In-Context Learning: A Universal Approximation Theory
- 将函数逼近理论与Transformer结构结合,构建可泛化任务的模型
- 仅用少量带噪示例,即可实现接近最优的预测风险
- 适用于非凸问题,对研究人员和算法设计者价值高
大型语言模型具备上下文学习能力,即在测试时仅通过少量输入-输出示例即可完成新任务,无需参数更新。本文建立通用逼近理论,揭示Transformer如何实现上下文学习。针对一类通用函数(每类代表一个任务),我们证明可构造一个Transformer,在不进行任何权重更新的情况下,基于少量噪声示例实现几乎无风险的预测。不同于以往将Transformer视为优化算法(如梯度下降)的近似器,本工作融合Barron的通用函数逼近理论与算法近似视角,获得不受被模仿优化算法有效性限制的逼近保证,显著扩展至非凸问题(如线性回归之外)。关键在于:(i) 任意目标函数可在一组通用特征上近似为小ℓ₁范数的线性组合;(ii) 可构造Transformer在测试时找出该线性表示——类似于求解Lasso。
原文摘要 · Abstract (English)
Large language models are capable of in-context learning, the ability to perform new tasks at test time using a handful of input-output examples, without parameter updates. We develop a universal approximation theory to elucidate how transformers enable in-context learning. For a general class of functions (each representing a distinct task), we demonstrate how to construct a transformer that, without any further weight updates, can predict based on a few noisy in-context examples with vanishingly small risk. Unlike prior work that frames transformers as approximators of optimization algorithms (e.g., gradient descent) for statistical learning tasks, we integrate Barron's universal function approximation theory with the algorithm approximator viewpoint. Our approach yields approximation guarantees that are not constrained by the effectiveness of the optimization algorithms being mimicked, extending far beyond convex problems like linear regression. The key is to show that (i) any target function can be nearly linearly represented, with small $\ell_1$-norm, over a set of universal features, and (ii) a transformer can be constructed to find the linear representation -- akin to solving Lasso -- at test time.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。