Few-shot learning adapts a model to a task by giving it a small number of examples and then asking it to handle a new input. For example, a sentiment classifier can use a few tweets paired with sentiment labels to infer how to label another tweet. section 2.5
In few-shot prompting, the examples are supplied in the prompt at inference time. They condition the response without updating model weights; the adaptation is transient rather than retraining. Zero-shot prompting supplies no task examples, while many-shot prompting supplies more, potentially tens to hundreds. section 6.3 section 6.4.2
Prompt for sentiment classification
Give the model a task and a few input-output pairs: “Label each tweet as positive or negative. Tweet: ‘The service was great.’ Sentiment: positive. Tweet: ‘My order arrived late.’ Sentiment: negative. Tweet: ‘The support team was helpful.’ Sentiment:” The model then predicts the label for the final tweet. This is an illustrative prompt, not a validated classifier. section 2.5 section 6.4.2
To make demonstrations useful:
- Choose high-quality examples that show both inputs and desired outputs. Keep their format consistent and relevant to the task. section 6.4.2 section 6.4.4
- Cover a variety of inputs and appropriate labels. Research findings emphasize the label space and distribution as well as individual mappings; this is not a reason to deliberately use incorrect labels. section 6.4.4
- Test different example orders and prompts. Ordering can affect output, and an order that works well for one model may work poorly for another. section 6.8 section 6.9
Few-shot examples often improve performance over zero-shot prompts, but responses can still be inconsistent or prompts overfitted. Repeatedly supplying the same examples can add cost; consider saving or caching them where appropriate. section 6.4.2 section 6.9

















