Transformer 无法通过梯度下降学习简单多数逻辑,即使有大量数据也失效。
Provable Failure of Language Models in Learning Majority Boolean Logic via Gradient Descent
- 用简化 Transformer 模型在二进制输入上训练多数函数
- 训练后误差随维度指数增长,即使使用多项式梯度查询仍不收敛
- 揭示了大模型在基础逻辑推理中的优化瓶颈,适合关注理论局限的读者
尽管基于 Transformer 的模型在自然语言任务中表现优异,但其在学习基本逻辑函数方面仍存疑虑。本文研究在梯度下降训练下,Transformer 是否能真正学习简单的多数逻辑函数。考虑一个简化 Transformer 架构,在两种样本量下进行分析:n = poly(d) 与 n = exp(Ω(d)),每个样本为长度 d 的二进制串及其对应的多数函数输出。结果表明,即使经过 poly(d) 次梯度查询,模型的泛化误差仍显著偏高,且随维度 d 指数级增长。该研究揭示了基于梯度的方法在训练 Transformer 处理最基础逻辑任务时的根本性优化挑战,提供了对模型理论局限的新见解。
原文摘要 · Abstract (English)
Recent advancements in Transformer-based architectures have led to impressive breakthroughs in natural language processing tasks, with models such as GPT-4, Claude, and Gemini demonstrating human-level reasoning abilities. However, despite their high performance, concerns remain about the inherent limitations of these models, especially when it comes to learning basic logical functions. While complexity-theoretic analyses indicate that Transformers can represent simple logic functions (e.g., $\mathsf{AND}$, $\mathsf{OR}$, and majority gates) by its nature of belonging to the $\mathsf{TC}^0$ class, these results assume ideal parameter settings and do not account for the constraints imposed by gradient descent-based training methods. In this work, we investigate whether Transformers can truly learn simple majority functions when trained using gradient-based methods. We focus on a simplified variant of the Transformer architecture and consider both $n=\mathrm{poly}(d)$ and $n=\exp(Ω(d))$ number of training samples, where each sample is a $d$-size binary string paired with the output of a basic majority function. Our analysis demonstrates that even after $\mathrm{poly}(d)$ gradient queries, the generalization error of the Transformer model still remains substantially large, growing exponentially with $d$. This work highlights fundamental optimization challenges in training Transformers for the simplest logical reasoning tasks and provides new insights into their theoretical limitations.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。