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}.
翻译:自从大型语言模型出现以来,提示学习已成为优化和定制这些模型的流行方法。诸如思维链等特殊提示甚至揭示了这些模型中此前未知的推理能力。然而,发现有效提示的进展一直较为缓慢,这推动了对通用提示优化方法的需求。遗憾的是,现有提示学习方法中很少有能同时满足“真正通用”标准,即具备自动化、离散、黑盒、无梯度和可解释性。在本文中,我们引入元启发式——一个拥有超过100种方法的离散非凸优化分支——作为提示学习的一种有前景途径。在我们的范式内,我们测试了六种典型方法:爬山法、模拟退火、带/不带交叉的遗传算法、禁忌搜索和和声搜索,展示了它们在白盒和黑盒提示学习中的有效性。此外,我们表明这些方法可用于发现推理和图像生成任务中此前未知的、更易于人类理解的提示,从而为提示优化开辟了丰富多样的可能性。我们在\url{https://github.com/research4pan/Plum}发布了所有代码。