GPS : Genetic Prompt Search for Efficient Few-Shot Learning (2022)

Abstract: Prompt-based techniques have demostrated great potential for improving the few-shot generalization of pretrained language models. However, their performance heavily relies on the manual design of prompts and thus requiring a lot of human efforts. In this paper, we introduce Genetic Prompt Search (GPS) to improve few-shot learning with prompts, which utilizes a genetic algorithm to automatically search for the best prompt.GPS is gradient-free and requires no update of model parameters but only a small validation set. Experiments on diverse datasets proved the effectiveness of GPS, which outperforms manual prompts by a large margin of 2.6 points. Our method is also better than other parameter-efficient tuning methods such as prompt tuning.

## introduction pretrained language models, such as bert @xcite , xlnet @xcite , t5 @xcite , and gpt @xcite , are often finetuned for downstream natural language processing tasks, which has been shown to improve performance over non-pretrained models. however, this pretraining-finetuning paradigm still relies on a relatively large set of labeled data for each downstream task to obtain competitive performance. although gpt-3 @xcite shows promising performance for zero-shot and few-shot learning by prompting on an extremely-large pretrained language models with 175b parameters, finding out the optimum prompt for each given task could be difficult @xcite . to improve the performance of prompting on pretrained language models, recent works focus on supervised pretraining with carefully designed or crowdsourced manual prompts @xcite @xcite . diverse prompts are collected to enhance the robustness and performance of prompting @xcite . @xcite introduced a dataset of labeler demonstrations and used it to finetune gpt-3. despite all these efforts, the challenge to obtain high-performing prompts for few-shot learning still exists. as pointed out by previous works @xcite @xcite , manual prompts are usually suboptimal and suffers a high variance on performance. to address this challenge, we propose a novel genetic prompt search (gps) algorithm that gradually mutates the prompts with a generative model and selects candidates according to their performance on a small development set. this evolutionary procedure relies on a tiny set of labeled data, only used for validation but not training. as illustrated in figure 1 , gps does not require updating any parameter, but only searches for the optimal hard prompts for every downstream task. similar to prompt tuning, gps allows the pretrained model to serve a large number of applications simultaneously. meanwhile, gps is even easier to deploy than prompt tuning, because it does not need to store the tuned continuous soft prompts. empirically, gps achieves substantial improvement over the baseline of manual prompts, and it also outperforms other parameter-efficient few-shot tuning methods. our contributions can be summarized as follows. ## related work recently, thanks to the prompt-based learning method, pretrained language models (plms) have been widely explored under zero-shot and few-shot scenarios for language understanding and generation tasks @xcite @xcite . prompt-based learning bridges the gap between pretraining and finetuning objectives by stitching the text input x with a prompt template and augmenting the label output y as a text string, such that the input and the output can be constructed in a sentence completion task form. previous few-shot learning methods can be generally categorized into two types, few-shot tuning methods that require updating parameters @xcite and prompt enchancement methods that have no learnable parameter but optimize the discrete prompts directly @xcite . ## genetic prompt search in this section, we will introduce the algorithm of genetic prompt search (gps) and various prompt generation strategies we have studied. note that the prompt search here refers to the search for a high-performing hard prompt in the discrete word space as shown in fig. 1 , and the formulation does not include soft prompts. ## experiments in this section, we conduct extensive experiments to study the effectiveness of gps, and reveal the way to obtain the best prompt for genetic prompt search. we also study several possible impact factors and hyper-parameters in gps. ## conclusions in this paper, we propose gps, an automatic prompt search method based on genetic algorithm for better few-shot learning. we compare different approaches on 10 datasets with only 32 labeled examples available. gps outperforms not only the manual prompt baseline, but also other parameterefficient few-shot learning methods. extensive experiments verified the effectiveness of the proposed gps.