A-ZPrompt Encyclopedia Get the book

How to write the prompt

How to write an AI prompt that actually works

By Mark W. Lamplugh Jr.Updated 2026-09-184,767 words14 sections

A prompt works when it carries six things the model cannot guess: the task, the audience, the source material, the deliverable format, the constraints, and the acceptance criteria you will judge the result against. Most weak prompts name only the topic. Compare "write a blog post about fleet maintenance" with a prompt that names the reader as a fleet manager running 40 vans, supplies the actual service records, demands 900 words in five headed sections, forbids invented statistics, and states that every claim must trace to the supplied records. The second prompt is not longer for the sake of it. Every added element removes a decision the model would otherwise make at random. Prompting is specification writing, and the skill transfers across ChatGPT, Claude, Gemini and Copilot because it is about the brief, not the button.

What this page establishes

  • A working prompt supplies six elements — task, audience, source material, format, constraints and acceptance criteria — because each one removes a decision the model would otherwise guess.
  • Attaching or pasting the actual source material matters more than describing it, since a model cannot open a file simply because a prompt mentions its name.
  • Chain-of-thought prompting raised GSM8K maths accuracy from 17.9% to 56.9% on the 540-billion-parameter PaLM model, according to Wei and colleagues at Google Research (NeurIPS 2022).
  • The Princeton GEO study of roughly 10,000 queries (ACM SIGKDD 2024) found that adding statistics moved visibility in AI answers by up to 41%, while keyword stuffing produced no benefit at all.
  • Output contracts beat adjectives: "five sections of 120 to 180 words, each ending in one action" is checkable, whereas "make it engaging" is not.
  • Self-Refine, published by Madaan and colleagues at NeurIPS 2023, improved task performance by about 20% on average across seven tasks by having the model critique and revise its own output.
  • Testing a prompt requires the same inputs run twice, not a single impression — models sample probabilistically, so one good answer is evidence of luck as much as of craft.

Why "be more specific" is useless advice on its own

Specificity only helps when you know which dimension to be specific about. A prompt reading "write a detailed, comprehensive, specific blog post about fleet maintenance" is stuffed with intensifiers and still supplies nothing the model can act on. The Princeton GEO study (ACM SIGKDD 2024, arXiv:2311.09735), which tested roughly 10,000 queries across 9 datasets, found that keyword stuffing produced no measurable benefit, while adding real statistics moved visibility by up to 41%. The pattern generalises to prompting: volume of adjectives is not information.

Six dimensions carry almost all the value, and a prompt that misses one will produce a draft that fails on exactly that axis. The task says what artifact to produce. The audience says who reads it and what they already know. The source material supplies the facts. The format fixes length and structure. The constraints name what must not happen. The acceptance criteria say how the result will be judged. Name all six and the model has a specification. Name only the topic and it has a genre, which is why the draft comes back sounding like every other article on the subject.

The six parts of a prompt that carries its own weight

Each of the six parts answers a question the model would otherwise answer by averaging its training data. Written out, the parts look like this:

PartThe question it settlesWeak version
TaskWhat artifact am I producing?"about onboarding"
AudienceWho reads it, and what do they already know?"for our customers"
Source materialWhich facts am I allowed to use?"use our data"
FormatHow long, in what shape?"a decent length"
ConstraintsWhat must not appear?"keep it professional"
Acceptance criteriaHow will this be judged?unstated

The sixth part is the one most people skip and the one that changes the most. A prompt ending "the result is acceptable if a new hire can complete step 3 without asking a question, and if every figure appears in the attached handbook" gives the model an explicit test, and gives you one too. Published prompting guidance from OpenAI and Anthropic converges on the same move: state success conditions rather than hoping the model infers them from tone.

Compare the economics. Writing the six parts adds perhaps 90 seconds. A revision cycle on a 900-word draft costs 10 to 20 minutes once you include rereading the brief, spotting the drift, and re-prompting. Across the 120 topics in the A-Z AI Prompt Encyclopedia, every chapter therefore opens with a "prepare your inputs" list before any of its 30 prompt cards, because the inputs are where the time is actually won.

