arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.07553cs.LG
收藏

Transformer 以多项对数参数证明学习稀疏异或

Transformers Provably Learn Sparse XOR with Polylogarithmic Parameters

School of Computation, Information and Technology(计算、信息与技术学院);Technical University of Munich(慕尼黑技术大学)

Yaomengxi Han, Debarghya Ghoshdastidar

AI总结:

研究探讨了单层双头Transformer学习稀疏异或问题,证明其在多项对数参数下可有效发现特征并使损失接近零,突破了FFNN固有的参数瓶颈。

摘要:

学习稀疏奇偶函数已成为研究神经网络特征学习的理论测试床。然而,现有分析主要集中在前馈神经网络(FFNNs)上。同时,尽管Transformer在经验上表现优异且结构适合发现长序列中的稀疏支持,但在此设置下的理论理解仍有限。为填补这一空白,我们分析了单层双头Transformer如何学习稀疏异或问题。考虑样本$(\mathbf{x}, y) \in \lbrace\pm 1\rbrace^d \times \lbrace\pm 1\rbrace$,其中标签由$y = -x_{i^*} x_{j^*}$定义,对于某些未知的$i^*, j^* \in [d]$。我们证明,仅使用$O(\mathrm{polylog}(d))$可训练参数,Transformer能够成功发现相关特征,并在一次梯度步骤内使每个输入的损失接近零。这一结果表明,Transformer突破了FFNN固有的$Ω(d)$参数瓶颈。此外,我们实证显示,这种快速特征发现是由精确的softmax注意力驱动的,优于线性或逐元素注意力等常见替代方案。最后,我们提供了从有限数据学习的理论样本复杂度界,展示了Transformer在此任务中的泛化能力。

英文摘要:

Learning sparse parity functions has become a theoretical testbed for studying feature learning in neural networks. However, existing analyses primarily focus on Feed-Forward Neural Networks (FFNNs). Meanwhile, theoretical understanding of Transformers in this setting remains limited, despite their empirical success and structural suitability for discovering sparse support over long sequences. To address this gap, we analyze how a single-layer, two-head Transformer learns the sparse XOR problem. Considering samples $(\mathbf{x}, y) \in \lbrace\pm 1\rbrace^d \times \lbrace\pm 1\rbrace$, where the label is defined by $y = -x_{i^*} x_{j^*}$ for some unknown $i^*, j^* \in [d]$, we prove that, with only $O(\mathrm{polylog}(d))$ trainable parameters, Transformers can successfully discover the relevant features and drive the loss for every input to nearly 0 with one gradient step. This result establishes that Transformers break the fundamental $Ω(d)$ parameter bottleneck inherent to FFNNs for this problem. Furthermore, we empirically show that this rapid feature discovery is uniquely driven by the exact softmax attention, outperforming common substitutes such as linear or component-wise attention. Finally, we provide a theoretical sample complexity bound for learning from finite data, demonstrating the generalization ability of Transformers in this task.

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

↑