T rans P rompt: Towards an Automatic Transferable Prompting Framework for Few-shot Text Classification (2021)

Abstract: Recent studies have shown that prompts improve the performance of large pre-trained language models for few-shot text classification. Yet, it is unclear how the prompting knowledge can be transferred across similar NLP tasks for the purpose of mutual reinforcement. Based on continuous prompt embeddings, we propose TransPrompt, a transferable prompting framework for few-shot learning across similar tasks. In TransPrompt, we employ a multi-task meta-knowledge acquisition procedure to train a meta-learner that captures cross-task transferable knowledge. Two de-biasing techniques are further designed to make it more task-agnostic and unbiased towards any tasks. After that, the meta-learner can be adapted to target tasks with high accuracy. Extensive experiments show that TransPrompt outperforms single-task and cross-task strong baselines over multiple NLP tasks and datasets. We further show that the meta-learner can effectively improve the performance on previously unseen tasks; and TransPrompt also outperforms strong fine-tuning baselines when learning with full training sets.

## introduction fine-tuning pre-trained language models (plms) has become the standard practice to train models for a majority of nlp tasks @xcite @xcite . to ensure high accuracy, it is necessary to obtain a sufficient amount of training data for downstream tasks, which is often the bottleneck in low-resource scenarios. the application of ultra-large plms such as @xcite proves that such plms can learn to solve a task with very few training samples. inspired by these works, @xcite propose a prompt-based approach to fine-tune bertstyle plms in a few-shot learning setting, which adapts plms into producing specific tokens corresponding to each class, instead of learning the prediction head. the effectiveness of prompts has also been shown in @xcite ; scao and rush (2021); @xcite and others. however, designing high-performing prompts is challenging and requires a very large validation set. to alleviate this problem, @xcite propose continuous prompt embeddings with fully differentiable parameters, avoiding the cumbersome manual prompt engineering process. despite the remarkable success, we notice that current prompt-based approaches may have a few limitations. for few-shot learning, the performance of downstream tasks is still constrained by the number of training instances. it would be highly desirable if the model can acquire the transferable knowledge from similar nlp tasks before it is adapted to specific tasks with few samples. however, it is unclear how the knowledge in prompt encoders and plms with prompting techniques is transferred across tasks. a natural question arises: how can we design a prompting framework for bert-style models that captures transferable knowledge across similar nlp tasks to improve the performance of few-shot learning? a straightforward solution to the above question is to adopt multi-task fine-tuning across these similar nlp tasks. when the training data is scarce, the fine-tuned plm would easily be over-fitted to specific instances @xcite . in machine learning, the meta-learning paradigm is extensively studied, which produces models that are capable of being adapted to a group of similar tasks quickly with few learning steps @xcite . for plms, @xcite discover that training a meta-learner for plms is effective to capture the transferable knowledge across different domains. yet, this method is not designed for prompts for few-shot learning and lacks the mechanism to learn unbiased prompt encoder 1 prompt encoder 2 multi-task meta-knowledge encoder prompt encoder 1 fine-tuned language encoder 𝑜 ["#@xmath0%] model adaptation model generalization b) task-aware model specification task 1 task 2 a) multi-task meta-knowledge acquisition universal prompt encoder i) prototype-based debiasing ii) entropy-based debiasing prompt encoder 2 fine-tuned language encoder 𝑜 ["#@xmath1%] figure 1 : the high-level architecture of the transprompt framework. in the toy example, task 1 and task 2 are existing tasks, while task 3 is a new task for the meta-learner to generalize. (best viewed in color.) in this paper, we present transprompt, a prompting framework that allows plms to capture crosstask transferable knowledge for few-shot text classification, with the high-level architecture shown in figure 1 . transprompt firstly employs a multitask meta-knowledge acquisition (mma) procedure to learn the transferable representations of prompt encoders and plms jointly across similar nlp tasks. to reduce over-fitting and make the underlying plm more task-agnostic and less unbiased towards any specific tasks, we propose two debiasing techniques, namely prototype-based debiasing and entropy-based de-biasing. the learned model can be viewed as the meta-learner for a group of similar nlp tasks. after mma, transprompt takes the task-aware model specification (tms) step, which can be further divided into two cases. i) when the model is adapted to existing tasks during mma, a variation of p-tuning @xcite can be applied for effective adaptation. ii) when it is required to fit a previously unseen task, a model generalization strategy is employed, specifically considering the universal prompting knowledge in the model. this is often the case where re-training of the metaleaner across all the tasks is infeasible due to data privacy or computation efficiency issues. 1 for evaluation, we test the transprompt framework on three sets of few-shot nlp tasks (including seven public datasets in total): i) sentiment analysis; ii) natural language inference (nli); and iii) paraphrase. experimental results show that transprompt consistently outperforms both single-task and cross-task strong baselines. we further show that i) the meta-learner trained by transprompt is effective to generalize to unseen tasks; and ii) transprompt also outperforms popular fine-tuning algorithms when learning with the full training sets. in summary, we make the following major contributions in this work: ## related work we summarize the related work on plms, plm prompting, transfer learning and meta-learning. ## the transprompt framework we formally present our task and the techniques of the proposed transprompt framework in detail. ## experiments in this section, we conduct extensive experiments to evaluate the transprompt framework and compare it against strong baselines. ## conclusion and future work in this paper, we present the transprompt framework for few-shot learning across similar nlp tasks based on continuous prompt embeddings. experimental results show that transprompt consistently outperforms strong baselines in both fewshot learning and standard fine-tuning settings. additionally, we find that the meta-learner trained by transprompt can be adapted to previously unseen tasks easily. in the future, we will explore how transprompt is applied to other plms apart from bert-style models and other nlp tasks.