Toward Human Readable Prompt Tuning: Kubrick’s The Shining is a good movie, and a good prompt too? (2023)

Abstract: Large language models can perform downstream tasks in a zero-shot fashion, given natural language prompts that specify the desired behavior. Such prompts are typically hand engineered, but can also be learned with gradient-based methods from labeled data. However, it is underexplored what factors make the prompts effective, especially when the prompts are in natural language. In this paper, we investigate common attributes shared by effective prompts in classification problems. We first propose a human readable prompt tuning method (FluentPrompt) based on Langevin dynamics that incorporates a fluency constraint to find a distribution of effective and fluent prompts. Our analysis reveals that effective prompts are topically related to the task domain and calibrate the prior probability of output labels. Based on these findings, we also propose a method for generating prompts using only unlabeled data, outperforming strong baselines by an average of 7.0% accuracy across three tasks.

## introduction large language models (lms) can perform downstream tasks by simply conditioning on a prompt-a short sequence of text specific to the task. such natural language prompts are either carefully hand engineered (e.g., manual prompt engineering, @xcite or automatically learned from labeled data (e.g., gradient-based prompt tuning, @xcite . despite their effectiveness, it remains unclear what makes these prompts work and what attributes effective prompts share. in this paper, we aim to identify key characteristics of effective prompting, and use this knowledge to generate effective and human readable prompts without any labeled data. figure 1 : compared with previous discrete prompt tuning method autoprompt @xcite which generates gibberish prompts, fluentprompt can identify effective and more readable prompts, useful for downstream analyses. we find that in prompt tuning, the good prompts are topically relevant to the task domain (e.g., mentioning a film director "kubrick" in a movie sentiment classification task), and calibrate the prior probability of output labels (e.g., including negative words to balance an overly optimistic model). there are two main challenges for performing this type of analysis. first, manual prompt tuning produces a limited number of effective prompts for each task, making it difficult to infer common features of good prompts where contrast with less effective prompts is needed. on the other hand, the prompts found by gradient-based tuning methods are often disfluent and unnatural, making them difficult to interpret (e.g., autoprompt in figure 1 ). to overcome these challenges, we first propose a human readable prompt tuning method called fluentprompt. inspired by prior work in controllable text generation @xcite , flu-entprompt uses langevin dynamics to generate a set of human readable prompts for any task. our method adds a progressive noise to the tuning procedure to obtain a distribution of effective prompts, while also maintaining the fluency of the prompts through a perplexity constraint. as shown in figure 1 , compared to the baseline gibberish prompts produced by autoprompt, fluentprompt generates prompts that are more fluent (i.e., lower perplexity) and perform competitively. the resulting fluent prompts not only facilitate our further analysis, but can also lead to better trust and engagement from both researchers and end users. after obtaining a broad set of effective and human-readable prompts, we analyze the factors that contribute to the effectiveness of prompts. specifically, we show that effective prompts are both (1) topically related to the task domain and (2) more calibrated to the prior probability of output labels. specifically, calibration measures how balanced the lm's prior probability of output labels (i.e., in the absence of a specific example) is. based on our findings, we propose a novel method unsupervised fluentprompt, for automatically searching for effective prompts using only unlabeled data. unsupervised fluent-prompt optimizes the prompts for both better calibration and better domain relevance. our experimental results show that unsupervised flu-entprompt outperforms strong zero-shot baseline @xcite by 7.0% in accuracy. we summarize our contributions as follows: ## fluentprompt we introduce fluentprompt, a prompt tuning method that generates a group of highly effective and human-readable prompts. our approach utilizes langevin dynamics to incorporate fluency constraints into the prompt tuning process, making it a novel application of controllable text generation and constrained sampling within the field of discrete prompt tuning. with human-readable prompts, we aim to explore the relationship between the features of the prompts and their performance. ## unsupervised fluentprompt our analysis in section 3 shows that effective prompts exhibit calibration and have high domain relevance to the task. since these two features are both highly indicative and do not require groundtruth labels for computation, we propose unsu-pervised fluentprompt, a method for automatically identifying effective prompts without labeled data. the key idea is to optimize the prompts for improved calibration and domain relevance. in the following sections, we will detail the methodology of unsupervised fluentprompt ( §5.1), describe the experimental setup ( §5.2), and present the results ( §5.3). ## conclusion in this paper, we investigate the factors that contribute to the effectiveness of prompts. to facilitate this study, we develop a human-readable prompt tuning method fluentprompt and apply it to the gpt-2 large model to generate effective and readable prompts. our analysis reveals that effective prompts are topically related to the task domain and calibrate the prior probability of label words. although the prompts generated by fluent-prompt are effective and readable, they still carry limited semantic meanings. for instance, we did not find any prompts directly indicating the task definition or instructions. one potential reason is that the gpt-2 large model is not instructiontuned. future work can apply fluentprompt to an instruction-tuned model to see if instruction-like prompts can be discovered.