ReCode: Unify Plan and Action for Universal Granularity Control

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yu, Zhaoyang, Zhang, Jiayi, Su, Huixue, Zhao, Yufan, Wu, Yifan, Deng, Mingyi, Xiang, Jinyu, Lin, Yizhang, Tang, Lingxiao, Luo, Yuyu, Liu, Bang, Wu, Chenglin
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908749208223744
author Yu, Zhaoyang
Zhang, Jiayi
Su, Huixue
Zhao, Yufan
Wu, Yifan
Deng, Mingyi
Xiang, Jinyu
Lin, Yizhang
Tang, Lingxiao
Luo, Yuyu
Liu, Bang
Wu, Chenglin
author_facet Yu, Zhaoyang
Zhang, Jiayi
Su, Huixue
Zhao, Yufan
Wu, Yifan
Deng, Mingyi
Xiang, Jinyu
Lin, Yizhang
Tang, Lingxiao
Luo, Yuyu
Liu, Bang
Wu, Chenglin
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2510_23564
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle ReCode: Unify Plan and Action for Universal Granularity Control
Yu, Zhaoyang
Zhang, Jiayi
Su, Huixue
Zhao, Yufan
Wu, Yifan
Deng, Mingyi
Xiang, Jinyu
Lin, Yizhang
Tang, Lingxiao
Luo, Yuyu
Liu, Bang
Wu, Chenglin
Artificial Intelligence
Computation and Language
Machine Learning
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.
title ReCode: Unify Plan and Action for Universal Granularity Control
topic Artificial Intelligence
Computation and Language
Machine Learning
url https://arxiv.org/abs/2510.23564