Prompt reinforcing for long-term planning of large language models

Hsien-Chin Lin, Benjamin Matthias Ruppik, Carel van Niekerk, Chia-Hao Shen, Michael Heck, Nurul Lubis, Renato Vukovic, Shutong Feng, Milica Gasic · DOI

Abstract

Large Language Models (LLMs) often struggle with long-term planning and goal tracking in multi-turn interactions, leading to cascading failures. We present Reinforced Prompt Optimisation (RPO), a gradient-free framework that treats system prompts as "textual parameters." RPO iteratively refines these prompts using reinforcement learning principles, specifically Temporal Difference (TD) feedback and experience replay. Our approach significantly improves performance across diverse domains—Text-to-SQL, Task-oriented Dialogue, and Medical QA—without requiring model fine-tuning.

Introduction

While LLMs demonstrate remarkable zero-shot capabilities in single-turn tasks, their performance degrades in complex, multi-turn scenarios such as incremental coding or task-oriented dialogues. In these settings, early misconceptions often propagate, resulting in a "lost in conversation" effect. Traditional optimization via gradient-based fine-tuning is often prohibitively expensive or impossible for proprietary models. RPO addresses this by evolving the system prompt through a structured feedback loop, bridging the gap between manual prompt engineering and formal reinforcement learning.

Methodology: Reinforced Prompt Optimisation

The RPO framework operates through an iterative loop of interaction, feedback, and rewriting. Unlike standard meta-prompting, RPO introduces two RL-inspired mechanisms to stabilize and enhance the optimization process.

The Reinforced Prompt Optimisation (RPO) framework illustrating the iterative loop of interaction, feedback, and prompt rewriting.

TD-style Feedback

A core innovation of RPO is the transition from global "Monte Carlo" success/failure labels to turn-level Temporal Difference (TD) style feedback. A "Feedbacker" LLM analyzes each turn of the interaction to predict user sentiment and forecast the likelihood of eventual success. This provides a denser, more immediate signal for the optimization process compared to sparse end-of-dialogue rewards.

Comparison between Monte Carlo style feedback (global success/fail) and Temporal Difference style feedback (turn-by-turn analysis).

Experience Replay for Rewriting

To prevent the "Rewriter" LLM from oscillating between strategies or repeating past errors, RPO utilizes an experience replay buffer. The Rewriter generates new prompts by considering a history of previous prompt-feedback pairs, ensuring that the evolution of the system prompt is informed by a broad range of past interactions. This parameter-free approach allows the underlying model weights to remain unchanged while the instructions evolve.

Experiments and Results

We evaluated RPO across three challenging benchmarks to test its generalizability:

  • Text-to-SQL (Spider-based): Requirements are revealed incrementally. RPO achieved a 54.2% relative improvement in functional accuracy over baselines across five different LLM backbones.
  • Task-oriented Dialogue (MultiWOZ 2.1): The success rate increased from a baseline of 0.420 to 0.619, a 47.3% relative gain.
  • Medical Question-Answering (Huatuo-26M & ShenNong-TCM): In head-to-head evaluations by human experts, the RPO-optimized system achieved an 86.7% win rate against HuatuoGPT-II, a model specifically fine-tuned for medical data.

The results demonstrate that turn-level feedback combined with experience replay leads to smoother convergence and higher performance ceilings compared to traditional prompting methods.

Conclusion

Reinforced Prompt Optimisation provides a robust, parameter-free method for enhancing the long-term planning capabilities of LLMs. By treating prompts as learnable parameters and applying RL-inspired feedback mechanisms, RPO effectively mitigates the "lost in conversation" gap. Future work will explore the integration of external knowledge bases and more advanced RL algorithms to further refine the prompt evolution process.

Summary updated

BibTeX
@misc{lin2025prompt,
  author = {Hsien-Chin Lin and Benjamin Matthias Ruppik and Carel van Niekerk and Chia-Hao Shen and Michael Heck and Nurul Lubis and Renato Vukovic and Shutong Feng and Milica Gasic},
  title = {{Prompt reinforcing for long-term planning of large language models}},
  year = {2025},
  eprint = {2510.05921},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.05921},
}
Figure