ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents

Zhenyu Zhang, Tian-Yi Chen, Wei-Ran Xu, A. Pentland, Jia-Xin Pei
10/1/2025
14 citations

No official code found. Best implementation: ReCAP-Stanford/ReCAP (46 stars).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents, NeurIPS 2025

462

Similar Papers

Cite this paper

@article{zhang2025recap,
  title  = {ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents},
  author = {Zhenyu Zhang and Tian-Yi Chen and Wei-Ran Xu and A. Pentland and Jia-Xin Pei},
  year   = {2025},
  eprint = {2510.23822},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2510.23822},
  url    = {https://doi.org/10.48550/arXiv.2510.23822},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.23822.svg)](https://codeofpaper.com/paper/2510.23822)

Discussion