AI engineering

Stage 2 · Lesson 2 of 9

Specific instructions and output format

Prompting and model APIs

Most weak outputs come from vague prompts, not weak models. Write a prompt the way you would brief a capable new colleague who knows nothing about your product. Say what the task is, who it is for and what the limits are.

Say what to do with missing or odd input. And say exactly what shape the answer must take. "Summarise this" leaves everything open.

"Summarise this support thread in at most three bullet points for an engineer, then a line starting Status: with open or resolved" does not. Keep your instructions apart from the data with markers, such as XML-style tags like <email> and </email>.

Ask for a fixed output format your code can read reliably. Test on ten varied inputs, not just the one you wrote it for.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

  • Run open models locally to test prompts and sampling settings at zero API cost

Keep handy

Also worth your time

Mark this stage as not done?