arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.00479cs.LGstat.ML
收藏

内核中的幽灵:通过领域泛化实现高效Transformer的上下文学习

Ghost in the Kernel: In-Context Learning with Efficient Transformers via Domain Generalization

School of Mathematics and Statistics, University of Sydney(悉尼大学数学与统计学院)

Peilin Liu, Ding-Xuan Zhou

AI总结:

本文从领域泛化角度研究线性Transformer的近似与泛化能力,证明其通过上下文分布到响应函数的映射实现上下文学习,并基于理论提出激活函数与损失函数设计新视角。

摘要:

基于Transformer的大型模型通过利用上下文感知的注意力模块进行上下文学习,在不同任务中展现了显著的泛化能力。随着上下文更丰富,Transformer无需任何参数更新就能更有效地适应当前用例。然而,softmax Transformer中上下文长度的二次计算和内存复杂度显著拖慢了数据处理速度。线性Transformer被提出通过将复杂度降低到与上下文长度线性相关来解决此问题,但从理论角度看,线性注意力中特征映射的设计和理解仍不清楚。在本文中,我们从领域泛化的两阶段采样过程出发,研究线性Transformer的近似和泛化能力。我们证明线性Transformer执行上下文学习,即学习从上下文分布到响应函数的映射。我们的泛化分析获得了与维度无关的收敛速度,这也展示了数据分布规律性与潜在特征之间的权衡。在我们的理论框架指导下,我们提出了用于线性化预训练softmax大语言模型的激活函数和损失函数设计的新视角。

英文摘要:

Transformer-based large models have demonstrated remarkable generalization abilities across different tasks by leveraging a context-aware attention module for in-context learning. With richer context, transformers adapt more effectively to the current use case without any parameter updates. However, the quadratic computational and memory complexity with respect to context length significantly slows data processing in softmax transformers. Linear transformers were proposed to address this issue by reducing the complexity to linear dependence on context length, but the design and understanding of the feature mapping in linear attention, from a theoretical viewpoint, remain unclear. In this paper, we investigate the approximation and generalization abilities of linear transformers under a two-staged sampling process from domain generalization. We show that linear transformers perform in-context learning as learning a mapping from context distributions to response functions. A dimension-independent convergence rate is obtained for our generalization analysis, which also exhibits the tradeoff between the regularities of data distributions and latent features. Guided by our theoretical framework, we propose a new perspective on activation and loss design for linearizing pretrained softmax large language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