释放大型语言模型作为提示优化器的潜力:与基于梯度的模型优化器的类比分析
Unleashing the Potential of Large Language Models as Prompt Optimizers: Analogical Analysis with Gradient-based Model Optimizers
AI总结:
本文通过类比基于梯度的模型优化器,提出受梯度启发的提示优化器GPO,从优化轨迹检索提示作为更新方向并利用基于余弦衰减的生成策略执行更新,在Big-Bench Hard和MMLU上取得显著提升。
摘要:
自动提示优化是提升大型语言模型(LLMs)性能的重要方法。近期研究表明,使用LLMs作为提示优化器具有潜力,其可通过迭代优化生成改进的任务提示。本文提出一种新视角来研究基于LLM的提示优化器设计,即通过与基于梯度的模型优化器进行类比。为连接这两种方法,我们确定了模型参数学习中的两个关键因素:更新方向和更新方法。通过系统分析这两个方面的大量改进策略,我们进一步开发了一种强大的受梯度启发的基于LLM的提示优化器,称为GPO。在每一步中,它首先从优化轨迹中检索相关提示作为更新方向。然后,它利用基于生成的优化策略执行更新,同时通过基于余弦的衰减策略控制编辑距离。大量实验证明了GPO的有效性和效率。特别是,与基线方法相比,GPO在Big-Bench Hard上带来了高达56.8%的额外提升,在MMLU上带来了62.6%的额外提升。代码可在https://github.com/RUCAIBox/GPO获取。
英文摘要:
Automatic prompt optimization is an important approach to improving the performance of large language models (LLMs). Recent research demonstrates the potential of using LLMs as prompt optimizers, which can generate improved task prompts via iterative refinement. In this paper, we propose a novel perspective to investigate the design of LLM-based prompt optimizers, by drawing an analogy with gradient-based model optimizers. To connect these two approaches, we identify two pivotal factors in model parameter learning: update direction and update method. By systematically analyzing a rich set of improvement strategies on the two aspects, we further develop a capable Gradient-inspired LLM-based Prompt Optimizer called GPO. At each step, it first retrieves relevant prompts from the optimization trajectory as the update direction. Then, it utilizes the generation-based refinement strategy to perform the update, while controlling the edit distance through a cosine-based decay strategy. Extensive experiments demonstrate the effectiveness and efficiency of GPO. In particular, GPO brings an additional improvement of up to 56.8% on Big-Bench Hard and 62.6% on MMLU compared to baseline methods. The code is available at https://github.com/RUCAIBox/GPO.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。