Start from the deliverable, not the topic

Topics produce essays. Deliverables produce usable work. "Fleet maintenance" is a topic; "a one-page pre-winter inspection checklist a driver can run in 10 minutes without tools" is a deliverable, and the second prompt cannot drift because the shape is nailed down before the first word is generated.

Writing the deliverable first also exposes briefs that were never going to work. If you cannot say what the finished thing is, the problem sits upstream of the model. A useful forcing question: what will a person do with this file within 48 hours of receiving it? Answers such as "send it to 300 subscribers on Tuesday" or "paste it into the Q3 board deck as slide 11" carry a format, a length and an audience inside them. Answers such as "have it on the website" carry none.

Mark W. Lamplugh Jr. structures all 3,600 prompt cards in the A-Z AI Prompt Encyclopedia this way — each card opens by naming the artifact, then the inputs to prepare. Chapter 001 of the 580-page first edition begins with exactly this move, converting a rough request into an executable brief before any drafting happens.

Name the reader, because "general audience" is a real instruction

Leaving the audience unstated does not produce neutral writing. A model with no stated reader writes for the statistical centre of its training data, which for business prose means a mildly promotional, mid-level, US-English register — the exact voice people complain sounds like AI. Naming a reader is therefore not a nicety; it is how you move off that default.

Useful audience lines carry three things: role, prior knowledge, and the decision the reader is about to make. "Write for a practice manager at a 6-person dental clinic who has never bought software before and is deciding whether to replace a paper appointment book this quarter" tells the model to skip API terminology, to explain the cost of switching, and to end where a decision gets made.

The same specificity governs vocabulary. A prompt aimed at a cardiologist may use "atrial fibrillation" unglossed; one aimed at a newly diagnosed patient must gloss it once and never again. Without that line, the model guesses, and the guess averages both readers into a paragraph serving neither.

Reading level is worth stating outright, because it is measurable after the fact. US federal agencies have operated under the Plain Writing Act of 2010, and plain-language guidance commonly targets a Flesch-Kincaid grade level around 8 for public-facing material. Naming a target — "grade 8 reading level, sentences under 22 words, no term of art used before it is defined" — converts an argument about tone into a check that takes 30 seconds in any word processor.

Give the model the source material, not the name of it

A model cannot open a document because a prompt mentions the filename. Writing "using our 2026 pricing sheet, draft the comparison table" produces a table built from plausible invention when no file is attached — the format will look right and the numbers will be fiction. This single mistake accounts for a large share of the fabricated figures people blame on hallucination.

Three delivery methods actually work. Paste the text directly into the prompt, which is reliable across ChatGPT, Claude, Gemini and Copilot. Attach the file where the tool supports uploads and confirm in the reply that the model can see it, by asking it to quote the first line. Or connect a retrieval system that fetches the passage at query time. Anything else is a description of evidence rather than evidence.

Position matters too. Liu and colleagues, in "Lost in the Middle" (Transactions of the ACL, 2024, arXiv:2307.03172), found that language models use information placed at the beginning or the end of a long context far more reliably than material buried in the middle. Put the passage you most need honoured near the top of the prompt or immediately before the instruction.

Write an output contract the result can be checked against

An output contract states the shape of the answer in terms a person can verify without rereading the prompt. "Five sections, each 120 to 180 words, each ending with one action the reader can take today, no section longer than the first" is a contract. "Make it punchy" is a mood.

Contracts matter most for machine-readable output. Asking for JSON does not guarantee valid JSON, so the contract should name the exact fields, their types, and what to do when a value is unknown: {"model": string, "year": integer, "price_usd": number or null}, with the rule that unknown values are null rather than invented. Then validate with software rather than by eye, because a single trailing comma will pass a human read and fail a parser.

For prose, the most useful contract clause is the one that says where uncertainty goes. A line such as "place any assumption or unresolved question in a short note after the deliverable, never inside the publishable copy" keeps hedging out of the draft while preserving the model's flags — a pattern used throughout the Create, Review and Refine cards in the Encyclopedia.

Constraints work when they are observable, not when they are adjectives

