Skip to content
On this page

🗻 Automatic Prompt

Background

Prompting has emerged as a promising approach to solving a wide range of NLP problems using large pre-trained language models (LMs), including leftto-right models such as GPTs ([Radford et al , 2019]) and masked LMs such as BERT ([Devlin et al, 2019]), RoBERTa ([Liu et al, 2019]), etc. Compared to conventional fine-tuning that expensively updates the massive LM parameters for each downstream task, prompting concatenates the inputs with an additional piece of text that steers the LM to produce the desired outputs. A key question with prompting is how to find the optimal prompts to improve the LM’s performance on various tasks.

Overview

Automatic Prompt uses advanced machine learning and other techniques to generate prompts for the language model LM/LLM. It trains the model to generate high-quality, contextually relevant and accurate prompts to guide LM/LLM to produce more coherent, precise, semantic and contextually relevant results.

The process can be summarized as follows: optimize the prompt using some method (here optimization is relative to the process of manually written prompts), select a better prompt, verify the merits of the prompt generated by some method (here there are various criteria for judging the merits, e.g., coherence, comprehensibility, contextual relevance, etc.), and finally update the prompt.

Generally speaking, there are two forms of prompts: discrete prompts discrete prompt and continuous prompts soft prompt.

Automatic Prompt has different processing methods for different types of prompts.

For discrete prompts, there are two processing methods: the first one is human-designed prompt to guide LM/LLM to generate the required content, but the prompts generated by this method are most likely not optimal; the second one is non-human-designed prompt, i.e., automatic prompt generation The second method is non-manual design of prompts, i.e., automatic generation of prompts, which is done by discrete changes to individual prompt tokens and then verifying the benefits of the changed prompt token to determine whether the prompt is good or bad.

For continuous prompts, a token-level prompt consisting of token representations is replaced by continuous vectors, note! Instead of fine-tuning the model, these continuous vectors are trained to find an optimal set of vectors to replace the explicit discrete prompt. however, by their nature continuous prompts are difficult to understand by humans due to their continuous form.

Working methods

Automtic Prompt searches/tunes prompt by two main methods.

First, by searching for the current optimal prompt for replacement, e.g., AutoPrompt[Shin et al., 2020] suggests that AutoPrompt performs a gradient-guided search to find the best token in the prompt; RLPrompt[(Deng et al., 2022] uses reinforcement learning to search for such hints. This approach is generally applied to discrete prompt generation.

Second, optimizing the current prompt for the purpose of automatic hints, for example, [Zhong et al., 2021] proposed OptiPrompt, which directly optimizes the input embedding space in the prompts for factual probing. This method is generally mostly applied to soft prompt generation.

Here is the table of contents of this section, which you can access directly by clicking on:

🌉 Contents