Vague prompt
- "Summarize this"
- No format specified
- No examples
- Inconsistent output
Engineered prompt
- Role + task + constraints
- Explicit output format
- Few-shot examples
- Consistent, checkable output
A language model produces a probability distribution over the next token conditioned on everything in its context so far. Prompt engineering is the practice of shaping that context — instructions, examples, formatting, ordering — so the distribution the model actually samples from puts most of its mass on the response you want, without changing a single model weight.
- Zero-shot — asking directly, with no examples of the task.
- Few-shot — showing a handful of worked examples in the prompt before the real question, so the model pattern-matches the format and style.
- Chain-of-thought (CoT) — asking the model to reason step by step before giving a final answer, which measurably improves accuracy on multi-step problems.
- System prompt — a persistent instruction (role, tone, rules) set once and applied to the whole conversation, distinct from the user's actual message.
Prompt engineering matters because it's the cheapest lever you have: no training run, no data collection, no GPU cost — just editing text — and it can move task accuracy by tens of percentage points on the exact same underlying model.
- Well-engineered prompts often outperform naive fine-tuning for tasks the base model can already do but does inconsistently.
- They compose with everything else: RAG, tool use, and structured output all rely on carefully engineered prompts underneath.
- They don't fix a model that genuinely lacks the underlying capability — no prompt teaches a model facts it was never trained on or reasoning it can't do at all.
Think of a prompt as having layers: role/persona, task description, constraints/format, and examples. Later layers unpack exactly how each of these mechanically changes the model's output distribution, and how to test whether a prompt change actually helped.