arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.03668cs.LGcs.CL
收藏

Hard Prompts Made Easy:用于提示词调优与发现的基于梯度的离散优化

Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery

University of YYY(YYY大学);Institute of WWW(WWW研究所)

Yuxin Wen, Neel Jain, John Kirchenbauer, Micah Goldblum, Jonas Geiping, Tom Goldstein

AI总结:

本文提出一种基于梯度的离散优化方法,可自动为文本到图像扩散模型和文本到文本分类 LM 发现可解释、可复用的硬提示词。

摘要:

现代生成模型的优势在于它们能够通过基于文本的提示词进行控制。典型的“硬”提示词由可解释的词语和 token 构成,并且必须由人工手工设计。此外还存在由连续特征向量组成的“软”提示词。这类提示词可以借助强大的优化方法被发现,但它们不易解释、无法跨模型复用,也不能直接接入基于文本的界面。我们描述了一种通过高效的基于梯度的优化来稳健优化硬文本提示词的方法。我们的方法可为文本到图像和文本到文本两类应用自动生成基于文本的硬提示词。在文本到图像场景中,该方法为扩散模型创建硬提示词,使 API 用户无需预先了解如何向模型发出提示,即可轻松生成、发现以及混搭图像概念。在文本到文本场景中,我们表明可以自动发现有效的硬提示词,用于调优执行分类任务的 LM。

英文摘要:

The strength of modern generative models lies in their ability to be controlled through text-based prompts. Typical "hard" prompts are made from interpretable words and tokens, and must be hand-crafted by humans. There are also "soft" prompts, which consist of continuous feature vectors. These can be discovered using powerful optimization methods, but they cannot be easily interpreted, re-used across models, or plugged into a text-based interface. We describe an approach to robustly optimize hard text prompts through efficient gradient-based optimization. Our approach automatically generates hard text-based prompts for both text-to-image and text-to-text applications. In the text-to-image setting, the method creates hard prompts for diffusion models, allowing API users to easily generate, discover, and mix and match image concepts without prior knowledge on how to prompt the model. In the text-to-text setting, we show that hard prompts can be automatically discovered that are effective in tuning LMs for classification.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