Prompt Engineering
Beginner
Debugging Prompt Failures
Diagnose prompt failures the way you diagnose software defects.
25 min
3 sections
debugging
failure-analysis
iteration
1
2
3
01. Classify the failure first
Section 1 of 3
Do not blindly add more instructions. Identify whether the model lacked context, misunderstood the task, ignored the format, overgeneralized from examples, hallucinated missing facts, or was asked to do something that should be handled by code.
text
Failure categories:
- Missing context: model needed data you did not provide.
- Ambiguous task: success criteria were unclear.
- Weak output contract: response could not be parsed or reviewed.
- Bad examples: examples taught the wrong boundary.
- Model limitation: task requires deterministic computation or external truth.
- Security issue: untrusted content changed behavior.Back to Course