When writing a prompt, you have three basic techniques at your disposal: zero-shot, few-shot, and chain-of-thought. No single approach is universally superior; each is built for a specific kind of task. The skill lies in knowing which to choose.

Zero-shot

Zero-shot prompting provides only the instruction, relying on the model’s pre-trained knowledge without showing examples. It is the simplest and cheapest route, and works well for straightforward tasks. If a task is clear enough to express with a precise description, start here.

Few-shot

Few-shot prompting includes examples of the input and desired output to demonstrate the target pattern. This approach is valuable when:

  • Rules alone cannot fully convey the required pattern.
  • The output format is complex and difficult to describe in words.
  • A specific reasoning style or edge case must be shown rather than told.

Avoid this approach when rules are clear and sufficient, when examples might bias the model towards a single specific pattern, or when a modern model already handles the task reliably without examples.

Chain-of-thought

With chain-of-thought, you instruct the model to show its reasoning steps before providing the final answer. This is highly effective for:

  • Multi-step mathematical or logical deduction.
  • Tasks where intermediate steps matter.
  • Scenarios requiring visibility into the reasoning process.

However, for straightforward classification, pattern matching, or tasks the model already handles reliably, chain-of-thought merely adds verbosity without benefit.

An important modern caveat

A recent finding is worth noting: for sufficiently capable models, chain-of-thought examples primarily enforce the output format rather than genuinely increasing reasoning ability. In many cases, a clear zero-shot instruction performs as well as — or even better than — a prompt heavily loaded with examples. Before adding samples to a prompt, it is worth testing the zero-shot baseline.

The golden rule: start simple

The standard decision path is straightforward: start with zero-shot. If you require a specific format or style, add a few examples. If the task calls for reasoning or explanation, use chain-of-thought. The guiding principle is to start simple, introducing complexity only when genuinely required. A good prompt is the shortest prompt that completes the job reliably.