让大模型通过交互式代码环境动态规划,提升复杂任务执行能力。
Interactive and Expressive Code-Augmented Planning with Large Language Models
- 引入可交互的代码执行环境,支持动态纠错与灵活调整
- 在多个规划任务中表现优于传统代码化方法
- 适合需要灵活应变的长周期任务规划场景
大型语言模型在常识推理和交互决策方面表现出色,但在复杂、长时序规划任务中仍显不足。现有技术通过引入变量和函数等代码结构提升规划效果,但纯代码方法易出错,难以处理模糊或非结构化数据。为此,我们提出REPL-Plan,一种完全具备代码表达力且高度动态的规划方法。该方法让LLM通过读取-求值-打印循环(REPL)与代码环境交互,类似交互式编程笔记本,可迭代执行并评估代码,实现错误自纠与动态适应。实验表明,REPL-Plan在多个规划领域均显著优于先前方法。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。