Four techniques and one dial. Each fixes a different kind of failure — matching the technique to the failure is the skill.
Zero-shot = no examples. One-shot = one worked pair. Few-shot = several. Models pattern-match on examples far more reliably than they follow prose descriptions — the effect that made GPT-3 famous (Brown et al., 2020).
Best for: locking output format, label strings, and edge-case behavior. Three labeled tickets lock BILLING / TECHNICAL / SALES exactly, so downstream code can switch on them.
Ask the model to work step by step before giving the final answer — big gains on multi-step math, logic, and policy questions (Wei et al., 2022). The lazy version works too: just add “Let’s think step by step” (zero-shot CoT, Kojima et al., 2022) — the cheapest first thing to try on a reasoning miss.
| Helps | 3-rule discount eligibility · multi-step calculations · ambiguous policy calls |
| Overkill | Extract a phone number · yes/no lookups — you pay tokens + latency for nothing |
For automation: let it reason, then demand a delimited final answer your code can parse — reasoning for the model, structure for the machine.
Free text cannot pipe into a database. {"field": value} can. Forcing a fixed, machine-readable shape is what turns “a model that answers” into “a component in a system” — the flow is free text → JSON → database / next agent.
Caution: validate. Well-formed JSON can still contain wrong values — schema conformance is not accuracy (the hands-on tests both).
Temperature controls output randomness. Same prompt — “Name our new project-management app” — different dial positions. Drag it.
Each scenario has one best-fit fix. Pick, then check.
Climb in this order — each rung adds reliability at rising cost. Fine-tuning is the top rung for a reason: try everything below it first.