LESSON 5 of 6 Beginner
Iterative Refinement
How to treat prompting as a conversation: test, analyze, and refine prompts for better results.
5 min read
β’ 2 quiz questions
Think of prompting like a conversation where you teach the model what you want. You try something, see the answer, and then make small changes.
Simple 4-step loop:
- Draft: Write a short prompt with role, task, and constraints.
- Test: Run it and look at the result.
- Diagnose: What went wrong? (wrong facts, bad format, too long, wrong tone)
- Fix: Change the prompt (add examples, make rules tighter, ask for steps). Repeat.
Mini-rubric to judge an output:
- Correctness: Are the facts right?
- Format: Is it the shape you asked for (JSON, list)?
- Length: Is it too long or too short?
- Tone: Does it sound like the audience you chose?
- Safety: Any risky or disallowed content?
Example refinement (short):
- First try: βSummarize this article.β β Too long and vague.
- Add constraints: βSummarize in 50 words for a 10-year-old.β β Better length and clarity.
- Add format: βReturn 3 bullet points.β β Now the output is short and structured.
Keep a small log of prompts and results: the original prompt, the changes you made, and which version worked best. That log is the fastest way to repeat success.
Quick Quiz
Test what you just learned. Pick the best answer for each question.
Q1 What's the recommended approach when a prompt gives a poor answer?
Q2 What does 'zero-shot' vs 'few-shot' mean?