Learning Paradigms
Zero-shot Learning
In shortGetting a model to perform a task or apply labels it was never trained on, with no examples, using only knowledge from pre-training.
Zero-shot learning means asking a model to do a task, or to use labels, it has never been trained on, without giving it any examples. You describe the categories (for instance “informational”, “commercial”, “transactional”) and the model assigns them using what it learned during pre-training. It is the fastest way to label data when you have no training data, and it is how most people use a chatbot.
How it works
There are two common forms in MLforSEO material. The first is a zero-shot classifier such as BART-large-MNLI on Hugging Face. It turns classification into a reasoning test: each text is treated as a premise, each candidate label becomes a hypothesis like “This text is about politics”, and the probability that the text entails the hypothesis becomes the label score. The second is zero-shot prompting of a large language model: you give an instruction with no examples. Adding one or a few examples turns it into one-shot or few-shot prompting. Image models like CLIP can also classify zero-shot: you write categories as captions and the model picks the closest caption for each image.
How it’s used in SEO and marketing
- Search intent classification of keyword lists against your own intent categories.
- Quick sentiment or topic labelling of reviews when there is no labelled dataset.
- Auditing an image library by type (product on white, lifestyle, stock photo, screenshot) with CLIP.
- Zero-shot topic modelling in BERTopic, where you supply topics you expect and the model matches documents to them.
Example
MLforSEO’s transformer-based intent notebook uses BART zero-shot, blended with query rules and SERP signals. On a GPU it labels roughly 1,700 keywords in under three minutes, against your categories, with no training data. It is less accurate out of the box than the slower entity-based semantic parsing approach, because it relies entirely on a pre-trained model; fine-tuning improves it. In the NLP API comparison, the chatbots were given a deliberately zero-shot prompt (no examples, no allowed entity types), because that is how most people use them.
Limitations and things to watch
- Accuracy depends heavily on how you word the labels; vague or overlapping categories produce noisy results.
- Zero-shot LLM labelling can return different answers to the same text on different runs, and costs more per item at scale than a purpose-built model. A low temperature and few-shot examples help but do not close the gap with a task-specific API.
- Always check a hand-labelled sample before trusting the output. If the task is a well-defined classification you will repeat at scale, move to supervised learning or a dedicated API.
Learn it on MLforSEO
- Search-Intent Classification with Machine Learning: The Approaches Explained compares zero-shot with other methods.
- Transformer-Based Search Intent Classification with BART Zero-Shot & SERP Signals (Colab Notebook) is the free notebook.
- Sentiment Analysis: A Deep Dive Into the Theory, Methods, and Applications covers zero-shot LLM sentiment labelling.
- Comparing NLP APIs for Entity and Sentiment Analysis (vs Generative AI) tests zero-shot chatbot prompts.
- Semantic AI-powered SEO Keyword Research teaches the zero-shot intent pipeline.
Where Zero-shot Learning shows up on MLforSEO
Sources and further reading
- Search-Intent Classification with Machine Learning: The Approaches Explained MLforSEO
- Transformer-Based Search Intent Classification with BART Zero-Shot & SERP Signals (Colab Notebook) MLforSEO
- Sentiment Analysis: A Deep Dive Into the Theory, Methods, and Applications MLforSEO
- facebook/bart-large-mnli model card (Hugging Face)
- Benchmarking Zero-shot Text Classification (Yin et al., 2019)
- Language Models are Few-Shot Learners (Brown et al., 2020)
Other terms from Learning Paradigms
- Active LearningA training approach where the model picks the unlabelled examples it is least sure about for a human to label,…
- Few-shot PromptingShowing a language model a handful of worked examples inside the prompt so it copies the pattern, format or la…
- Fine-tuningTraining an existing pre-trained model a little further on your own labelled examples so it performs better on…
- Human-in-the-loopAn approach where people stay involved in an AI or ML system, labelling data, reviewing outputs or approving a…
- Pre-trainingThe first, large-scale training stage in which a model learns general patterns from huge datasets before it is…
- Reinforcement LearningA machine learning approach where an agent learns by trial and error, taking actions and adjusting its behavio…
- Supervised LearningMachine learning trained on labelled examples, where the right answer is known, so the model can predict label…
- Unsupervised LearningMachine learning on data without labels, where the model finds groups, patterns or structure on its own, as in…
