Skip to content
mentoor

Topic 5 of 5 · 5 min read

Hypotheses, evidence and misleading AI diagnoses

Goal: Judge whether an AI diagnosis is supported by the evidence and choose the experiment that would confirm or refute it.

Treat an AI diagnosis as a hypothesis, not an answer: give it evidence, ask for several ranked possibilities, and pick the experiment that would prove each one wrong. Assistants such as Claude, ChatGPT, Gemini and Copilot are fast at proposing causes. They are also happy to sound certain when the evidence does not support it.

Check yourself · 1 of 3

What is the best way to start a debugging chat with an AI assistant?

Choose one answer

Why it matters

A model predicts a plausible explanation from your words. If you write "I think it's the cache", it will often agree and build a story around the cache, even when the logs say otherwise. A wrong diagnosis costs more than none: you spend an hour on a fix for a cause that is not there.

How to do it

  1. Send evidence, not conclusions. The exact error, the relevant 20 to 50 lines of log, the repro, versions, what changed recently, and what you already ruled out. Remove secrets and personal data first.
  2. Keep your guess out of the first message. Ask: "What are the three most likely causes, ranked, and what in this evidence supports each?"
  3. Ask for the test, not the fix. "For each cause, what one check would confirm or rule it out?" Run the cheapest check first.
  4. Make it cite. A good answer points to specific lines: "the timeout at 12:03:01 precedes the null". If it cites a line that is not in your log, or a function that does not exist, discard that reasoning.
  5. Run the experiment, report the result. Paste what happened, including when it contradicts the model. Then ask it to revise.

Before and after

Weak prompt: "My API returns 500 sometimes. I think Redis is the problem. Fix it."

Better prompt: "POST /orders returns 500 about 3 percent of the time since the 14:00 deploy. Log excerpt and the diff are below. Redis metrics are flat. List three possible causes, ranked, with the line of evidence for each and one check that would rule it out."

Signs a diagnosis is not supported

  • It names a cause that needs data you have not shown (a config, a query plan).
  • It fits the symptom but not the timing: the bug began after a deploy and the answer blames old code.
  • It cannot say what would prove it wrong.
  • It switches cause each time you push back, with the same confidence.
  • It suggests a fix before listing alternatives.

What goes wrong

  • Leading the witness. Your guess becomes its answer.
  • Applying the fix to see. Without a check first, a coincidence looks like a cure.
  • Missing context. The model cannot see your runtime, so it fills gaps with common causes.

Examples

A confident but unsupported answer

Log excerpt: a database timeout at 14:02:11, then a null error. The assistant answers: "This is a memory leak in the image resizer." Neither the log nor the metrics mention the resizer or memory. Ask: "Which line shows that?" If it cannot point to one, treat it as a guess and test the timeout first.

Choosing the experiment

Two hypotheses: a slow query after a new index, or a connection pool that is too small. One check separates them: run the query alone. If it takes 40 ms, the query is fine and the pool is suspect. A 6-second result points at the index. One query, two hypotheses sorted.

Key points

  • Give an assistant raw evidence, a repro and what you ruled out, not your conclusion.
  • Ask for ranked hypotheses with the supporting evidence line for each, and a check that would refute each.
  • Run the cheapest discriminating experiment before applying any suggested fix.
  • Discard reasoning that cites log lines, functions or settings that are not in what you showed.
  • A diagnosis that cannot say what would prove it wrong, or that flips under pushback, is a guess.

Common mistakes

  • Stating your own theory in the prompt and asking the model to confirm it.
  • Pasting a whole log or a secret instead of the relevant excerpt with secrets removed.
  • Applying the suggested fix before running any check that could disprove the diagnosis.
  • Believing a diagnosis because it was written fluently and in detail.

Check yourself · 2 of 3

An assistant names a cause but cites a log line that is not in your log. What should you do?

Choose one answer

Check yourself · 3 of 3

Two hypotheses are a slow query and a small connection pool. Which action best separates them?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic