Prompt Anatomy
A working prompt usually combines a task description, optional examples, and the concrete task, with placement tuned per model.
Most effective prompts combine three parts:
- Task description — what to do, including persona/role and output format (usually static content).
- Example(s) — few-shot demonstrations of the desired behaviour (in-context learning).
- The task — the concrete question or request, plus dynamic instance context.
Many APIs map the description to a system prompt and the task to a user prompt. Placement of the description matters: some models prefer it at the start, others at the end — experiment per model. Structure the three parts for clarity rather than stuffing everything into one undifferentiated blob; that is the scaffold prompt engineering builds on.
Berryman's document-oriented framing adds placement roles along the same spine: an introduction that names the document type and early focus (models have a fixed per-token thought budget — guide attention early), a middle parade of context elements (concise; avoid drowning in the Valley of Meh), a sandwich technique refocus, and a prompt transition into the completion. Prefer crisp elements; end elements on newlines when natural to simplify assembly and length math under context engineering.
Sources
- AI Engineering (Chip Huyen), ch. 5
- Prompt Engineering for LLMs (Berryman), ch. 6