PRewrite: Prompt Rewriting with Reinforcement Learning
Weize Kong, Spurthi Amba Hombaiah, Mingyang Zhang, Qiaozhu, Mei, Michael Bendersky

TL;DR
This paper introduces PRewrite, a reinforcement learning-based method to automatically improve prompts for large language models, reducing manual effort and enhancing task performance across various benchmarks.
Contribution
It presents a novel automated prompt rewriting approach using reinforcement learning to optimize prompts for downstream tasks.
Findings
PRewrite significantly improves prompt effectiveness on benchmark datasets.
Reinforcement learning effectively trains the prompt rewriter.
Automated prompt rewriting reduces manual trial-and-error in prompt engineering.
Abstract
Prompt engineering is critical for the development of LLM-based applications. However, it is usually done manually in a "trial and error" fashion that can be time consuming, ineffective, and sub-optimal. Even for the prompts which seemingly work well, there is always a lingering question: can the prompts be made better with further modifications? To address these problems, we investigate automated prompt engineering in this paper. Specifically, we propose PRewrite, an automated method to rewrite an under-optimized prompt to a more effective prompt. We instantiate the prompt rewriter using a LLM. The rewriter LLM is trained using reinforcement learning to optimize the performance on a given downstream task. We conduct experiments on diverse benchmark datasets, which demonstrates the effectiveness of PRewrite.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Advanced Malware Detection Techniques
