Learning a Better Initialization for Soft Prompts via Meta-Learning

Zhou Yu, Yukun Huang, Kun Qian, Zhou Yu 0005

Abstract

Adapting large-scale Pre-trained Language Models (PLMs) to downstream tasks often involves either computationally intensive full-model fine-tuning or parameter-efficient prompt tuning. However, prompt tuning frequently struggles in few-shot scenarios due to its sensitivity to initialization. This paper introduces MetaPT (Meta-learned Prompt Tuning), a method that leverages unsupervised clustering to construct diverse meta-tasks and applies Model-Agnostic Meta-Learning (MAML) to find a robust initialization for soft prompts. MetaPT significantly improves few-shot performance, updating only 0.02% of the model's parameters while outperforming both full-model tuning and standard prompt pre-training.

Introduction

The rapid growth of Pre-trained Language Models (PLMs) has led to two primary adaptation paradigms: Full-model Tuning (FT) and Prompt Tuning (PT). While FT updates all parameters, PT keeps the PLM frozen and only trains a small set of "soft prompt" tokens. Despite its efficiency, PT is notoriously unstable in few-shot settings. Existing solutions like Pre-trained Prompt Tuning (PPT) attempt to pre-train these prompts on large unlabeled datasets but often fail to capture the latent structure of the data, leading to suboptimal generalizations. MetaPT addresses this by explicitly modeling data diversity through meta-learning.

Methodology: The MetaPT Pipeline

MetaPT employs a three-stage pipeline designed to instill adaptability into the prompt initialization process.

The MetaPT pipeline: from source data clustering to meta-learning with MAML and final downstream fine-tuning.
  1. Source Data Construction: The researchers utilized a RoBERTa model trained on the Yelp5 dataset to pseudo-label 10GB of text from OpenWebText, resulting in a balanced pool of 1,000,000 sentiment-labeled samples.
  2. Unsupervised Task Design: To capture the latent structure of the source data, Sentence-BERT was used to generate embeddings, followed by K-means clustering. This process partitions the data into distinct "meta-tasks" based on semantic similarity (e.g., electronics vs. food reviews).
  3. Prompt-MAML Algorithm: The Model-Agnostic Meta-Learning (MAML) algorithm is applied to the soft prompts. In the inner loop, prompts are updated on specific meta-tasks. In the outer loop, the meta-initialization is optimized based on performance across all clusters. This ensures the initialization is inherently adaptable to diverse data distributions.

Experimental Setup and Datasets

The effectiveness of MetaPT was evaluated across several sentiment classification benchmarks, including SST-2, SST-5, Amazon-2, Amazon-5, Sentihood, and SemEval-2016. The primary evaluation focused on a 40-shot setting using T5-base and T5-large architectures.

Key Results and Analysis

MetaPT demonstrates superior performance and stability compared to baseline methods across various data scales.

Comparison of Accuracy vs. Number of Sampled Data for Full-tuning (FT), Pre-trained Prompt Tuning (PPT), and MetaPT.
  • Performance Gains: MetaPT outperformed PPT on all seven evaluated tasks and surpassed FT on six out of seven. For instance, on SST-5, MetaPT achieved 45.26% accuracy, compared to 42.90% for PPT and 43.57% for FT.
  • Few-Shot Efficiency: As shown in the results, MetaPT maintains a performance lead even as the number of training samples increases, while requiring only 0.02% of the parameter updates of FT.
  • Stability: A significant challenge in few-shot learning is high variance. MetaPT notably reduced this variance, providing more consistent results across different data samples.
  • Ablation Insights: The researchers found that performance gains plateaued around 10,000 pre-training samples, indicating that the quality and diversity of meta-tasks are more critical than raw data volume. Furthermore, K-means clustering proved more effective for task construction than LDA or random splitting.

Discussion and Conclusion

While MetaPT shows great promise for sentiment classification, its generalizability to other Natural Language Understanding (NLU) tasks remains to be fully explored. Additionally, the reliance on pseudo-labeling means that adapting MetaPT to new domains would require domain-specific labeling strategies. Future work will investigate the scalability of MetaPT to "extra-large" models like T5-11B. In conclusion, MetaPT offers a powerful and parameter-efficient approach to few-shot adaptation, setting a new standard for prompt-based learning by combining unsupervised clustering with meta-learning.

Summary updated

BibTeX
@inproceedings{yu2023learning,
  author = {Zhou Yu and Yukun Huang and Kun Qian and Zhou Yu},
  title = {{Learning a Better Initialization for Soft Prompts via Meta-Learning}},
  booktitle = {Ijcnlp},
  year = {2023},
  doi = {10.18653/v1/2023.ijcnlp-short.8},
}
Figure