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

Code Driven Planning with Domain-Adaptive Critic

Zikang Tian, Shaohui Peng, Du Huang, Jiaming Guo, Ruizhi Chen, Rui Zhang, Xishan Zhang, Yuxuan Guo, Zidong Du, Qi Guo, Ling Li, Yewen Pu, Xing Hu, Yunji ChenarXiv 2025 · DOI

Abstract

Task planning with Large Language Models (LLMs) often suffers from high computational costs and a lack of domain-specific grounding. We present CoPiC (Code Driven Planning with Domain-Adaptive Critic), a framework that transitions from step-by-step natural language action generation to high-level program execution. By employing a Mixture-of-Experts (MoE) approach to generate planning code and a fine-tuned, domain-adaptive critic to select optimal strategies, CoPiC achieves significant improvements in task success rates while drastically reducing token consumption.

Introduction

While Large Language Models (LLMs) demonstrate impressive "common sense" reasoning, they frequently struggle with the grounded specifics of novel or complex environments. Current state-of-the-art planners, such as ReAct or Reflexion, typically rely on iterative, step-by-step queries. In these paradigms, the LLM suggests an action, observes the environment's feedback, and adjusts its next move.

However, this iterative approach faces two critical bottlenecks:

  1. Prohibitive Cost and Latency: Frequent calls to massive models like GPT-4o result in high token costs and significant execution delays.
  2. Short-Sightedness: These models often perform a "greedy" search, optimizing for immediate feedback rather than long-term strategic goals, such as navigating complex technology trees in strategy games.

CoPiC addresses these challenges by reframing the LLM's role from a "step-by-step narrator" to a "high-level programmer."

Methodology: The CoPiC Framework

CoPiC introduces a modular architecture divided into a Planning Phase and a Learning Phase.

Overview of the CoPiC framework, illustrating the Planning and Learning phases.

Code-Driven Planning

Instead of generating individual actions, the LLM generates multiple high-level Python programs using a Mixture-of-Experts (MoE) approach. These programs encapsulate the logic required to interact with the environment, handle preconditions, and refine plans locally. This shift allows the system to execute hundreds of environment steps without requiring a new LLM query for every single action.

Domain-Adaptive Critic

To navigate the multiple candidate plans generated by the MoE, CoPiC employs a "Critic"—a smaller, efficient model (e.g., TinyLlama-1.1B). This critic is fine-tuned using Reinforcement Learning (PPO) and Low-Rank Adaptation (LoRA) to predict which candidate plan is most likely to yield the highest long-term reward within a specific domain.

Iterative Evolution

The framework includes a learning phase where interaction histories (summarized trajectories of successes and failures) are analyzed. This feedback loop allows the system to evolve and debug its planning programs while simultaneously training the critic to better understand the nuances of the target environment.

Experimental Evaluation

The authors evaluated CoPiC across three distinct and challenging environments: ALFWorld (synthetic household tasks), NetHack (roguelike survival), and StarCraft II Unit Building (resource management).

Key Results

CoPiC consistently outperformed advanced baselines such as AdaPlanner and Reflexion across several metrics:

  • Success Rate (SR): The framework achieved an average 20.29% improvement in success rates. Notably, in "Hard" StarCraft II tasks, CoPiC reached a 100% success rate where baseline models struggled.
  • Efficiency and Cost: Token costs were reduced by an average of 79.39%. In specific NetHack tasks, the reduction in query costs reached as high as 96%.
  • Execution Speed: Tasks were completed in 30-34% fewer steps, suggesting that the generated plans were more direct and holistic.
Performance comparison of CoPiC against baselines in the ALFWorld environment, showing Success Rate (SR) and Cost.

Discussion and Future Work

The success of CoPiC highlights the power of code as a compact policy representation. A single well-structured function can handle complex environment interactions more efficiently than natural language. Furthermore, the results demonstrate that a small, domain-tuned critic can outperform general-purpose giants in strategy selection.

However, the framework's primary limitation is its dependency on the base LLM's coding proficiency. If the model cannot generate functional Python logic, the planning process fails. Additionally, the initial learning phase required to evolve programs and train the critic means the system is not strictly "zero-shot" for peak performance.

Future research will focus on scaling CoPiC to even more complex scenarios, such as full-scale strategy games or real-world robotic planning tasks where long-horizon reasoning is essential.

Summary updated

BibTeX
@misc{tian2025code,
  author = {Zikang Tian and Shaohui Peng and Du Huang and Jiaming Guo and Ruizhi Chen and Rui Zhang and Xishan Zhang and Yuxuan Guo and Zidong Du and Qi Guo and Ling Li and Yewen Pu and Xing Hu and Yunji Chen},
  title = {{Code Driven Planning with Domain-Adaptive Critic}},
  year = {2025},
  eprint = {2509.19077},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.19077},
}
Figure