2025-10-28 · 专家 · 自然语言处理 · 机器学习

ReCode: Unify Plan and Action for Universal Granularity Control

本文提出了ReCode,一种基于递归代码生成的全新范式,通过统一规划和行动在单一代码表示中实现通用粒度控制,显著提高了推理性能和训练效率。

更新于 2025-11-11。作者:Zhaoyang Yu、Jiayi Zhang、Huixue Su、Yufan Zhao、Yifan Wu、Mingyi Deng、Jinyu Xiang、Yizhang Lin、Lingxiao Tang、Yingchao Li、Yuyu Luo、Bang Liu、Chenglin Wu。

中文摘要

现实世界的任务需要在不同的粒度上进行决策,人类通过利用统一的认知表示,将规划本质理解为一种高级行动形式,在此方面表现出色。然而,基于当前大型语言模型(LLM)的智能体缺乏在决策粒度上流畅操作的关键能力。这种限制源于现有范式强制实施的严格分离高级规划和低级行动,这损害了动态适应性并限制了泛化能力。我们提出了ReCode(递归代码生成)这一新颖范式,通过在单一代码表示中统一规划和行动来解决这一限制。在这种表示中,ReCode将高级计划视为抽象占位函数,智能体随后将其递归分解成更细粒度的子函数,直到达到原始行动。这种递归方法消除了计划和行动之间的严格边界,使智能体能够动态控制其决策粒度。此外,递归结构本身生成了丰富、多粒度的训练数据,使模型能够学习分层决策过程。广泛的实验表明,ReCode在推理性能上显著超越先进基线,并在训练中表现出卓越的数据效率,验证了我们的核心洞察,即通过递归代码生成统一规划和行动是实现通用粒度控制的一种强大而有效的方法。代码可在https://github.com/FoundationAgents/ReCode找到。

英文摘要

Real-world tasks require decisions at varying granularities, and humans excel at this by leveraging a unified cognitive representation where planning is fundamentally understood as a high-level form of action. However, current Large Language Model (LLM)-based agents lack this crucial capability to operate fluidly across decision granularities. This limitation stems from existing paradigms that enforce a rigid separation between high-level planning and low-level action, which impairs dynamic adaptability and limits generalization. We propose ReCode (Recursive Code Generation), a novel paradigm that addresses this limitation by unifying planning and action within a single code representation. In this representation, ReCode treats high-level plans as abstract placeholder functions, which the agent then recursively decomposes into finer-grained sub-functions until reaching primitive actions. This recursive approach dissolves the rigid boundary between plan and action, enabling the agent to dynamically control its decision granularity. Furthermore, the recursive structure inherently generates rich, multi-granularity training data, enabling models to learn hierarchical decision-making processes. Extensive experiments show ReCode significantly surpasses advanced baselines in inference performance and demonstrates exceptional data efficiency in training, validating our core insight that unifying planning and action through recursive code generation is a powerful and effective approach to achieving universal granularity control. The code is available at https://github.com/FoundationAgents/ReCode.

解读

一句话总结

本文提出了ReCode,一种基于递归代码生成的全新范式,通过统一规划和行动在单一代码表示中实现通用粒度控制,显著提高了推理性能和训练效率。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt