A prompt is instructions for a language model, and the gap between a vague request and a well-built one is the gap between a mediocre answer and one you can use straight away. This guide covers the pieces that matter, each with a concrete example.
The five building blocks
Almost every strong prompt is assembled from the same parts. You rarely need all five, but naming them helps you spot what is missing when a reply disappoints.
- Role — who the model should act as. "You are a copy editor for a science magazine" sets vocabulary, tone, and priorities in one line.
- Context — the background the model needs but cannot guess: the audience, the product, the paragraph you are rewriting, the data it should work from.
- Task — the single thing you want done, stated as an action verb. "Summarize", "rewrite", "classify", "draft", "compare".
- Output format — the exact shape of the answer: a bulleted list, a table, JSON, three sentences, a subject line only.
- Constraints — the boundaries: word count, tone, what to avoid, reading level, which facts are off-limits.
Here is a thin prompt and the same request rebuilt with all five parts.
Weak: Write about our new running shoe.
Stronger:
You are a product copywriter for a running brand. [role]
The shoe is a lightweight trainer for road runners doing
5k to 10k, priced mid-range, key feature is a firm foam
that returns energy. [context]
Write the product page intro. [task]
Output: two short paragraphs, then three bullet benefits. [format]
Under 120 words, plain and confident, no hype words like
"revolutionary" or "game-changing". [constraints] The second version leaves far less to chance. If you only remember one habit, make it this: say who, say what, say the shape, say the limits.
Zero-shot vs few-shot
A zero-shot prompt asks for the task with no examples. It works well when the task is common and the format is simple.
Classify the sentiment of this review as positive, negative, or neutral:
"The battery lasts all day but the screen scratches easily." A few-shot prompt shows a handful of worked examples first, so the model copies the pattern. Reach for it when the output has a specific shape, a house style, or an edge case you keep hitting.
Turn each feature into a one-line benefit.
Feature: 12-hour battery -> Benefit: Works a full day on one charge.
Feature: 200g weight -> Benefit: Light enough to forget you're wearing it.
Feature: waterproof to 50m -> Benefit: The model finishes the last line in the style you demonstrated. Two or three examples usually change the output more than a paragraph of description does.
Few-shot examples in a table
When examples share the same fields, a table is the clearest way to show the pattern. It reads well and the model picks up the mapping quickly.
| Input | Desired output |
|---|---|
| "cant login help" | Category: Account · Priority: High · Tone: reassuring |
| "where is my order #4471" | Category: Shipping · Priority: Medium · Tone: informative |
| "love the new update thanks" | Category: Feedback · Priority: Low · Tone: warm |
After three rows like this, a new ticket gets tagged the same way without further explanation. This is the everyday workhorse of few-shot prompting.
Chain-of-thought: think step by step
For anything with reasoning, arithmetic, or multiple moving parts, ask the model to work through it before answering. The phrase "think step by step" is enough to trigger this in most models.
A team of 4 finishes a task in 6 days. How long for 3 people
at the same pace? Think step by step, then give the final answer. Showing the steps tends to catch mistakes that a snap answer would miss, because each step constrains the next. It genuinely helps on math, logic, planning, and multi-condition decisions.
It is not free, though. Step-by-step reasoning makes replies longer and slower, and on trivial questions it adds noise. Use it where the problem has real steps; skip it for lookups and one-liners. If you want the reasoning without the clutter, add "then give only the final answer on its own line".
Be explicit about output format
Most disappointing replies come from a format the model had to guess. Name it exactly, and if you plan to feed the result into a spreadsheet or a program, show the skeleton.
Extract the details as JSON with keys: name, role, company, email.
If a field is missing, use null. Return only the JSON, no commentary. "Return only the JSON, no commentary" earns its place: without it, models often wrap the answer in a friendly sentence that breaks a parser. The same idea works for prose. "Reply with exactly three bullets" beats "give me a few points" every time. Our prompt generator builds this structure for you if you would rather start from a filled-in template.
Set constraints that actually bind
Constraints steer the answer toward something usable. The ones that pull the hardest are specific and checkable.
- Length: "under 50 words" or "exactly 5 items", not "keep it short".
- Audience and level: "explain for someone new to the topic, no jargon".
- Tone: "warm but professional", "dry and factual".
- Boundaries: "only use facts from the text above", "do not invent prices or dates".
That last one matters when accuracy counts. Telling the model to work only from what you provided, and to say "not stated" when something is missing, cuts down on confident-sounding guesses.
Iterate, do not restart
Treat your first prompt as a draft. Read the reply, find the one thing that is off, and adjust that alone. Change too much at once and you cannot tell which edit helped.
- Too long? Add a word limit.
- Wrong tone? Name the tone and give a one-line example of it.
- Made something up? Add "only use the information provided".
- Odd shape? Show the exact format you want.
Two or three tightening passes usually get you there. Keep the version that worked so you can reuse it. The guide to writing AI prompts goes deeper on this loop.
Temperature and creativity, in plain terms
Many tools expose a temperature setting, usually from 0 to 1 or 0 to 2. Think of it as a spread dial. Low temperature makes the model pick the safest, most predictable words, so answers are focused and repeatable — good for extraction, classification, code, and anything factual. Higher temperature loosens things up and invites variety, which helps with brainstorming, names, and creative copy.
A rough starting point: keep it low (around 0.2) when you want the same reliable answer each time, and raise it (0.7 or above) when you want options and surprise. If your tool has no such control, you can nudge the same effect with words: "give one precise answer" versus "give five varied options".
When to split into multiple prompts
A single prompt that tries to do everything tends to do each part badly. Break the job up when you notice these signs:
- The task has clear stages — research, then outline, then draft, then polish.
- One step's output is the next step's input, and you want to check it in between.
- You are mixing modes, like "analyze this data and also write a cheerful newsletter about it".
- The instructions are getting so long the model starts dropping some of them.
For example, to write an article: prompt one produces an outline you can approve, prompt two drafts each section from that outline, prompt three tightens the language. Each prompt is short, focused, and easy to fix. You also get a checkpoint between steps, so a wrong turn is caught early instead of buried in a final draft. When you want polished, task-specific starting points, see our ChatGPT prompts collection.
The whole craft comes down to removing guesswork. Every part above — role, context, format, constraints, examples, steps — is a way of telling the model something it would otherwise have to invent.