How to Write Better AI Prompts
The single biggest improvement to any AI prompt is supplying the context the model does not have: what you are trying to achieve, who will read the output, what you have already tried, and what a good answer looks like. Most disappointing responses come from prompts that were technically clear but left the model guessing at all four.
Everything else — role-playing, magic phrases, politeness — matters far less than that, and some of the widely shared "tricks" do nothing at all.
Prompt advice has accumulated a lot of folklore. This guide covers the techniques that reliably change output quality, explains why they work, and is honest about which popular tips are cargo cult.
The core problem: the model cannot see your situation
A language model predicts a plausible continuation of your text. It has no access to your job, your document, your audience or your intent unless you put those in the prompt. When information is missing it does not ask — it fills the gap with the most statistically ordinary assumption, which is why generic prompts get generic answers.
Compare:
| Weak | Strong |
|---|---|
| "Write an email asking for a refund" | "Write an email asking for a refund on a £180 pair of headphones that developed a fault after 5 weeks. The retailer has already refused once by phone, saying it is outside their 30-day window. I want to reference UK consumer rights without sounding aggressive. Four short paragraphs." |
| "Explain recursion" | "Explain recursion to me. I write JavaScript comfortably and understand loops, but I lose track of what the call stack is doing. Use one worked example and show the stack at each step." |
The strong versions are not longer for the sake of it. Every added clause removes a decision the model would otherwise make badly.
The four things worth specifying
1. The goal, not just the task. "Summarise this report" produces a neutral summary. "Summarise this report so I can decide whether to attend the meeting" produces something filtered for decision-relevance. Stating the purpose lets the model prioritise.
2. The audience. "Explain this to a client who is not technical" and "explain this to our backend team" should produce very different text. Without it you get an average of every possible reader.
3. What you have already tried or ruled out. Especially for debugging and advice. "I have already checked X and Y" prevents the model spending its answer on the two things you have done.
4. The shape of the output. Length, format, tone. "Three bullet points, under 20 words each" is enforceable; "be concise" is not. If you need a table, a specific structure, or a particular file format, say so explicitly.
Give it an example
Showing beats describing, and this is the most underused technique in ordinary use.
If you want commit messages in a particular style, paste three of your existing ones and ask for more in that style. If you want a specific tone, paste a paragraph that has it. One concrete example conveys constraints you would struggle to articulate — sentence length, formality, how much hedging you tolerate.
This is the practical version of what the literature calls few-shot prompting, and for formatting and voice it works better than any amount of adjectives. Anthropic's prompt engineering documentation covers the same techniques in more depth.
Ask for reasoning on hard problems
For multi-step problems, asking the model to work through its reasoning before answering measurably improves accuracy on logic, maths and planning tasks. The intermediate steps become context the final answer is built on.
Work through this step by step, then give your final answer.
Two caveats worth knowing. Newer reasoning-focused models do much of this internally, so the instruction adds less than it once did. And stated reasoning is not a guarantee of correct reasoning — a model can produce confident, well-structured steps that contain an error. It helps because you can inspect the steps, not because reasoning aloud makes the model reliable.
For anything numerical, verify with something that actually computes rather than predicts text — a spreadsheet, or a purpose-built tool like our percentage calculator or compound interest calculator.
Iterate instead of restarting
The most common inefficiency: getting a mediocre answer and rewriting the whole prompt from scratch.
Refining is faster and better, because the model keeps the context:
- "That is too formal — rewrite it as if emailing a colleague you know well."
- "Keep the structure, halve the length."
- "The second point is wrong because our users are on mobile. Redo with that in mind."
Treat the first response as a draft that reveals what you actually wanted. Often you do not know your own requirements until you see something that misses them.
Make it interrogate your work, not produce it
A shift in how you use the tool, and usually where the most value is:
- "What is the strongest argument against this?"
- "Which claims here are not supported by the evidence I gave you?"
- "What would a sceptical reviewer ask?"
- "What am I assuming that I have not stated?"
Critique is more reliable than generation, because you can check every point against work you already understand. Generated text has to be verified from scratch; critique of your own text can be judged instantly.
What does not help
| Popular advice | Reality |
|---|---|
| "You are a world-class expert…" | Weak effect at best. Describing the audience and required depth does the real work. |
| Offering a tip or threatening | No reliable benefit. Widely shared, poorly evidenced. |
| "Do not hallucinate" | Models do not know when they are wrong, so instructing them not to be cannot work. |
| Being polite (or rude) | Little measurable effect on quality. Be polite if you prefer; it is not a technique. |
| ALL CAPS for emphasis | Clear, specific wording works; shouting does not. |
| Very long preamble templates | Diluted instructions. Specific context beats boilerplate. |
The pattern: things that add genuine information help; things that add emphasis do not. "Do not hallucinate" is the clearest example — fabrication is not a behaviour the model chooses, so asking it to stop has nothing to act on. The fix is verification on your side, not an instruction.
Constraints beat adjectives
Vague quality words are unenforceable. Replace them with something checkable:
| Instead of | Say |
|---|---|
| "Be concise" | "Under 150 words" |
| "Make it engaging" | "Open with a concrete example, no rhetorical questions" |
| "Be professional" | "Plain English, no jargon, no exclamation marks" |
| "Give me some ideas" | "Give me 8 options, each one line, no explanations" |
| "Improve this" | "Cut 30% without losing any claim" |
The right-hand column also gives you a way to tell whether the output is acceptable, which the left-hand column does not.
A structure that works for anything non-trivial
[Context] What the situation is, what I have tried, who this is for.
[Task] What I want done, in one sentence.
[Format] Length, structure, tone.
[Example] A sample of the style or format, if I have one.
You do not need headings — the point is that all four are present. For simple questions this is overkill; for anything you would be annoyed to get wrong, it takes thirty seconds and prevents three rounds of correction.
For programming specifically, the tooling matters as much as the prompt — our guide to the best AI coding tools groups them by the job they actually do.
If you have not settled on an assistant yet, our comparison of Claude vs ChatGPT vs Gemini covers what actually differs for everyday use — and a twenty-minute test that decides it for your own work.
Better prompting reduces vague output but does not make the answers reliable. Why AI makes things up covers which categories of claim to verify every time, whatever you asked.
Frequently asked questions
How do I write a better AI prompt?
Add the context the model cannot see: your goal, your audience, what you have already tried, and the format you want. Replace vague adjectives like "concise" with checkable constraints like "under 150 words", and give an example if you care about style.
Does telling AI to "act as an expert" work?
Far less than commonly claimed. Specifying the audience and the depth you need — "explain to a developer who knows loops but not recursion" — does the real work, because it conveys actual information rather than a label.
Does saying "do not hallucinate" reduce errors?
No. Models have no internal signal distinguishing a recalled fact from a fabricated one, so the instruction has nothing to act on. Verify anything that matters, and prefer tools that cite sources when accuracy is important.
Should I write long or short prompts?
As long as needed to convey genuine context, and no longer. Extra context helps; extra boilerplate dilutes. A three-sentence prompt containing your goal, audience and format beats a page of role-play preamble.
Is it better to start a new chat or keep refining?
Refine, in most cases — the model retains the context and your corrections. Start fresh when the conversation has accumulated wrong assumptions you keep having to correct, since those stay in context and keep influencing the output.
Does asking for step-by-step reasoning help?
Yes for multi-step logic, maths and planning, because the intermediate steps inform the final answer and you can inspect them. It helps less with newer reasoning models that do this internally, and visible reasoning steps can still contain errors.
Conclusion
Almost all prompt quality reduces to one question: what does the model need to know that only I know? Goal, audience, constraints, prior attempts. Supply those and ordinary prompts work well; leave them out and no amount of role-play preamble compensates.
The other shift worth making is using these tools to critique your work rather than produce it. Our guide to free AI tools for students covers that in a study context, including the fabricated-citation problem to watch for.
Comments