Prompting strategies that actually work
A practical checklist: structure, formatting, few-shot examples, chain-of-thought and grounding.
Structure every prompt in three parts
- System — persona and rules (“You are a precise technical writer. Answer only from the context.”).
- User — the concrete request.
- Context — the source material to ground the answer.
Keeping these separate makes prompts predictable and easy to iterate on.
High-leverage techniques
- Be explicit about output format. “Reply with a JSON object” or “one sentence, no preamble”.
- Few-shot examples. Show 1–3 input→output pairs; the model mimics the pattern.
- Chain-of-thought. “Think step by step” improves multi-step reasoning (you can hide the steps from the user).
- Decomposition. Break a big task into smaller prompts and combine the results.
- Grounding. Provide sources and instruct “answer only from the context above; if unknown, say so.”
Anti-patterns to avoid
- Vague asks. “Tell me about X” invites rambling. Specify scope and format.
- Overstuffed context. Irrelevant chunks dilute attention — retrieve fewer, better chunks.
- Trusting unverifiable claims. For facts and math, prefer a tool over the model’s memory.
A quick checklist
- Is the persona/role set?
- Is the desired output format explicit?
- Is trusted context provided (and is it relevant)?
- Did I tell it what to do when it doesn’t know?
If an answer is bad, the fix is usually better context or a clearer format, not a longer question.