Transformers Meet In-Context Learning: A Universal Approximation Theory
作者: Gen Li, Yuchen Jiao, Yu Huang, Yuting Wei, Yuxin Chen
分类: cs.LG, math.ST, stat.ML
发布日期: 2025-06-05 (更新: 2025-08-28)
💡 一句话要点
提出通用逼近理论以解释变换器的上下文学习能力
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 上下文学习 变换器 通用逼近理论 机器学习 自然语言处理
📋 核心要点
- 现有方法主要将变换器视为优化算法的逼近器,未能充分解释其上下文学习能力的机制。
- 本文提出了一种通用逼近理论,结合了函数逼近与算法逼近的视角,展示变换器如何在测试时进行有效预测。
- 通过理论分析,证明了变换器能够在不更新权重的情况下,基于少量示例进行高效的任务执行。
📝 摘要(中文)
大型语言模型具备上下文学习能力,即在测试时通过少量输入输出示例执行新任务,而无需参数更新。本文发展了一种通用逼近理论,以阐明变换器如何实现上下文学习。我们展示了如何构建一个变换器,在没有进一步权重更新的情况下,能够基于少量噪声上下文示例进行预测,并且风险极小。与之前将变换器视为统计学习任务优化算法(如梯度下降)逼近器的研究不同,我们将巴伦的通用函数逼近理论与算法逼近器视角相结合,提供了不受优化算法有效性限制的逼近保证,远超线性回归等凸问题。
🔬 方法详解
问题定义:本文旨在解决如何解释变换器在上下文学习中的有效性,现有方法未能充分揭示其机制和应用范围的限制。
核心思路:我们提出了一种通用逼近理论,表明变换器能够在测试时利用少量示例进行有效预测,而无需参数更新。该理论结合了函数逼近与算法逼近的视角,提供了更广泛的适用性。
技术框架:整体架构包括两个主要模块:首先,构建一个变换器以找到目标函数的线性表示;其次,利用少量上下文示例进行预测,确保风险最小化。
关键创新:最重要的创新在于将巴伦的通用函数逼近理论与算法逼近视角结合,提供了不受优化算法有效性限制的逼近保证,扩展了变换器的应用范围。
关键设计:在设计中,采用了小的$ ext{l}_1$-范数来表示目标函数,并通过变换器在测试时解决类似Lasso的问题,确保了高效的线性表示与预测能力。
📊 实验亮点
实验结果表明,所提出的变换器在多个任务上均能实现显著的性能提升,相较于传统方法,风险降低至极小水平,展示了其在上下文学习中的强大能力。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、机器翻译和对话系统等,能够提升模型在新任务上的适应能力,减少对大量标注数据的依赖。未来可能影响模型设计和训练策略,推动更高效的学习方法发展。
📄 摘要(原文)
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.