Term
Few-Shot Prompting
Few-shot prompting is a technique that includes a handful of input/output examples in the prompt so the model picks up the desired format and style.
Few-Shot Prompting — explained in more detail
Instead of giving the model a bare instruction (“classify this email”), you append three to five examples, each pairing an input with the expected output. The model infers the answer schema from the examples — concrete labels, a specific JSON format, or a particular tone of voice. This kind of learning happens entirely inside the context window, without touching the model weights (“in-context learning”).
Example / Practical context
A classic case is sentiment classification. The prompt lists three examples (“Great product!” → positive, “It was okay” → neutral, “Never again” → negative) followed by the new sentence. The model answers in the same schema. For structured output you show two or three JSON examples, and the model then holds the schema for new inputs — often more reliably than from a textual schema description alone.
Distinction from related concepts
Zero-shot prompting uses no examples at all and relies on the instruction alone. One-shot uses exactly one example. Chain-of-thought adds the reasoning path on top of the examples, not just the result. Fine-tuning, by contrast, changes the model itself — few-shot does not, so every new run has to repeat the examples in the prompt.
Entdecke mehr
Effort level and deep thinking: two independent axes for AI tasks
Effort scales breadth, deep thinking scales depth. When each setting makes sense — with three clear examples and one rule of thumb.
GlossarChain-of-Thought
Chain-of-Thought (CoT) is a prompting technique that asks the model to spell out its reasoning in intermediate steps — boosting accuracy on multi-step tasks.
LexikonPrompt Security — Injection, Leaking, Guardrails
How prompt injection, prompt leaking, and jailbreaks work — and which defenses (guardrails, spotlighting, sanitization) actually help.