Module 4 of 5 · Beginner · 7 min read
Iterating and debugging prompts
A systematic way to fix prompts that give generic, wrong or inconsistent results.
- 1Test on several real inputs, not one.
- 2Change one thing at a time and keep notes.
- 3Most failures trace back to missing context, ambiguous instructions or weak examples.
01Diagnose before you rewrite
When output disappoints, identify the failure type first. Each has a typical fix.
- Generic or bland: add audience, goal and an example of great output.
- Wrong facts: provide source material and ask for quotes.
- Wrong format: specify the shape precisely, or use a schema.
- Ignores a rule: explain why the rule exists; remove conflicting instructions.
- Inconsistent across runs: add examples and tighten criteria.
02Build a tiny test set
Collect five to ten realistic inputs, including a couple of awkward ones. Run every version of your prompt against all of them and compare. A prompt that works on your favourite example often fails on the third.
Keep the versions and results in a doc. You will be surprised how often a change you were sure would help makes things worse.
03Ask the model for help
Models are good at improving prompts. Show it your prompt, a bad output and what you wanted instead, and ask what in the prompt caused the gap.
You can also ask a strong model to draft a prompt from scratch given the task, audience and pitfalls, then test and refine it.
Finished reading?
Mark it complete to track your progress, then test yourself with the Prompting Fundamentals quiz.