Code-Driven Planning in Grid Worlds with Large Language Models
Ashwath Vaithinathan Aravindan, Zhisheng Tang, Mayank Kejriwal

TL;DR
This paper introduces an iterative programmatic planning framework using large language models to generate executable code policies for grid-world tasks, outperforming direct code generation methods and establishing new benchmarks.
Contribution
The paper presents a novel iterative refinement approach for code-based policy synthesis with LLMs, improving performance and efficiency over existing methods.
Findings
IPP improves performance by up to 10x over direct code generation.
IPP achieves state-of-the-art results on the GRASP benchmark.
Reusing generated code reduces costs significantly.
Abstract
We propose an iterative programmatic planning (IPP) framework for solving grid-based tasks by synthesizing interpretable agent policies expressed in code using large language models (LLMs). Instead of relying on traditional search or reinforcement learning, our approach uses code generation as policy synthesis, where the LLM outputs executable programs that map environment states to action sequences. Our proposed architecture incorporates several prompting strategies, including direct code generation, pseudocode-conditioned refinement, and curriculum-based prompting, but also includes an iterative refinement mechanism that updates code based on task performance feedback. We evaluate our approach using six leading LLMs and two challenging grid-based benchmarks (GRASP and MiniGrid). Our IPP framework demonstrates improvements over direct code generation ranging from 10\% to as much as 10x…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsReinforcement Learning in Robotics · AI-based Problem Solving and Planning · Artificial Intelligence in Games
