Prompt Foundations

Iteration and Refinement

Master the edit-evaluate loop to continuously improve your prompts.

Iteration and Refinement

No one writes a perfect prompt on the first try. The best prompt engineers treat their work as an iterative process: write, evaluate, identify weaknesses, revise, and evaluate again. This edit-evaluate loop is the single most important habit you can develop.

The Edit-Evaluate Loop

The loop has four steps. Write your initial prompt based on your best understanding of the task. Evaluate the output — does it match what you wanted? Where does it fall short? Identify the specific weaknesses: is the output too long, off-topic, missing key details, wrong tone? Revise the prompt to address those weaknesses, then evaluate again. Each cycle should produce a measurably better result.

Common Weaknesses to Look For

When evaluating AI output, look for these common issues: hallucination (the AI made up facts), drift (the response starts on-topic but wanders), format violations (you asked for a list but got paragraphs), tone mismatches (you wanted formal but got casual), and incompleteness (key requirements were missed). Each of these points back to a specific part of your prompt that needs strengthening.

Revision Strategies

For hallucination, add constraints like "Only use verified information" or "If unsure, say so." For drift, add a clear scope statement: "Focus exclusively on X; do not discuss Y." For format violations, add explicit format examples. For tone mismatches, strengthen your tone directives or add a style example. For incompleteness, add a checklist of required elements.

Practice Iteration

In the exercise below, you will be given a weak prompt. Your job is to identify its problems and write an improved version. Think about what is missing, what is vague, and what could confuse the AI.