Prompt-based Zero-shot Text Classification with Conceptual Knowledge

Yuqi Wang, Wei Wang, Qi Chen, Kaizhu Huang, Anh Nguyen, Suparna De

Abstract

Zero-shot text classification often relies on manually defined "verbalizers" within prompt-tuning frameworks, which can be brittle and limited by pre-training biases. This paper introduces a novel framework presented at ACL 2023 that enhances zero-shot classification by extracting a diverse set of keywords from masked language models and weighting them based on semantic relevance using contrastive learning. By projecting these weighted keywords into a structured Knowledge Graph (ConceptNet) embedding space, the proposed method achieves state-of-the-art performance and significantly higher stability across varying prompt templates compared to traditional methods.

Introduction

In the "extreme zero-shot" setting, models are tasked with classifying text into categories they have never encountered during training, relying solely on label names. Current state-of-the-art approaches typically utilize prompting, where an input is wrapped in a template (e.g., "The movie was [MASK]") and a Pre-trained Language Model (PLM) predicts the missing token.

However, these methods generally depend on verbalizers—static mappings that translate predicted words (e.g., "excellent") into specific labels (e.g., "Positive"). This reliance introduces several significant flaws:

  1. Narrow Scope: Pre-defined verbalizer lists often ignore domain-specific vocabulary.
  2. Pre-training Bias: PLMs may have inherent biases that skew predictions toward common but irrelevant words.
  3. Template Sensitivity: Small variations in the prompt template can lead to drastically different results, making the models "brittle" and unreliable.

Methodology

The proposed framework addresses these issues through a four-stage process that integrates distributional semantics with structured conceptual knowledge.

Overview of the proposed framework for zero-shot text classification.
  1. Prompt-based Keyword Extraction: Instead of a single label word, the model uses a Masked Language Model (MLM) to generate the top 50 most likely words for the <mask\> token in a given prompt template.
  2. Weight Assignment via SimCSE: To mitigate MLM bias, the authors employ SimCSE (a Siamese network based on contrastive learning) to calculate the semantic similarity between the original input sentence and a version where the mask is replaced by each extracted keyword. This ensures that contextually relevant keywords receive higher weights.
  3. Knowledge Graph (KG) Embedding: Keywords are mapped to embeddings from ConceptNet, a large-scale knowledge graph. These embeddings are refined via "retrofitting" to ensure that connected entities in the KG are positioned closer together in the vector space.
  4. Final Classification: The input text's final representation is a weighted sum of its keyword embeddings. Classification is performed by comparing this representation against target label embeddings using cosine similarity.

Experimental Setup

The framework was evaluated on four benchmark datasets covering two primary tasks:

  • Sentiment Analysis: SST-2 and Yelp-polarity.
  • Topic Detection: AG’s News (4 classes) and DBPedia (14 classes).

The method was compared against strong baselines, including GPT-3 (with calibration), RoBERTa, and AdaPrompt.

Results and Analysis

The proposed framework consistently outperformed all baseline models across the evaluated datasets.

Performance comparison of the proposed method against state-of-the-art baselines.

Key findings include:

  • Performance Gains: The model achieved a 13.88% accuracy gain on the Yelp-polarity dataset and a 5.31% gain on AG’s News compared to previous state-of-the-art prompt-based methods.
  • Robustness and Stability: One of the most significant improvements was the reduction in standard deviation across different prompt templates. While traditional prompting is notoriously sensitive to template wording, this method's use of a broad keyword set and KG space makes it much more robust.
  • Ablation Study: Removing the weight assignment (-WA) or the Knowledge Graph component (-KG) led to performance drops, confirming that both semantic weighting and structured knowledge are essential for optimal performance.

Discussion

The success of this approach highlights the value of concepts over simple co-occurrence. Ablation studies showed that ConceptNet embeddings significantly outperformed distributional embeddings like GloVe, particularly for topic detection tasks. This suggests that structured "conceptual" knowledge is more valuable for zero-shot reasoning than simple word co-occurrence statistics. Furthermore, using SimCSE as a filter acts as a powerful de-biasing mechanism, helping the model ignore "hallucinated" words that are common in general language but irrelevant to the specific context.

Conclusion and Future Work

While the framework represents a significant step forward, the authors identify several areas for future research. The current study focused on single-label classification; extending this to multi-label tasks remains a challenge. Additionally, despite the weighting mechanism, some keyword noise persists. Future work could explore more sophisticated filtering techniques and a more nuanced treatment of word senses to address polysemy, where a single word has multiple meanings depending on the context.

Summary updated

BibTeX
@inproceedings{wang2023prompt,
  author = {Yuqi Wang and Wei Wang and Qi Chen and Kaizhu Huang and Anh Nguyen and Suparna De},
  title = {{Prompt-based Zero-shot Text Classification with Conceptual Knowledge}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-srw.4},
}
Figure