arXiv:2502.17416cs.CLcs.AI2025-02ICLR被引 206

用循环变压器结构实现深度推理,节省参数却性能不减。

Reasoning with Latent Thoughts: On the Power of Looped Transformers

  • 用循环堆叠k层Transformer,等效于深层非循环模型。
  • 在数学和归纳任务中,循环模型性能接近甚至超越同等深度的非循环模型。
  • 可隐式生成潜在思维链,适合需要逐步推理的任务。

大型语言模型展现出强大的推理能力,扩展规律表明参数量(尤其是深度)是关键驱动因素。本文提出更强观点:许多推理问题需要大深度而非多参数。这为循环模型在推理中的应用开辟新路径。我们发现,对于加法、p跳归纳和数学问题等合成任务,一个k层Transformer循环L次,性能几乎等同于kL层非循环模型,显著优于k层模型。理论分析表明,这类问题可通过迭代算法求解,因此循环模型能以近似最优深度有效应对。令人意外的是,这一优势也延伸至实际语言建模任务:循环模型在多个下游推理任务中表现媲美甚至优于相同总层数的非循环模型。实证分析揭示,循环与非循环模型的扩展行为均依赖其有效深度,类似思维链(CoT)推理的推理时扩展特性。进一步证明,循环模型会隐式生成潜在思维,通过T次循环可模拟T步CoT。基于此,我们揭示了推理与记忆之间的二分性,并设计出一种基于循环的正则化方法,在两类任务中均有效。

原文摘要 · Abstract (English)

Large language models have shown remarkable reasoning abilities and scaling laws suggest that large parameter count, especially along the depth axis, is the primary driver. In this work, we make a stronger claim -- many reasoning problems require a large depth but not necessarily many parameters. This unlocks a novel application of looped models for reasoning. Firstly, we show that for many synthetic reasoning problems like addition, $p$-hop induction, and math problems, a $k$-layer transformer looped $L$ times nearly matches the performance of a $kL$-layer non-looped model, and is significantly better than a $k$-layer model. This is further corroborated by theoretical results showing that many such reasoning problems can be solved via iterative algorithms, and thus, can be solved effectively using looped models with nearly optimal depth. Perhaps surprisingly, these benefits also translate to practical settings of language modeling -- on many downstream reasoning tasks, a language model with $k$-layers looped $L$ times can be competitive to, if not better than, a $kL$-layer language model. In fact, our empirical analysis reveals an intriguing phenomenon: looped and non-looped models exhibit scaling behavior that depends on their effective depth, akin to the inference-time scaling of chain-of-thought (CoT) reasoning. We further elucidate the connection to CoT reasoning by proving that looped models implicitly generate latent thoughts and can simulate $T$ steps of CoT with $T$ loops. Inspired by these findings, we also present an interesting dichotomy between reasoning and memorization, and design a looping-based regularization that is effective on both fronts.

推理循环结构变压器深度学习

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