Gen-Z: Generative Zero-Shot Text Classification with Contextualized Label Descriptions

Sachin Kumar, Chan Young Park, Yulia Tsvetkov

Prompting large language models (LLMs) for text classification is a powerful but notoriously brittle paradigm. A tiny change in how a prompt is phrased can lead to wildly different results. Most current prompting methods are discriminative: they ask the model to estimate the probability of a label given an input text ($P(\text{label} | \text{input})$). This approach is prone to miscalibration and often relies on superficial shortcuts rather than a deep understanding of the task.

While In-Context Learning (ICL)—providing a few labeled examples in the prompt—improves performance, recent research suggests ICL doesn't necessarily "teach" the model the task. Instead, it "primes" the model to locate the right concept within its existing pre-trained knowledge. However, finding the perfect examples to prime the model is difficult, computationally expensive, and highly sensitive to example ordering.

This raises a compelling question: If examples primarily serve to prime the model, can we achieve the same results by explicitly priming the model with detailed, contextualized descriptions instead?

The GEN-Z Framework

To address the brittleness of standard prompting, the authors introduce GEN-Z (Generative Zero-Shot Classification). This framework shifts the classification paradigm in two major ways:

  1. Generative Objective: Instead of predicting a label from the text, GEN-Z calculates the likelihood of the input text conditioned on a label description ($P(\text{input} | \text{label description})$). This "noisy channel" approach has been shown to be significantly more robust to distribution shifts and prompt variations.
  2. Contextualized Label Descriptions: Rather than using simple, isolated label words (e.g., "Positive" or "Empowering"), GEN-Z uses expressive, multivariate natural language descriptions.
Comparison of standard discriminative and generative classifiers with the proposed multivariate generative approach using contextualized label descriptions.

As illustrated above, this multivariate approach allows the model to seamlessly integrate contextual metadata—such as the platform (e.g., Reddit), the reader's demographics, or the writer's background—directly into the prompt. For example, instead of just predicting "Empowering," the generative model evaluates the likelihood of the text given the description: "The Reddit comment written by a woman empowers the addressed woman."

To handle the inherent variance in natural language phrasing, GEN-Z generates approximately 20 paraphrases of these descriptions (using an auxiliary model like ChatGPT) and aggregates the results via arithmetic mean. This ensembling further stabilizes the model's zero-shot performance.

Experimental Setup

The researchers evaluated GEN-Z across 18 text classification datasets spanning several domains:

  • Sentiment Analysis: SST2, SST5, Yelp, Movie Reviews (MR), Customer Reviews (CR), and Financial Phrasebank.
  • Topic Classification: AGNews, DBPedia.
  • Hate Speech & Ethos: HS18 and various Ethos subsets (Race, Religion, etc.).
  • Pragmatics & Personalization: Politeness (Email) and Empowerment (Reddit).

They tested the framework across six open-source model families—including GPT-2, OPT, Pythia, GPT-J, and Llama 1 & 2—with sizes ranging from 125M to 13B parameters.

Key Findings and Results

  • Superiority over Zero-Shot Baselines: On GPT-J (6B), GEN-Z outperformed standard discriminative zero-shot methods on nearly every task. For instance, on the SST2 sentiment task, GEN-Z achieved a 91.7 F1 score, compared to 87.1 for the best discriminative baseline.
  • Rivaling Few-Shot Learning: Remarkably, GEN-Z often performed on par with or better than 8-shot and 16-shot ICL, despite not seeing a single labeled example. Explicit priming with a well-crafted, contextualized description proved just as effective as implicit priming via examples.
  • The Power of Metadata: Incorporating readily available variables—like where the text came from or who wrote it—consistently boosted performance. This suggests that LLMs possess a nuanced, latent understanding of how language varies across different domains (e.g., a formal "review" on Yelp versus a casual "post" on Reddit).
  • Zero-Shot Personalization: One of the most exciting findings is GEN-Z's ability to "personalize" classification. By including reader or author demographics in the label description (e.g., "According to a 20-year-old with a college degree, this email is impolite"), the model can adjust its predictions based on social context without needing specific training data for those demographic groups.
  • Robustness and Scaling: GEN-Z showed the smallest variance in performance across different prompt phrasings, directly addressing the "brittleness" problem. Furthermore, performance generally improved as model size increased, particularly for the GPT-2 and Pythia families.

Limitations and Future Directions

While highly effective, the current study is limited to English-language datasets. Additionally, the framework currently assumes a simplified prior where all labels are equally likely ($p(y_i)$ is uniform), which may not hold true in real-world, imbalanced distributions. The authors also note that the datasets and the inherent Western-centric biases of the pre-trained models might limit the generalizability of the personalization results across diverse global populations.

Future work could extend this generative framework beyond standard text classification to more complex NLP tasks, such as sentence pair classification or question answering, further exploring the limits of explicit, contextualized priming.

Summary updated

BibTeX
@inproceedings{kumar2024gen,
  author = {Sachin Kumar and Chan Young Park and Yulia Tsvetkov},
  title = {{Gen-Z: Generative Zero-Shot Text Classification with Contextualized Label Descriptions}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=rkplYfqUr0},
}
Figure