Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery
Yuxin Wen, Neel Jain, John Kirchenbauer, Micah Goldblum, Jonas, Geiping, Tom Goldstein

TL;DR
This paper introduces a gradient-based method to automatically generate interpretable hard text prompts for generative models, improving control, reusability, and ease of use across text and image tasks.
Contribution
It presents a novel approach for optimizing hard text prompts using gradients, enabling automatic discovery and tuning of prompts for diverse applications.
Findings
Effective automatic prompt generation for text-to-image models
Improved prompt tuning for language model classification
Facilitates prompt reuse and mixing without prior expertise
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsGene expression and cancer classification · Computational Physics and Python Applications
MethodsDiffusion
