Zero-Shot, One-Shot, Few-Shot: How to get results from AI quickly
Want to use AI without complicated setup? Zero-shot, one-shot, and few-shot prompting are simple techniques that will help you get results…
Zero-Shot, One-Shot, Few-Shot: How to get results from AI quickly
Want to use AI without complicated setup? Zero-shot, one-shot, and few-shot prompting are simple techniques that will help you get results from large language models (LLMs) quickly.
In this article, I will explain what they are, show examples from review classification and pizza order parsing, and give tips to avoid mistakes. Let’s get started!

What is Zero-Shot, One-Shot and Few-Shot Prompting?
Zero-Shot Prompting
Zero-shot is when you give the LLM a task without examples. The model relies on its training data to understand what is required.
- Simplicity: No need to prepare samples.
- Limitations: May give inaccurate results if the task is unusual.
One-Shot and Few-Shot Prompting
One-shot uses one example and few-shot uses several to show the LLM what you want. This improves accuracy, especially for complex tasks.
- One-Shot: One sample for reference.
- Few-Shot: 2–5 examples for a better understanding of the context.
Practical examples: What to do and what to avoid
Example 1: Classifying film reviews (Table 1) Task: Identify whether a review is positive or negative.
Here’s what not to do:
Prompt: ‘Is this a good review? ‘The film was boring.’’
Result: ‘Yes’ (the model did not understand the task due to vagueness).
You should do it like this:
Prompt: ‘Classify the review as positive or negative.
Example: ‘The film was great’ -> Positive. Example: ‘The film was boring’ -> Negative.’
Result: ‘Negative’ (clear task with an example).
Example 2: Parsing pizza orders in JSON (Table 2) Task: Convert a text order to JSON.
This is not the way to do it:
Prompt: ‘Make JSON from this: ‘I want a pizza with cheese and pepperoni.
Result: ‘{ ‘pizza’: ‘cheese and pepperoni’ }’ (unstructured).
You need to do this:
Prompt: ‘Convert the order to JSON. Example: ‘Pizza with mushrooms’ -> {‘order’: {‘type’: ‘pizza’, ‘toppings’: [‘mushrooms’]}}.
Order: ‘I want a pizza with cheese and pepperoni’ -> {‘order’: {‘type’: ‘pizza’, ‘toppings’: [‘cheese’, ‘pepperoni’]}}.’
Result: ‘{‘order’: {‘type’: ‘pizza’, ‘toppings’: [‘cheese’, ‘pepperoni’]}}’ (structured output).
Tips for success
Choose a variety of examples: In a few-shot, use samples with different styles or formats to cover edge cases.
Example: For classification, add ‘Great film!’ and ‘Too long…’.
Avoid over-complication: Don’t overload the promo with unnecessary details — keep it clear.
Bad: ‘Classify by weather, mood and time of day…’
Good: ‘Classify it as positive or negative.’
Test and optimise: Try 1–2 examples in a one-shot, then add up to 5 in a multi-shot if accuracy is required.
Who is it for and what problems does it solve
These techniques are ideal for developers, content managers, and analysts who want to get LLMs up and running quickly without deep AI knowledge.
They solve:
- Not knowing how to get started (zero-shot gives you a simple start).
- Problems with unstructured answers (few-shot structures the output).
- Lack of examples (one-shot and few-shot provide a reference point).
Zero-shot, one-shot, and few-shot are your first steps to working with AI effectively. Start with simple tasks, add examples for better results, and avoid over-complication.
Try these techniques today and share your results in the comments .
And if you have any questions, feel free to contact me personally.
I’m always open to new opportunities. Sincerely, Mr. Mykyta
Published on June 2, 2025, at 12:53 PM EEST
메타데이터
- post_id
- 5461a8d411dc
- slug
- zero-shot-one-shot-few-shot-how-to-get-results-from-ai-quickly-5461a8d411dc
- url
- https://medium.com/@8926581/zero-shot-one-shot-few-shot-how-to-get-results-from-ai-quickly-5461a8d411dc
- canonical_url
- https://medium.com/@8926581/zero-shot-one-shot-few-shot-how-to-get-results-from-ai-quickly-5461a8d411dc
- author_url
- https://medium.com/@8926581
- status
- ok
- fetched_at
- 2026-07-25 18:10:40