Introduction
Zero-shot text classification (ZSTC) is a critical task in natural language processing, enabling the categorization of text into classes unseen during model training. Current approaches generally fall into two categories: generative methods and mining-based methods. Generative methods utilize large-scale language models (LLMs) like GPT-3 to synthesize training data. However, these models are computationally expensive and often fail to generate sufficiently discriminative text for tasks with numerous similar classes. Conversely, mining-based methods use keyword matching to extract examples from unlabeled corpora. While efficient, these methods are often "brittle," missing semantically related documents that lack exact keyword matches.
To bridge this gap, we introduce REGEN (Retrieval-Enhanced Zero-shot Data Generation), a framework that mines high-quality, semantically rich training data from massive unlabeled corpora using progressive dense retrieval.
Methodology
REGEN employs a "retrieve-then-fine-tune" pipeline designed to iteratively build a clean and diverse synthetic dataset.
1. Contrastive Pretraining
The process begins by pretraining a Dense Retriever ($R_\theta$) on an unlabeled corpus (e.g., Wikipedia) using a self-supervised contrastive approach. By treating sentences from the same document as positive pairs, the model learns to group semantically related concepts in a continuous vector space, surpassing the limitations of traditional keyword search.
2. Progressive Retrieval and Augmentation
Initially, the retriever uses class label names (verbalizers) as queries. In subsequent rounds, REGEN implements Verbalizer Augmentation with Demonstrations. The highest-quality documents retrieved in the previous round are appended to the query, providing "in-context" examples that help the retriever identify a broader range of relevant topics. For instance, a query for "Sports" might expand to include terms like "stadium" or "tournament."
3. Self-consistency Guided Filtering
To mitigate noise in the retrieved data, REGEN utilizes a Classifier ($C_\phi$) trained on the current data batch. A "consensus" check is performed: only examples where both the Retriever and the Classifier agree on the label are retained. This filtering step effectively prunes out-of-distribution or mislabeled documents.
Experimental Setup
REGEN was evaluated on nine benchmark datasets across two domains:
- Topic Classification: AGNews, DBPedia, Yahoo Topics, and NYT.
- Sentiment Analysis: IMDB, MR, SST-2, Amazon, and Yelp.
The background unlabeled corpus consisted of millions of documents from Wikipedia, RealNews, and Amazon Reviews.
Results and Discussion
REGEN demonstrates significant improvements over existing ZSTC baselines while maintaining high efficiency.
Performance and Efficiency
REGEN achieved a 4.3% average performance gain across all nine datasets, with the most notable improvements in topic classification (up to 6.8%). Unlike generative baselines that require billion-parameter models, REGEN utilizes BERT-base scale architectures (approx. 110M parameters), making it roughly 70% faster and significantly more resource-efficient.
Label Efficiency
In few-shot scenarios, the data generated by REGEN proved to be exceptionally high-quality. As shown in the figure below, a model trained on REGEN-generated data can match the performance of models trained on 4x to 8x more manually labeled human data.
Conclusion
REGEN offers a powerful and efficient alternative to generative data synthesis for zero-shot text classification. By leveraging progressive dense retrieval and self-consistency filtering, it extracts high-quality "real-world" training examples that are more discriminative and diverse than hallucinated text. Future work will explore scaling the retriever architecture and adapting the framework for more complex tasks such as Natural Language Inference (NLI).
Summary updated