A constraint is only enforceable if a reader can hold the draft up and say yes or no. "Professional tone" fails that test. "No exclamation marks, no rhetorical questions, no sentence longer than 25 words, no claim that we are the leading provider" passes it, and each clause can be checked in a single pass.

Negative constraints beat positive ones for style, because the model has a strong prior it drifts toward. Naming the drift explicitly is what stops it: no em-dash-heavy rhythm, no "in today's fast-paced world" opener, no three-item list in every paragraph, no paragraph beginning "In conclusion", no sentence starting "Moreover" or "Furthermore". Readers recognise those five tells, and each one disappears when forbidden by name.

Keep the forbidden list short enough to survive. Four to six named constraints get honoured reliably; a list of 20 starts to behave like background noise, and the ones near the middle are the first to slip — consistent with the positional effect Liu and colleagues documented in "Lost in the Middle" (TACL 2024). Put the two constraints you care most about last, immediately before the instruction to begin.

Factual constraints deserve their own line, stated as a rule rather than a warning. "Every statistic must come from the attached report and must name the report and year in the sentence that uses it; if a figure is not in the report, write UNKNOWN rather than estimating" is enforceable. "Be accurate" is not, because no draft ever announces its own inaccuracy.

Examples teach patterns, and they teach mistakes just as fast

Supplying worked examples inside the prompt — few-shot prompting, described by Brown and colleagues in "Language Models are Few-Shot Learners" (NeurIPS 2020, arXiv:2005.14165) — is the strongest available lever when the desired style is easier to show than to describe. Two or three examples typically capture a format; beyond about five, returns flatten and the prompt gets expensive to maintain.

The risk is that examples teach everything they contain, including accidents. If all three sample emails you paste happen to open with the recipient's first name and end with a question, the model will treat both as rules even though you only cared about length. If all three are 90 words, it will treat 90 words as the target. Audit your examples for unintended patterns before pasting them.

One deliberately difficult example is worth more than three easy ones. Include the awkward case — the customer who is both angry and factually wrong, the product with no clean competitor, the month where the data is missing — because the easy cases were never where the draft was going to fail.

Asking for reasoning changes accuracy on multi-step work

For problems with several dependent steps, asking the model to work through them before answering measurably improves accuracy. Wei and colleagues at Google Research demonstrated this in "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" (NeurIPS 2022, arXiv:2201.11903): on the GSM8K grade-school maths benchmark, the 540-billion-parameter PaLM model rose from 17.9% with standard prompting to 56.9% with chain-of-thought prompting.

Wang and colleagues extended the finding with self-consistency (ICLR 2023, arXiv:2203.11171), sampling several reasoning paths and taking the majority answer, which added a further 17.9 percentage points on GSM8K. The practical translation for everyday work: for anything involving arithmetic, eligibility rules, sequencing or multi-condition logic, ask for the working, then check the working rather than the conclusion.

Two cautions keep this honest. Newer reasoning-tuned models already do this internally, so the explicit instruction adds less than it did in 2022. And a visible chain of reasoning is a presentation of reasoning, not a transcript of it — a confident, well-formatted explanation can still support a wrong answer, which is why the arithmetic still needs checking in a calculator.

What role prompts do, and what they cannot do

Opening with "act as a senior tax accountant" shifts vocabulary, structure and assumed reader knowledge. That is a real effect and worth using. What it does not do is grant credentials, access, or accuracy — the model does not acquire a licence, a client file, or the current tax code because a sentence assigned it a job title.

Roles are most useful when they encode a genuine point of view that changes the output. "Review this contract as the counterparty's lawyer looking for ambiguity that favours us" changes what gets flagged. "Act as a world-class expert" changes almost nothing, because the model has no separate expert mode to switch into; superlatives in a role line mostly add tokens.

The research points the same way. Zheng and colleagues, in "When 'A Helpful Assistant' Is Not Really Helpful" (Findings of EMNLP 2024, arXiv:2311.10054), tested a large set of personas across many factual questions and found that adding a persona to the system prompt did not systematically improve accuracy over no persona at all. Read that as a limit on flattery, not on framing: a role that changes the task — auditor, hostile reviewer, translator for a 10-year-old — still changes the output, because it changes what the model is being asked to do.

