Abstract
Recent advancements in Natural Language Processing (NLP) have shifted the focus toward prompt-based learning, where models like GPT-3 solve tasks in a zero-shot or few-shot manner. While Masked Language Modeling (MLM) models like BERT and RoBERTa are commonly used for this, ELECTRA—a model trained via Replaced Token Detection (RTD)—has been largely ignored for zero-shot tasks. This paper introduces a novel RTD-based prompt learning method, demonstrating that ELECTRA significantly outperforms MLM-based models, achieving up to 90.1% accuracy on sentiment analysis in a zero-shot setting.
Introduction
The "pre-train, prompt, and predict" paradigm has revolutionized NLP, allowing large-scale models to perform tasks without extensive fine-tuning. However, the massive parameter counts of models like GPT-3 (175B) make them impractical for many real-world applications. Smaller models like BERT and RoBERTa rely on MLM, which only learns from a small fraction (15%) of masked tokens. In contrast, ELECTRA’s discriminator learns from every token by distinguishing original words from those generated by a companion model. This paper explores whether ELECTRA’s unique pre-training objective can be leveraged for superior zero-shot and few-shot performance.
Methodology: RTD-based Prompt Learning
The core contribution of this work is the adaptation of ELECTRA’s discriminator for prompt-based classification. In traditional MLM-based prompting, a model predicts a hidden token (e.g., "This movie is [MASK]"). In the proposed RTD-based approach, the model evaluates a full sentence and determines if a specific "label word" is original or replaced.
For a sentiment task, the model is given "This movie is great." If the discriminator identifies "great" as an original token, it indicates positive sentiment. By designing specific templates for 15 different NLP tasks, the authors transform diverse challenges into this binary "original vs. replaced" decision.
Experimental Setup
The method was evaluated across 15 datasets covering a wide range of linguistic challenges:
- Sentiment & Opinion: SST-2, SST-5, MR, CR, MPQA, Subj.
- Natural Language Inference (NLI): MNLI, SNLI, QNLI, RTE.
- Similarity & Classification: MRPC, QQP, STS-B (Regression), CoLA, TREC.
The researchers compared RTD-ELECTRA against MLM-BERT, NSP-BERT, and MLM-RoBERTa in both base and large configurations.
Results and Discussion
The experimental results consistently favored the RTD-based approach. RTD-ELECTRA-large outperformed MLM-RoBERTa-large by an average of 8.4% and MLM-BERT-large by 13.7% across all 15 tasks.
Key findings include:
- Zero-Shot Excellence: On the SST-2 sentiment task, ELECTRA achieved 90.1% accuracy without any training data, significantly higher than RoBERTa's 83.6%.
- Efficiency and Stability: ELECTRA captures more knowledge per training step due to its all-token learning objective. It also demonstrated greater robustness to prompt variations compared to BERT, suggesting a more stable internal representation of task logic.
- Few-Shot Scaling: ELECTRA maintained its performance lead as the number of training samples ($K$) increased from 16 to 128, proving its stability as a foundation for learning even with minimal data.
Conclusion
This research highlights that ELECTRA is not merely an efficient alternative for standard fine-tuning but a powerful contender in the zero-shot and few-shot learning landscape. By aligning the downstream task with the pre-training objective of replaced token detection, ELECTRA unlocks significant latent knowledge. Future work will explore automatic prompt generation and the application of "soft" continuous prompts to further enhance the model's potential.
Summary updated