对于大语言模型(LLM)而言,需要多步推理和动态重规划的长程任务仍然颇具挑战。序列提示方法容易出现上下文漂移、目标信息丢失和循环失败的问题,而分层提示方法往往会削弱层级间连续性,或是产生巨大的运行时开销。我们提出ReCAP(Recursive Context-Aware Reasoning and Planning,递归上下文感知推理与规划)——一种具备共享上下文的LLM推理与规划分层框架。ReCAP融合了三项核心机制:(i)前置规划分解:模型生成完整的子任务列表,执行首个子项并优化剩余部分;(ii)父计划结构化重注入:在递归返回过程中维持一致的多层级上下文;(iii)内存高效执行:限制活跃提示的规模,使开销随任务深度线性增长。这些机制共同实现了高层目标与底层动作的对齐,减少了冗余提示,同时在递归过程中保持连贯的上下文更新。实验表明,ReCAP在多种长程推理基准上大幅提升了子目标对齐度和成功率:在严格的pass@1协议下,同步Robotouille任务上提升32%,异步Robotouille任务上提升29%。
英文摘要:
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.
HaReCAP: Habitual-action Grounding for Recursive Large Language Model Agents
North China Institute of Computer System Engineering(华北计算机系统工程研究所);University of Science and Technology of China(中国科学技术大学);China Information Security Research Institute Co., Ltd.(中国信息安全研究院有限公司)
ReCode: Unify Plan and Action for Universal Granularity Control
DeepWisdom;The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Renmin University of China(中国人民大学);Zhejiang University(浙江大学);Université de Montréal & Mila(蒙特利尔大学及Mila)
MedRLM: Recursive Multimodal Health Intelligence for Long-Context Clinical Reasoning, Sensor-Guided Screening, Evidence-Grounded Decision Support, and Community-to-Tertiary Referral Optimization
School of Information, Computer;Communication Technology Sirindhorn International Institute of Technology, Thammasat University Pathum Thani, Thailand 1
LLM-Based SQL Generation: Prompting, Self-Refinement, and Adaptive Weighted Majority Voting
Institute of Information Management(信息管理研究所);National Yang Ming Chiao Tung University(阳明交通大学);R. B. Annis School of Engineering(R. B. Annis工程学院);University of Indianapolis(印第安纳大学)
Beyond a single latent space: a dual-latent world model for long-horizon planning
Nanjing University(南京大学);Shenzhen University of Advanced Technology(深圳先进技术大学);Shanghai Jiao Tong University(上海交通大学);Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences(中国科学院深圳先进技术研究院)
Parallelized Planning-Acting for Efficient LLM-based Multi-Agent Systems in Minecraft
Zhejiang University(浙江大学);Nanyang Technological University(南洋理工大学);Hangzhou City University(杭州市城市大学);Ningbo Global Innovation Center, Zhejiang University(宁波全球创新中心,浙江大学)
Parallel Predictive World Models for Accurate and Efficient Long-Horizon Planning
Tsinghua University(清华大学);Institute of Microelectronics, Chinese Academy of Sciences(中国科学院微电子研究所);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Nanyang Technological University, Singapore(新加坡南洋理工大学)
Beyond the Next Step: Variable-Length Latent World Models for Long-Horizon Planning
State Key Lab of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University(北京大学智能科学与技术学院通用人工智能国家重点实验室);Amazon AGI SF Lab(亚马逊AGI旧金山实验室);Institute for Artificial Intelligence, Peking University(北京大学人工智能研究院)