Key takeaways
- Give the model a role and a concrete audience before the task.
- Describe the output format as a contract, not a suggestion.
- Include two examples: one ideal, one near-miss you want avoided.
- Keep an evaluation set of 10-20 real inputs and re-run it after every model update.
Structure beats cleverness
The most common failure in production prompts is not weak wording, it is missing structure. A prompt that names the role, states the audience, supplies the source material and defines the output shape will outperform an elegantly phrased one-liner on almost every model.
Write prompts in four blocks: role, context, task, output contract. Keeping the blocks in that order makes prompts diffable, reviewable and safe to hand to a colleague.
Treat the output format as an API
If a downstream system consumes the output, specify it as strictly as you would a JSON schema: field names, allowed values, what to emit when a value is unknown. Ambiguity there is what causes silent parsing failures weeks later.
State the failure mode explicitly. 'If the document does not contain the answer, return NOT_FOUND and nothing else' removes an entire class of hallucination from the pipeline.
Evaluate before and after every model change
Keep a folder of 10-20 real inputs with the outputs you consider correct. Re-run it whenever you change the prompt or the provider ships an update. This is the single highest-return habit in applied AI work and takes an afternoon to set up.
Score on the dimension that matters to your users — factual accuracy, tone, or format validity — rather than a generic quality rating.
References
- [1] OpenAI prompt engineering guide — platform.openai.com
- [2] Anthropic prompt library and best practices — docs.anthropic.com
Frequently asked questions
Do longer prompts always work better?
No. Beyond the necessary context, extra words dilute the instruction. Add structure first and length only when a test case demands it.
Is prompt engineering still a job?
As a standalone title it is fading, but the underlying skill — specifying tasks precisely and evaluating outputs — is now expected of most knowledge workers.