← all topics

Large Language Models

Prompt Engineering

Specifying a task precisely enough that a probabilistic system does it reliably.

Levels foundation / engineer
Depth 8
Time 5h
Kind practice
On AI Engineer, Agent Builder, AI Architect

Grasp

Prompt engineering has a reputation problem, because the popular version of it is superstition: magic phrases, politeness, threats. The real discipline is much closer to writing a precise specification for a capable but literal-minded contractor who has no access to your context.

What reliably works: state the task and the output format explicitly, give two or three examples of the exact shape you want, supply the relevant context rather than assuming the model has it, and give the model room to reason before committing to an answer. What reliably fails: vagueness, buried instructions, and asking for several unrelated things in one call.

Treat prompts as code. Version them, evaluate them against a fixed test set, and change one thing at a time. A prompt that works on your five favourite examples and was never measured on anything else is not engineering, and it will regress silently the first time the underlying model is updated.