Are Large Language Models Good Prompt Optimizers?

Ruotian Ma, Xiaolei Wang, Xin Zhou, Jian Li, Nan Du +3 more
2/3/2024
cs.CLcs.AI

No official code found. Best implementation: rtmaww/LLM_AutoPromptStudy (1 star, last commit 2025-03-05).

Abstract

LLM-based Automatic Prompt Optimization, which typically utilizes LLMs as Prompt Optimizers to self-reflect and refine prompts, has shown promising performance in recent studies. Despite the success, the underlying mechanism of this approach remains unexplored, and the true effectiveness of LLMs as Prompt Optimizers requires further validation. In this work, we conducted a comprehensive study to uncover the actual mechanism of LLM-based Prompt Optimization. Our findings reveal that the LLM optimizers struggle to identify the true causes of errors during reflection, tending to be biased by their own prior knowledge rather than genuinely reflecting on the errors. Furthermore, even when the reflection is semantically valid, the LLM optimizers often fail to generate appropriate prompts for the target models with a single prompt refinement step, partly due to the unpredictable behaviors of the target models. Based on the observations, we introduce a new "Automatic Behavior Optimization" paradigm, which directly optimizes the target model's behavior in a more controllable manner. We hope our study can inspire new directions for automatic prompt optimization development.

View on arXivView PDF

Code Implementations(1)

10PythonJul 21, 20241 years ago

Cite this paper

@article{ma2024large,
  title  = {Are Large Language Models Good Prompt Optimizers?},
  author = {Ruotian Ma and Xiaolei Wang and Xin Zhou and Jian Li and Nan Du and Tao Gui and Qi Zhang and Xuanjing Huang},
  year   = {2024},
  eprint = {2402.02101},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.02101v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.02101.svg)](https://codeofpaper.com/paper/2402.02101)

Discussion