Where a real professional is required — legal advice, medical diagnosis, financial recommendations, tax filings, safety certification — a role line does not substitute for one, and a prompt written for publication should say so. The A-Z AI Prompt Encyclopedia applies this rule across its professional and industry chapters, naming where a licensed human must review the work before it is relied on.

Create, Review, Refine: why one prompt is rarely the whole job

Treating the first output as a draft rather than a deliverable is the single highest-leverage habit in prompting. The structure used across all 1,200 workflows in the A-Z AI Prompt Encyclopedia is three explicit stages: Create produces the artifact, Review inspects it against the brief and the source material, and Refine applies only the corrections you approved.

Separating Review from Create matters because the two jobs want different instructions. A Create prompt is told what to make; a Review prompt is told what to look for, and is given the original brief and sources rather than just the draft. Madaan and colleagues found in Self-Refine (NeurIPS 2023, arXiv:2303.17651) that iterative self-critique improved performance by roughly 20% on average across seven tasks.

The counterweight is equally well evidenced. Huang and colleagues at Google DeepMind argued in "Large Language Models Cannot Self-Correct Reasoning Yet" (ICLR 2024, arXiv:2310.01798) that without external feedback, self-correction can degrade correct answers. Practical reading: self-review catches format, omission and internal contradiction reliably; it does not reliably catch facts. Facts need the source document, a calculator, or a person.

A worked example: the same request, before and after

Here is a real-shaped request in its usual form, then specified properly. The weak version:

Write a blog post about why fleet maintenance matters for small businesses. Make it SEO friendly and engaging.

The specified version supplies all six parts:

Task: Write a 900-word article for our company blog. Audience: An owner-operator running 8 to 40 light commercial vans in Southern California who handles maintenance scheduling personally and has no fleet software. Source material: Use only the attached 2026 service-interval table and the three customer service histories below. Quote figures from these; if a figure is absent, write UNKNOWN. Format: Five H2 sections of 150 to 200 words. Each H2 is a question an owner would type. One short paragraph under each, then a 3-item checklist. Constraints: No invented statistics. No claim that we are the best or leading provider. No "in today's fast-paced world" opener. No exclamation marks. Name the source and year in any sentence carrying a number. Acceptance criteria: A reader can complete one checklist item the same day without calling us; every number traces to the attached table; the word count is between 850 and 950.

The second prompt takes about 90 seconds longer to write and removes an entire revision cycle, because the failure modes were specified out of existence rather than discovered in the draft.

How to tell whether your new prompt is actually better

Impressions are unreliable because language models sample probabilistically: the same prompt can return a strong answer once and a mediocre one the next time. Judging a prompt change on a single run measures luck as much as craft. A minimal, honest test costs about 15 minutes.

Keep five to eight representative inputs, including at least one where information is missing and one where the data conflicts. Run the old prompt and the new prompt over the same inputs, twice each. Score against the acceptance criteria you already wrote — that is the second job the criteria do. Record failures as well as wins, because a prompt that gains polish while losing factual discipline is a regression dressed as an improvement.

Where your tool exposes sampling controls, pin them during the comparison. A temperature near 0 makes runs far more repeatable and is the right setting for extraction, classification and anything that feeds a spreadsheet; a temperature nearer 1 widens the spread and suits ideation. Comparing a new prompt at temperature 0.2 against an old one at 0.9 measures the setting, not the prompt.

Write down the date and the model version alongside the score. Prompt behaviour shifts when a provider updates a model, and a result recorded against "GPT-5, March 2026" remains interpretable a year later, whereas an unlabelled note does not. Retest when the model, the data or the business process changes.

What better prompting cannot fix

Prompting cannot supply facts the model was never given. If the 2026 price list is not in the context window, no phrasing retrieves it; the model will produce a well-formatted approximation instead. The fix is retrieval or pasting, never rewording.

Prompting cannot grant access or permission. A prompt cannot open a private account, execute a payment, or prove that a task was completed — OWASP's Top 10 for Large Language Model Applications makes the same point from the security side, treating retrieved content as untrusted data rather than as authorised instruction. Authorisation is an engineering property, not a sentence.

