Case & CodeA FIELD GUIDE TO AI
Start learning
Beginner

Few-shot prompting

In plain words

Showing the model a few examples of what you want before asking it to do the same thing.

The fuller definition

Few-shot prompting includes a small number of examples showing the desired task behavior or output pattern.

How it fits together
  1. Example one

    Proposal stays a proposal

  2. Example two

    Agreement has support

  3. New input

    Apply the demonstrated distinction

A simplified relationship, not a screenshot or a complete design.

A concrete example

Provide two fictional examples distinguishing a proposed date from an agreed date before asking for extraction.

The distinction that matters

Examples supplied as context do not ordinarily update model weights; their facts should not leak into the new answer.

Related terms

Where it is taught

Give AI a brief it can actually follow

Source and further reading

Anthropic · Context engineering

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC