Lesson 13 / 29

Self-Critique and Verification

Have the model or code check the first answer.

Draft, check, revise

A second pass can catch errors the first missed. Patterns: critique-and-revise (ask the model to list problems with its draft against a checklist, then fix them); verifier prompt (a separate call decides "does the answer follow from the source? yes/no and why"); rule checks in code (JSON validity, required fields, numbers within range, banned words); and tool checks (run the generated code and tests, query the database to confirm a value). Models are poor judges of their own mistakes when asked vaguely, so give a specific checklist and prefer checks that do not rely on the same model's opinion.

Give the checker a checklist

"Is this right?" is weak. "Does every number appear in the source? Is the tone polite? Is it under 80 words?" is checkable.

Quick check: Which check is most independent of the model's own opinion?

  • Asking "are you sure?"
  • Running the generated code against tests
  • Repeating the same prompt
  • Making the answer longer
Answer

Running the generated code against tests — Executable tests give objective evidence.