TL;DR
The Prototypical Prompt Verbalizer (PPV) is a novel approach to prompt-tuning that replaces discrete label words with continuous prototypical embeddings in a feature space. By optimizing these prototypes via contrastive learning and initializing them using raw, unlabeled text, PPV eliminates the need for manual verbalizer engineering while successfully overcoming the "cold-start" problem in zero- and few-shot text classification.
What Problem Does This Paper Address?
Prompt-tuning has emerged as a powerful paradigm for adapting Pretrained Language Models (PLMs) to downstream tasks, especially in low-resource settings. It works by turning a classification task into a cloze-style question (e.g., wrapping a movie review as "[Review] It was a [MASK] movie").
A critical component here is the verbalizer, which maps the model's predicted token at the [MASK] position back to a class label (e.g., mapping "great" to the Positive class). However, current verbalizer construction methods suffer from two major drawbacks:
- Word-based verbalizers require significant human effort and domain expertise to manually select the best label words. Choosing the wrong words introduces substantial bias.
- Soft verbalizers replace discrete words with trainable continuous vectors. While flexible, these vectors are randomly initialized, leading to a severe cold-start problem in zero-shot or extreme few-shot scenarios where labeled data is scarce.
This paper introduces PPV to bridge this gap, representing labels as continuous semantic prototypes without requiring extensive manual design or abundant labeled data.
Methods
PPV shifts the classification criterion from discrete token prediction to distance-based metric learning in a continuous feature space.
1. Prototypical Embeddings
Instead of forcing the PLM to output a specific word, PPV extracts the hidden state of the [MASK] token and projects it into a compact feature space via a projection function $f$. Each class $y$ is represented by a prototypical embedding $\mathbf{p}$ in this same space. Classification is performed simply by finding the class prototype closest (via cosine similarity) to the input's projected [MASK] embedding.
2. Triple Contrastive Objectives
To ensure the feature space is highly discriminative, the authors introduce three distinct contrastive learning losses:
- Instance-Instance Loss ($\mathcal{L}_s$): Pulls input embeddings of the same class together and pushes different classes apart.
- Instance-Prototype Loss ($\mathcal{L}_{p1}$): Pulls an instance embedding closer to its corresponding class prototype.
- Prototype-Instance Loss ($\mathcal{L}_{p2}$): Pushes a class prototype away from instance embeddings belonging to other classes.
3. Solving the Cold-Start Problem (Pretraining)
To initialize the prototypes for zero-shot settings, the authors elegantly elicit knowledge directly from the PLM. For a given label, they take its literal word (e.g., "politics") and find a few unlabeled sentences containing that word. They wrap these sentences in a specific template: "[SENTENCE] In this sentence, [WORD] means [MASK]." The resulting [MASK] embeddings from the PLM are used to construct the initial class prototypes.
Datasets
The authors evaluated their method on three widely used many-class topic classification benchmarks in low-resource (0, 1, 5, 10, and 20-shot) settings:
- AG's News: 4 classes, 7,600 test size
- Yahoo Answers: 10 classes, 60,000 test size
- DBPedia: 14 classes, 70,000 test size
Key Insights and Ideas
- Continuous Semantics > Discrete Words: Representing labels as continuous prototypes allows the model to capture a broader, richer semantic scope than a single discrete word or a small set of manually curated words.
- Elicitation as Initialization: The internal knowledge of a PLM can be effectively "mined" using a clever template trick on unlabeled data. This provides a warm start for continuous embeddings, making zero-shot learning viable for soft verbalizers.
- The Power of Joint Losses: Ablation studies revealed that using instance-level contrastive learning alone ($\mathcal{L}_s$) fails miserably in few-shot scenarios. The explicit binding between instances and prototypes ($\mathcal{L}_{p1} + \mathcal{L}_{p2}$) is what stabilizes and drives the performance of the network.
Key Results
PPV demonstrates remarkable performance, particularly as the number of classes increases and labeled data remains minimal.
- Zero-Shot Superiority: In the 0-shot setting, PPV significantly outperformed standard prompt-tuning (PT) on complex datasets. On DBPedia (14 classes), PPV achieved a Micro-F1 of 80.65% compared to standard prompt-tuning's 65.10%.
- Few-Shot Dominance: In 10-shot and 20-shot settings, PPV consistently beat standard prompt-tuning, fine-tuning, and soft prompt verbalizers (SPV) across the board. For example, on 20-shot Yahoo Answers, PPV achieved 68.22% Micro-F1, outperforming SPV by nearly 2.5%.
As visualized via t-SNE reduction, the contrastive objective successfully forces the continuous prototypes and their corresponding instance embeddings into well-separated, tight clusters:
Limitations and Future Work
- Inadequate Contrastive Learning on Small Class Spaces: On AG's News (which only has 4 classes), PPV underperformed standard prompt-tuning in 1-shot and 5-shot settings. The authors attribute this to the fact that too few categories and training samples lead to insufficient negative pairs for effective contrastive learning.
- Sensitivity to Initialization Noise: Eliciting initial prototypes from randomly sampled unlabeled sentences introduces noise, as words can have multiple polysemous meanings depending on the context.
- Future Directions: The authors plan to explore advanced denoising mechanisms and self-supervised strategies to make the zero-shot prototype initialization more robust against data noise.
Summary updated