Interactive and Expressive Code-Augmented Planning with Large Language Models
Anthony Zhe Liu, Xinhe Wang, Jacob Sansom, Yao Fu, Jongwook Choi, Sungryull Sohn, Jaekyeom Kim, Honglak Lee
Abstract
Large Language Models (LLMs) demonstrate strong abilities in common-sense reasoning and interactive decision-making, but often struggle with complex, long-horizon planning tasks. Recent techniques have sought to structure LLM outputs using control flow and other code-adjacent techniques to improve planning performance. These techniques include using variables (to track important information) and functions (to divide complex tasks into smaller re-usable sub-tasks). However, purely code-based approaches can be error-prone and insufficient for handling ambiguous or unstructured data. To address these challenges, we propose REPL-Plan, an LLM planning approach that is fully code-expressive (it can utilize all the benefits of code) while also being dynamic (it can flexibly adapt from errors and use the LLM for fuzzy situations). In REPL-Plan, an LLM solves tasks by interacting with a Read-Eval-Print Loop (REPL), which iteratively executes and evaluates code, similar to language shells or interactive code notebooks, allowing the model to flexibly correct errors and handle tasks dynamically. We demonstrate that REPL-Plan achieves strong results across various planning domains compared to previous methods.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- WebArena: A Realistic Web Environment for Building Autonomous Agents cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
- WebArena: A Realistic Web Environment for Building Autonomous Agents cites ALFWorld: Aligning Text and Embodied Environments for Interactive Learning
- WebArena: A Realistic Web Environment for Building Autonomous Agents cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
- ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents cites ALFWorld: Aligning Text and Embodied Environments for Interactive Learning
- ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Large Language Models are Zero-Shot Reasoners cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Code Driven Planning with Domain-Adaptive Selector cites ALFWorld: Aligning Text and Embodied Environments for Interactive Learning
- Code Driven Planning with Domain-Adaptive Selector cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Cited by top-tier papers4
- ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model AgentsZhenyu Zhang, Tianyi Chen, Weiran Xu, Alex Pentland et al.NeurIPS 2025 · 12 citations
- PEARL: Self-Evolving Assistant for Time Management with Reinforcement LearningBingxuan Li, Jeonghwan Kim, Cheng Qian, Xiusi Chen et al.ACL 2026 · 2 citations
- Hierarchical Procedural Meta-Reasoning for Generalizable Multimodal AgentsYao Fu, Shengyi Qian, Pierluca D'Oro, Fanyi Xiao et al.ICML 2026
- Code Driven Planning with Domain-Adaptive SelectorZikang Tian, Shaohui Peng, Di Huang, Jiaming Guo et al.ICLR 2026
Builds on8
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
- Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
- WebArena: A Realistic Web Environment for Building Autonomous AgentsShuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou et al.ICLR 2024 · 1,197 citations
- ALFWorld: Aligning Text and Embodied Environments for Interactive LearningMohit Shridhar, Xingdi Yuan, Marc-Alexandre Côté, Yonatan Bisk et al.ICLR 2021 · 819 citations
Related papers
- AdaPlanner: Adaptive Planning from Feedback with Language ModelsHaotian Sun, Yuchen Zhuang, Lingkai Kong, Bo Dai et al.NeurIPS 2023 · 257 citations
- AutoPlan: Automatic Planning of Interactive Decision-Making Tasks With Large Language ModelsSiqi Ouyang, Lei LiEMNLP Findings 2023 · 9 citations
- CodePlan: Unlocking Reasoning Potential in Large Language Models by Scaling Code-form PlanningJiaxin Wen, Jian Guan, Hongning Wang, Wei Wu et al.ICLR 2025
- Classical Planning with LLM-Generated Heuristics: Challenging the State of the Art with Python CodeAugusto B. Corrêa, André Grahl Pereira, Jendrik SeippNeurIPS 2025 · 27 citations
- Can LLMs Fix Issues with Reasoning Models? Towards More Likely Models for AI PlanningTurgay Caglar, Sirine Belhaj, Tathagata Chakraborti, Michael Katz et al.AAAI 2024 · 11 citations
