ZeroPrompt: Scaling Prompt-Based Pretraining to 1,000 Tasks Improves Zero-Shot Generalization

Hanwei Xu, Yujun Chen, Yulun Du, Nan Shao, Yanggang Wang, Haiyu Li, Zhilin Yang

TL;DR

ZeroPrompt demonstrates that scaling the number of training tasks to over 1,000 is a powerful and efficient alternative to scaling model parameters for zero-shot generalization. By training smaller models on a massive variety of real-world tasks, the authors achieve performance comparable to models 30x larger, improving training efficiency by 30x in terms of FLOPs.

What Problem Does This Paper Address?

While large language models (LLMs) like GPT-3 have shown impressive zero-shot capabilities, their performance often pales in comparison to fully supervised fine-tuning. Recent research into Multitask Pretraining (MTP)—where models are trained on a collection of supervised tasks—has shown promise in closing this gap. However, previous work (like FLAN or T0) only explored scaling to a few dozen tasks.

The authors of ZeroPrompt ask a fundamental question: What happens when we scale the number of tasks to hundreds or even thousands? They hypothesize that "task scaling" might be just as important as "model scaling" (increasing parameter count) for building generalizable AI systems.

Methods

ZeroPrompt utilizes a multitask prompted pretraining framework with several key technical components:

  1. Hybrid Prompt Design: The model uses a combination of hard prompts (hand-crafted task descriptions and label candidates) and soft prompts (learnable continuous embeddings used as prefixes). This allows the model to leverage both human-readable instructions and optimized vector representations.
  2. Auxiliary MLM Loss: To prevent "catastrophic forgetting"—where a model loses its general language knowledge while learning specific tasks—the authors include a Masked Language Modeling (MLM) objective as an auxiliary loss during the multitask training phase.
  3. Self-Training and Data Retrieval: To further boost performance, the authors use a self-training loop. They retrieve task-similar unlabeled data from a massive corpus using sentence embedding similarity and use the model to generate pseudo-labels, effectively expanding the diversity of the training data.
  4. Task-Specific Soft Prompting for Unseen Tasks: For new, unseen tasks, the model needs a soft prompt. The authors experimented with weighting existing prompts based on task similarity but found that, surprisingly, a random initialization of the soft prompt for unseen tasks performed best.

Datasets

The study is unique in its scale, utilizing a total of 1,110 Chinese NLP tasks:

  • Public Datasets: 80 tasks covering sentiment analysis, news classification, NLI, summarization, and more.
  • Production Datasets: Over 1,000 real-world datasets derived from commercial sales conversations across 10 domains (e.g., Auto, Insurance, Finance).

The task taxonomy for these production datasets is highly diverse, as shown in the figure below:

Figure 4: The task taxonomy of the real-world produc- tion datasets. The tasks are collected from commercial sales conversations in ten domains, e.g. Auto and Insur- ance. Task types are marked by different colors. For example, “Profile” is to predict an aspect of customer profile from a given transcribed text, and “Acception” is to judge whether a salesperson follows a certain sales script.

The authors split these into 824 training tasks and 286 testing tasks to rigorously evaluate zero-shot generalization.

Key Insights and Ideas

  • The Task Scaling Law: The most significant finding is that as the number of training tasks increases, the performance gap between small and large models narrows significantly.
  • Task Scaling > Sample Scaling: The authors decoupled the effects of adding more tasks versus adding more data per task. They found that training on 800 tasks with 128 samples each yielded much better zero-shot performance than training on 80 tasks with 1,280 samples each, even though the total number of training examples was identical.
  • Efficiency Gains: Because task scaling allows smaller models to perform like larger ones, it offers a massive boost in efficiency. A 0.4B parameter model trained on 800 tasks achieved zero-shot performance comparable to a 12B parameter model, representing a 30x improvement in FLOPs efficiency.

Key Results

ZeroPrompt shows substantial improvements over existing state-of-the-art Chinese models:

  • Vs. Baselines: ZeroPrompt (1.5B) outperformed T5 (zero-shot) by 30.96 points and beat much larger models like CPM-2 (11B) and Pangu-α (13B) by approximately 28 points.
  • Vs. Supervised Models: Remarkably, ZeroPrompt's zero-shot performance was only 4.7 points short of a fully supervised, task-specifically finetuned RoBERTa-large model.

As illustrated in Figure 1, the performance of smaller ZeroPrompt models converges toward larger models as the number of tasks scales up:

Figure 1: Task scaling vs model scaling. The horizon- tal axis is the number of training tasks, and the verti- cal axis is the zero-shot performance on unseen tasks. RoBERTa-Large was finetuned in a fully-supervised manner, while Pangu Alpha, CPM-2 and our Zero- Prompt were zero-shot prompted.

Limitations and Future Work

The authors acknowledge a few key limitations:

  • Distributional Sensitivity: Zero-shot performance is highly dependent on the similarity between training and test task distributions. If the test task is completely unlike anything in the 1,000-task training set, performance gains are less certain.
  • Quantifying Similarity: It remains an open research problem to quantitatively characterize "task similarity" to predict how well a model will generalize to a specific new domain.
  • Language Scope: The current study focuses exclusively on Chinese NLP tasks; extending this to a multilingual context is a natural next step.

Future work could involve optimizing the distribution of training tasks rather than just the number, potentially leading to even more efficient zero-shot learners.

Summary updated

Abstract

We propose a multitask pretraining approach ZeroPrompt for zero-shot generalization, focusing on task scaling and zero-shot prompting. While previous models are trained on only a few dozen tasks, we scale to 1,000 tasks for the first time using real-world data. This leads to a crucial discovery that task scaling can be an efficient alternative to model scaling; i.e., the model size has little impact on performance with an extremely large number of tasks. Our results show that task scaling can substantially improve training efficiency by 30 times in FLOPs. Moreover, we present a prompting method that incorporates a genetic algorithm to automatically search for the best prompt for unseen tasks, along with a few other improvements. Empirically, ZeroPrompt substantially improves both the efficiency and the performance of zero-shot learning across a variety of academic and production datasets.
BibTeX
@inproceedings{xu2022zeroprompt,
  author = {Hanwei Xu and Yujun Chen and Yulun Du and Nan Shao and Yanggang Wang and Haiyu Li and Zhilin Yang},
  title = {{ZeroPrompt: Scaling Prompt-Based Pretraining to 1,000 Tasks Improves Zero-Shot Generalization}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=-9dGh1rqcTp},
}
Figure