提出线性Transformer的理论框架,提升上下文学习效率与泛化能力。
Ghost in the Kernel: In-Context Learning with Efficient Transformers via Domain Generalization

- 基于领域泛化分析线性Transformer的上下文学习机制
- 获得与维度无关的泛化收敛速率,揭示数据与特征规律的权衡
- 指导设计激活函数和损失函数,实现预训练模型高效线性化
基于Transformer的大模型通过上下文感知注意力模块,在无需参数更新的情况下,利用丰富上下文有效适应当前任务,展现出卓越的泛化能力。然而,传统softmax Transformer的计算与内存复杂度随上下文长度呈二次增长,严重限制了数据处理速度。线性Transformer通过将复杂度降至线性,缓解了这一问题,但其特征映射的设计与理论理解仍不清晰。本文在领域泛化框架下,研究线性Transformer在双阶段采样过程中的近似与泛化能力,发现其本质是学习从上下文分布到响应函数的映射。我们建立了与维度无关的泛化收敛率,揭示了数据分布规律性与潜在特征规律性之间的权衡关系。基于此理论框架,我们提出了针对激活函数与损失函数的新设计思路,推动预训练softmax大语言模型的高效线性化。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。