In zero-shot prompting, you simply describe what you want. In few-shot prompting, you include a handful of examples in the prompt to show the pattern. Modern instruction-tuned models handle many tasks zero-shot, but examples still help with unusual formats, specific tone or tricky classification.

How it works

Zero-shot works because large language models have already learned a huge range of tasks during pre-training and later instruction tuning, where they were trained on many examples of following written requests. When you ask 'Classify this review as positive, negative or neutral', the model recognises the task from your wording and applies patterns it has seen before. Few-shot prompting, sometimes called in-context learning, adds examples inside the prompt, such as three reviews with their correct labels, so the model can copy the format and decision rules. The model's weights do not change in either case; it is only using the prompt as context. The 2020 GPT-3 paper, 'Language Models are Few-Shot Learners', showed that larger models get much better at learning from in-prompt examples, and instruction-tuned models later made zero-shot performance far stronger. A related technique, zero-shot chain of thought, adds an instruction such as 'think step by step' to improve reasoning without examples. In classic machine learning, zero-shot also means recognising categories never seen in training, for instance labelling an animal from a text description alone.

Why it matters

Knowing when zero-shot is enough saves time and tokens. For everyday writing, summarising and simple sorting, a clear instruction is usually all you need. When results come back in the wrong format or tone, the fastest fix is often two or three examples rather than a longer explanation. This choice between zero-shot, few-shot and fine-tuning is one of the most practical skills in prompt engineering.

Where you will see it

  • Summarising a meeting transcript with a single instruction.
  • Sorting customer feedback into categories without labelled examples.
  • Translating a product description into another language.
  • Extracting names, dates and amounts from an invoice into a table.

Limits and common misconceptions

  • Zero-shot results can be inconsistent in format, which causes problems when output feeds into a spreadsheet or automation.
  • A model may misunderstand niche tasks, house styles or company-specific labels without examples.
  • Few-shot examples can introduce their own bias, for instance if most examples share the same label.

How it differs from related terms

  • Zero-shot vs Prompt engineering Prompt engineering is the wider craft of designing prompts; choosing zero-shot or few-shot is one decision within it.
  • Zero-shot vs Fine-tuning Fine-tuning changes the model's weights with training examples; zero-shot and few-shot only change what is in the prompt.

Frequently asked questions

What is the difference between zero-shot, one-shot and few-shot?

Zero-shot gives only instructions. One-shot adds a single example of the desired input and output. Few-shot adds several examples, often two to five. More examples usually improve consistency in format and style, but they use more tokens and can bias the model towards the examples.

When should I use few-shot instead of zero-shot?

Use few-shot when you need a specific format, tone or labelling scheme, or when zero-shot answers are inconsistent. If results are already good with a clear instruction, extra examples add cost without much benefit.

Does zero-shot prompting train the model?

No. The model's internal weights stay the same. It uses your instructions only within that conversation and does not learn permanently from them. Changing the model itself requires training methods such as fine-tuning.

Related terms

All AI terms