One-shot prompting gives the model exactly one example of the task before asking it to perform it — a middle ground between zero-shot (no examples) and few-shot (several examples).
Example
Prompt:
"Convert product descriptions into a title + 1-line tagline.
Example:
Description: A durable stainless steel water bottle that keeps
drinks cold for 24 hours.
Output:
Title: Stainless Steel Water Bottle
Tagline: Cold drinks, all day long.
Now convert this:
Description: A wireless mouse with a rechargeable battery lasting
up to 3 months per charge."
The single example demonstrates the exact desired output structure — often enough to lock in a consistent format that a plain instruction alone might not reliably produce.
Why Use Exactly One Example (Not Zero, Not Several)
| Situation | Better Fit |
|---|---|
| Task is simple, instruction alone is clear | Zero-shot |
| Output format needs to be shown, but the pattern is simple/consistent | One-shot |
| Output has more variation, or the task benefits from seeing multiple pattern variations | Few-shot |
One-shot is a reasonable default when zero-shot output format is inconsistent, but you want to keep the prompt compact (fewer tokens than several few-shot examples).
Practical Use Case
Structured, format-sensitive tasks (like the title/tagline example above) where a single clear demonstration is usually enough to establish the pattern, without the added token cost of multiple examples.
Common Mistakes
- Choosing an example that's atypical or an edge case — the model tends to generalize from the pattern shown, so a poorly chosen example can bias output in unintended ways
- Assuming one example is always sufficient — some tasks genuinely need multiple examples to show format variation (see Few-Shot Prompting)
Interview Relevance
"What's the practical difference between one-shot and few-shot prompting, beyond just the number of examples?" — token cost tradeoff and how much output-format variation the task actually has are the key distinguishing considerations.
Practice Question
Design a one-shot prompt for converting a customer complaint into a structured (category, urgency, summary) format, choosing a representative (not edge-case) example.