arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2602.05896cs.LGcs.AI
收藏

奇偶性、敏感度与变换器

Parity, Sensitivity, and Transformers

CENIA;IPPT PAN;Queen Mary University of London(伦敦大学Queen Mary)

Alexander Kozachinskiy, Tomasz Steifer, Przemysław Wałȩga

AI总结:

本文研究了变换器计算奇偶性任务的最小层数,证明单层变换器无法解决该任务,而两层变换器可实现,并提出改进的构造方法去除不切实际的假设。

摘要:

理解神经架构能计算什么而不能计算是什么在AI理论中是一个核心挑战。在这一背景下,奇偶性任务是一个根本问题,它询问二进制输入序列中1的个数是偶数还是奇数。奇偶性是计算理论中研究的核心任务之一,但仍然令人惊讶的是,变换器在何种条件下能或不能解决它仍不清楚。本文证明变换器计算奇偶性所需的最小层数是两层。特别是,我们解决了开放问题:单层变换器能否计算奇偶性。我们通过证明单层变换器的平均敏感度增长速度比奇偶性慢而否定这一可能性。此外,我们提出了一种新的变换器构造方法,该方法改进了现有构造,通过去除若干不切实际的假设。现有的奇偶性变换器依赖于诸如长度依赖的位置编码、硬max、无正则化参数的layernorm或与因果掩码不兼容等不切实际的假设。我们证明这些假设可以去除,代价是将层数从两层增加到四层。具体来说,我们证明可以通过softmax注意力、长度无关且多项式有界的定位编码、无layernorm以及兼容因果和非因果掩码的四层变换器计算奇偶性。

英文摘要:

Understanding what neural architectures can and cannot compute is a central challenge in the theory of AI. One of the fundamental problems in this context is the PARITY task, which asks whether the number of 1s in a binary input sequence is even or odd. PARITY is one of the central tasks studied in the theory of computation, yet it remains surprisingly unclear under which conditions transformers can or cannot solve it. In this paper, we show that the minimal number of layers a transformer needs to compute PARITY is two. In particular, we solve the open problem asking whether a one-layer transformer can compute PARITY. We answer it negatively by showing that average sensitivity of a one-layer transformer grows slower than that of PARITY. Furthermore, we show a new construction for transformer that computes PARITY, which improves on the existing constructions by removing a number of impractical assumptions. In particular, the existing transformers for PARITY rely on such impractical assumptions as length-dependent positional encoding, hardmax, layernorm without a regularisation parameter, or incompatibility with causal masking. We show that these assumptions can be removed, at the cost of increasing the number of layers from two to four. Specifically, we show that PARITY can be computed by a four-layer transformer using softmax attention, length-independent and polynomially bounded positional encoding, no layernorm, and compatible with both causal and non-causal masking.

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

↑