Skip to content

How to Write a Good AI Prompt

A good prompt gives an AI assistant four things: the task, the context you are carrying in your head, who the answer is for, and what the finished output should look like. Weak prompts nearly always drop one of the four. You do not need a framework or a magic opening phrase. You need to write down what is obvious to you and invisible to the model.

What weak prompts leave out

A weak prompt is rarely vague in general. It is missing one specific thing, and the missing thing is visible in the output. "Summarize this document" does not say who the summary is for, how long it should be, or what you will do with it, and the answer comes back generic about exactly those three things.

The published guidance converges on the same list. Harvard University Information Technology's August 2023 guidance on writing a prompt sets out nine strategies, among them being specific, specifying the output format, giving examples, and considering tone and audience. Anthropic's documentation for Claude adds the test that makes this usable: treat the assistant as "a brilliant but new employee who lacks context on your norms and workflows", then show your prompt to a colleague who knows little about the task and ask them to follow it. If they would be confused, the model will be too.

The table is the fast version. If you arrived here with an answer that came back wrong, find the symptom in the first column.

What the output gets wrongWhat the prompt left outWhat to add
Generic, could be about any companyContextWho you are, what happened, what is at stake
Right content, wrong registerAudienceWho reads it and what they already know
Good ideas, unusable shapeFormatLength, structure, where each part goes
Confidently wrong factsGroundingThe source, and an instruction to use only it
Close, but not how you writeExampleTwo or three samples of the thing done well
A fine answer to a different questionThe decisionWhat you will actually do with the answer

Each of the worked examples below fixes one of those rows.

Example 1: give the context that lives in your head

Weak prompt

"Help me plan our team offsite."

Better prompt

"I manage a five-person marketing team, two of whom joined in the last month. We have one day in November, a budget of $60 a head, and everyone is in the same city except one person who works remotely and would travel three hours to get there. The last offsite was back-to-back presentations and people said afterwards that it was a wasted day. Half the day should go to how we plan campaigns together, and the two new people should leave knowing the rest of the team properly. Give me three possible schedules for 9.30 to 4, each with a one-line rationale for its shape, and mark anything that needs me to prepare something in advance. No icebreakers that ask people to share something personal."

Why the second works. Every added sentence removes a guess: who is in the room, what they already know about each other, what the day is for, what failed last time, what the money and the travel allow, and what you want handed back at the end. The first prompt can only produce the generic offsite the internet already contains. The second produces one that fits a team of five with two new starters and a three-hour commute in the room. One line bends a good rule. Anthropic's guidance is to say what you want rather than what you do not, but a single prohibition aimed at a known failure earns its place, and the icebreaker that demands a personal disclosure is a known failure.

Example 2: show an example instead of describing one

Weak prompt

"Rewrite my resume bullet points so they sound more professional."

Better prompt

"Here are three bullets from my resume that already work the way I want them to:"

  • Cut invoice processing time from 9 days to 4 by moving approvals into Xero.
  • Ran the 2024 supplier review across 31 contracts and renegotiated 6.
  • Trained 12 new hires on the booking system in their first week.

"Each is one line, leads with a verb, carries one number and avoids jargon. Rewrite the five bullets below to match that pattern. Keep every figure exactly as written. If a bullet contains no figure, rewrite it anyway and flag it rather than inventing one."

Why the second works. "More professional" has no reference point, so the model substitutes its own, which is usually the corporate register you were trying to escape. The second prompt supplies the standard rather than naming it. This is few-shot prompting, and it is the most reliable way to control style, because you stop describing the target and start demonstrating it. Anthropic recommends three to five examples, close to the real task and varied enough that the model does not lock onto an accidental pattern. The line about figures does a second job: left alone, a model asked to improve a bullet will happily improve a number into one you never earned.

Example 3: name the audience and the format

Weak prompt

"Make a quiz about photosynthesis."

Better prompt

"Write a 10-question quiz on photosynthesis for a mixed-ability eighth-grade science class, ages 13 to 14, who have had two lessons on it. Eight multiple choice, two short answer. Three of the questions should target the common misconception that plants take in food through their roots. Put the answer key at the end rather than after each question, and give one sentence per answer explaining why the wrong options are wrong. Nothing that requires the chemical equation."

Why the second works. The first prompt has a task and nothing else, so the model invents an audience and settles on an average of every photosynthesis quiz online. The second sets prior knowledge, difficulty, question mix, structure and one exclusion. The misconception line is what turns a request into a teaching tool, and it is the kind of detail people skip because it feels too specific to bother typing. Where AI fits in a classroom more broadly is covered in AI in schools.

Example 4: tie the answer to the source you supplied

Weak prompt

"Summarize this report." (50-page PDF attached)

Better prompt

"Using only the report above, answer one question: does it give a figure for what the new contract costs in year one? Quote the sentences you are relying on before you answer, then give the figure and the page. If the report does not state a year-one figure, say so and stop. Do not estimate from the other numbers." (the report pasted or attached above the question)

