Nivå 2 — Intermediate

Few-shot examples

Show Claude what you want — with examples. Few-shot prompting is the technique that gives you the most control over format and style.
📅 21.05.2026 👁 63 views 🇳🇴 Les på norsk

What is few-shot prompting?

Few-shot prompting means giving Claude one or more examples of desired input and output before asking the actual question. Claude recognizes the pattern and follows it.

💡 The names:
Zero-shot — no examples, just instruction.
One-shot — one example.
Few-shot — two to five examples.
The more complex the pattern, the more examples you need.

Why is few-shot so powerful?

Words like "professional", "friendly" or "concise" are interpreted differently by Claude and you. An example removes all ambiguity — Claude sees exactly what you mean.

Few-shot + chain-of-thought

Combine the two techniques for maximum power — give Claude an example that also shows the reasoning:

2️⃣
Two examples are often enough for simple patterns. Use three to five for complex formats or edge cases.
⚖️
Vary the examples — do not use two identical ones. Claude learns better from examples that cover different cases.
"A thousand words describe less precisely than one good example." — The core of few-shot prompting
Your faith is your fortune. What you believe within, you will see without.
— Florence Scovel Shinn

🎯 Test your knowledge

Test yourself — completely optional, but fun! 🎯

Question 1 of 3

Question 1 of 3

What is the difference between zero-shot and few-shot prompting?

Zero-shot gives no examples — just instruction. Few-shot gives two to five examples of desired input and output before the question.

Question 2 of 3

Question 2 of 3

Why is few-shot more precise than describing the desired format with words?

Words like "professional" are interpreted differently — a concrete example shows Claude exactly what you mean without ambiguity.

Question 3 of 3

Question 3 of 3

What should you think about when creating few-shot examples?

Vary the examples to cover different cases, and be consistent in format — inconsistent examples give inconsistent output.
Share:

Read also