研究变压器如何从易到难数据中学习复合函数,揭示了训练数据分布的关键作用。
Learning Compositional Functions with Transformers from Easy-to-Hard Data
- 用渐进难度的课程学习策略训练深层Transformer
- 梯度下降可在k次复合任务中实现多项式复杂度的学习
- 证明了仅靠简单样本无法有效学习,需包含难样本
基于Transformer的语言模型在多种复杂推理任务中表现优异。已有理论表明,Transformer能高效完成涉及并行计算的多步推理任务,但其学习性——特别是梯度优化下高效学习所需的样本分布条件——仍不明确。本文研究k重复合任务,该任务需计算k个输入排列与k个隐藏排列的交错复合,可用O(log k)层Transformer表达。负面结果:我们证明了任何仅进行多项式次数统计查询的统计查询(SQ)学习器,必须有指数于k的样本量,建立了统计-计算差距。正面结果:我们展示通过两种课程学习策略——按难度递增提供k'≤k的复合函数,或同时呈现所有组合——可使O(log k)深度的Transformer以多项式时间与样本复杂度成功学习。本工作揭示了训练数据中同时包含简单与复杂样本对学习复杂组合任务的必要性与充分性。
原文摘要 · Abstract (English)
Transformer-based language models have demonstrated impressive capabilities across a range of complex reasoning tasks. Prior theoretical work exploring the expressive power of transformers has shown that they can efficiently perform multi-step reasoning tasks involving parallelizable computations. However, the learnability of such constructions, particularly the conditions on the data distribution that enable efficient learning via gradient-based optimization, remains an open question. Towards answering this question, in this work we study the learnability of the $k$-fold composition task, which requires computing an interleaved composition of $k$ input permutations and $k$ hidden permutations, and can be expressed by a transformer with $O(\log k)$ layers. On the negative front, we prove a Statistical Query (SQ) lower bound showing that any SQ learner that makes only polynomially-many queries to an SQ oracle for the $k$-fold composition task distribution must have sample size exponential in $k$, thus establishing a statistical-computational gap. On the other hand, we show that this function class can be efficiently learned, with runtime and sample complexity polynomial in $k$, by gradient descent on an $O(\log k)$-depth transformer via two different curriculum learning strategies: one in which data consists of $k'$-fold composition functions with $k' \le k$ presented in increasing difficulty, and another in which all such data is presented simultaneously. Our work sheds light on the necessity and sufficiency of having both easy and hard examples in the data distribution for transformers to learn complex compositional tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。