Instruction Clarity, Positive Framing & Iterative Refinement
CoreApply prompt engineering techniques matched to the task · Difficulty 2/5
Explanation
Instruction Clarity Beats Cleverness
Be specific about the desired output and format rather than relying on the model to infer intent from a clever or terse instruction. Ambiguity in the instruction produces variance in the output.
Positive Instructions Over Negative Lists
A positive instruction -- "respond only in JSON matching this schema" -- is more reliable than a long list of "don'ts" (don't add commentary, don't use markdown, don't include extra fields, ...). Positive framing tells the model what to do; negative lists only narrow what not to do, leaving the actual target under-specified.
Placement Matters
With long inputs, place the key instruction after the material, near the end of the prompt, rather than before it. This reduces the chance that the instruction is diluted by everything the model processes afterward.
Deliberate Iteration
Prompt improvement is empirical, not intuition-driven:
- Change one thing at a time
- Measure the change against an eval set
- Keep what wins, discard what doesn't
A prompt change without a measured comparison is a guess, not an improvement.
Common exam traps
- Assuming a longer or more detailed instruction is automatically clearer -- clarity is about specificity and structure, not length.
- Iterating on multiple prompt changes at once, which makes it impossible to attribute a quality change to a specific edit.
Key Takeaways
- Specific, clear instructions beat clever or terse ones for consistent output
- Positive instructions ('respond only in JSON matching this schema') beat long negative 'don't' lists
- With long inputs, place the key instruction after the material, near the end
- Iterate one change at a time and measure against an eval set
Glossary Terms
A Claude-native prompting pattern using XML-style tags (e.g., <document>, <instructions>, <example>) to clearly delimit sections of a prompt. Helps Claude unambiguously identify context, instructions, and data. Reduces prompt injection risk by separating instructions from untrusted input.
The observed phenomenon where Claude (and other LLMs) give less attention to content in the middle of a long context window compared to content at the beginning and end. Critical information should be placed at the start (system prompt) or end (most recent user turn) of the context.
Related Concepts