计算机科学 > 人工智能
[提交于 2024年1月16日 (v1),最后修订于 2024年6月10日 (此版本, v4)]
标题:PRewrite: Prompt Rewriting with Reinforcement Learning
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.