Plum: Prompt Learning using Metaheuristic

Rui Pan, Shuo Xing, Shizhe Diao, Wenhe Sun, Xiang Liu +4 more
11/14/2023
cs.LGcs.AIcs.DM

Official code: research4pan/Plum (131 stars, last commit 2024-02-13).

Abstract

Since the emergence of large language models, prompt learning has become a popular method for optimizing and customizing these models. Special prompts, such as Chain-of-Thought, have even revealed previously unknown reasoning capabilities within these models. However, the progress of discovering effective prompts has been slow, driving a desire for general prompt optimization methods. Unfortunately, few existing prompt learning methods satisfy the criteria of being truly "general", i.e., automatic, discrete, black-box, gradient-free, and interpretable all at once. In this paper, we introduce metaheuristics, a branch of discrete non-convex optimization methods with over 100 options, as a promising approach to prompt learning. Within our paradigm, we test six typical methods: hill climbing, simulated annealing, genetic algorithms with/without crossover, tabu search, and harmony search, demonstrating their effectiveness in white-box and black-box prompt learning. Furthermore, we show that these methods can be used to discover more human-understandable prompts that were previously unknown in both reasoning and image generation tasks, opening the door to a cornucopia of possibilities in prompt optimization. We release all the codes in \url{https://github.com/research4pan/Plum}.

View on arXivView PDF

Code Implementations(1)

research4pan/PlumOfficial100%

Prompt Learning using Metaheuristics

1317Shell, PythonNov 14, 20232 years ago

Similar Papers

Cite this paper

@article{pan2023plum,
  title  = {Plum: Prompt Learning using Metaheuristic},
  author = {Rui Pan and Shuo Xing and Shizhe Diao and Wenhe Sun and Xiang Liu and Kashun Shum and Renjie Pi and Jipeng Zhang and Tong Zhang},
  year   = {2023},
  eprint = {2311.08364},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.08364v3}
}

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/2311.08364.svg)](https://codeofpaper.com/paper/2311.08364)

Discussion