Algorithmic reasoning requires capabilities which are most naturally understood through recurrent models of computation, like the Turing machine. However, Transformer models, while lacking recurrence, are able to perform such reasoning using far fewer layers than the number of reasoning steps. This raises the question: what solutions are these shallow and non-recurrent models finding? We investigate this question in the setting of learning automata, discrete dynamical systems naturally suited to recurrent modeling and expressing algorithmic tasks. Our theoretical results completely characterize shortcut solutions, whereby a shallow Transformer with only $o(T)$ layers can exactly replicate the computation of an automaton on an input sequence of length $T$. By representing automata using the algebraic structure of their underlying transformation semigroups, we obtain $O(\log T)$-depth simulators for all automata and $O(1)$-depth simulators for all automata whose associated groups are solvable. Empirically, we perform synthetic experiments by training Transformers to simulate a wide variety of automata, and show that shortcut solutions can be learned via standard training. We further investigate the brittleness of these solutions and propose potential mitigations.
翻译:算法推理要求通过反复计算模型(如图灵机器)最自然理解的能力。然而,变形模型虽然没有重复,但能够使用比推理步骤少得多的层数来进行这种推理。这提出了这样一个问题:这些浅度和非经常性模型发现的解决办法是什么?我们在学习自动模型、自然适合反复建模和表达算法任务的离散动态系统时调查了这个问题。我们的理论结果完全体现了捷径解决方案的特征,即一个只有$(T)的浅质变换器能够完全复制一个输入序列中的自动图解调的计算,其输入序列为$(T)美元。通过使用其基本变换半组的代数结构代表自动马塔,我们获得了用于所有自动成形模型的深度模拟器$(log T) 和 $( $) 深度模拟器( $) 用于所有与其相关组可解算的自动成像仪, 的深度模拟器都是可解算的。我们进行合成实验的,通过训练变换器模拟多种自动图解算,并显示可通过标准培训来学习捷径解决方案。