How it works · 24 of 37 Foundation
How do you write a good prompt and system prompt for an AI model?
A clear brief, a better answer
Prompting, system prompts & examples: The instructions, context and examples you give change the answer more than people expect; a system prompt sets standing rules.
Loading the animation…
Say it like this A prompt is the message you send an AI: say who it's for, your limits and the format, and show an example. Apps also send a hidden prompt of their own, the system prompt.
Under the hood — for builders
- Examples in the prompt
- Put a few solved examples before your question and the model copies the pattern, with no retraining (few-shot prompting).
- Show the working, not just the answer
- If your examples show their steps, the model writes out steps too, and solves far more maths word problems (chain of thought).
- The role and the standing rules
- A system prompt is the brief the app sends before every message: who the model is, and its rules. One sentence changes its tone.
- How many examples
- Anthropic suggests 3–5: close to your real task, varied, each wrapped in <example> tags.
- Measure it
- Anthropic's test: if a colleague with no context would be confused by the prompt, “Claude will be too.”
- Watch out
- Layout alone moves scores: reformatting one prompt swung LLaMA-2-13B by up to 76 points out of 100 (Sclar et al.).
- Watch out
- Examples teach the format more than the facts: random answers in them “barely hurt” (Min et al., 12 models).
- Sources
- Brown et al. (OpenAI), Language Models are Few-Shot Learners, 2020 (arXiv 2005.14165) · Wei et al. (Google), Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, 2022 (arXiv 2201.11903) · Sclar et al., Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design, 2023 (arXiv 2310.11324) · Min et al., Rethinking the Role of Demonstrations, 2022 (arXiv 2202.12837) · Anthropic, Prompting best practices (platform.claude.com/docs).
What happens in the prompting, system prompts & examples animation, step by step?
- A prompt is the message you send to an AI. Here, you ask a cooking app about dinner.
- A vague prompt gets a vague answer.
- Your turn: tap each piece to add it to your prompt.
- Same AI, clearer prompt: a far better answer.
- The app also sends its own hidden prompt every time: the system prompt.
- You never see it, but the AI follows it: no chicken in this app.
What everyday example explains prompting, system prompts & examples?
Briefing a new contractor: vague brief, vague job.
Why should a team care about prompting, system prompts & examples?
The cheapest lever on quality.