Hayya Med AI
๐ŸŽฏ

Foundations

Zero-Shot & Few-Shot Learning

Zero-shot and few-shot learning describe an AI model's ability to perform a new task correctly from just an instruction, or from a handful of examples, without any additional training.

The Core Idea

Traditional machine learning required a labeled training dataset for every task โ€” to classify support tickets, you needed thousands of labeled tickets. Foundation models changed that by making zero-shot learning possible: describing a task in plain language, such as classify this complaint as billing, clinical, or scheduling, and getting a reasonable answer with no examples at all, because the model already learned the underlying concepts during pre-training. Few-shot learning is the middle ground โ€” providing two to ten examples of the task done correctly, right inside the prompt, which sharpens the model's understanding of the exact format, edge cases, or tone wanted without any retraining. Both are fundamentally different from fine-tuning: no weights change, no training run happens, and the adaptation lives entirely in what's typed into the prompt at the moment of use. This is what makes foundation models useful for tasks a business hasn't seen enough of yet to build a proper training set.

Why Examples Beat Instructions (Sometimes)

Zero-shot performance is strong for tasks that are common and well-represented in general training data, such as translation, general summarization, and straightforward classification. It degrades on tasks with unusual output formats, ambiguous category boundaries, or domain-specific judgment calls, which is exactly where few-shot examples earn their keep: showing the model a few correctly labeled edge cases does more to fix a specific failure than paragraphs of written instruction, because the model is pattern-matching against demonstrated behavior rather than parsing a rule. The tradeoff is that few-shot examples consume context window space and add to the token cost of every request, and poorly chosen examples can bias the model in unintended directions โ€” if all the examples happen to be about one clinical specialty, the model may over-apply that pattern to unrelated cases. Choosing between zero-shot and few-shot is therefore a practical engineering decision made per task, based on error rates observed in testing, not a general preference for one over the other.

Where It Fits at Hayya Med AI

This distinction matters directly when Hayya Med AI onboards a new hospital or government client: a triage-classification agent can often go live zero-shot for common categories, but for client-specific categories, such as a hospital's unique internal escalation codes or a ministry's specific tender-document classifications, the team adds a small set of few-shot examples drawn from that client's own historical data rather than waiting for a full fine-tuning cycle. That approach lets a new client's system reach usable accuracy within days of onboarding instead of the weeks a from-scratch training project would take, while leaving the door open to fine-tune later if the task's volume and category count justify the investment.

Share
Abbas Al Masri

Written by Abbas Al Masri

Founder & Chief Executive Officer, Hayya Med AI

Abbas Al Masri founded Hayya Med AI to help organizations across the GCC and beyond build AI-native platforms grounded in real market, regulatory, and operational reality.

View Full Profile โ†’

Frequently Asked

Does few-shot learning permanently change the model?

No โ€” the examples only affect the single request they're included in; the model's underlying weights are unchanged, so the next request without those examples reverts to baseline behavior.

When does few-shot learning stop being enough and fine-tuning become necessary?

When a task needs more nuance than a handful of examples can convey, runs at high enough volume that the added prompt cost outweighs a training investment, or must reliably work with very short prompts.