Pacific Design/ artificial intelligence

Prompt Engineering · entry 02/04

Few-shot & chain of thought

Worked examples and rented reasoning are the two highest-leverage prompting techniques — and reasoning models have quietly retired half of the second.

Learning without weight updates

Show a model three worked examples and it does the task markedly better — with no training step and nothing changed on disk. In-context learning is the transformer conditioning on patterns in the prompt itself, and the distinction is worth stating precisely: training moves weights permanently; few-shot prompting rents the behavior for one request. It emerged with scale, and it is the reason prompting is a discipline rather than a folk art.

Few-shot, done properly

Examples communicate three things at once: the task, the output format, and the level of detail. The model imitates all three, so example quality dominates example count — two or three clean, diverse, correctly labeled examples routinely beat ten sloppy ones, and one mislabeled example can drag accuracy below zero-shot. Cover the edges you actually care about (include a negative, or a "none of the above," if those exist in production), and keep formatting rigidly consistent, because the model copies your format more faithfully than your intent:

Classify sentiment as positive, negative, or mixed.

Review: "Battery life is superb but the hinge broke in a week."
Label: mixed

Review: "Does exactly what it says. No complaints."
Label: positive

Review: "Arrived late and the box was crushed."
Label:

Chain of thought

A transformer spends a roughly fixed amount of computation per emitted token, so a hard problem answered in one token gets one token's worth of thought. Chain-of-thought prompting — reason step by step, then answer — buys more compute by spending intermediate tokens, and it reliably lifts accuracy on arithmetic, logic, and multi-hop questions. The transcript is genuine scratch space doing real work, not narration of some inner process.

When to stop asking for it

Reasoning models changed the calculus. Models post-trained with reinforcement learning to produce long private reasoning traces already think step by step, at whatever length the problem warrants — instructing one to do so is redundant at best, and prescribing your own solution steps can degrade a model whose learned strategy is better than yours. Manual chain of thought still earns its tokens on small, fast, non-reasoning models, and as a debugging view when you need to see where the logic went wrong.

Failure mode

Trusting the reasoning because it reads well. A model can produce an impeccable chain of steps and a wrong answer, or a right answer wrapped in a rationalized transcript it never actually followed. Fluent step-by-step prose is plausibility applied to logic, not a proof of anything. Verify conclusions independently; grade the answer, not the show of work.