Abstract
Few-shot text classification remains a significant challenge for pre-trained language models (PLMs) like BERT and RoBERTa. While prompt-based fine-tuning has emerged as a promising solution, it is often hindered by high sensitivity to prompt wording and a distribution gap between pre-training and downstream tasks. This paper introduces Unified Prompt Tuning (UPT), a framework designed to capture task-invariant prompting semantics. UPT utilizes a novel Prompt-Options-Verbalizer (POV) paradigm and a self-supervised auxiliary task, Knowledge-enhanced Selective Masked Language Modeling (KSMLM). Experimental results across nine datasets demonstrate that UPT achieves state-of-the-art performance in low-resource settings by effectively "learning to prompt" before adapting to specific target tasks.
Introduction
Adapting PLMs to new tasks with minimal data—the "few-shot" setting—is a core objective in natural language processing. Standard fine-tuning often fails in these scenarios due to the limited number of training examples. Prompt-based methods mitigate this by reformulating classification as a cloze-style task. However, these methods are notoriously sensitive to the choice of templates and verbalizers. Furthermore, the "prompt-style" format is absent from the original pre-training data of models like BERT, leading to a distribution mismatch.
The UPT framework addresses these issues by teaching models the general logic of prompting. By unifying the input format across diverse tasks and introducing a self-supervised pre-training phase, UPT enables models to acquire transferable prompting knowledge from dissimilar datasets.
Methodology
The Prompt-Options-Verbalizer (POV) Paradigm
A key innovation in UPT is the inclusion of an explicit Options component within the prompt. Traditional prompts typically consist of the input text followed by a template like It is [MASK].. In contrast, the POV paradigm explicitly lists candidate label words: [Input Text] Is it [Option A] or [Option B]? It is [MASK]..
This explicit listing provides the model with a clear "hint" regarding the expected output space, narrowing the search for the Masked Language Modeling (MLM) head and providing a consistent inductive bias across different classification tasks.
Knowledge-enhanced Selective Masked Language Modeling (KSMLM)
To bridge the distribution gap and learn task-invariant semantics, UPT employs a self-supervised auxiliary task called KSMLM. This task involves:
- Options Knowledge Repository (OKR): Adjectives are extracted from a large corpus and clustered based on their PLM embeddings using K-Means.
- Selective Masking: For a given sentence, a specific word (e.g., an adjective) is masked.
- Distractor Selection: The model queries the OKR to find a "dissimilar" word from a different cluster to serve as a distractor.
- Prompt Generation: The model is presented with a prompt containing the masked sentence and the options (correct word vs. distractor).
This process forces the model to learn the relationship between the context and the provided options, effectively training it on the mechanism of prompt-based decision-making.
Multi-task Training
The training process involves two stages. First, the model undergoes multi-task training on a collection of "dissimilar" source tasks (e.g., training on NLI data when the target is Sentiment Analysis) using the POV format and the KSMLM objective. Finally, the model is fine-tuned on the specific few-shot target task.
Experiments and Results
The UPT framework was evaluated on nine public text classification datasets spanning Sentiment Analysis (SST-2, MR, CR), Natural Language Inference (MNLI, SNLI, QNLI, RTE), and Paraphrase Detection (MRPC, QQP).
Key Findings
- Superior Performance: In a 16-shot setting, UPT achieved an average accuracy of 78.9% across all tasks, significantly outperforming standard fine-tuning (64.4%) and advanced prompt-based methods like LM-BFF (75.9%). A self-ensemble version (UPT-SE) further improved this to 80.1%.
- Zero-Shot Robustness: UPT demonstrated strong zero-shot capabilities, outperforming multi-task zero-shot baselines even without target-task training.
- Ablation Studies: Removing either the KSMLM task or the POV options resulted in a marked decrease in performance, validating the necessity of both components.
Conclusion
Unified Prompt Tuning (UPT) demonstrates that "learning to prompt" is a transferable skill. By incorporating explicit options and a knowledge-enhanced self-supervised task, UPT stabilizes few-shot learning and bridges the gap between pre-training and downstream application. Future work will explore extending this framework to more complex NLP tasks such as Named Entity Recognition and Relation Extraction, as well as investigating continuous prompt tuning to further automate template engineering.
Summary updated