NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Coding Agents for Generalized Task and Motion Planning Problems

Matteo Merler, Bowen Li, Josh Roy, Yichao Liang, Qianwei Wang, Yixuan Huang, Tom SilverarXiv 2026

TL;DR

This paper demonstrates that LLM-based coding agents can autonomously synthesize generalized Python programs to solve complex Task and Motion Planning (TAMP) problems. By iteratively interacting with a simulator during a synthesis phase, these agents generate standalone code that outperforms traditional hand-engineered planners on unseen tasks while executing orders of magnitude faster at test time.

What Problem Does This Paper Address?

Robots operating in the real world must solve Task and Motion Planning (TAMP) problems, which require combining discrete logic (e.g., "which tool should I pick up?") with continuous physical constraints (e.g., avoiding collisions, calculating joint kinematics, and managing dynamics).

Generalized TAMP aims to create solutions that work across a whole family of related problems (e.g., clearing a shelf regardless of how many objects are on it). Historically, achieving this generalization required human experts to meticulously hand-engineer domain-specific abstractions, such as custom motion samplers, symbolic predicates, and search heuristics.

This paper investigates whether modern coding agents can automate this tedious engineering process. Instead of using an LLM directly as a real-time planner—which is slow, expensive, and often fails at geometric reasoning—the authors ask: Can an LLM act as a software engineer to write a standalone, generalized planning program?

Methods

The authors introduce AgenticGenPlan, a framework that treats generalized TAMP as a program synthesis problem:

  1. Interactive Synthesis Phase: The coding agent (e.g., Claude Code or Codex) is given a text description of the environment and access to a bare-bones Python sandbox containing a simulator client. Within a fixed budget ($20 of API usage), the agent autonomously decides how to interact with the simulator. It can write custom scripts, probe environment dynamics, inspect states, and iteratively debug its code.
  2. Frozen Evaluation Phase: Once the synthesis budget is spent, the agent outputs a final Python policy class (implementing reset and get_action). This program is frozen—meaning no LLM calls are allowed at test time—and evaluated on entirely unseen problem instances with scaled-up object counts.

The authors evaluated two primary settings: a main setting (where the agent has no access to the environment's underlying source code) and a + source setting (where the agent can inspect the environment's implementation and reuse helper functions like inverse kinematics solvers).

Fig. 1: Coding agents for generalized TAMP. A coding agent (Claude Code with Opus 5) synthesizes a programmatic policy shared across problem instances, without hand-designed planning components. Compared with the planner and LLM-based generalized planner, the agentic method achieves a higher success rate while maintaining efficiency. Bottom: success rate and computation time per instance as the number of objects grows, averaged over environments with a planner available and multiple object counts.

Datasets

The approach was evaluated across 28 simulated environments spanning two major benchmarks:

  • KinDER: 25 environments divided into four categories: Kinematic2D, Dynamic2D, Kinematic3D, and Dynamic3D. These tasks isolate physical reasoning challenges like sweeping, pouring, and tossing.
  • PDDLStream: 3 classic TAMP domains (Packing, Blocked, and Rovers) where standard LLMs traditionally struggle.

To rigorously test generalization, the evaluation instances included object counts far beyond those used in the original benchmarks.

Key Insights and Ideas

  • The Power of the "Agentic" Loop: Static, one-shot LLM generation performs poorly on TAMP tasks. The defining factor for success is the agent's ability to build its own test suites, discover edge cases (such as objects trapped against walls), and refine its code based on simulator feedback.
  • Emergent Internal Models: Rather than just guessing actions, the agents actively used the simulator to calibrate physical models. For example, in the Shelf environment, Claude Code wrote a script to probe a robot arm's movements, fitting a kinematic model to predict cube positions from joint angles to solve inverse kinematics.
  • Discovery of Novel Strategies: The agents frequently discovered creative, non-prehensile manipulation strategies that were completely absent from human-engineered baselines. As shown in Figure 2, these included throwing objects, using the robot's forearm to sweep multiple items at once, or flipping trays in mid-air.
Fig. 2: Unexpected successful strategies found by the coding agents. Each row shows one execution from left to right; the annotation describes the unexpected behavior. The strategies come from both the main setting and the + source setting.

Key Results

  • Higher Success Rates: On the 16 environments where a traditional hand-engineered planner was available, the best agent configuration (GPT-6 Astra) achieved a 95% mean success rate, and Claude Code achieved 82%, vastly outperforming the traditional planners' 47%.
  • Robust Scaling: As the number of objects scaled up, traditional planners degraded rapidly due to combinatorial explosion. In contrast, the agents' synthesized programs maintained high success rates (see Figure 1).
  • Massive Speedups at Test Time: Because the LLM is completely out of the loop during evaluation, the frozen programs are incredibly fast. GPT-6 Astra's programs averaged just 1.3 milliseconds per action, compared to the 29 seconds per instance required by traditional planners—a speedup of several orders of magnitude.

Limitations and Future Work

  • Perception Assumptions: The current setup assumes fully observed, object-centric states and perfect simulator access during the training phase. It does not address environments with high perception uncertainty or noisy visual inputs.
  • Complex 3D Dynamics: While the agents excelled at kinematic tasks, highly dynamic 3D environments—such as sweeping or pouring large quantities of small objects—remain largely unsolved in the main setting.
  • Data Contamination Uncertainty: Because the training data for frontier LLMs is closed, it is impossible to completely rule out prior exposure to the benchmark code, though the unique strategies and active debugging logs suggest genuine problem-solving rather than mere memorization.

Summary updated

BibTeX
@misc{merler2026coding,
  author = {Matteo Merler and Bowen Li and Josh Roy and Yichao Liang and Qianwei Wang and Yixuan Huang and Tom Silver},
  title = {{Coding Agents for Generalized Task and Motion Planning Problems}},
  year = {2026},
  eprint = {2609.30233},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.30233},
}
Figure