Why the second works. Liu and colleagues, in Transactions of the Association for Computational Linguistics in 2024, found that models retrieve information most reliably when it sits at the beginning or the end of a long input, and noticeably less well from the middle. Anthropic's long-context guidance accordingly says to place long documents above the question, and reports that queries at the end improved response quality by up to 30% in its testing. That is a company claim about its own models, not an independent result, but it points the same way.

Padding matters too. Shi and colleagues, at the 2023 International Conference on Machine Learning, added irrelevant sentences to grade-school math problems and watched accuracy drop sharply. Extra words are not free, so attaching the whole quarterly report when you needed four pages makes the answer worse.

Asking for the quotes first makes this a grounding prompt. It also gives you something to check.

When to ask for reasoning, and when to skip it

Asking a model to work through a problem step by step is the best-known technique there is. Wei and colleagues introduced it at NeurIPS in 2022, showing that a 540-billion-parameter model given eight worked examples reached state-of-the-art accuracy on a grade-school math benchmark. That is chain-of-thought prompting, and it became the default advice everywhere.

It has since been narrowed twice. Sprague and colleagues, at ICLR in 2025, ran a meta-analysis of more than 100 papers alongside their own evaluation across 20 datasets and 14 models, and found the gains come "primarily on tasks involving math or logic, with much smaller gains on other types of tasks." Separately, OpenAI's documentation now tells developers to "avoid chain-of-thought prompts" with its reasoning models, because "these models perform reasoning internally."

The practical rule is smaller than the folklore. Ask for the working when the task is arithmetic or logic, or when you intend to check it, and not otherwise. This is also the clearest case of prompt advice going stale: a line that genuinely helped in 2022 is redundant on some 2026 models.

Iterate rather than restart

The most common wasted move is deleting the conversation and rewriting from scratch. Harvard's guidance is to build on previous prompts rather than start over, and to correct mistakes as you go. Its wording is "Treat the AI as a colleague; provide constructive criticism", which in practice means saying which parts of the output worked and which did not. OpenAI describes prompting as iterative by nature: send, read, refine.

Specific feedback beats a fresh attempt. "Paragraphs two and four are right, keep them. The opening is too formal. The example in paragraph three assumes a UK reader and mine are in the US." Three corrections the model can act on, and it keeps what already worked.

The limit is length. Everything in the thread has to fit the model's context window, and long conversations drift as early instructions lose force. What an assistant keeps between messages, and between one day and the next, is covered in does AI remember what you tell it. When a thread stops responding to correction, start a clean one with your best current prompt. The wider habits sit in how to start using AI well.

What matters less than people claim

Formatting affects output, but not in a way you can use. Sclar and colleagues, at ICLR in 2024, changed only cosmetic features of prompts, separators, casing and spacing, and recorded performance differences of up to 76 accuracy points on one open model, Llama 2 13B. Accuracy points there means the share of benchmark questions answered correctly, so a gap that size is the distance between a model that mostly fails a task and one that mostly passes it, opened by punctuation.

That reads like a contradiction of everything above, and it is not, for one reason. The swings are real but the winning format is specific to a model and a task, and the study found performance across formats correlated only weakly between models, so a template tuned on one system tells you little about the next. The information you put into a prompt carries over when you switch tools; the punctuation you tuned does not. The finding is an argument against fixed templates rather than for them, and a reason to judge a prompt on a few attempts rather than one.

The acronym frameworks sit in the same category. They are memory aids somebody wrote down, not findings from a research group or a standards body. As a checklist they are harmless. Treated as science they push people to pad prompts with role-play instead of information, and role-play in particular does not pay for itself: Zheng and colleagues, in Findings of EMNLP 2024, tested 162 personas across four families of models and 2,410 factual questions and found that adding a persona to the system prompt did not improve accuracy over adding none.

What a better prompt will not fix

A prompt cannot give a model information it does not have, and it cannot make it honest about the gap. Researchers at OpenAI and Georgia Tech argued in September 2025 that models guess rather than admit uncertainty partly because standard evaluations score a confident wrong answer above "I do not know". Adding "only say what you are certain of" helps at the margin without removing the behavior, so AI hallucinations stay something you check for rather than prompt away. Where accuracy matters, supplying the source yourself, or using a tool that looks documents up, is the structural fix, and that pattern is explained in what RAG is.

Nor will a prompt supply the judgment about whether the answer is any good, which stays with you however the answer was produced. That judgment is the substance of AI literacy, and it is a separate skill from writing the request. Some of the limits are structural rather than a wording problem, and what AI cannot do sets out which ones. What is left is unglamorous and works: say what you want, say who it is for, hand over the context you are carrying, show an example if you have one, and correct what comes back rather than starting again. Most of the available gain is in the first two.

  • Prompt: The instruction or information you give an AI model to guide its response.
  • Prompt engineering: Designing prompts and context so a model produces more useful, reliable output.
  • Few-shot prompting: Giving a model a small number of examples to demonstrate the pattern you want.
  • Zero-shot prompting: Asking for a task with no worked examples attached.
  • Chain-of-thought prompting: Prompting that encourages intermediate reasoning steps before a final answer.
  • Grounding prompt: Instructions that require an answer to stay tied to sources you supply.

