RePrompt: Planning by Automatic Prompt Engineering for Large Language Models Agents

Weizhe Chen, Sven Koenig, Bistra DilkinaarXiv 2024 · DOI

Abstract

Large Language Model (LLM) agents are highly sensitive to prompt instructions, yet traditional Automatic Prompt Engineering (APE) often fails in agentic workflows due to the lack of ground-truth checkers and the fragility of output formats. We present REPROMPT, a framework that iteratively refines agent prompts by treating dialogue histories as "gradients." By focusing on intermediate reasoning steps rather than final outputs, REPROMPT significantly improves performance on complex planning tasks like PDDL generation and travel coordination without requiring a ground-truth solution checker.

Introduction

LLM agents are increasingly deployed for complex reasoning and tool-use tasks. However, their efficacy is tied to the precision of their instructions. Existing APE methods struggle with two primary issues: the "Missing Checker" problem, where objective scoring is unavailable for open-ended tasks, and "Format Fragility," where prompt rewrites break strict tool-interaction requirements. REPROMPT addresses these by optimizing intermediate reasoning steps through an iterative feedback loop that leverages the feedback already present in agent-user or agent-environment interactions.

Methods

REPROMPT operates as a natural language training loop consisting of three core components: the Actor, the Summarizer, and the Prompt Optimizer.

The REPROMPT framework architecture, illustrating the loop between the Actor, Summarizer, and Prompt Optimizer.
  • The Actor: The LLM agent performs tasks using the current prompt, gathering intermediate feedback from the environment or a feedback generator using schemes like ReAct or Reflexion.
  • The Summarizer: Instead of a numerical loss function, an LLM analyzes chat histories to identify "focus points"—common errors or helpful reasoning patterns.
  • The Prompt Optimizer: This component takes the error summary and original prompt to propose specific refinements to step-by-step instructions, prioritizing structural improvements over scenario-specific details to ensure generalization.

Datasets and Evaluation

The researchers evaluated REPROMPT across three distinct reasoning environments:

  1. PDDL Generation: Creating Planning Domain Definition Language code for domains like TyreWorld and Household, testing strict logic and syntax.
  2. TravelPlanner: A complex benchmark requiring multi-day trip planning while satisfying budget and transportation constraints.
  3. Meeting Planning: Scheduling meetings for groups while considering travel times and availability.

Key Results

REPROMPT demonstrated clear advantages over both original "primitive" prompts and existing APE baselines like PromptAgent. In the PDDL Household domain, REPROMPT reduced total errors from 52 to 23.

Performance comparison on the TravelPlanner benchmark, showing REPROMPT's improvements over baselines like Reflexion and PromptAgent.

As shown in the TravelPlanner results, REPROMPT (5-epochs) achieved a final pass rate of 3.89%, outperforming the Reflexion baseline (2.78%) and PromptAgent (2.11%). While absolute pass rates remain low on this difficult benchmark, the relative improvement is significant. Additionally, REPROMPT proved roughly twice as cost-effective as MCTS-based methods by processing data in batches.

Discussion and Conclusion

The core insight of REPROMPT is that the "gradient" for improvement is embedded in the dialogue history. By focusing on the algorithm the agent follows—its step-by-step reasoning—rather than scenario-specific templates, the agent becomes more resilient.

While effective, the framework's performance is still bounded by the diversity of training data and the quality of intermediate feedback. Future work will focus on improving hallucination detection and exploring more robust ways to incorporate "loss" signals directly from chat histories. Nonetheless, REPROMPT provides a scalable, checker-free path toward more reliable LLM agents.

Summary updated

BibTeX
@misc{chen2024reprompt,
  author = {Weizhe Chen and Sven Koenig and Bistra Dilkina},
  title = {{RePrompt: Planning by Automatic Prompt Engineering for Large Language Models Agents}},
  year = {2024},
  eprint = {2406.11132},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.11132},
}
Figure