Prompting also cannot decide what is worth publishing. The judgment about whether a claim is defensible, whether a tone fits the brand, and whether the work should go out at all stays with the person whose name is on it. That is why the Encyclopedia's cards end at a reviewed draft rather than at a publish button, and why the NIST AI Risk Management Framework (AI RMF 1.0, January 2023) frames governance as an organisational practice rather than a feature of any single tool.

Quick answers

What is the simplest prompt structure that works?

Name the task, the reader, the source material, the format, the constraints and the acceptance criteria — in that order. Six short labelled lines outperform a long paragraph because each line settles a decision the model would otherwise make by averaging its training data. Labelled lines are also easier to reuse as a template next week.

How long should a prompt be?

Long enough to carry the six parts and the source material, and no longer. A 60-word prompt with a pasted document beats a 400-word prompt of adjectives. Length itself is not the variable that matters; unresolved decisions are. Cut any sentence that does not remove a decision or supply a fact.

Does saying "act as an expert" improve the answer?

Assigning a genuine role changes vocabulary, structure and assumed reader knowledge, which is useful. Adding superlatives such as "world-class" changes very little, because there is no separate expert mode to switch on. Use roles that encode a real point of view, such as reviewing a contract as the counterparty, rather than as flattery.

Should I ask the model to explain its reasoning?

For multi-step problems, yes. Wei and colleagues (NeurIPS 2022) raised GSM8K accuracy from 17.9% to 56.9% on PaLM 540B using chain-of-thought prompting. Treat the explanation as a place to check the working, not as proof of correctness — a fluent explanation can still support a wrong total.

Why does the same prompt give different answers?

Language models sample from a probability distribution rather than looking up a fixed response, so variation is expected behaviour, not a fault. Lowering the temperature setting where your tool exposes it, and supplying a strict output contract, both narrow the spread. For work that must be identical each time, use a template and a validator.

What should I do when the first answer is wrong?

Do not simply retry the same prompt. Identify which of the six parts was missing — usually the source material or the acceptance criteria — and add it. Then run a separate review pass that gives the model the original brief and sources, and asks for an issue list with the exact passage, evidence and recommended correction.

Do prompts transfer between ChatGPT, Claude and Gemini?

The structural parts transfer well, because the task, audience, source material, format, constraints and criteria are properties of the brief rather than of the vendor. Provider-specific parameters and syntax do not transfer. Keep the plain-language brief separate from any tool-specific settings so the same prompt survives a change of model.

Frequently asked questions

What is prompt engineering, in plain terms?

Prompt engineering is specification writing for a language model. Instead of configuring software with settings, you describe the job in text: what to produce, for whom, from which facts, in what shape, under what constraints, and how the result will be judged. The label sounds technical, but the underlying skill is one most managers already have — writing a brief clear enough that a competent stranger could execute it without a follow-up conversation. The reason it needs a name at all is that models fill every gap you leave. A human contractor asks a question when the brief is ambiguous; a language model quietly picks an answer and keeps going, which is why the missing piece only becomes visible in the finished draft.

Is there a single best prompt template I should use?

No single template survives contact with every task, because a product photo prompt, a SQL query prompt and a condolence letter need different inputs. What does transfer is the six-part skeleton: task, audience, source material, format, constraints, acceptance criteria. Build your own templates on top of that skeleton for the three or four jobs you actually repeat, and keep them in a file rather than in your head. The A-Z AI Prompt Encyclopedia takes this approach across 120 topics: every chapter opens with a "prepare your inputs" list specific to that kind of work, then gives 30 numbered cards built on the same underlying structure.

How do I stop the model inventing statistics?

Supply the real numbers and forbid the rest explicitly. A working constraint reads: every statistic must come from the attached document, must name the document and year in the sentence that uses it, and any figure not present must be written as UNKNOWN rather than estimated. Without the source attached, no wording prevents invention, because producing plausible text is exactly what the model does when it has no data. Then verify. Check each number against the document yourself, and treat any citation the model produced from memory as unverified until you have opened the URL — fabricated references are usually well-formatted, which is precisely what makes them easy to miss.

