arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.02677cs.AI
收藏

探索大型语言模型在解决递归逻辑任务中的深度泛化能力

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

Zhiyuan He(He)

Zhiyuan He

AI总结:

本研究提出了一种循环定位和替换流程,用于解决大型语言模型在递归逻辑任务中的深度泛化问题,通过分解递归问题并利用两个专门模型提升性能。

摘要:

大型语言模型在许多任务上展示了显著的能力,但在处理需要解决嵌套层次结构的递归推理问题时面临重大挑战。尽管先前研究广泛研究了长度泛化(模型处理比训练时更长序列的能力),我们探讨了一个不同的且尚未被广泛研究的限制:深度泛化。这里,深度指的是层次问题中的嵌套层级数,例如数学表达式中的括号层次或布尔公式中逻辑子句的嵌套。我们的工作揭示了标准变压器架构在处理比训练时更深的递归问题时遇到困难,即使它们在处理更长但非嵌套的序列时表现良好。这种限制源于它们无法维持栈式行为,即跟踪和解决多个嵌套层级依赖的能力。通过系统分析,我们展示了这种架构限制如何导致递归深度增加时性能迅速下降。为了解决这一挑战,我们开发了一种新的循环定位和替换流程,将递归问题分解为可管理的子组件。该方法使用两个专门的模型:一个定位器用于识别可解的子表达式,一个替换器用于评估这些组件同时保持整体结构。我们在三个精心设计的领域中评估了这种方法:布尔代数、递归算术和命题逻辑,每个领域都有可控的递归深度。我们显示,我们的方法在测试非分布递归深度时有效缓解了性能下降。

英文摘要:

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 the 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 evaluated this method in three carefully designed domains: Boolean algebra, recursive arithmetic, and propositional logic, each with a controllable depth of recursion. We show that our method effectively alleviates the performance decay when tested on out-of-distribution recursion depth.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