Scalable Prompt Generation for Semi-supervised Learning with Language Models (2023)

Abstract: Prompt-based learning methods in semi-supervised learning (SSL) settings have been shown to be effective on multiple natural language understanding (NLU) datasets and tasks in the literature. However, manually designing multiple prompts and verbalizers requires domain knowledge and human effort, making it difficult and expensive to scale across different datasets. In this paper, we propose two methods to automatically design multiple prompts and integrate automatic verbalizer in SSL settings without sacrificing performance. The first method uses various demonstration examples with learnable continuous prompt tokens to create diverse prompt models. The second method uses a varying number of soft prompt tokens to encourage language models to learn different prompts. For the verbalizer, we use the prototypical verbalizer to replace the manual one. In summary, we obtained the best average accuracy of 71.5% (a relative improvement of 0.99% over even the previous state-of-the-art SSL method with manual prompts and verbalizers) in different few-shot learning settings.

## introduction pre-training large language models with huge amounts of text corpora in masked language modeling tasks and then fine-tuning the pre-trained language model (plm) on downstream tasks have shown superior performance in many natural language processing tasks. however, the discrepancy between the pretraining task (masked language modeling objective) and the downstream fine-tuning task (task without mask token) could lead to unexpected behaviors. recently, there has been growing research interest in the area of prompt-tuning, where any nlu task is transformed into a cloze task to mimic the pre-training objective of a large masked language model @xcite *equal contribution. this work was done during yuhang's internship at amazon, alexa ai. @xcite @xcite . prompt-based learning transforms an input x into x ′ using a prompt function. it makes use of the vast amount of acquired knowledge of plms to predict a distribution of tokens at the masked position. the verbalizer then maps the predicted tokens to classes. the main advantage of this approach is that this method works well in a few-shot learning environment @xcite . however, the main disadvantage of this method is the limitation posed by the prompt and verbalizer functions, which require human knowledge to carefully craft them. such handcrafting work is expensive and not scalable with the increase in the variety of tasks and datasets. for example, in alexa, there are thousands of domains and manually designing prompts and verbalizer for intent classification for each of them according to the dataset content demand human expertise, which is time consuming and not applicable. it is essential to reduce the human efforts in the process of prompt generation. prompt-based learning requires finding the right tokens in the prompts that align with the task requirement and dataset content. however, since the objective of these prompt tokens is only for the language models to perform the task at hand, it is not necessary for them to be a sequence of words that humans can understand. continuous prompt-based learning alleviates the need for human intervention to determine prompt tokens. instead, it automates the prompt design process. in the literature, there are mainly two methods: i) automatically search for discrete prompt text tokens @xcite ) ii) automatically learn numerical prompt embeddings @xcite @xcite . the main difference between these two approaches is that the first searches for actual discrete tokens from the language model vocabulary, whereas the second method directly learns the embeddings for prompt tokens, which may not be human comprehensible. similarly, automatic selection of label words @xcite @xcite , soft verbalizer @xcite , and prototypical verbalizer @xcite are the methods proposed to eliminate the tedious process of manually defining verbalizer mapping functions. most of these continuous prompt and automatic verbalizer methods focus on supervised learning (sl) settings but ignore their generalization under semi-supervised learning (ssl) settings. the previous state-of-the-art (sota) ssl method with various manual prompts and verbalizers has shown superiority over sl language models with a single manual prompt @xcite . in this ssl pipeline, we normally train several labeler models with different manual prompts to capture diverse information from the limited training data and make use of them to annotate a huge amount of unlabeled data. having to design several manual prompts and verbalizer models for ssl settings and applying them across multiple datasets and tasks will exacerbate the scalability and cost problem. in this paper, we tackle the problem posed by manual prompt and verbalizer design and propose automatic methods to fully automate the design of diverse prompts and verbalizers in ssl settings. our main contributions are as follows. ## methodology our overall prompt-based ssl workflow follows pattern-exploiting training (pet) semi-supervised learning setting @xcite . pet first transforms the input sequence x to a cloze question containing a single mask token. next, it uses plm to fill in the value of the mask token and applies verbalizers to map the output tokens to the class labels @xmath0. they devise a semisupervised framework to produce soft labels on a large amount of unlabeled data, which are later used to train a final supervised classifier f. they report strong performance over other supervised prompt-tuning methods and other semi-supervised approaches without prompts across multiple nlu tasks. before this paper, the pet approach was the state-of-the-art (sota) framework that integrates the prompt-tuning method into the ssl pipeline. the pet method fine-tunes multiple plms with different prompts. it introduces diversity in the prompts by manually designing several prompts using domain and task knowledge. similarly, it uses human expertise to design verbalizer mappings for each of the datasets based on the knowledge of the tasks. here, we use continuous and automatic prompts and verbalizers, thus eliminating the need for human involvement in designing manual prompts and verbalizers. ## experiments to verify the effectiveness of our framework, we conduct multiple semi-supervised learning experiments with several strong baseline frameworks on the commonly-used nlu benchmarks. ## conclusions in this paper, we are able to successfully use automatic prompts and verbalizers in semi-supervised learning settings. we show that our proposed automatic prompt generation methods with prototypical verbalizer can eliminate human engineering in prompt-based ssl setup and achieve similar or better performance than the sota manual pet method. our methods have the added advantage of being scalable with multiple tasks and datasets. we also empirically verify the power of semi-supervised learning methods, which take advantage of large amounts of unlabeled data, over supervised methods. in the next steps, we plan to investigate whether we would be able to achieve similar performance by freezing plms' parameters and only tuning verbalizer and prompt parameters. this setup will save a tremendous amount of space by making it easy to share and reuse plms. moreover, we plan to explore ways to combine the two proposed methods demo+soft pet and vary soft pet, which would take advantage of both methods.