Frequently Asked Questions

What is an example of a good AI prompt?

A good prompt is one a competent stranger could act on without asking you a question. Instead of "write a job ad for a receptionist", try: "We are a three-dentist practice in Columbus hiring a part-time receptionist, 25 hours across four days, paid slightly above the local average. Write a 250-word job ad for our website. Warm and specific, no corporate language. Mention that we pay for the software training and that the team has been stable for six years. Do not list a salary figure."

What are the 5 P's of effective prompting?

There is no agreed answer, which is worth saying directly. Different writers use the phrase for different lists, usually some mix of persona, purpose, problem, parameters, product or platform. No standards body, research group or model developer defines it, and it does not appear in the guidance published by MIT Sloan, Harvard University Information Technology, OpenAI or Anthropic. The advice it compresses, give context and say what the output should look like, is sound. The acronym adds nothing.

How long should an AI prompt be?

As long as it takes to remove the guesswork, and no longer. Context helps; words carrying no information hurt. Researchers at the 2023 International Conference on Machine Learning showed that inserting irrelevant sentences into math problems caused a sharp drop in accuracy. Reread a long prompt and delete any sentence that would not change the answer if it were gone.

Does telling an AI to act as an expert improve the answer?

Not for factual accuracy, on the evidence available. Researchers reported in Findings of the Association for Computational Linguistics in 2024 that they tried 162 personas across four families of models and 2,410 factual questions, and adding a role to the system prompt did not beat adding no role at all. A role still helps when it carries real information, such as writing for an audience of pharmacists rather than for the general public, because that tells the model who is reading and what they already know. Asking the model to be a world-class expert tells it nothing it can act on, and it is the easiest way to feel like you have improved a prompt without having added anything.

Why does the same prompt give a different answer the second time?

Because assistants generate text by sampling from a range of likely next words rather than always taking the single most likely one. The setting governing how much variation is allowed is usually called temperature, and a normal chat interface does not let you see or change it. This is expected behavior, and a reason to judge a prompt across a few attempts rather than one. If you need identical output every time, you need a tool with a fixed setting, not a better prompt.

How do you prompt an AI correctly?

There is no correct way, and hunting for one is what sends people to templates. Cosmetic formatting that wins on one model tends not to transfer to the next, so the part that carries over is the information you put in. Give the task, the context you are holding in your head, who the answer is for, and what the finished thing should look like. Then correct the specific parts that missed rather than deleting the thread and starting again.

Sources

  1. MIT Sloan Teaching & Learning Technologies, "Effective Prompts for AI: The Essentials," accessed September 2026. https://mitsloanedtech.mit.edu/ai/basics/effective-prompts/
  2. Harvard University Information Technology, "Getting started with prompts for text-based Generative AI tools," accessed September 2026. https://www.huit.harvard.edu/news/ai-prompts
  3. Anthropic, "Claude prompting best practices," Claude developer documentation, accessed September 2026. https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
  4. OpenAI, "Prompt engineering best practices for ChatGPT," OpenAI Help Center, accessed September 2026. https://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt
  5. OpenAI, "Reasoning best practices," OpenAI developer documentation, accessed September 2026. https://developers.openai.com/api/docs/guides/reasoning-best-practices
  6. Jason Wei et al., "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models," NeurIPS 2022. https://arxiv.org/abs/2201.11903
  7. Zayne Sprague et al., "To CoT or not to CoT? Chain-of-thought helps mainly on math and symbolic reasoning," ICLR 2025. https://arxiv.org/abs/2409.12183
  8. Melanie Sclar et al., "Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design," ICLR 2024. https://arxiv.org/abs/2310.11324
  9. Freda Shi et al., "Large Language Models Can Be Easily Distracted by Irrelevant Context," ICML 2023. https://arxiv.org/abs/2302.00093
  10. Nelson F. Liu et al., "Lost in the Middle: How Language Models Use Long Contexts," Transactions of the Association for Computational Linguistics, 2024. https://aclanthology.org/2024.tacl-1.9/
  11. Adam Tauman Kalai, Ofir Nachum, Santosh S. Vempala and Edwin Zhang, "Why Language Models Hallucinate," September 2025. https://arxiv.org/abs/2509.04664
  12. Mingqian Zheng, Jiaxin Pei, Lajanugen Logeswaran, Moontae Lee and David Jurgens, "When 'A Helpful Assistant' Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models," Findings of EMNLP 2024. https://arxiv.org/abs/2311.10054