Debugging
Prompt Debugging Playbook
When a prompt gives weak results, the cause is usually one of a few common problems: unclear task, missing context, no output shape, weak grounding, or no quality check.
How to debug a bad prompt
| Symptom | Likely cause | Fix |
|---|---|---|
| Answer is vague | Task is too broad | Narrow the task and define exact output sections. |
| Answer ignores constraints | Constraints are weak or late | Move constraints near the top and make them explicit. |
| Hallucinated facts | No grounding or stale knowledge | Use retrieval, documents, or explicit uncertainty rules. |
| Overly long response | No response shape | Specify length and structure. |
Debug template
Analyse why the following prompt is underperforming.
Prompt:
{prompt_here}
Observed bad output:
{bad_output_here}
Please return:
1. root cause analysis
2. rewritten prompt
3. explanation of improvements
4. test cases to validate the new version