AI School · Level 2 · Lesson 1

Anatomy of a good prompt

Léelo en español →

A prompt is not a magic phrase. It is a brief, and a brief is judged by the same things as any brief you give somebody: whether it is clear what you want, who it is for, what shape it should take, and what to do when a piece of information is missing.

The piece almost nobody writes is the one that changes the answer most. It is not "act as an expert pharmacist" — it already does that the moment you ask about pharmacy — it is "if anything is missing, tell me instead of assuming it". Without that line the model answers what it knows and what it does not with exactly the same confidence.

The five pieces, by what leaving them out costs you

PieceWhat happens without it
The task
critical
With no verb there is no prompt: there is a topic. Given a topic the model writes an encyclopaedia, which is the least useful thing with somebody waiting.
What to do when it does not know
high
It fills the gap. Not out of dishonesty: nobody told it that "I do not know" was an answer it was allowed to give.
The context
high
It answers about the average case. The average case does not walk through your door.
The format
medium
You get prose, and prose has to be re-read. Re-reading at the counter costs time.
The role
low
Almost nothing — and it is the piece prompt guides put first. It sets who it is talking to, not how accurate it is.

Write it piece by piece

Fill in whatever you like and press the button. Below you get the assembled prompt and, under it, what you left out and what that costs you.

Where it speaks from. The piece that changes the answer least.
Who will read it, what you already know, the source text.
The verb: summarise, compare, extract, rewrite, check.
Table, three bullets, 80 words, one sentence.
The instruction that lets it NOT answer.

Your prompt

What is missing

What this exercise does NOT check

Whether the prompt is any good. It checks that the five pieces are there, which is necessary and not sufficient: a prompt with all five can ask for something a model should not be asked — that is what the risk traffic light decides — and an answer with flawless shape can still be wrong, which is what checking it decides.

And the identifier detector catches the obvious: an ID number, a national insurance number, a phone, an email, a date of birth. It does not catch — and cannot — "the lady from the third floor who comes in on Tuesdays", which identifies just as well and is far more common. That is why the judgement lives in the first lesson and not in a detector.

Four shortcuts that do work

A full example, and what is wrong with it

The table above says what each missing piece costs. This example shows it, which is a different thing: the same query written both ways, with both replies underneath. Same case, same model, same day.

Short version: "What can I give somebody with a dry cough?"

Version with the five pieces: "You are a community pharmacist in Spain. An adult comes in asking for something for a dry cough of three days, no fever. Give me, in three bullets, what to ask before dispensing, what over-the-counter options there are, and when to refer. If you are missing any fact you need to decide, tell me instead of assuming it."

What it replies

What the short version replies. For a dry cough, the usual options are antitussives such as dextromethorphan, or pharmacy-only formulations, as well as preparations containing cloperastine. Soothing lozenges and good hydration can also help. It is important to keep the air humid and avoid irritants such as tobacco. If the cough lasts more than two weeks, it is advisable to see a doctor.

What the long version replies. Before dispensing, ask: whether the cough is genuinely dry or productive, what medication they take — particularly ACE inhibitors, which cause a dry cough — and whether there is known asthma, COPD or allergy. Over-the-counter options: licensed antitussives per each product's information and demulcents, weighing interactions and drowsiness. Refer if there is fever, breathlessness, chest pain, blood-stained sputum, weight loss, a cough of more than three weeks, or if it is an infant. I am missing something to be precise: you have not told me what else this person takes, or whether there is a pregnancy.

And now, what is wrong with that reply:

  1. The short one is not wrong. It is beside the point. Everything it says is true and none of it helps the person in front of you: it gives you a tour of the options when what you needed was what to ask first. And because there is no error, nothing warns you that you have been handed something else. This is the real cost of leaving out the task — not a worse answer, but an answer to a different question.
  2. With no context, it invents the context. Notice the short one mentions codeine without asking the age, and codeine is not for everybody. It is not that it got it wrong: nobody told it who the patient was, so it took the average one — adult, nothing else going on, no pregnancy, no other medication. The average case does not walk through your door, and the model has no way of knowing that yours is not it.
  3. Format is not decoration: it is counter time. The short one is six lines of prose you have to reread to extract three things. The long one is three bullets you can take in at a glance with somebody waiting. The difference is not in what the model knows: it is that one of them can be used standing up and the other cannot. In that situation, a paragraph you have to reread is a paragraph that does not get read.
  4. And the last line of the long one is what the exercise is for. "I am missing something: you have not told me what else they take or whether there is a pregnancy." That is what a colleague does and what a model never does unless you ask it to — because answering fits better than asking. It costs eleven words in the prompt and it changes what the tool is: it goes from always giving you an answer to telling you when the answer cannot be given yet.

Now one important thing about this example, so as not to draw the wrong conclusion: the long version is not a "better prompt", it is a different request. The short one asked for a tour of the options and delivered one. If the tour was genuinely what you wanted, it was perfect.

The question to ask while writing is not "is my prompt well phrased?" but "have I said what I want to do with the answer?". The five pieces fall out of that on their own, and that is why the composer above does not fill them in for you.

← Back to the school Next: summarising a research paper →