# Self-Critique and Verification — Prompt Engineering

Source: https://www.geekswithgeeks.com/en/prompt-engineering/r-verify

> 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.

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

- [ ] Asking "are you sure?"
- [x] 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.
