ReCode: 범용 세분성 제어를 위한 계획과 실행의 통합
ReCode: Unify Plan and Action for Universal Granularity Control
October 27, 2025
저자: 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
cs.AI
초록
실제 세계의 과제는 다양한 세분화 수준에서의 의사 결정을 요구하며, 인간은 계획이 근본적으로 높은 수준의 행동으로 이해되는 통합된 인지 표현을 활용함으로써 이에 탁월하게 대처합니다. 그러나 현재의 대규모 언어 모델(LLM) 기반 에이전트는 의사 결정 세분화 수준을 유연하게 넘나드는 이 중요한 능력이 부족합니다. 이러한 한계는 높은 수준의 계획과 낮은 수준의 행동을 엄격하게 분리하는 기존 패러다임에서 비롯되며, 이는 동적 적응성을 저해하고 일반화를 제한합니다. 우리는 이러한 한계를 해결하기 위한 새로운 패러다임인 ReCode(Recursive Code Generation)를 제안합니다. ReCode는 단일 코드 표현 내에서 계획과 행동을 통합합니다. 이 표현에서 ReCode는 높은 수준의 계획을 추상적인 플레이스홀더 함수로 취급하며, 에이전트는 이를 기본 행동에 도달할 때까지 더 세분화된 하위 함수로 재귀적으로 분해합니다. 이 재귀적 접근법은 계획과 행동 사이의 경계를 허물어 에이전트가 의사 결정의 세분화 수준을 동적으로 제어할 수 있게 합니다. 더 나아가, 재귀적 구조는 본질적으로 풍부한 다중 세분화 수준의 훈련 데이터를 생성하여 모델이 계층적 의사 결정 과정을 학습할 수 있게 합니다. 광범위한 실험을 통해 ReCode가 추론 성능에서 선진 베이스라인을 크게 능가하며 훈련에서도 탁월한 데이터 효율성을 보여줌으로써, 재귀적 코드 생성을 통한 계획과 행동의 통합이 보편적인 세분화 제어를 달성하는 강력하고 효과적인 접근법이라는 우리의 핵심 통찰을 입증했습니다. 코드는 https://github.com/FoundationAgents/ReCode에서 확인할 수 있습니다.
English
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.