重新思考位置编码的作用:无PE的滑动窗口Transformer仍具图灵完备性
Rethinking the Role of Positional Encoding: Sliding-Window Transformers without PE Remain Turing Complete
AI总结:
本文证明,在滑动窗口机制下,无需位置编码的Transformer仍可通过窗口演化模拟图灵完备的Post机器,从而具备通用计算能力。
摘要:
位置编码(PE)被广泛认为是Transformer处理有序序列所必需的:没有位置编码,下一个token映射在其上下文token中似乎是置换不变的。这一直觉支撑了所有先前的普适性结果,这些结果依赖位置信息来证明具有思维链的Transformer可以执行任意计算,即它们是图灵完备的。我们在与长程推理最相关的机制下重新审视这一信念,其中生成通过有限的滑动上下文窗口进行。我们的初步认识是,窗口机制本身(轻微地)打破了置换对称性。为了提炼并精确捕捉这种额外表达能力的大小,我们引入了一个抽象的自回归模型——HIST模型,其中每次更新仅依赖于恒定大小的内部状态和当前窗口内的token计数直方图。我们证明这个HIST模型是图灵完备的,通过展示窗口的演化可以揭示刚刚离开窗口的token,这足以模拟图灵完备的Post机器。然后,我们构建了一个在恒定大小token字母表上的滑动窗口Transformer,没有位置编码,并证明它可以模拟HIST模型。我们的结果表明,位置编码对于Transformer执行通用计算并非不可或缺:窗口滑动本身已经打破了置换对称性并捕获了足够的位置信息。
英文摘要:
Positional encoding (PE) is widely viewed as necessary for transformers to process ordered sequences: without them, the next-token map appears permutation-invariant in its context tokens. This intuition underlies all prior universality results, which rely on positional information to prove that transformers with chain-of-thought can perform arbitrary computation, i.e., they are Turing complete. We revisit this belief in the regime most relevant to long-form reasoning, where generation proceeds through a finite sliding context window. Our opening perception is that the window mechanism itself (mildly) breaks the permutation symmetry. To distill and precisely capture the degree of this added expressiveness, we introduce an abstract autoregressive model, the HIST model, in which each update depends only on constant-size internal state and the token-count histogram within the current window. We prove that this HIST model is Turing complete by showing that the evolution of the window can reveal the token that has just left the window, which suffices to simulate Turing-complete Post machines. We then construct a sliding-window transformer over a constant-size token alphabet, without PE, and show that it can simulate the HIST model. Our result demonstrates that positional encodings are not indispensable for transformers to perform universal computation: The window sliding itself already breaks permutation symmetry and captures sufficient positional information.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。