What is few-shot prompting
Few-shot means you first show the model 2–3 ready "input → output" examples in your prompt, then give a new input. "Shot" here means example. Zero-shot is a task with no examples at all. The model continues text, so it spots the pattern and writes the next answer in the same style: instead of describing what you want, you show it.
A few-shot prompt has three parts: a short task, examples with identical labels ("Item: … Description: …"), and a new "Item: …" with an empty "Description:". 2–5 examples are usually enough. The catch: the model copies everything it sees, typos and wrong prices included, and similar examples narrow the answer. So examples must be correct and varied.
Covered in the lessonShow an example: few-shotOpen the lesson →
More terms from this course
- What is an AI agent
- What is an AI hallucination
- What is a context window
- What is an embedding
- What is a knowledge cutoff
- What is an LLM (large language model)
- What is machine learning
- What is multimodal AI
- What is a neural network
- What is a prompt
- What is RAG
- What is RLHF
- What is a tokenizer
- What is voice cloning