Lune

AAAI2026顶会

Exploring Depth Generalization in Large Language Models for Solving Recursive Logic Tasks

Zhiyuan He

摘要

Large language models have demonstrated remarkable capabilities across many tasks, yet face significant challenges when dealing with recursive reasoning problems—those requiring the resolution of nested hierarchical structures. While prior research has extensively studied length generalization (a model’s ability to handle longer sequences than seen during training), we investigate a distinct and underexplored limitation: depth generalization. Here, depth refers to the number of nested levels in a hierarchical problem, such as the layers of parentheses in a mathematical expression or the nesting of logical clauses in a Boolean formula. Our work reveals that standard transformer architectures struggle with problems involving deeper recursion than encountered during training, even when they perform well on longer but non-nested sequences. This limitation stems from their inability to maintain stack-like behavior—the capacity to track and resolve multiple levels of nested dependencies. Through systematic analysis, we demonstrate how this architectural constraint leads to rapid performance decay as the depth of recursion increases. To address this challenge, we develop a novel looped locate-and-replace pipeline that decomposes recursive problems into manageable subcomponents. The approach employs two specialized models: a locator that identifies solvable subexpressions and a replacer that evaluates these components while preserving the overall structure. We evaluate this method in three carefully designed domains—Boolean algebra, recursive arithmetic, and propositional logic—each with a controllable depth of recursion. Our results show that the proposed method effectively alleviates performance decay when tested on out-of-distribution recursion depth.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Thinking Like Transformers
  • What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 The Impact of Positional Encoding on Length Generalization in Transformers
  • What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Exploring Length Generalization in Large Language Models
  • The Impact of Positional Encoding on Length Generalization in Transformers 引用了 Thinking Like Transformers
  • The Impact of Positional Encoding on Length Generalization in Transformers 引用了 Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • The Impact of Positional Encoding on Length Generalization in Transformers 引用了 Exploring Length Generalization in Large Language Models
  • Exploring Length Generalization in Large Language Models 引用了 Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper15

  1. Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 次引用
  2. The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das 等NeurIPS 2023 · 444 次引用
  3. Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz 等NeurIPS 2022 · 267 次引用
  4. What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin 等ICLR 2024 · 189 次引用
  5. Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 次引用

相关 Paper

  1. Reasoning with Latent Thoughts: On the Power of Looped TransformersNikunj Saunshi, Nishanth Dikkala, Zhiyuan Li, Sanjiv Kumar 等ICLR 2025
  2. Looped Transformers for Length GeneralizationYing Fan, Yilun Du, Kannan Ramchandran, Kangwook LeeICLR 2025
  3. Faith and Fate: Limits of Transformers on CompositionalityNouha Dziri, Ximing Lu, Melanie Sclar, Xiang Lorraine Li 等NeurIPS 2023 · 728 次引用
  4. Inner Thinking Transformer: Leveraging Dynamic Depth Scaling to Foster Adaptive Internal ThinkingYilong Chen, Junyuan Shang, Zhenyu Zhang, Yanxi Xie 等ACL 2025
  5. Recursive Transformer: Boosting Reasoning Ability with State StackKechi Zhang, Ge Li, Jia Li, Huangzhao Zhang 等NeurIPS 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