arXiv:2409.09239cs.CLcs.AI2024-09被引 16

揭示自回归模型如何通过思维链模拟循环计算,提升推理能力

Autoregressive + Chain of Thought = Recurrent: Recurrence's Role in Language Models' Computability and a Revisit of Recurrent Transformer

  • 用思维链(CoT)逼近循环结构,弥补Transformer的计算短板
  • 实验证明该方法显著提升计数、字符串反转等任务表现
  • 为设计更强大的语言模型提供理论依据,适合模型架构研究者

Transformer架构在多种语言建模任务中表现优异,部分原因在于其去除了循环连接,实现了并行训练和更平滑的梯度流动。然而,这种脱离循环结构的设计使Transformer处于乔姆斯基计算层级的较低位置,限制了其计算能力。因此,即使先进的Transformer模型在计数、字符串反转和乘法等任务上仍面临巨大挑战。与此同时,'思维链'(Chain of Thought, CoT)提示方法使基于Transformer的语言模型能够解决此前无法完成或表现不佳的任务。本文深入研究循环结构对神经模型推理能力与可计算性的影响,对比自回归机制在计算能力中的作用。我们揭示了CoT方法如何模拟循环计算,并在自回归与循环之间架起桥梁。正是这种近似的循环行为显著提升了模型性能与计算能力。此外,我们重新审视近期基于循环的Transformer模型设计,通过提出的'循环完备性'概念评估其计算能力,指出了Linear Transformer和RWKV等模型的关键理论局限。本研究旨在为神经网络架构提供洞见,推动更优模型设计。

原文摘要 · Abstract (English)

The Transformer architecture excels in a variety of language modeling tasks, outperforming traditional neural architectures such as RNN and LSTM. This is partially due to its elimination of recurrent connections, which allows for parallel training and a smoother flow of gradients. However, this move away from recurrent structures places the Transformer model at the lower end of Chomsky's computational hierarchy, imposing limitations on its computational abilities. Consequently, even advanced Transformer-based models face considerable difficulties in tasks like counting, string reversal, and multiplication. These tasks, though seemingly elementary, require a level of computational complexity that exceeds the capabilities of the Transformer architecture. Concurrently, the emergence of ``Chain of Thought" (CoT) prompting has enabled Transformer-based language models to tackle tasks that were previously impossible or poorly executed. In this work, we thoroughly investigate the influence of recurrent structures in neural models on their reasoning abilities and computability, contrasting the role autoregression plays in the neural models' computational power. We then shed light on how the CoT approach can mimic recurrent computation and act as a bridge between autoregression and recurrence in the context of language models. It is this approximated recurrence that notably improves the model's performance and computational capacity. Moreover, we revisit recent recurrent-based Transformer model designs, focusing on their computational abilities through our proposed concept of ``recurrence-completeness" and identify key theoretical limitations in models like Linear Transformer and RWKV. Through this, we aim to provide insight into the neural model architectures and prompt better model design.

语言模型思维链计算能力Transformer

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。