← Back to glossary
+Suggest a term
Concept·Patterns & Practices·Added 1 day ago

One-shot

Also known as: one shot, one-shot prompting, single example prompt, one shot it

Giving the model exactly one example of what you want before asking it to do the task. Part of the zero/one/few-shot spectrum. 'One-shotting it' in builder slang sometimes also means completing a task in a single prompt without iteration.

One-shot, zero-shot, and few-shot are terms from the research literature on in-context learning that have migrated into everyday builder vocabulary. Zero-shot means you give no examples, just a task description. One-shot means you provide exactly one example input-output pair. Few-shot means you provide several examples. More examples usually means better performance on structured tasks, but takes up more context.

In practice, choosing how many examples to include is a prompt engineering judgment call. Zero-shot is fastest and works fine when the task is common enough that the model already knows what to do (summarize this, translate that). One-shot helps when the model needs a nudge about format or style. Few-shot is useful when the task is unusual or the format is specific.

The slang 'one-shotting it' or 'I one-shotted that prompt' has a slightly different meaning in builder communities: it means you wrote the prompt once and got the output you wanted without iteration. It's a brag about prompting efficiency. Worth noting: this usage is a metaphor from the prompting sense but is now used independently to mean 'nailed it on the first try.'

This definition is AI-generated and refreshed weekly. It may contain inaccuracies. Use your own judgment, especially for production decisions.
Related terms
Few-shot promptingZero-shot promptingICLPrompt engineering