Prompt debugging is a systematic process of isolating and fixing the exact part of a prompt that causes unexpected model output — and by the end of this lesson you will have a repeatable technique you can apply every time the AI tutor misbehaves.
It's a Tuesday afternoon. A teammate opens a JIRA ticket: "AI tutor giving three-paragraph answers when the user asks a simple yes/no question." You pull up the prompt. It looks fine. It says "Answer concisely." You even added "Keep it short." at the end. The model still returns a wall of text. Your first instinct is completely natural: change the wording. Maybe "Be brief" works better than "Answer concisely." You deploy. Still too long. You try "One sentence only." Better — but now it occasionally drops the answer entirely and just says "Yes." with nothing else. You've just entered the most frustrating loop in AI engineering: prompt trial and error . The problem isn't your writing. The problem is that you're changing multiple things at once, in the dark, with no way to tell which change helped and which made things worse. Prompt debugging gives you a flashlight. How does it work?
Think about debugging regular Java code. When a method returns the wrong value, you don't rewrite the whole class. You add a log statement, isolate the bad line, fix just that, and confirm the fix worked. One change, one test, one conclusion. Prompt debugging is the exact same discipline — applied to the text you send an LLM (a large language model, the AI system that reads your prompt and generates a reply). A prompt is just the message you send to the model. It usually has a few parts: a system instruction ("You are a concise tutor"), some context (the user's history, a question bank entry), and the user message itself. When the model's reply is wrong, one of those parts is likely the culprit. Prompt debugging means: 1. Isolating — strip the prompt down to the smallest version that still shows the problem. 2. Hypothesising — form one specific guess about what's causing it. 3.…
Picture a whiteboard. On the left side, there's a box labeled Full Prompt . It contains four parts stacked on top of each other like layers in a sandwich: System instruction Context / history Question bank entry User message On the right side, there's a box labeled Model Output . Right now it shows: "That's a great question! Let me explain this in detail..." — three paragraphs when you wanted one sentence. Step 1 — Bisect You slice the sandwich in half. You send only the system instruction and the user message — no context, no question bank entry. You run it. The output is still three paragraphs. The problem is in the half you kept. The context layers are innocent. Step 2 — Isolate further Now you send only the system instruction, with a simple test message: "Is Java compiled?" The output is one clean sentence: "Yes, Java is compiled to bytecode." The system instruction is fine.…