跳到正文
arXiv (AI + Vision + Imaging)· Magnus Sesodia, Juil Sock, Philip Torr, Christian Schroeder de Witt·· 8 天前AI 评分18

循环Transformer如何逐步执行排列遍历算法:机制研究

Inside the Loop: A Mechanistic Study of Looped Transformers on Permutation Traversal

AI 导读

研究以有向排列遍历任务(从起点沿H跳到达节点,每跳均有真值)剖析循环Transformer每次迭代的计算。四层块迭代八次的循环模型在所有随机种子下均解出任务,同等有效深度的非权重共享模型则从未成功。探针与干预显示循环模型沿残差流逐跳推进、形成随迭代预算调整的阶梯,被重新定义为迭代式程序学习器。

正文 · 原文

arXiv:2610.24135v2 Announce Type: replace Abstract: Solving algorithmic tasks with many sequential steps typically requires scaling up transformer depth or chain-of-thought length, incurring unfavorable parameter and inference-compute costs, respectively. Looped transformers, which reuse one block of layers across many iterations, are poised to address this, since they scale effective depth without adding parameters or tokens. Yet, it remains unclear what each iteration is actually computing, or whether the loop merely simulates a deeper untied stack. Here, we study directed permutation traversal, in which a model follows H hops from a starting node and reports the node it reaches, so every intermediate hop has a known ground truth. We find that a minimum effective depth is necessary to solve the task, beyond which the degree of weight tying becomes the determining factor. For instance, a looped transformer with a four-layer block iterated eight times solves the task in every seed, while an identically trained untied transformer of the same effective depth never does, succeeding only with a lower learning rate or supervision of its intermediate layers. Probing and intervening on the residual stream, we find that the looped model advances through the intermediate nodes gradually, forming a staircase that adapts to its iteration budget, whereas the untied model, at that lower rate, exposes them only in its final layers. Taken together, our results recast looped transformers as iterative program learners, which allocate their iterations to successive steps of the algorithm and solve tasks that identically trained untied models of the same effective depth do not. Code is available at https://github.com/magnus-sesodia/insidetheloop.

来源:arXiv (AI + Vision + Imaging) · arxiv.org