system prompt vs. user prompt

System promptUser prompt
Set byThe application developerThe end user (or the app, on their behalf)
PurposeRole, constraints, tone, output format, tools availableThe actual task/question for this turn
Trust levelInstructions here are given more weight by most modelsShould be treated as untrusted input if it comes from an end user — see Safety & Guardrails

zero-shot vs. few-shot

# zero-shot: just ask
"Classify the sentiment of this review as positive, negative, or neutral: {review}"

# few-shot: show 2-3 worked examples first, then the real input
Review: "Fast shipping, exactly as described." -> positive
Review: "Broke after two days." -> negative
Review: "It's fine, does the job." -> neutral
Review: "{review}" -> 
Few-shot examples are most valuable when the output format is unusual or ambiguous from instructions alone — they show, rather than tell. For well-understood tasks on a capable model, the extra tokens often aren't worth it; test both.

chain-of-thought

Asking the model to reason step by step before giving a final answer measurably improves accuracy on multi-step problems (arithmetic, logic, multi-hop questions) — because each generated token can only depend on tokens already in the context, forcing intermediate steps into the output gives the model "scratch space" it wouldn't otherwise have. The failure mode: on simple tasks, forcing reasoning steps adds latency and cost for no quality gain, and can occasionally introduce errors that weren't there in a direct answer.

"Q: A store had 23 apples, sold 15, then received a shipment of 8.
How many apples now? Think step by step, then give the final answer."
Many current "reasoning" models do this internally by default and expose it as a separate reasoning-effort setting rather than requiring the prompt trick explicitly — check the specific model's docs before assuming you need to ask for it.

patterns worth keeping in a toolbox

PatternUse it when
Ask for a specific output format up front (JSON schema, XML tags, markdown table)Downstream code needs to parse the response reliably — see Structured Output
"If you don't know, say so" / explicit uncertainty instructionReducing confident wrong answers matters more than always producing an answer
Give the model a persona or roleSteering tone/register cheaply; less effective for steering actual capability
Break a complex task into an explicit numbered checklist in the promptMulti-part tasks where the model tends to skip a sub-step

where to go from here

Structured Output & JSON Mode — the next step once you need machine-parseable responses.
Context Windows — how much room you actually have for examples and instructions.
Evaluating LLM Applications — how to know if a prompt change actually helped.