AI · Grade 11 · Chapter 3
Advanced Prompt Engineering
Chain-of-thought and few-shot prompting techniques.
Here's a problem
Two Prompts, Two Worlds
The same math problem is given to an AI two different ways. One prompt gets a wrong, rushed answer. The other — asking the AI to "think step by step" — gets a correct, well-reasoned solution. Same question, very different results.
Discuss before revealing: Why might just asking the AI to "show its work" actually improve the answer?
Today's tool
Chain-of-Thought & Few-Shot
Chain-of-thought prompting asks the AI to reason step by step, often improving accuracy on complex problems. Few-shot prompting gives the AI a couple of examples first, showing it the pattern you want.
How it looks
Few-Shot Example
# few-shot prompt structure
Q: 2 + 2 = ? A: 4
Q: 5 + 3 = ? A: 8
Q: 9 + 7 = ? A: ?
Try it yourselves
Rewrite With Few-Shot
We'll take a plain prompt and rewrite it using a few-shot example structure, then compare results.
Activity: Give students a task-based prompt (e.g. classify sentiment, format data). Rewrite it as few-shot with 2-3 examples, run both versions, and compare quality.
Quick check
What does "few-shot prompting" mean?
AAsking a very short question
BGiving the AI a few examples before the actual task
CLimiting the AI's response length
DDisabling the AI's memory
Click to reveal answer
Let's discuss
Where might advanced prompting matter most?
Thinking ahead to your AI capstone project — where might chain-of-thought or few-shot prompting genuinely improve your results?
Before you go
Today we learned...
Better prompting techniques can meaningfully improve AI output quality. Next week: refreshing Python before OOP!