How many examples should I include in a prompt?

Two or three is the usual sweet spot for teaching a format, with returns flattening after about five. Few-shot prompting was formalised by Brown and colleagues in "Language Models are Few-Shot Learners" (NeurIPS 2020), and the practical lesson since has been about quality rather than quantity. The bigger risk is contamination: examples teach every pattern they contain, including the ones you did not intend. If all three samples run to 90 words, open with a first name and close with a question, the model treats all three as requirements. Audit examples for accidental regularities, and include at least one genuinely awkward case.

Does a longer prompt always produce a better answer?

No. Length helps only when the added words remove a decision or supply a fact. Padding a prompt with intensifiers measurably does not help — the Princeton GEO study (ACM SIGKDD 2024), testing roughly 10,000 queries, found keyword stuffing produced no benefit while adding real statistics moved visibility up to 41%. There is also a positional cost to very long prompts. Liu and colleagues showed in "Lost in the Middle" (TACL 2024) that models use information at the start and end of a long context more reliably than material in the middle, so burying your key requirement halfway through a 2,000-word prompt is a real risk.

Should I write one long prompt or several short ones?

Split the work when the stages want different instructions or different inputs. Drafting, reviewing and revising are three jobs: Create needs the brief, Review needs the brief plus the draft plus the sources, and Refine needs the approved corrections. Cramming all three into one prompt tends to produce a draft that praises itself. Keep it as one prompt when the task is genuinely single-step, such as reformatting a list or translating a paragraph. The test is whether you would hand the whole thing to one person in one sitting; if you would not, the model should not get it that way either.

How do I know whether my prompt improved or I just got lucky?

Run both versions over the same five to eight saved inputs, twice each, and score against your written acceptance criteria. Because models sample probabilistically, a single good result is weak evidence. Include at least one input with missing information and one with conflicting data, since those are the cases where a weak prompt actually fails. Record the date and model version with the score. Prompt behaviour shifts when a provider updates a model, so a note reading "scored 7/8 on GPT-5, March 2026" stays interpretable later, while an undated note does not.

What can better prompting never fix?

Three things. It cannot supply facts the model was never given — if your price list is not in the context, rewording will not retrieve it. It cannot grant access or authorisation: a prompt cannot open a private account or prove a task was executed, a point OWASP makes in its Top 10 for Large Language Model Applications by treating retrieved content as untrusted data rather than authorised instruction. And it cannot decide what is worth publishing. Whether a claim is defensible and whether the work should go out at all remains a human judgment, which is why the NIST AI Risk Management Framework (AI RMF 1.0, January 2023) treats governance as an organisational practice rather than a tool feature.

Sources

  1. GEO: Generative Engine Optimization — Aggarwal et al., ACM SIGKDD, 2024.
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models — Wei et al., NeurIPS, 2022.
  3. Language Models are Few-Shot Learners — Brown et al., NeurIPS, 2020.
  4. Lost in the Middle: How Language Models Use Long Contexts — Liu et al., Transactions of the ACL, 2024.
  5. Self-Refine: Iterative Refinement with Self-Feedback — Madaan et al., NeurIPS, 2023.
  6. Large Language Models Cannot Self-Correct Reasoning Yet — Huang et al., ICLR, 2024.
  7. AI Risk Management Framework (AI RMF 1.0) — National Institute of Standards and Technology, 2023.
  8. Self-Consistency Improves Chain of Thought Reasoning — Wang et al., ICLR, 2023.

Every figure on this page names its source and year in the sentence that uses it. Where no methodology was published, the claim is stated qualitatively instead of dressed up as data.

Skip the blank page — 3,600 prompts, already written

The A-Z AI Prompt Encyclopedia gives you 3,600 numbered prompt cards across 120 topics, each one a complete Create, Review and Refine workflow. Ebook $12.99, 580-page paperback $38.99.

Get the book

Published 2026-09-18 · Last reviewed 2026-09-18 by Mark W. Lamplugh Jr., author of the A-Z AI Prompt Encyclopedia.