Research map / Large language models / Agents, code and math
ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes ReCAP, a training-free recursive hierarchical prompting framework with plan-ahead subtask lists, parent-plan re-injection into a shared context, and a bounded sliding window, evaluated under pass@1 on Robotouille, ALFWorld, FEVER, and SWE-bench Verified.
Problem
Long-horizon tasks requiring multi-step reasoning and dynamic re-planning remain hard for LLM agents: sequential prompting suffers context drift and loss of goal information, while hierarchical prompting fragments context across levels or adds runtime overhead.
Approach
Generate a full ordered subtask list, execute only the head item, and on each return from recursion re-inject the parent's thought and remaining subtasks into a single shared LLM context, with a sliding window bounding the active prompt so cost scales with tree depth.
Key results
- On synchronous Robotouille ReCAP reaches 70.0% vs 38.0% for ReAct (32-point gain) with GPT-4o under pass@1.
- On asynchronous Robotouille ReCAP reaches 53.0% vs 24.0% for ReAct (29-point gain).
- On SWE-bench Verified with GPT-4.1, ReCAP resolves 44.8% vs 39.58% for the mini-SWE-agent ReAct baseline; ALFWorld improves from 84.0% to 91.0%.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use ReCAP instead of ReAct | GPT-4o agent · Robotouille synchronous | pass@1 task success rate (%): 38.0 -> 70.0 | Helped |
| Use ReCAP instead of ReAct | GPT-4o agent · Robotouille asynchronous | pass@1 task success rate (%): 24.0 -> 53.0 | Helped |
| Use ReCAP instead of ReAct | GPT-4o agent · ALFWorld unseen split | pass@1 task success rate (%): 84.0 -> 91.0 | Helped |
| Use ReCAP instead of ReAct | GPT-4o agent · FEVER | pass@1 task success rate (%): 63.5 -> 63.5 | No clear effect |
| Use ReCAP instead of mini-SWE-agent (ReAct) | GPT-4.1 agent · SWE-bench Verified | pass@1 task success rate (%): 39.58 -> 44.8 | Helped |
| Use ReCAP instead of ReAct | Robotouille tasks 2, 4, and 6 · Robotouille synchronous | success rate (%): 63.0 -> 90.0 | Helped |
| Use ReCAP instead of ReAct | Qwen2.5-32B agent · Robotouille tasks 2, 4, and 6 | success rate (%): 10.0 -> 33.0 | Helped |
| Use ReCAP instead of ReAct | Qwen2.5-72B agent · Robotouille tasks 2, 4, and 6 | success rate (%): 23.0 -> 53.0 | Helped |
| Use ReCAP instead of ReAct | LLaMA-4 (400B) agent · Robotouille tasks 2, 4, and 6 | success rate (%): 37.0 -> 60.0 | Helped |
| Use ReCAP instead of ReAct | DeepSeek-V3 (671B) agent · Robotouille tasks 2, 4, and 6 | success rate (%): 57.0 -> 87.0 | Helped |
| pass all think history instead of only the most recent (ablation) | ReCAP · Robotouille synchronous task 6 (lettuce-tomato-cheeseburger) | success rate (%): 80 -> 70 | No clear effect |
| remove intermediate think reasoning; output decomposition/action only (ablation) | ReCAP · Robotouille synchronous task 6 (lettuce-tomato-cheeseburger) | success rate (%): 80 -> 60 | No clear effect |
Surprising findings
- On FEVER ReCAP matches ReAct (63.5%), indicating no gain for short-horizon tasks.
- ReCAP's ALFWorld cost was roughly 3x ReAct (118.40 USD vs 37.89 USD).
Limitations
- Decomposition, execution, and backtracking rely entirely on the LLM with no external validation, so errors can propagate.
- Recursive design incurs longer trajectories, higher API cost and latency than flat prompting.
- Several baselines (THREAD, Reflexion, Ada-Planner, REPL-Plan) were excluded from main comparisons, and ADaPT was re-implemented by the authors on Robotouille.
Experimental setup
Datasets: Robotouille ALFWorld FEVER SWE-bench Verified
Benchmarks: Robotouille ALFWorld FEVER SWE-bench Verified
Metrics: pass@1 success rate
Baselines: Standard CoT ReAct Act ADaPT mini-SWE-agent
Builds on: ReAct Chain-of-Thought Reflexion ADaPT Tree of Thoughts
Closest papers by meaning
- Recursive Language Models (NeurIPS 2026 · similarity 0.89)
- Graph-enhanced Large Language Models in Asynchronous Plan Reasoning (ICML 2024 · similarity 0.88)
- Tree-Planner: Efficient Close-loop Task Planning with Large Language Models (ICLR 2024 · similarity 0.88)
- Log-Augmented Generation: Scaling Test-Time Reasoning with Reusable Computation (ICLR 2026 · similarity 0.88)
- On the self-verification limitations of large language models on reasoning and planning tasks (ICLR 2025 · similarity 0.88)
- Long-Horizon Planning for Multi-Agent Robots in Partially Observable Environments (NeurIPS 2024 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
