Suppose you need an LLM to label customer reviews but have only a handful of labeled examples. Few-shot learning is the ability to use those examples to perform the task. A practical route is few-shot prompting: put example inputs and desired outputs in the prompt, then provide a new input. The model can follow the pattern without task-specific finetuning. section 2.4 section 7.1.1
Label a review
A prompt might pair “Worked as advertised, 10/10” with “positive” and “It was broken on delivery” with “negative,” then end with an unlabeled review. The examples establish both the task and the answer format. If more labels are acceptable, state the allowed options explicitly; you can also ask for only one label and no explanation. section 7.1.1
Few-shot does not mean that every model will benefit from the same examples. Larger LLMs can generalize to tasks with little labeled data, while a smaller, specialized model may struggle with an unfamiliar prompt format. In a coding copilot, plain-English instruction examples were a poor match for a model trained to take code as input and generate code. Trying code examples, finetuning, or a different model are practical next steps. section 2.4 section 10.4
Choose the amount of guidance the task needs:
- Zero-shot: try the task without an example when the model can handle it directly. section 2.4
- One-shot or few-shot: supply one or several examples when the desired behavior or format needs demonstration. section 2.4 section 7.1.1
- Finetuning: consider changing the model when prompting alone cannot bridge a mismatch with its training or intended use. section 10.4

















