Abstract
Robot Task and Motion Planning (TAMP) requires a delicate balance between high-level logical reasoning and low-level physical constraints. While Large Language Models (LLMs) possess significant common-sense knowledge, they often struggle with the precise numeric reasoning required for complex planning. This paper introduces Code-as-Symbolic-Planner, a framework that shifts the role of the LLM from a direct planner to a software engineer. By generating, verifying, and iteratively refining symbolic code (e.g., A* search algorithms), the system overcomes the inherent limitations of LLMs in mathematical optimization. Evaluated across seven diverse benchmarks, the framework achieves a 24.1% average improvement in success rates over state-of-the-art baselines and demonstrates remarkable scalability as task complexity increases.
Introduction
Traditional robot planning often relies on formal languages like PDDL, which require extensive expert hand-coding. Recent attempts to use LLMs for planning typically involve generating textual step-by-step instructions or simple code policies. However, these "direct planning" methods frequently fail when faced with strict numeric constraints or the need for global optimization—areas where LLMs act as mediocre "calculators."
Code-as-Symbolic-Planner addresses this by steering LLMs to generate the algorithms that solve a problem. This "third paradigm" leverages the coding proficiency of foundation models to build custom, task-specific symbolic planners, bridging the gap between high-level intent and low-level execution.
Methodology: The Steer-Generate-Check Framework
The core of the proposed approach is a multi-agent, multi-round system designed to move beyond "lazy" code generation, where an LLM might simply print a hardcoded list of moves rather than implementing a robust solver.
The framework consists of four primary components:
- TaskLLM: Responsible for generating the symbolic code, such as implementing search algorithms (DFS, A*) or optimization solvers tailored to the robot's environment.
- CheckLLM: An independent agent that writes verification code to test the validity of the plans produced by the TaskLLM's generated solver.
- Symbolic Complexity Checker: A rule-based module that ensures the TaskLLM is producing algorithmic logic (loops, search trees) rather than trivial hardcoded sequences.
- SteerLLM: The orchestrator that reviews feedback from the checkers and provides iterative guidance to the TaskLLM, pushing it toward more sophisticated symbolic solutions over multiple rounds.
Experimental Setup
The framework was evaluated on seven representative TAMP tasks across discrete and continuous environments, including multi-robot sorting (BoxNet), classic stacking (Blocksworld), collaborative lifting (BoxLift), and 3D drone navigation. Testing involved 140 samples per task with increased complexity (more objects and tighter constraints) compared to standard benchmarks. Simulations were performed in Pybullet, and real-world validation was conducted using dual robotic arm setups.
Key Results and Discussion
The iterative refinement process proved crucial. Success rates typically increased significantly between the first round (often "lazy" code) and the third round (sophisticated symbolic algorithms).
Performance and Scalability
Code-as-Symbolic-Planner outperformed the best baseline, OpenAI’s Code Interpreter, by an average of 18% and direct LLM planning methods by over 24%. Notably, as shown in the results, the framework maintains performance even as the number of objects (e.g., blocks or boxes) increases, whereas traditional LLM planning success rates drop toward zero.
Model Agnosticism and Real-World Application
The framework is model-agnostic, showing consistent gains using GPT-4o, Claude 3.5 Sonnet, and Mistral Large. In real-world hardware tests, the system achieved up to 100% success in multi-robot coordination tasks, more than doubling the performance of direct prompting methods.
Conclusion
Code-as-Symbolic-Planner demonstrates that LLMs are most effective in robotics when used as high-level architects of symbolic logic rather than direct executors of motion. While challenges remain regarding execution efficiency and the translation of raw sensory data into abstract problem formulations, this symbolic approach provides a robust path forward for complex, constrained robot planning. Future work will focus on integrating multi-modal inputs like vision and force sensing directly into the iterative loop.
Summary updated