Zero-shot classification
Classifying text into categories without training examples — you provide label names in plain language, and the model applies them based on semantic understanding alone.
Zero-shot classification lets you assign text to categories without providing labeled training examples. Instead of training a classifier on hundreds of annotated examples per category, you give the model a set of label descriptions in natural language — “positive sentiment,” “mentions climate policy,” “describes a participant’s emotional response” — and the model predicts which label applies to each piece of text based on the meaning of the labels alone.
This is possible because large language models learn representations of meaning during pretraining that generalize to new tasks. A model that has never seen labeled examples of “discussion of informed consent” can still recognize that pattern because it has processed millions of documents containing that concept.
Practical value for researchers:
Zero-shot classification is particularly useful when you’re developing a new coding scheme during analysis and don’t yet have enough coded examples to train a custom classifier. You can iterate on your label definitions in natural language, apply them to a sample, and refine them — much faster than the train/evaluate/retrain loop of supervised classification.
Common libraries that support zero-shot text classification: Hugging Face transformers (pipeline with facebook/bart-large-mnli or similar), SetFit (few-shot, slightly more data needed), direct LLM prompting via API.
Limitations:
- Performance on specialized or ambiguous categories is less reliable than a fine-tuned classifier on in-domain data
- “Zero-shot” performance varies significantly by model size and the clarity of your label descriptions — vague labels produce inconsistent results
- For high-stakes classification (e.g., identifying ethical violations in interview transcripts), zero-shot results need systematic human validation before being reported as findings
- Confidentiality: text passed to commercial API-based models may not be appropriate for sensitive research data under your IRB protocol
Related terms: Named Entity Recognition, Topic Modeling, Prompt Engineering
Related guide: Social Science