Ploba logo

Find the right AI tool for the job: apps, agents, APIs, MCP servers and datasets, explained plainly.

Get the AI Digest

Discover

  • Explore
  • Top Charts
  • Categories
  • Agents
  • MCP servers
  • Developer tools

Learn & community

  • Learn AI
  • AI Glossary
  • Blog
  • Hackathons
  • People
  • AI Digest

For makers

  • List your tool
  • Docs
  • Claim a listing
  • Advertise
  • Write for us

Company

  • About
  • Careers
  • Changelog
  • Trust
  • Security
  • Contact

© 2026 Ploba. All rights reserved.

  • Privacy
  • Terms
  • Cookies
  • Advertising
  • All policies
llms.txt
AI glossary
Generative AI

Few-Shot Prompting

Also called Few-shot learning, In-context examples, One-shot prompting

Including a handful of worked examples in a prompt so the AI model can copy the pattern, format and tone you want.

What is few-shot prompting?

Few-shot prompting means showing an AI model a few examples of the task before asking it to do the real one. Instead of only describing what you want, you include two to five input-and-answer pairs in the prompt, then add your new input. The model picks up the pattern and follows it.

With one example it's called one-shot prompting; with none, it's zero-shot prompting.

How does it work?

A large language model predicts what text should come next. When the prompt contains several examples in the same shape, the most likely continuation is another answer in that shape. For example:

  • Review: "Arrived broken." → Sentiment: negative
  • Review: "Does the job, nothing special." → Sentiment: neutral
  • Review: "Best purchase this year." → Sentiment:

The model completes the last line as "positive", in exactly the format of the others. Nothing about the model changes; the examples only live in that one request.

What is it commonly confused with?

  • Fine-tuning. Fine-tuning trains the model on examples and changes its weights permanently. Few-shot examples are read once and forgotten after the request.
  • Learning new facts. The "learning" here is temporary pattern-following inside the context window, not new knowledge.

Why does it matter?

Examples are often the single biggest improvement you can make to a prompt, especially for strict formats, classification, tone of voice and extraction. Pick examples that are varied and correct: the model copies mistakes and quirks as faithfully as good habits. Each example also adds tokens, so long examples make every request cost more. See What is prompt engineering? for more techniques.

Category
Generative AI
Last reviewed
Nov 3, 2026
Also called
Few-shot learning, In-context examples, One-shot prompting

Sources

  • Brown et al.: Language Models are Few-Shot Learners
  • Prompting Guide: Few-shot prompting

Related terms

  • Generative AIZero-Shot PromptingInstructing an AI model to perform a task without providing any examples in the prompt.
  • Generative AIPrompt EngineeringThe practice of designing, structuring, and refining inputs to get optimal outputs from AI models.
  • FundamentalsPromptThe specific input or instruction provided to an AI model to elicit a response or action.
  • Generative AI · CoTChain-of-ThoughtAsking or training an AI model to work through intermediate reasoning steps before giving its final answer.
  • DevelopmentFine-TuningThe process of adapting a pre-trained AI model to a specific task or style by training it further on a specialized dataset.

Read more on Learn

All articles
  • Illustration of a person typing a prompt into an AI interfaceAI Concepts · Sep 3, 2026What Is Prompt Engineering? A Practical Beginner’s GuideLearn the basics of prompt engineering. Discover practical tips for talking to AI models like ChatGPT and Claude to get better, more accurate results.
  • Close up of a futuristic computer server rackComparisons · Aug 6, 2026RAG vs Fine-Tuning vs Prompt EngineeringPrompt engineering, RAG or fine-tuning? Learn what each one changes, what it costs, and the order to try them when your AI gives poor answers.