Entailment as Few-Shot Learner

Sinong Wang, Han Fang, Madian Khabsa, Hanzi Mao, Hao MaarXiv 2021

Abstract

Large pre-trained language models (LMs) have demonstrated remarkable ability as few-shot learners. However, their success hinges largely on scaling model parameters to a degree that makes it challenging to train and serve. In this paper, we propose a new approach, named EFL (Entailment as Few-Shot Learner), that can turn small LMs into better few-shot learners. The key idea is to reformulate potential NLP tasks into an entailment format and then fine-tune the model with as few as 8 examples. A systematic evaluation on 18 standard NLP tasks demonstrates that this approach improves existing state-of-the-art few-shot learning methods by 12% and yields competitive performance with models 500 times larger, such as GPT-3.

Introduction

Large language models like GPT-3 have revolutionized few-shot learning, but their 175-billion-parameter scale makes them prohibitively expensive for most applications. Smaller models, such as RoBERTa (355M parameters), typically struggle in low-data regimes, requiring thousands of examples to achieve high accuracy. While recent "prompt-based" methods (cloze tests) have helped bridge this gap, they remain limited when task distributions differ significantly from pre-training data. EFL addresses this by framing classification as a universal textual entailment problem, allowing smaller models to punch significantly above their weight class.

Methodology

The core innovation of EFL is the reformulation of standard NLP tasks into a unified textual entailment format. Instead of using a traditional classification head to predict a category, the model is presented with a sentence pair: the original input and a "label description."

Comparison of standard finetuning, prompt-based methods, and the proposed EFL approach.

For example, in sentiment analysis, a standard model might predict "Positive" for the input "I love this movie." In the EFL framework, the model evaluates the pair: "I love this movie [SEP] This is a great movie" and predicts whether the second sentence is entailed by the first. This turns every task—from linguistic acceptability to topic classification—into a binary sentence-pair classification problem. To further enhance performance, the authors utilize Unsupervised Contrastive data Augmentation (UCA) to generate additional training pairs and often employ intermediate training on large-scale entailment datasets like MNLI before task-specific fine-tuning.

Experimental Results

The researchers evaluated EFL across 18 standard NLP tasks, including the GLUE and SuperGLUE benchmarks. The results were striking:

  • Superior Few-Shot Performance: Across 15 tasks with only $K=8$ examples per class, EFL outperformed existing state-of-the-art methods like LM-BFF by an average of 12%.
  • Efficiency at Scale: A RoBERTa-large model using EFL achieved results competitive with GPT-3 on several benchmarks, despite being 500 times smaller.
  • Learning Curves: As shown in the performance plots below, EFL maintains a significant lead over standard fine-tuning and other prompt-based methods, particularly when the number of training examples is extremely low.
Accuracy vs. number of examples per class (K) for SST-2 and QNLI, comparing EFL against standard fine-tuning and LM-BFF.
  • Multilingual Generalization: In multilingual settings, EFL showed a massive 19-point improvement over standard fine-tuning. Remarkably, a model trained on English entailment descriptions could generalize to other languages without requiring translated labels.

Discussion and Limitations

EFL demonstrates that few-shot capability is not solely a function of model size, but also of how tasks are framed. By leveraging the structural similarity between pre-training objectives (like Next Sentence Prediction) and entailment, EFL bridges the gap between pre-training and fine-tuning more effectively than cloze-style prompts.

However, the method has limitations. It is currently restricted to discriminative tasks (classification and regression) and does not extend to generative tasks like summarization. Additionally, because the model must perform a forward pass for every potential label description, inference can be slower for tasks with many classes. Future work may involve automating label description engineering and optimizing inference speed through Siamese network architectures.

Summary updated

BibTeX
@misc{wang2021entailment,
  author = {Sinong Wang and Han Fang and Madian Khabsa and Hanzi Mao and Hao Ma},
  title = {{Entailment as Few-Shot Learner}},
  year = {2021},
  eprint = {2104.14690},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.14690},
}
Figure