Applied AI·topic 4 of 12
Prompting
Prompting is interface design for a probabilistic component. The vocabulary is small but heavily used, and most of it is about being unambiguous.
Read in order · tick what you already know
- 01
when you say the prompt you mean the parts your application controls, which is most of what actually got sent.
Prompt
- 02
it turned out to be writing a clear specification and testing it against an eval set, not finding a magic phrase.
Prompt engineering
- 03
you ask with instructions only, and add examples only after measuring that instructions alone were not enough.
Zero-shot
- 04
examples teach format and edge-case handling far more reliably than prose descriptions of the format.
Few-shot / in-context learning
- 05
you open with you are a senior database engineer, and the vocabulary and defaults shift, but it does not know anything new.
Role prompting
- 06
you finally spelled out the fields, the ordering and what to do when a value is missing, and the model stopped being unreliable.
Output format specification
- 07
you wrap the document in tags so the model stops reading its contents as instructions addressed to it.
Delimiters and XML tags
- 08
do not add commentary kept producing commentary, and respond only with JSON worked first time.
Negative instructions
- 09
you tell the model to work through it step by step, and the answer gets better on anything with arithmetic or several constraints at once.
Chain of thought
- 10
you add answer only from the provided documents, and say so if they do not cover it, and the invented details stop.
Grounding via context
- 11
a line buried in a retrieved document told the model to ignore your system prompt, and it partly listened.
Instruction hierarchy
- 12
you put the important instruction halfway down a long prompt and the model behaved as if it were not there.
Lost in the middle
- 13
the prompt lives in version control with named placeholders, not concatenated inline at three different call sites.
Prompt template
- 14
you change a word, re-run the eval set, look at what broke, and change it back, instead of reading one good output and declaring victory.
Prompt iteration
- 15
you have the model rewrite your prompt, then test the rewrite exactly like any other change rather than trusting it.
Meta-prompting