Title: ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents
Venue: NeurIPS 2025
Accepted: yes
Keywords: Large Language Model

Long-Horizon Reasoning

LLM Agent

LLM Reasoning
Abstract: Long-horizon tasks requiring multi-step reasoning and dynamic re-planning remain challenging for large language models (LLMs). Sequential prompting methods are prone to context drift, loss of goal information, and recurrent failure cycles, while hierarchical prompting methods often weaken cross-level continuity or incur substantial runtime overhead. We introduce ReCAP (Recursive Context-Aware Reasoning and Planning), a hierarchical framework with shared context for reasoning and planning in LLMs. ReCAP combines three key mechanisms: (i) plan-ahead decomposition, in which the model generates a full subtask list, executes the first item, and refines the remainder; (ii) structured re-injection of parent plans, maintaining consistent multi-level context during recursive return; and (iii) memory-efficient execution, bounding the active prompt so costs scale linearly with task depth. Together these mechanisms align high-level goals with low-level actions, reduce redundant prompting, and preserve coherent context updates across recursion. Experiments demonstrate that ReCAP substantially improves subgoal alignment and success rates on various long-horizon reasoning benchmarks, achieving a 32\% gain on synchronous Robotouille and a 29\% improvement on asynchronous Robotouille under the strict pass@1 protocol.


Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper presents a novel approach for real-time planning with LLMs. The novelty relies on the use of an LLM to decompose problems into subtasks recursively until reaching primitive actions, while maintaining the decomposition tree with contextual information to interleave planning and execution.\n\nThe approach is tested over three problems, Robotouille, ALFworld and FEVER, and it is shown to improve performance over problems with long planning requirements and a concurrent goals.\n\nSTRENGTHS AND WEAKNESSES:\n# Quality\n\nThe paper provides a sound algorithm describing the high level procedure followed to recursively decompose the problem and maintain the relevant data in each node. The experimental design is clearly presented, and the results are discussed in detail. \n\nThat said, a few experiments were missing in order to understand the complexity of the tasks and the context tree. No results are provided in terms of the number of backtracks, the number of LLM calls, or the size of the resulting context trees as a function of plan legth. See questions below.\n\n# Clarity\n\nThe paper is accessible and easy to follow at a high level. Certain sections would require more formal or precise definitions. For example, the setup for interleaving planning and execution is not clearly defined. I couldn’t understand how much time is allowed for each phase, or if this depends on the duration of the action execution. I couldn’t tell either if backtracking meant real backtracking in the environment, or backtracking  as in changing the chosen subtask or planned next action. This became clear in the experimental section, but not while reading about the method. In general, I would recommend adding text about how the problems are described and how prompts are designed. \n\nIn general, superlatives can be misleading. Stating that the results of LLMs using ReAct are “impressive” (line 26), over complex sequential reasoning is not well defined and contradictory. It is contradictory because the experimental results in this paper show that ReAct is not impressive over tasks with more than 10 actions. It is not clear either with respect to which measure or other computational approaches is the performance impressive. The adjective “complex” is ambiguous at this stage of the paper. What makes a problem to be “complex” is not a trivial statement. \n\nMinor comments:\n\n- Figure 1 is not referenced in the text, and it is not self-explainable. I don’t understand what the colours mean.\n- Add reference to the algorithm lines when describing it in section 2.3 and 2.4.\n- One shot example is referenced for the first time in line 128, but no context is provided to understand how is it used. This is partially due to the fact that the prompt structure is not provided.\n- extra dot (line 171)\n- Line 197-198 is repeated (see line 131)\n- Figure 3 does not add much with respect to the textual explanation, which does a great job already. It can be removed to make space for some of the experiments needed to answer the questions below.\n- It is unclear what does stale reasoning means (line 264).\n\n# Significance\n\nThe results are significantly better than baselines over long horizon planning, clearly showing the potential of representing the context as a recursive tree, as well as providing the right level of detailed context.\n\n# Originality\n\nThe paper provides a valuable insight of treating context as a non-linear data-structure and showing how it can improve the reasoning ability for long-term planning that interleaves reasoning and execution. The only caveat is that the paper needs better positioning with respect to work on hierarchical task decomposition in planning, e.g. Hierarchical Task Networks (HTN), and clarify how it differs from HTNs. The first claim of novelty should be clarified that it is in the context of ReAct, but that recursive hierarchical decompositions has a large body of research. The problem of interleaving reasoning and acting could also be placed in the broader context beyond the approaches used by LLMs (line 286). See work in “Ghallab, Malik, Dana Nau, and Paolo Traverso. Automated planning and acting. Cambridge University Press, 2016.”\n\nQUESTIONS:\nIs there any problem that requires interleaving tasks, where completing one task would make it impossible to complete the other? This can be illustrated by the Sussman Anomaly problem.\n\nIs there any problem in the experiments where a deadlock can occur, as in, the problem becomes unsolvable due to the execution of an action?\n\nCan you give insights into the size of the context tree and number of backtracks?\n\nCan you give insights into the runtime overhead and the increased number of LLM calls with respect to the baselines?\n\nGiven that the aim is to have real-time reasoning, how long does it take to return an action? What is the impact of different recursion levels in terms of time?\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "CLARITY": 3, "IMPACT": 2, "ORIGINALITY": 2, "DATE": "2025-06-23"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn the vein of ReAct, Reflexion and similar works, the authors introduce ReCAP, a new LLM-based online planning methodology. The authors state that what separates ReCAP from previous work is that it autonomously and dynamically generates sub-tasks which are placed in a sequential dependency tree, meaning that coupled tasks appear closely together. Additionally, the dynamic nature allows ReCAP to adapt when subtasks or actions fail.\n\nReCAP is evaluated on three domains and compared to several common baseline LLM-planning strategies. ReCAP outperforms the baselines, especially in the tasks with more steps and longer dependencies.\n\nSTRENGTHS AND WEAKNESSES:\nThe introduced approach of ReCAP is reasonable and motivated. Additionally, the experimental results showcase performance increases, likely without introducing overly much overhead. While some details on the prompting are unclear, it is also generally easy to follow and it would be possible to re-implement based on this.\n\nAn ablation study is also performed. While the results therein are mixed, there are some interesting results such as showing that further limiting the maximum depth might be preferable (Level 3 never performed worse than the original, usually outperforming it).\n\nThe discussion on related works is somewhat limited and could be expanded with other works which for example use LLMs to explicitly decompose tasks, e.g., MLDT (https://www.springerprofessional.de/en/mldt-multi-level-decomposition-for-complex-long-horizon-robotic-/50350624) and Compositional Foundation Models for Hierarchical Planning (https://openreview.net/forum?id=dyXNh5HLq3), or perform tree-based search, e.g., RAP (https://openreview.net/forum?id=VTWWvYtF1R). There's also concurrent work, e.g., Hierarchical Planning for Complex Tasks (https://arxiv.org/abs/2504.04578) and HyperTree (https://openreview.net/forum?id=45he3Ri6JP&noteId=a53sNTHN6D), published closer to the NeurIPS submission deadlines. Discussing these or other related works in relation to ReCAP would further strengthen the paper.\n\nQUESTIONS:\n1. What does it mean if a completed subtask is \"pruned\"? (line 111)\n2. What are some \"fundamental mistakes\" exhibited by ReACT? (line 218)\n3. How is the one-shot prompt designed? Does it exemplify high-level subtask decomposition, selection of an atomic leaf action or both?\n4. What \"Level\", if any, was used for the base experiments? Additionally, how is the LLM informed about the level limit?\n5. How does ReCAP compare with e.g. ReAct regarding token usage?\n6. What information is propagated up from a completed subtask? As discussed in the ablation study, it's not just the status thereof.\n\nLIMITATIONS:\nyes", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "CLARITY": 3, "IMPACT": 3, "ORIGINALITY": 3, "DATE": "2025-06-24"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nReCAP introduces a hierarchical prompting framework that equips LLM agents with a dynamic context tree to record recursive subtask decompositions, intermediate observations, and reasoning traces, enabling robust long-horizon planning with adaptive backtracking. Without any additional model training, it achieves substantial zero-shot gains—up to a 32 pp absolute improvement on Robotouille. It consistently outperforms sequential prompting baselines across embodied and symbolic benchmarks (ALFWorld, FEVER), demonstrating both improved context management and failure recovery in multi-step tasks.\n\nSTRENGTHS AND WEAKNESSES:\nPros\n- Extends an LLM’s effective reasoning horizon by integrating a dynamic context tree directly into the prompting loop, keeping high-level intentions tightly coupled with ongoing decisions.\n- Demonstrates substantial zero-shot performance gains (e.g. +32 pp absolute on Robotouille) without any additional model training or fine-tuning.\n- Employs adaptive backtracking to recover from low-level failures by revisiting and refining higher-level goals, improving robustness in long-horizon tasks.\n- Remains model-agnostic and broadly applicable across different benchmarks and LLM families, thanks to its purely prompt-based design.\n\nCons\n- Performance improvements can be modest on shorter or less structured tasks, making the added complexity feel disproportionate in those scenarios.\n- Validations are limited to simulated and symbolic benchmarks; real-world applicability under noisy, partially observable conditions remains untested.\n- Relies on the underlying LLM’s token capacity to store the context tree—extremely long or deeply branched tasks may still exceed limits despite hierarchical structuring.\n\nQUESTIONS:\n- The paper reports overall success‐rate improvements, but does not break down failure modes: could the authors provide a taxonomy of errors and their relative frequencies?\n- Can the authors quantify the additional latency and memory overhead introduced by maintaining and updating the context tree, perhaps with empirical measurements as task depth increases?\n\nLIMITATIONS:\nyes.", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "CLARITY": 4, "IMPACT": 2, "ORIGINALITY": 3, "DATE": "2025-07-01"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe authors suggest the limitations of prior LLM agents, such as ReAct and Reflexion, that tasks that require long-horizon interactions would make it challenging for their contexts to fit in LLMs' context windows, which can harm their capabilities in complex scenarios. As a solution, the authors propose Recursive Context-Aware reasoning and Planning (ReCAP). With ReCAP, LLM agents can recursively create and execute subtasks where the execution contexts are managed in a tree. Also, it is capable of updating the rest of the plan (which consists of subtasks). Empirically, they perform evaluation of ReCAP agent on Robotouille, ALFWorld, and FEVER and demonstrate that it outperforms the baseline approaches including ReAct, Act, and CoT.\n\nSTRENGTHS AND WEAKNESSES:\nStrengths\n- A sequential execution of some earlier LLM agents has clear limitations in their abilities to solve complex tasks, and tackling such limitations by introducing a hierarchical execution structure with recursion is a reasonable direction. Often, complex tasks can be decomposed into smaller subtasks, where solving such smaller tasks is easier in general.\n- The authors provide multiple analyses of how the design of the proposed method, ReCAP, is helpful in solving the tasks from the benchmarks in different aspects, including horizons, recursion depths, and context lengths.\n\nWeaknesses\n- One of my major concerns about this work is that there exist similar prior approaches with even some overlap in the target benchmarks, which are not mentioned in this submission: THREAD (\"THREAD: Thinking Deeper with Recursive Spawning\", appeared online on May 27th, 2024) and REPL-Plan (\"Interactive and Expressive Code-Augmented Planning with Large Language Models\", appeared online on Nov 21st, 2024). These methods have the ability to create and spawn subtasks and adaptively plan next steps based on the execution results and observations, with the managed contexts. There could be differences to make this submission unique by its own, but in order to make this a case, such existing work should be discussed and compared. Please note that the NeurIPS FAQ (https://neurips.cc/Conferences/2025/PaperInformation/NeurIPS-FAQ) suggests \"we do not distinguish arxiv papers and other published (conference & journal) papers, and the Contemporaneous-Work rule applies in the same way.\"\n- In addition to the concern about the originality and methodological comparison with existing work, empirically, the existing papers mentioned above report >95% performance on ALFWorld with GPT-3.5 whereas this work reports 91% with GPT-4o on ALFWorld, which gives the existing work an empirical edge. While I'm not suggesting that this tendency would necessarily hold for other benchmarks, I'm rather suggesting that given the existing methods with similarities, including those would help to provide empirical justifications of how well this method performs.\n\nQUESTIONS:\nPlease take a look at the weaknesses above. I may update my score based on the author response to the weaknesses mentioned (both the originality and empirical justification).\n\nLIMITATIONS:\nYes, they discuss the proposed method's limitations.", "TITLE": "Official Review", "RECOMMENDATION": 3, "REVIEWER_CONFIDENCE": 4, "CLARITY": 3, "IMPACT": 2, "ORIGINALITY": 1, "DATE": "2025-07-03"}