Skip to content
AI for Beginners

Few-shot Prompting

Showing an AI a small handful of examples of what you want before asking it to do the same for you. The examples act as a pattern to follow. Because you are giving a few examples, this is called few-shot prompting.

Sometimes describing what you want is harder than showing it. Few-shot prompting leans on that idea. You give the AI two or three quick examples of the task done correctly, then ask it to continue in the same style. The “few” refers to those few examples you include.

Say you want product names written in a playful, punchy style. Rather than trying to define “playful and punchy” in words, you show a few names you like, then ask for more in that vein. The AI picks up the pattern from your examples and matches it. This often works far better than explanation alone, especially for tone, format, or anything with a particular flavour.

This is one of the most practical tricks you can learn. When an AI keeps missing the mark on style or structure, showing rather than telling usually gets you there. A couple of good examples inside your prompt can transform the result.

Few-shot prompting is the natural next step when a direct request, known as zero-shot prompting, does not quite land. Both are everyday tools within prompt engineering, and neither needs any technical knowledge, only a willingness to give the AI a good example to follow.

Related terms