arXiv:2410.10101cs.LGcs.AI2024-10NeurIPS被引 7

证明了线性注意力Transformer可在多项式时间内学习,实现高效泛化。

Learning Linear Attention in Polynomial Time

  • 将线性注意力视为再生核希尔伯特空间中的线性预测器
  • 任意经验风险最小化解等价于生成数据的线性Transformer
  • 适用于学习有限自动机、关联记忆等可计算任务

以往研究探讨了Transformer在模拟布尔电路或图灵机方面的计算表达能力,但其从观测数据中可学习性仍悬而未决。本文首次给出了单层线性注意力Transformer的多项式时间可学习性结果(具体为强、广义PAC学习)。我们证明线性注意力可视为在特定定义的再生核希尔伯特空间(RKHS)中的线性预测器,从而将学习问题转化为在扩展特征空间中学习普通线性预测器,并可逆映射回多头线性Transformer。在泛化方面,我们展示了如何高效识别使得所有经验风险最小化解均等价于生成模型(至平凡对称性)的训练数据集,确保模型对所有输入正确泛化。我们还提供了线性注意力可表达且多项式时间可学习的计算示例,包括关联记忆、有限自动机及具有多项式有界计算历史的通用图灵机(UTM)类。我们在三个任务上验证理论:学习随机线性注意力网络、键值关联与有限自动机执行。研究弥合了Transformer理论表达力与可学习性之间的关键鸿沟,表明灵活通用的计算模型可被高效学习。

原文摘要 · Abstract (English)

Previous research has explored the computational expressivity of Transformer models in simulating Boolean circuits or Turing machines. However, the learnability of these simulators from observational data has remained an open question. Our study addresses this gap by providing the first polynomial-time learnability results (specifically strong, agnostic PAC learning) for single-layer Transformers with linear attention. We show that linear attention may be viewed as a linear predictor in a suitably defined RKHS. As a consequence, the problem of learning any linear transformer may be converted into the problem of learning an ordinary linear predictor in an expanded feature space, and any such predictor may be converted back into a multiheaded linear transformer. Moving to generalization, we show how to efficiently identify training datasets for which every empirical risk minimizer is equivalent (up to trivial symmetries) to the linear Transformer that generated the data, thereby guaranteeing the learned model will correctly generalize across all inputs. Finally, we provide examples of computations expressible via linear attention and therefore polynomial-time learnable, including associative memories, finite automata, and a class of Universal Turing Machine (UTMs) with polynomially bounded computation histories. We empirically validate our theoretical findings on three tasks: learning random linear attention networks, key--value associations, and learning to execute finite automata. Our findings bridge a critical gap between theoretical expressivity and learnability of Transformers, and show that flexible and general models of computation are efficiently learnable.

Transformer线性注意力可学习性泛化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。