ReCAP: Recursive Context-Aware Reasoning and Planning with Language Models
Zhenyu Zhang, Tianyi Chen, Weiran Xu, Alex Pentland, Jiaxin Pei
While large language models (LLMs) have shown exceptional capabilities in a wide range of tasks, long-horizon tasks that require continuous multi-step reasoning and planning remain challenging. We propose ReCAP (Recursive Context-Aware Reasoning and Planning), a hierarchical framework that integrates recursive subtask decomposition, task execution, and observation-driven plan revision. At the core of ReCAP is a dynamic context tree that tracks the evolving task hierarchy, reasoning trajectory, and environment feedback. This structured reasoning process allows the system to recursively generate and execute subtasks and to return to higher-level goals upon subtask completion or failure.  Experimental results show that ReCAP significantly improves success rates and subgoal alignment across various long-horizon reasoning tasks.