LLMs have recently been used to generate Python programs representing generalized plans in PDDL planning, i.e., plans that generalize across the tasks of a given PDDL domain. Previous work proposed a framework consisting of three steps: the LLM first generates a summary and then a strategy for the domain, both in natural language, and then implements that strategy as a Python program, that gets debugged on example planning tasks. In that work, only one strategy is generated and passed directly to the program generation. If the strategy is incorrect, its implementation will therefore result in an incorrect generalized plan. Here, we introduce an approach that generates the strategy in the form of pseudocode and enables automatic debugging of the pseudocode, hence allowing us to identify and fix errors prior to the generation of the generalized plan itself. Additionally, we extend the Python debugging phase with a reflection step prompting the LLM to pinpoint the reason for the observed plan failure. Finally, we take inspiration from LLM code generation to produce several program variants and pick the best one. Running experiments on 17 benchmark domains with two reasoning and two non-reasoning LLMs, we show that these extensions substantially improve the quality of the generalized plans. Our best performing configuration achieves an average coverage of 82% across the domains.
翻译:大语言模型(LLM)近期被用于生成表示PDDL规划中广义计划的Python程序,即能够泛化到给定PDDL领域内所有任务的规划方案。先前研究提出了一个三阶段框架:LLM首先用自然语言生成领域摘要和策略,随后将该策略实现为Python程序,并通过示例规划任务进行调试。但该工作仅生成单一策略并直接传递给程序生成阶段——若策略存在错误,其实现将直接导致错误的广义计划。本文提出一种新方法:以伪代码形式生成策略并支持伪代码的自动调试,从而在生成广义计划前即可识别和修正错误。此外,我们在Python调试阶段引入反思步骤,引导LLM定位观察到的计划失败原因。最后,受LLM代码生成的启发,我们生成多个程序变体并选取最优方案。在17个基准领域中使用两种推理型与两种非推理型LLM开展的实验表明:这些改进显著提升了广义计划的质量。我们最优配置方案在所有领域的平均覆盖率达到82%。