MemotivaPrompt Engineering Patterns: Instruction Following, Negative Constraints, and Output Format Control

How do you write clear instructions for an LLM?

Prompt Engineering Patterns: Instruction Following, Negative Constraints, and Output Format Control

Audio flashcard · 0:16

Nortren·

How do you write clear instructions for an LLM?

0:16

Write clear instructions by being specific about what you want, using concrete examples, ordering instructions from most to least important, separating instructions from data with delimiters, telling the model what to do rather than what to avoid, and testing instructions against edge cases. Vague instructions produce vague outputs.
docs.anthropic.com