Learn the difference between zero-shot and few-shot prompting. Understand how to provide examples to an AI to get more accurate and customized responses. Lecture 05
Teaching the AI
Welcome to Part 2 of our course! We’re now moving into specific techniques. Today, we’ll learn how to “teach” an AI what we want by showing it examples.
Sometimes, just describing what you want isn’t enough. The best way to get a specific style or format is to show the AI exactly what you mean. This is where Zero-Shot and Few-Shot prompting come in.
Zero-Shot Prompting
Zero-Shot Prompting is what we’ve been doing so far. You ask the AI to do something without giving it any prior examples. You’re relying on its existing knowledge to figure out the task.
It’s called “zero-shot” because you’re giving the AI zero examples, or “shots,” at the task before you ask it to perform.
Example of Zero-Shot Prompting
Prompt:
Classify this movie review as positive or negative: Review: "This movie was a fantastic journey from start to finish!" Sentiment:
The AI uses its general understanding of language to know that “fantastic journey” is positive. You didn’t have to show it any examples of positive or negative reviews.
Few-Shot Prompting
Few-Shot Prompting is when you provide a few examples (a “few shots”) in your prompt to show the AI what you want. This helps it understand the pattern, style, or format you’re looking for.
This is incredibly useful when you have a very specific or unique task that the AI might not automatically understand.

Example of Few-Shot Prompting
Imagine you want the AI to summarize text in a very specific, informal way. You can show it how.
Prompt:
Here are some examples of summarizing complex topics in a fun, simple way. Original: "Photosynthesis is a process used by plants, algae, and certain bacteria to convert light energy into chemical energy." Summary: "Plants eat sunlight for food!" Original: "The water cycle involves the continuous movement of water on, above, and below the surface of the Earth." Summary: "Earth's water goes on a round trip: up to the sky and back down again!" Original: "Gravity is the force by which a planet or other body draws objects toward its center." Summary:
Expected AI Response:
What goes up must come down!
By providing examples, you taught the AI the exact style you wanted, which is much more effective than trying to describe “fun and simple” with words alone.
When to Use Each?
- Use Zero-Shot for simple, common tasks where the AI likely already knows what to do (e.g., summarizing, translating, answering general questions).
- Use Few-Shot for complex, custom tasks that require a specific format, style, or pattern that the AI needs to learn first.
Key Takeaways from Lecture 05
- Zero-Shot Prompting: Giving an instruction with zero examples. Best for simple, direct tasks.
- Few-Shot Prompting: Giving an instruction with a few examples to show the AI what you want.
- Show, Don’t Just Tell: Providing examples is one of the most powerful ways to guide an AI.
- The examples you provide act as a mini-lesson for the AI for that specific conversation.
End of Lecture 05. Excellent work! Next, we’ll learn how to give the AI a personality or a role to play, which is another great way to control its responses.