现代生成模型的优势在于它们能够通过基于文本的提示词进行控制。典型的“硬”提示词由可解释的词语和 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.
Carnegie Mellon University(卡内基梅隆大学);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);University of California, San Diego(加利福尼亚大学圣迭戈分校);Guangdong University of Technology(广东工业大学);University of Melbourne(墨尔本大学);Shiga University(滋贺大学);RIKEN(理化学研究所)
Prompting Neural-Guided Equation Discovery Based on Residuals
Technical University of Darmstadt(德累斯顿技术大学);Hessian Center for Artificial Intelligence (hessian.AI)(黑森人工智能中心);National Research Center for Applied Cybersecurity ATHENE(应用网络安全国家研究中心ATHENE);Johannes Gutenberg-Universität Mainz(美因茨约翰内斯·古腾堡大学);German Research Center for Artificial Intelligence(德国人工智能研究中心)
Bridging Mechanistic Interpretability and Prompt Engineering with Gradient Ascent for Interpretable Persona Control
Department of Computer Science(计算机科学系);Indian Institute of Technology (ISM), Dhanbad(印度理工学院(ISM),丹巴德);National University of Singapore(新加坡国立大学);CIFAR Fellow(CIFAR研究员)
Learning to Design SR Solvers: Harness Optimization for Symbolic Regression
Shanghai Jiao Tong University(上海交通大学);Eastern Institute of Technology(东方理工大学);The Hong Kong Polytechnic University(香港理工大学);Max Planck Institute for Heart and Lung Research(马克斯·普朗克心肺研究所)
Sparsity Hurts: Simple Linear Adapter Can Boost Generalized Category Discovery
School of Computer Science and Engineering, Southeast University(东南大学计算机科学与工程学院);Key Laboratory of Computer Network and Information Integration (Southeast University), Ministry of Education, China(计算机网络与信息集成重点实验室(东南大学),教育部,中国)